From 095eb8ba71cde665bffa3abf93a15289f87bb9c2 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Tue, 14 Jan 2025 00:34:21 -0800 Subject: [PATCH] generated JS: improve indentation of switch cases (#1299) * generated JS: improve indentation of switch cases * snapshot runtime tests * fix blackbox tests, add changelog entries --- Changes.md | 8 + jscomp/core/js_dump.ml | 4 +- jscomp/test/dist-es6/jscomp/test/mt.mjs | 172 +- .../dist/jscomp/test/adt_optimize_test.js | 68 +- jscomp/test/dist/jscomp/test/arith_lexer.js | 48 +- jscomp/test/dist/jscomp/test/arith_syntax.js | 14 +- jscomp/test/dist/jscomp/test/arity_infer.js | 32 +- jscomp/test/dist/jscomp/test/bb.js | 18 +- jscomp/test/dist/jscomp/test/bdd.js | 24 +- jscomp/test/dist/jscomp/test/big_enum.js | 1200 +- .../test/dist/jscomp/test/caml_format_test.js | 118 +- jscomp/test/dist/jscomp/test/compare_test.js | 54 +- .../jscomp/test/complete_parmatch_test.js | 6 +- .../test/dist/jscomp/test/complex_if_test.js | 60 +- jscomp/test/dist/jscomp/test/const_test.js | 6 +- .../test/dist/jscomp/test/ext_bytes_test.js | 60 +- .../dist/jscomp/test/flow_parser_reg_test.js | 13284 ++-- jscomp/test/dist/jscomp/test/gpr_1438.js | 10 +- jscomp/test/dist/jscomp/test/gpr_1698_test.js | 204 +- jscomp/test/dist/jscomp/test/gpr_2413_test.js | 16 +- jscomp/test/dist/jscomp/test/gpr_2642_test.js | 16 +- jscomp/test/dist/jscomp/test/gpr_2931_test.js | 12 +- jscomp/test/dist/jscomp/test/gpr_3209_test.js | 4 +- jscomp/test/dist/jscomp/test/gpr_4069_test.js | 6 +- jscomp/test/dist/jscomp/test/gpr_4639_test.js | 12 +- .../test/dist/jscomp/test/int_switch_test.js | 20 +- jscomp/test/dist/jscomp/test/js_json_test.js | 196 +- jscomp/test/dist/jscomp/test/mario_game.js | 2872 +- .../test/dist/jscomp/test/match_case_test.js | 4 +- .../test/dist/jscomp/test/mel_ast_variants.js | 34 +- .../test/dist/jscomp/test/miss_colon_test.js | 64 +- jscomp/test/dist/jscomp/test/mock_mt.js | 112 +- jscomp/test/dist/jscomp/test/mt.js | 172 +- jscomp/test/dist/jscomp/test/number_lexer.js | 60 +- .../dist/jscomp/test/ocaml_parsetree_test.js | 4836 +- .../test/dist/jscomp/test/ocaml_proto_test.js | 4008 +- jscomp/test/dist/jscomp/test/ocaml_re_test.js | 2046 +- .../dist/jscomp/test/ocaml_typedtree_test.js | 62398 ++++++++-------- jscomp/test/dist/jscomp/test/offset.js | 102 +- jscomp/test/dist/jscomp/test/parser_api.js | 4190 +- .../test/dist/jscomp/test/parser_api_test.js | 410 +- jscomp/test/dist/jscomp/test/qcc.js | 606 +- jscomp/test/dist/jscomp/test/rbset.js | 96 +- .../dist/jscomp/test/re_or_res/reasonReact.js | 24 +- .../test/re_or_res/reasonReactRouter.js | 6 +- .../test/dist/jscomp/test/rec_module_test.js | 102 +- .../test/dist/jscomp/test/rec_value_test.js | 10 +- .../scanf_reference_error_regression_test.js | 4 +- jscomp/test/dist/jscomp/test/set_gen.js | 102 +- jscomp/test/dist/jscomp/test/sexpm.js | 178 +- .../dist/jscomp/test/simple_lexer_test.js | 8 +- .../dist/jscomp/test/simplify_lambda_632o.js | 16 +- jscomp/test/dist/jscomp/test/string_test.js | 32 +- .../test/dist/jscomp/test/stringmatch_test.js | 282 +- .../test/dist/jscomp/test/switch_case_test.js | 8 +- jscomp/test/dist/jscomp/test/test_bug.js | 36 +- .../test/dist/jscomp/test/test_incomplete.js | 4 +- .../test/dist/jscomp/test/test_internalOO.js | 182 +- jscomp/test/dist/jscomp/test/test_per.js | 4 +- .../dist/jscomp/test/test_ramification.js | 16 +- jscomp/test/dist/jscomp/test/test_set.js | 102 +- .../jscomp/test/test_simple_pattern_match.js | 10 +- jscomp/test/dist/jscomp/test/test_string.js | 4 +- .../test/dist/jscomp/test/test_string_case.js | 4 +- .../dist/jscomp/test/test_string_switch.js | 8 +- jscomp/test/dist/jscomp/test/test_switch.js | 8 +- jscomp/test/dist/jscomp/test/ticker.js | 186 +- jscomp/test/dist/jscomp/test/topsort_test.js | 102 +- jscomp/test/dist/jscomp/test/tscanf_test.js | 64 +- jscomp/test/dist/jscomp/test/typeof_test.js | 12 +- jscomp/test/dist/jscomp/test/variant.js | 18 +- test/blackbox-tests/variants-as-strings.t | 8 +- 72 files changed, 49615 insertions(+), 49607 deletions(-) diff --git a/Changes.md b/Changes.md index 2fdeaf3632..e4fe3d200e 100644 --- a/Changes.md +++ b/Changes.md @@ -99,6 +99,14 @@ Unreleased ([#1296](https://github.com/melange-re/melange/pull/1296)) - JS generation: add space before while loop condition ([#1297](https://github.com/melange-re/melange/pull/1297)) +- JS generation: improve indentation of parenthesized blocks + ([#1293](https://github.com/melange-re/melange/pull/1293)) +- JS generation: add space after constructor comments + ([#1294](https://github.com/melange-re/melange/pull/1294)) +- JS generation: improve identation of `switch` cases + ([#1299](https://github.com/melange-re/melange/pull/1299)) +- JS generation: don't generate empty `default:` cases in `switch` + ([#1300](https://github.com/melange-re/melange/pull/1300)) 4.0.1 2024-06-07 --------------- diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 4a020ad9f1..74a045899b 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -478,7 +478,7 @@ and pp_one_case_clause : 'a. _ -> (_ -> 'a -> unit) -> 'a * J.case_clause -> _ = (switch_case, ({ switch_body; should_break; comment } : J.case_clause)) -> let cxt = group cxt 1 (fun () -> - group cxt 1 (fun () -> + group cxt 0 (fun () -> string cxt L.case; space cxt; pp_comment_option cxt comment; @@ -486,7 +486,7 @@ and pp_one_case_clause : 'a. _ -> (_ -> 'a -> unit) -> 'a * J.case_clause -> _ = (* could be integer or string *) space cxt; string cxt L.colon); - group cxt 1 (fun () -> + group cxt 0 (fun () -> let cxt = match switch_body with | [] -> cxt diff --git a/jscomp/test/dist-es6/jscomp/test/mt.mjs b/jscomp/test/dist-es6/jscomp/test/mt.mjs index b5b000fab5..a19bf7d619 100644 --- a/jscomp/test/dist-es6/jscomp/test/mt.mjs +++ b/jscomp/test/dist-es6/jscomp/test/mt.mjs @@ -52,45 +52,45 @@ function close_enough(thresholdOpt, a, b) { function handleCode(spec) { switch (spec.TAG) { case /* Eq */ 0 : - Assert.deepEqual(spec._0, spec._1); - return; + Assert.deepEqual(spec._0, spec._1); + return; case /* Neq */ 1 : - Assert.notDeepEqual(spec._0, spec._1); - return; + Assert.notDeepEqual(spec._0, spec._1); + return; case /* StrictEq */ 2 : - Assert.strictEqual(spec._0, spec._1); - return; + Assert.strictEqual(spec._0, spec._1); + return; case /* StrictNeq */ 3 : - Assert.notStrictEqual(spec._0, spec._1); - return; + Assert.notStrictEqual(spec._0, spec._1); + return; case /* Ok */ 4 : - Assert.ok(spec._0); - return; + Assert.ok(spec._0); + return; case /* Approx */ 5 : - const b = spec._1; - const a = spec._0; - if (!close_enough(undefined, a, b)) { - Assert.deepEqual(a, b); - return; - } else { - return; - } + const b = spec._1; + const a = spec._0; + if (!close_enough(undefined, a, b)) { + Assert.deepEqual(a, b); + return; + } else { + return; + } case /* ApproxThreshold */ 6 : - const b$1 = spec._2; - const a$1 = spec._1; - if (!close_enough(spec._0, a$1, b$1)) { - Assert.deepEqual(a$1, b$1); - return; - } else { - return; - } - case /* ThrowAny */ 7 : - Assert.throws(spec._0); + const b$1 = spec._2; + const a$1 = spec._1; + if (!close_enough(spec._0, a$1, b$1)) { + Assert.deepEqual(a$1, b$1); + return; + } else { return; + } + case /* ThrowAny */ 7 : + Assert.throws(spec._0); + return; case /* Fail */ 8 : - return assert_fail("failed"); + return assert_fail("failed"); case /* FailWith */ 9 : - return assert_fail(spec._0); + return assert_fail(spec._0); } } @@ -118,71 +118,71 @@ function from_pair_suites(name, suites) { const _fn = Curry._1(param[1], undefined); switch (_fn.TAG) { case /* Eq */ 0 : - console.log([ - name, - _fn._0, - "eq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "eq?", + _fn._1 + ]); + return; case /* Neq */ 1 : - console.log([ - name, - _fn._0, - "neq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "neq?", + _fn._1 + ]); + return; case /* StrictEq */ 2 : - console.log([ - name, - _fn._0, - "strict_eq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "strict_eq?", + _fn._1 + ]); + return; case /* StrictNeq */ 3 : - console.log([ - name, - _fn._0, - "strict_neq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "strict_neq?", + _fn._1 + ]); + return; case /* Ok */ 4 : - console.log([ - name, - _fn._0, - "ok?" - ]); - return; + console.log([ + name, + _fn._0, + "ok?" + ]); + return; case /* Approx */ 5 : - console.log([ - name, - _fn._0, - "~", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "~", + _fn._1 + ]); + return; case /* ApproxThreshold */ 6 : - console.log([ - name, - _fn._1, - "~", - _fn._2, - " (", - _fn._0, - ")" - ]); - return; + console.log([ + name, + _fn._1, + "~", + _fn._2, + " (", + _fn._0, + ")" + ]); + return; case /* ThrowAny */ 7 : - return; + return; case /* Fail */ 8 : - console.log("failed"); - return; + console.log("failed"); + return; case /* FailWith */ 9 : - console.log("failed: " + _fn._0); - return; + console.log("failed: " + _fn._0); + return; } }), suites); diff --git a/jscomp/test/dist/jscomp/test/adt_optimize_test.js b/jscomp/test/dist/jscomp/test/adt_optimize_test.js index f7c587346e..eda827c305 100644 --- a/jscomp/test/dist/jscomp/test/adt_optimize_test.js +++ b/jscomp/test/dist/jscomp/test/adt_optimize_test.js @@ -6,11 +6,11 @@ const Caml_js_exceptions = require("melange.js/caml_js_exceptions.js"); function f(x) { switch (x) { case /* A */ 0 : - return 1; + return 1; case /* B */ 1 : - return 2; + return 2; case /* C */ 2 : - return 3; + return 3; } } @@ -18,11 +18,11 @@ function f(x) { function f_0(x) { switch (x) { case /* A */ 0 : - return -1; + return -1; case /* B */ 1 : - return 0; + return 0; case /* C */ 2 : - return 1; + return 1; } } @@ -38,15 +38,15 @@ function f2(param) { function f3(param) { switch (param) { case /* X0 */ 0 : - return /* Y0 */ 0; + return /* Y0 */ 0; case /* X1 */ 1 : - return /* Y1 */ 1; + return /* Y1 */ 1; case /* X2 */ 2 : - return /* Y2 */ 2; + return /* Y2 */ 2; case /* X3 */ 3 : - return /* Y3 */ 3; + return /* Y3 */ 3; case /* X4 */ 4 : - return /* Y4 */ 4; + return /* Y4 */ 4; } } @@ -59,20 +59,20 @@ function f5(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* A */ 0 : - return 1; + return 1; case /* B */ 1 : - return 3; + return 3; case /* F */ 2 : - return 4; + return 4; } } else { switch (param.TAG) { case /* C */ 0 : case /* D */ 1 : - return 1; + return 1; case /* E */ 2 : - return 2; + return 2; } } @@ -85,9 +85,9 @@ function f6(param) { switch (param) { case /* A */ 0 : case /* B */ 1 : - return 0; + return 0; case /* F */ 2 : - return 2; + return 2; } } @@ -96,21 +96,21 @@ function f7(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* A */ 0 : - return 1; + return 1; case /* B */ 1 : - return 2; + return 2; case /* F */ 2 : - return -1; + return -1; } } else { switch (param.TAG) { case /* C */ 0 : - return 3; + return 3; case /* D */ 1 : - return 4; + return 4; case /* E */ 2 : - return -1; + return -1; } } @@ -121,7 +121,7 @@ function f8(param) { switch (param) { case /* T60 */ 0 : case /* T61 */ 1 : - return 1; + return 1; default: return 3; } @@ -129,7 +129,7 @@ function f8(param) { switch (param.TAG) { case /* T64 */ 0 : case /* T65 */ 1 : - return 2; + return 2; default: return 3; } @@ -142,7 +142,7 @@ function f9(param) { case /* T60 */ 0 : case /* T61 */ 1 : case /* T62 */ 2 : - return 1; + return 1; default: return 3; } @@ -150,7 +150,7 @@ function f9(param) { switch (param.TAG) { case /* T64 */ 0 : case /* T65 */ 1 : - return 2; + return 2; default: return 3; } @@ -161,23 +161,23 @@ function f10(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* T60 */ 0 : - return 0; + return 0; case /* T61 */ 1 : - return 2; + return 2; case /* T62 */ 2 : - return 4; + return 4; case /* T63 */ 3 : - return 1; + return 1; } } else { switch (param.TAG) { case /* T64 */ 0 : case /* T65 */ 1 : - return 2; + return 2; case /* T66 */ 2 : case /* T68 */ 3 : - return 3; + return 3; } } diff --git a/jscomp/test/dist/jscomp/test/arith_lexer.js b/jscomp/test/dist/jscomp/test/arith_lexer.js index ce59cc06e1..47d1879810 100644 --- a/jscomp/test/dist/jscomp/test/arith_lexer.js +++ b/jscomp/test/dist/jscomp/test/arith_lexer.js @@ -26,32 +26,32 @@ function __ocaml_lex_lexeme_rec(lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - ___ocaml_lex_state = 0; - continue; + ___ocaml_lex_state = 0; + continue; case 1 : - return { - TAG: /* NUMERAL */ 0, - _0: Caml_format.caml_int_of_string(Stdlib__Lexing.lexeme(lexbuf)) - }; + return { + TAG: /* NUMERAL */ 0, + _0: Caml_format.caml_int_of_string(Stdlib__Lexing.lexeme(lexbuf)) + }; case 2 : - return { - TAG: /* IDENT */ 1, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* IDENT */ 1, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 3 : - return /* PLUS */ 0; + return /* PLUS */ 0; case 4 : - return /* MINUS */ 1; + return /* MINUS */ 1; case 5 : - return /* TIMES */ 2; + return /* TIMES */ 2; case 6 : - return /* DIVIDE */ 3; + return /* DIVIDE */ 3; case 7 : - return /* LPAREN */ 5; + return /* LPAREN */ 5; case 8 : - return /* RPAREN */ 6; + return /* RPAREN */ 6; case 9 : - return /* EOF */ 7; + return /* EOF */ 7; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -67,19 +67,19 @@ function lexeme(lexbuf) { function str(e) { switch (e.TAG) { case /* Numeral */ 0 : - return Stdlib.string_of_float(e._0); + return Stdlib.string_of_float(e._0); case /* Plus */ 1 : - return str(e._0) + ("+" + str(e._1)); + return str(e._0) + ("+" + str(e._1)); case /* Minus */ 2 : - return str(e._0) + ("-" + str(e._1)); + return str(e._0) + ("-" + str(e._1)); case /* Times */ 3 : - return str(e._0) + ("*" + str(e._1)); + return str(e._0) + ("*" + str(e._1)); case /* Divide */ 4 : - return str(e._0) + ("/" + str(e._1)); + return str(e._0) + ("/" + str(e._1)); case /* Negate */ 5 : - return "-" + str(e._0); + return "-" + str(e._0); case /* Variable */ 6 : - return e._0; + return e._0; } } diff --git a/jscomp/test/dist/jscomp/test/arith_syntax.js b/jscomp/test/dist/jscomp/test/arith_syntax.js index d3d299d416..406920c4b4 100644 --- a/jscomp/test/dist/jscomp/test/arith_syntax.js +++ b/jscomp/test/dist/jscomp/test/arith_syntax.js @@ -6,19 +6,19 @@ const Stdlib = require("melange/stdlib.js"); function str(e) { switch (e.TAG) { case /* Numeral */ 0 : - return Stdlib.string_of_float(e._0); + return Stdlib.string_of_float(e._0); case /* Plus */ 1 : - return str(e._0) + ("+" + str(e._1)); + return str(e._0) + ("+" + str(e._1)); case /* Minus */ 2 : - return str(e._0) + ("-" + str(e._1)); + return str(e._0) + ("-" + str(e._1)); case /* Times */ 3 : - return str(e._0) + ("*" + str(e._1)); + return str(e._0) + ("*" + str(e._1)); case /* Divide */ 4 : - return str(e._0) + ("/" + str(e._1)); + return str(e._0) + ("/" + str(e._1)); case /* Negate */ 5 : - return "-" + str(e._0); + return "-" + str(e._0); case /* Variable */ 6 : - return e._0; + return e._0; } } diff --git a/jscomp/test/dist/jscomp/test/arity_infer.js b/jscomp/test/dist/jscomp/test/arity_infer.js index 64ec24dc40..5549441a2b 100644 --- a/jscomp/test/dist/jscomp/test/arity_infer.js +++ b/jscomp/test/dist/jscomp/test/arity_infer.js @@ -30,25 +30,25 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = (function (x) { - return x + 1 | 0; - }); - break; + tmp = (function (x) { + return x + 1 | 0; + }); + break; case 1 : - tmp = (function (x) { - return x + 2 | 0; - }); - break; + tmp = (function (x) { + return x + 2 | 0; + }); + break; case 2 : - tmp = (function (x) { - return x + 3 | 0; - }); - break; + tmp = (function (x) { + return x + 3 | 0; + }); + break; case 3 : - tmp = (function (x) { - return x + 4 | 0; - }); - break; + tmp = (function (x) { + return x + 4 | 0; + }); + break; default: throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found diff --git a/jscomp/test/dist/jscomp/test/bb.js b/jscomp/test/dist/jscomp/test/bb.js index 11f6f93d23..da26d1c856 100644 --- a/jscomp/test/dist/jscomp/test/bb.js +++ b/jscomp/test/dist/jscomp/test/bb.js @@ -16,11 +16,11 @@ function f(x) { function ff(x) { switch (x) { case "a" : - return "a"; + return "a"; case "b" : - return "b"; + return "b"; case "c" : - return "c"; + return "c"; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -37,14 +37,14 @@ function test(x) { let match; switch (x) { case "a" : - match = "a"; - break; + match = "a"; + break; case "b" : - match = "b"; - break; + match = "b"; + break; case "c" : - match = "c"; - break; + match = "c"; + break; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", diff --git a/jscomp/test/dist/jscomp/test/bdd.js b/jscomp/test/dist/jscomp/test/bdd.js index deb8e45c3b..42eba1a554 100644 --- a/jscomp/test/dist/jscomp/test/bdd.js +++ b/jscomp/test/dist/jscomp/test/bdd.js @@ -265,14 +265,14 @@ function and2(n1, n2) { let f; switch (match) { case /* LESS */ 0 : - f = mkNode(and2(l1, n2), v1, and2(r1, n2)); - break; + f = mkNode(and2(l1, n2), v1, and2(r1, n2)); + break; case /* EQUAL */ 1 : - f = mkNode(and2(l1, l2), v1, and2(r1, r2)); - break; + f = mkNode(and2(l1, l2), v1, and2(r1, r2)); + break; case /* GREATER */ 2 : - f = mkNode(and2(n1, l2), v2, and2(n1, r2)); - break; + f = mkNode(and2(n1, l2), v2, and2(n1, r2)); + break; } Caml_array.set(andslot1, h, i1); @@ -312,14 +312,14 @@ function xor(n1, n2) { let f; switch (match) { case /* LESS */ 0 : - f = mkNode(xor(l1, n2), v1, xor(r1, n2)); - break; + f = mkNode(xor(l1, n2), v1, xor(r1, n2)); + break; case /* EQUAL */ 1 : - f = mkNode(xor(l1, l2), v1, xor(r1, r2)); - break; + f = mkNode(xor(l1, l2), v1, xor(r1, r2)); + break; case /* GREATER */ 2 : - f = mkNode(xor(n1, l2), v2, xor(n1, r2)); - break; + f = mkNode(xor(n1, l2), v2, xor(n1, r2)); + break; } Caml_array.set(andslot1, h, i1); diff --git a/jscomp/test/dist/jscomp/test/big_enum.js b/jscomp/test/dist/jscomp/test/big_enum.js index 83e099fa22..8ad2527f64 100644 --- a/jscomp/test/dist/jscomp/test/big_enum.js +++ b/jscomp/test/dist/jscomp/test/big_enum.js @@ -5,605 +5,605 @@ function to_enum(param) { switch (param) { case /* A0 */ 0 : - return 0; + return 0; case /* A1 */ 1 : - return 1; + return 1; case /* A2 */ 2 : - return 2; + return 2; case /* A3 */ 3 : - return 3; + return 3; case /* A4 */ 4 : - return 4; + return 4; case /* A5 */ 5 : - return 5; + return 5; case /* A6 */ 6 : - return 6; + return 6; case /* A7 */ 7 : - return 7; + return 7; case /* A8 */ 8 : - return 8; + return 8; case /* A9 */ 9 : - return 9; + return 9; case /* A10 */ 10 : - return 10; + return 10; case /* A11 */ 11 : - return 11; + return 11; case /* A12 */ 12 : - return 12; + return 12; case /* A13 */ 13 : - return 13; + return 13; case /* A14 */ 14 : - return 14; + return 14; case /* A15 */ 15 : - return 15; + return 15; case /* A16 */ 16 : - return 16; + return 16; case /* A17 */ 17 : - return 17; + return 17; case /* A18 */ 18 : - return 18; + return 18; case /* A19 */ 19 : - return 19; + return 19; case /* A20 */ 20 : - return 20; + return 20; case /* A21 */ 21 : - return 21; + return 21; case /* A22 */ 22 : - return 22; + return 22; case /* A23 */ 23 : - return 23; + return 23; case /* A24 */ 24 : - return 24; + return 24; case /* A25 */ 25 : - return 25; + return 25; case /* A26 */ 26 : - return 26; + return 26; case /* A27 */ 27 : - return 27; + return 27; case /* A28 */ 28 : - return 28; + return 28; case /* A29 */ 29 : - return 29; + return 29; case /* A30 */ 30 : - return 30; + return 30; case /* A31 */ 31 : - return 31; + return 31; case /* A32 */ 32 : - return 32; + return 32; case /* A33 */ 33 : - return 33; + return 33; case /* A34 */ 34 : - return 34; + return 34; case /* A35 */ 35 : - return 35; + return 35; case /* A36 */ 36 : - return 36; + return 36; case /* A37 */ 37 : - return 37; + return 37; case /* A38 */ 38 : - return 38; + return 38; case /* A39 */ 39 : - return 39; + return 39; case /* A40 */ 40 : - return 40; + return 40; case /* A41 */ 41 : - return 41; + return 41; case /* A42 */ 42 : - return 42; + return 42; case /* A43 */ 43 : - return 43; + return 43; case /* A44 */ 44 : - return 44; + return 44; case /* A45 */ 45 : - return 45; + return 45; case /* A46 */ 46 : - return 46; + return 46; case /* A47 */ 47 : - return 47; + return 47; case /* A48 */ 48 : - return 48; + return 48; case /* A49 */ 49 : - return 49; + return 49; case /* A50 */ 50 : - return 50; + return 50; case /* A51 */ 51 : - return 51; + return 51; case /* A52 */ 52 : - return 52; + return 52; case /* A53 */ 53 : - return 53; + return 53; case /* A54 */ 54 : - return 54; + return 54; case /* A55 */ 55 : - return 55; + return 55; case /* A56 */ 56 : - return 56; + return 56; case /* A57 */ 57 : - return 57; + return 57; case /* A58 */ 58 : - return 58; + return 58; case /* A59 */ 59 : - return 59; + return 59; case /* A60 */ 60 : - return 60; + return 60; case /* A61 */ 61 : - return 61; + return 61; case /* A62 */ 62 : - return 62; + return 62; case /* A63 */ 63 : - return 63; + return 63; case /* A64 */ 64 : - return 64; + return 64; case /* A65 */ 65 : - return 65; + return 65; case /* A66 */ 66 : - return 66; + return 66; case /* A67 */ 67 : - return 67; + return 67; case /* A68 */ 68 : - return 68; + return 68; case /* A69 */ 69 : - return 69; + return 69; case /* A70 */ 70 : - return 70; + return 70; case /* A71 */ 71 : - return 71; + return 71; case /* A72 */ 72 : - return 72; + return 72; case /* A73 */ 73 : - return 73; + return 73; case /* A74 */ 74 : - return 74; + return 74; case /* A75 */ 75 : - return 75; + return 75; case /* A76 */ 76 : - return 76; + return 76; case /* A77 */ 77 : - return 77; + return 77; case /* A78 */ 78 : - return 78; + return 78; case /* A79 */ 79 : - return 79; + return 79; case /* A80 */ 80 : - return 80; + return 80; case /* A81 */ 81 : - return 81; + return 81; case /* A82 */ 82 : - return 82; + return 82; case /* A83 */ 83 : - return 83; + return 83; case /* A84 */ 84 : - return 84; + return 84; case /* A85 */ 85 : - return 85; + return 85; case /* A86 */ 86 : - return 86; + return 86; case /* A87 */ 87 : - return 87; + return 87; case /* A88 */ 88 : - return 88; + return 88; case /* A89 */ 89 : - return 89; + return 89; case /* A90 */ 90 : - return 90; + return 90; case /* A91 */ 91 : - return 91; + return 91; case /* A92 */ 92 : - return 92; + return 92; case /* A93 */ 93 : - return 93; + return 93; case /* A94 */ 94 : - return 94; + return 94; case /* A95 */ 95 : - return 95; + return 95; case /* A96 */ 96 : - return 96; + return 96; case /* A97 */ 97 : - return 97; + return 97; case /* A98 */ 98 : - return 98; + return 98; case /* A99 */ 99 : - return 99; + return 99; case /* A100 */ 100 : - return 100; + return 100; case /* A101 */ 101 : - return 101; + return 101; case /* A102 */ 102 : - return 102; + return 102; case /* A103 */ 103 : - return 103; + return 103; case /* A104 */ 104 : - return 104; + return 104; case /* A105 */ 105 : - return 105; + return 105; case /* A106 */ 106 : - return 106; + return 106; case /* A107 */ 107 : - return 107; + return 107; case /* A108 */ 108 : - return 108; + return 108; case /* A109 */ 109 : - return 109; + return 109; case /* A110 */ 110 : - return 110; + return 110; case /* A111 */ 111 : - return 111; + return 111; case /* A112 */ 112 : - return 112; + return 112; case /* A113 */ 113 : - return 113; + return 113; case /* A114 */ 114 : - return 114; + return 114; case /* A115 */ 115 : - return 115; + return 115; case /* A116 */ 116 : - return 116; + return 116; case /* A117 */ 117 : - return 117; + return 117; case /* A118 */ 118 : - return 118; + return 118; case /* A119 */ 119 : - return 119; + return 119; case /* A120 */ 120 : - return 120; + return 120; case /* A121 */ 121 : - return 121; + return 121; case /* A122 */ 122 : - return 122; + return 122; case /* A123 */ 123 : - return 123; + return 123; case /* A124 */ 124 : - return 124; + return 124; case /* A125 */ 125 : - return 125; + return 125; case /* A126 */ 126 : - return 126; + return 126; case /* A127 */ 127 : - return 127; + return 127; case /* A128 */ 128 : - return 128; + return 128; case /* A129 */ 129 : - return 129; + return 129; case /* A130 */ 130 : - return 130; + return 130; case /* A131 */ 131 : - return 131; + return 131; case /* A132 */ 132 : - return 132; + return 132; case /* A133 */ 133 : - return 133; + return 133; case /* A134 */ 134 : - return 134; + return 134; case /* A135 */ 135 : - return 135; + return 135; case /* A136 */ 136 : - return 136; + return 136; case /* A137 */ 137 : - return 137; + return 137; case /* A138 */ 138 : - return 138; + return 138; case /* A139 */ 139 : - return 139; + return 139; case /* A140 */ 140 : - return 140; + return 140; case /* A141 */ 141 : - return 141; + return 141; case /* A142 */ 142 : - return 142; + return 142; case /* A143 */ 143 : - return 143; + return 143; case /* A144 */ 144 : - return 144; + return 144; case /* A145 */ 145 : - return 145; + return 145; case /* A146 */ 146 : - return 146; + return 146; case /* A147 */ 147 : - return 147; + return 147; case /* A148 */ 148 : - return 148; + return 148; case /* A149 */ 149 : - return 149; + return 149; case /* A150 */ 150 : - return 150; + return 150; case /* A151 */ 151 : - return 151; + return 151; case /* A152 */ 152 : - return 152; + return 152; case /* A153 */ 153 : - return 153; + return 153; case /* A154 */ 154 : - return 154; + return 154; case /* A155 */ 155 : - return 155; + return 155; case /* A156 */ 156 : - return 156; + return 156; case /* A157 */ 157 : - return 157; + return 157; case /* A158 */ 158 : - return 158; + return 158; case /* A159 */ 159 : - return 159; + return 159; case /* A160 */ 160 : - return 160; + return 160; case /* A161 */ 161 : - return 161; + return 161; case /* A162 */ 162 : - return 162; + return 162; case /* A163 */ 163 : - return 163; + return 163; case /* A164 */ 164 : - return 164; + return 164; case /* A165 */ 165 : - return 165; + return 165; case /* A166 */ 166 : - return 166; + return 166; case /* A167 */ 167 : - return 167; + return 167; case /* A168 */ 168 : - return 168; + return 168; case /* A169 */ 169 : - return 169; + return 169; case /* A170 */ 170 : - return 170; + return 170; case /* A171 */ 171 : - return 171; + return 171; case /* A172 */ 172 : - return 172; + return 172; case /* A173 */ 173 : - return 173; + return 173; case /* A174 */ 174 : - return 174; + return 174; case /* A175 */ 175 : - return 175; + return 175; case /* A176 */ 176 : - return 176; + return 176; case /* A177 */ 177 : - return 177; + return 177; case /* A178 */ 178 : - return 178; + return 178; case /* A179 */ 179 : - return 179; + return 179; case /* A180 */ 180 : - return 180; + return 180; case /* A181 */ 181 : - return 181; + return 181; case /* A182 */ 182 : - return 182; + return 182; case /* A183 */ 183 : - return 183; + return 183; case /* A184 */ 184 : - return 184; + return 184; case /* A185 */ 185 : - return 185; + return 185; case /* A186 */ 186 : - return 186; + return 186; case /* A187 */ 187 : - return 187; + return 187; case /* A188 */ 188 : - return 188; + return 188; case /* A189 */ 189 : - return 189; + return 189; case /* A190 */ 190 : - return 190; + return 190; case /* A191 */ 191 : - return 191; + return 191; case /* A192 */ 192 : - return 192; + return 192; case /* A193 */ 193 : - return 193; + return 193; case /* A194 */ 194 : - return 194; + return 194; case /* A195 */ 195 : - return 195; + return 195; case /* A196 */ 196 : - return 196; + return 196; case /* A197 */ 197 : - return 197; + return 197; case /* A198 */ 198 : - return 198; + return 198; case /* A199 */ 199 : - return 199; + return 199; case /* A200 */ 200 : - return 200; + return 200; case /* A201 */ 201 : - return 201; + return 201; case /* A202 */ 202 : - return 202; + return 202; case /* A203 */ 203 : - return 203; + return 203; case /* A204 */ 204 : - return 204; + return 204; case /* A205 */ 205 : - return 205; + return 205; case /* A206 */ 206 : - return 206; + return 206; case /* A207 */ 207 : - return 207; + return 207; case /* A208 */ 208 : - return 208; + return 208; case /* A209 */ 209 : - return 209; + return 209; case /* A210 */ 210 : - return 210; + return 210; case /* A211 */ 211 : - return 211; + return 211; case /* A212 */ 212 : - return 212; + return 212; case /* A213 */ 213 : - return 213; + return 213; case /* A214 */ 214 : - return 214; + return 214; case /* A215 */ 215 : - return 215; + return 215; case /* A216 */ 216 : - return 216; + return 216; case /* A217 */ 217 : - return 217; + return 217; case /* A218 */ 218 : - return 218; + return 218; case /* A219 */ 219 : - return 219; + return 219; case /* A220 */ 220 : - return 220; + return 220; case /* A221 */ 221 : - return 221; + return 221; case /* A222 */ 222 : - return 222; + return 222; case /* A223 */ 223 : - return 223; + return 223; case /* A224 */ 224 : - return 224; + return 224; case /* A225 */ 225 : - return 225; + return 225; case /* A226 */ 226 : - return 226; + return 226; case /* A227 */ 227 : - return 227; + return 227; case /* A228 */ 228 : - return 228; + return 228; case /* A229 */ 229 : - return 229; + return 229; case /* A230 */ 230 : - return 230; + return 230; case /* A231 */ 231 : - return 231; + return 231; case /* A232 */ 232 : - return 232; + return 232; case /* A233 */ 233 : - return 233; + return 233; case /* A234 */ 234 : - return 234; + return 234; case /* A235 */ 235 : - return 235; + return 235; case /* A236 */ 236 : - return 236; + return 236; case /* A237 */ 237 : - return 237; + return 237; case /* A238 */ 238 : - return 238; + return 238; case /* A239 */ 239 : - return 239; + return 239; case /* A240 */ 240 : - return 240; + return 240; case /* A241 */ 241 : - return 241; + return 241; case /* A242 */ 242 : - return 242; + return 242; case /* A243 */ 243 : - return 243; + return 243; case /* A244 */ 244 : - return 244; + return 244; case /* A245 */ 245 : - return 245; + return 245; case /* A246 */ 246 : - return 246; + return 246; case /* A247 */ 247 : - return 247; + return 247; case /* A248 */ 248 : - return 248; + return 248; case /* A249 */ 249 : - return 249; + return 249; case /* A250 */ 250 : - return 250; + return 250; case /* A251 */ 251 : - return 251; + return 251; case /* A252 */ 252 : - return 252; + return 252; case /* A253 */ 253 : - return 253; + return 253; case /* A254 */ 254 : - return 254; + return 254; case /* A255 */ 255 : - return 255; + return 255; case /* A256 */ 256 : - return 256; + return 256; case /* A257 */ 257 : - return 257; + return 257; case /* A258 */ 258 : - return 258; + return 258; case /* A259 */ 259 : - return 259; + return 259; case /* A260 */ 260 : - return 260; + return 260; case /* A261 */ 261 : - return 261; + return 261; case /* A262 */ 262 : - return 262; + return 262; case /* A263 */ 263 : - return 263; + return 263; case /* A264 */ 264 : - return 264; + return 264; case /* A265 */ 265 : - return 265; + return 265; case /* A266 */ 266 : - return 266; + return 266; case /* A267 */ 267 : - return 267; + return 267; case /* A268 */ 268 : - return 268; + return 268; case /* A269 */ 269 : - return 269; + return 269; case /* A270 */ 270 : - return 270; + return 270; case /* A271 */ 271 : - return 271; + return 271; case /* A272 */ 272 : - return 272; + return 272; case /* A273 */ 273 : - return 273; + return 273; case /* A274 */ 274 : - return 274; + return 274; case /* A275 */ 275 : - return 275; + return 275; case /* A276 */ 276 : - return 276; + return 276; case /* A277 */ 277 : - return 277; + return 277; case /* A278 */ 278 : - return 278; + return 278; case /* A279 */ 279 : - return 279; + return 279; case /* A280 */ 280 : - return 280; + return 280; case /* A281 */ 281 : - return 281; + return 281; case /* A282 */ 282 : - return 282; + return 282; case /* A283 */ 283 : - return 283; + return 283; case /* A284 */ 284 : - return 284; + return 284; case /* A285 */ 285 : - return 285; + return 285; case /* A286 */ 286 : - return 286; + return 286; case /* A287 */ 287 : - return 287; + return 287; case /* A288 */ 288 : - return 288; + return 288; case /* A289 */ 289 : - return 289; + return 289; case /* A290 */ 290 : - return 290; + return 290; case /* A291 */ 291 : - return 291; + return 291; case /* A292 */ 292 : - return 292; + return 292; case /* A293 */ 293 : - return 293; + return 293; case /* A294 */ 294 : - return 294; + return 294; case /* A295 */ 295 : - return 295; + return 295; case /* A296 */ 296 : - return 296; + return 296; case /* A297 */ 297 : - return 297; + return 297; case /* A298 */ 298 : - return 298; + return 298; case /* A299 */ 299 : - return 299; + return 299; } } @@ -611,605 +611,605 @@ function to_enum(param) { function to_string(param) { switch (param) { case /* A0 */ 0 : - return "A0"; + return "A0"; case /* A1 */ 1 : - return "A1"; + return "A1"; case /* A2 */ 2 : - return "A2"; + return "A2"; case /* A3 */ 3 : - return "A3"; + return "A3"; case /* A4 */ 4 : - return "A4"; + return "A4"; case /* A5 */ 5 : - return "A5"; + return "A5"; case /* A6 */ 6 : - return "A6"; + return "A6"; case /* A7 */ 7 : - return "A7"; + return "A7"; case /* A8 */ 8 : - return "A8"; + return "A8"; case /* A9 */ 9 : - return "A9"; + return "A9"; case /* A10 */ 10 : - return "A10"; + return "A10"; case /* A11 */ 11 : - return "A11"; + return "A11"; case /* A12 */ 12 : - return "A12"; + return "A12"; case /* A13 */ 13 : - return "A13"; + return "A13"; case /* A14 */ 14 : - return "A14"; + return "A14"; case /* A15 */ 15 : - return "A15"; + return "A15"; case /* A16 */ 16 : - return "A16"; + return "A16"; case /* A17 */ 17 : - return "A17"; + return "A17"; case /* A18 */ 18 : - return "A18"; + return "A18"; case /* A19 */ 19 : - return "A19"; + return "A19"; case /* A20 */ 20 : - return "A20"; + return "A20"; case /* A21 */ 21 : - return "A21"; + return "A21"; case /* A22 */ 22 : - return "A22"; + return "A22"; case /* A23 */ 23 : - return "A23"; + return "A23"; case /* A24 */ 24 : - return "A24"; + return "A24"; case /* A25 */ 25 : - return "A25"; + return "A25"; case /* A26 */ 26 : - return "A26"; + return "A26"; case /* A27 */ 27 : - return "A27"; + return "A27"; case /* A28 */ 28 : - return "A28"; + return "A28"; case /* A29 */ 29 : - return "A29"; + return "A29"; case /* A30 */ 30 : - return "A30"; + return "A30"; case /* A31 */ 31 : - return "A31"; + return "A31"; case /* A32 */ 32 : - return "A32"; + return "A32"; case /* A33 */ 33 : - return "A33"; + return "A33"; case /* A34 */ 34 : - return "A34"; + return "A34"; case /* A35 */ 35 : - return "A35"; + return "A35"; case /* A36 */ 36 : - return "A36"; + return "A36"; case /* A37 */ 37 : - return "A37"; + return "A37"; case /* A38 */ 38 : - return "A38"; + return "A38"; case /* A39 */ 39 : - return "A39"; + return "A39"; case /* A40 */ 40 : - return "A40"; + return "A40"; case /* A41 */ 41 : - return "A41"; + return "A41"; case /* A42 */ 42 : - return "A42"; + return "A42"; case /* A43 */ 43 : - return "A43"; + return "A43"; case /* A44 */ 44 : - return "A44"; + return "A44"; case /* A45 */ 45 : - return "A45"; + return "A45"; case /* A46 */ 46 : - return "A46"; + return "A46"; case /* A47 */ 47 : - return "A47"; + return "A47"; case /* A48 */ 48 : - return "A48"; + return "A48"; case /* A49 */ 49 : - return "A49"; + return "A49"; case /* A50 */ 50 : - return "A50"; + return "A50"; case /* A51 */ 51 : - return "A51"; + return "A51"; case /* A52 */ 52 : - return "A52"; + return "A52"; case /* A53 */ 53 : - return "A53"; + return "A53"; case /* A54 */ 54 : - return "A54"; + return "A54"; case /* A55 */ 55 : - return "A55"; + return "A55"; case /* A56 */ 56 : - return "A56"; + return "A56"; case /* A57 */ 57 : - return "A57"; + return "A57"; case /* A58 */ 58 : - return "A58"; + return "A58"; case /* A59 */ 59 : - return "A59"; + return "A59"; case /* A60 */ 60 : - return "A60"; + return "A60"; case /* A61 */ 61 : - return "A61"; + return "A61"; case /* A62 */ 62 : - return "A62"; + return "A62"; case /* A63 */ 63 : - return "A63"; + return "A63"; case /* A64 */ 64 : - return "A64"; + return "A64"; case /* A65 */ 65 : - return "A65"; + return "A65"; case /* A66 */ 66 : - return "A66"; + return "A66"; case /* A67 */ 67 : - return "A67"; + return "A67"; case /* A68 */ 68 : - return "A68"; + return "A68"; case /* A69 */ 69 : - return "A69"; + return "A69"; case /* A70 */ 70 : - return "A70"; + return "A70"; case /* A71 */ 71 : - return "A71"; + return "A71"; case /* A72 */ 72 : - return "A72"; + return "A72"; case /* A73 */ 73 : - return "A73"; + return "A73"; case /* A74 */ 74 : - return "A74"; + return "A74"; case /* A75 */ 75 : - return "A75"; + return "A75"; case /* A76 */ 76 : - return "A76"; + return "A76"; case /* A77 */ 77 : - return "A77"; + return "A77"; case /* A78 */ 78 : - return "A78"; + return "A78"; case /* A79 */ 79 : - return "A79"; + return "A79"; case /* A80 */ 80 : - return "A80"; + return "A80"; case /* A81 */ 81 : - return "A81"; + return "A81"; case /* A82 */ 82 : - return "A82"; + return "A82"; case /* A83 */ 83 : - return "A83"; + return "A83"; case /* A84 */ 84 : - return "A84"; + return "A84"; case /* A85 */ 85 : - return "A85"; + return "A85"; case /* A86 */ 86 : - return "A86"; + return "A86"; case /* A87 */ 87 : - return "A87"; + return "A87"; case /* A88 */ 88 : - return "A88"; + return "A88"; case /* A89 */ 89 : - return "A89"; + return "A89"; case /* A90 */ 90 : - return "A90"; + return "A90"; case /* A91 */ 91 : - return "A91"; + return "A91"; case /* A92 */ 92 : - return "A92"; + return "A92"; case /* A93 */ 93 : - return "A93"; + return "A93"; case /* A94 */ 94 : - return "A94"; + return "A94"; case /* A95 */ 95 : - return "A95"; + return "A95"; case /* A96 */ 96 : - return "A96"; + return "A96"; case /* A97 */ 97 : - return "A97"; + return "A97"; case /* A98 */ 98 : - return "A98"; + return "A98"; case /* A99 */ 99 : - return "A99"; + return "A99"; case /* A100 */ 100 : - return "A100"; + return "A100"; case /* A101 */ 101 : - return "A101"; + return "A101"; case /* A102 */ 102 : - return "A102"; + return "A102"; case /* A103 */ 103 : - return "A103"; + return "A103"; case /* A104 */ 104 : - return "A104"; + return "A104"; case /* A105 */ 105 : - return "A105"; + return "A105"; case /* A106 */ 106 : - return "A106"; + return "A106"; case /* A107 */ 107 : - return "A107"; + return "A107"; case /* A108 */ 108 : - return "A108"; + return "A108"; case /* A109 */ 109 : - return "A109"; + return "A109"; case /* A110 */ 110 : - return "A110"; + return "A110"; case /* A111 */ 111 : - return "A111"; + return "A111"; case /* A112 */ 112 : - return "A112"; + return "A112"; case /* A113 */ 113 : - return "A113"; + return "A113"; case /* A114 */ 114 : - return "A114"; + return "A114"; case /* A115 */ 115 : - return "A115"; + return "A115"; case /* A116 */ 116 : - return "A116"; + return "A116"; case /* A117 */ 117 : - return "A117"; + return "A117"; case /* A118 */ 118 : - return "A118"; + return "A118"; case /* A119 */ 119 : - return "A119"; + return "A119"; case /* A120 */ 120 : - return "A120"; + return "A120"; case /* A121 */ 121 : - return "A121"; + return "A121"; case /* A122 */ 122 : - return "A122"; + return "A122"; case /* A123 */ 123 : - return "A123"; + return "A123"; case /* A124 */ 124 : - return "A124"; + return "A124"; case /* A125 */ 125 : - return "A125"; + return "A125"; case /* A126 */ 126 : - return "A126"; + return "A126"; case /* A127 */ 127 : - return "A127"; + return "A127"; case /* A128 */ 128 : - return "A128"; + return "A128"; case /* A129 */ 129 : - return "A129"; + return "A129"; case /* A130 */ 130 : - return "A130"; + return "A130"; case /* A131 */ 131 : - return "A131"; + return "A131"; case /* A132 */ 132 : - return "A132"; + return "A132"; case /* A133 */ 133 : - return "A133"; + return "A133"; case /* A134 */ 134 : - return "A134"; + return "A134"; case /* A135 */ 135 : - return "A135"; + return "A135"; case /* A136 */ 136 : - return "A136"; + return "A136"; case /* A137 */ 137 : - return "A137"; + return "A137"; case /* A138 */ 138 : - return "A138"; + return "A138"; case /* A139 */ 139 : - return "A139"; + return "A139"; case /* A140 */ 140 : - return "A140"; + return "A140"; case /* A141 */ 141 : - return "A141"; + return "A141"; case /* A142 */ 142 : - return "A142"; + return "A142"; case /* A143 */ 143 : - return "A143"; + return "A143"; case /* A144 */ 144 : - return "A144"; + return "A144"; case /* A145 */ 145 : - return "A145"; + return "A145"; case /* A146 */ 146 : - return "A146"; + return "A146"; case /* A147 */ 147 : - return "A147"; + return "A147"; case /* A148 */ 148 : - return "A148"; + return "A148"; case /* A149 */ 149 : - return "A149"; + return "A149"; case /* A150 */ 150 : - return "A150"; + return "A150"; case /* A151 */ 151 : - return "A151"; + return "A151"; case /* A152 */ 152 : - return "A152"; + return "A152"; case /* A153 */ 153 : - return "A153"; + return "A153"; case /* A154 */ 154 : - return "A154"; + return "A154"; case /* A155 */ 155 : - return "A155"; + return "A155"; case /* A156 */ 156 : - return "A156"; + return "A156"; case /* A157 */ 157 : - return "A157"; + return "A157"; case /* A158 */ 158 : - return "A158"; + return "A158"; case /* A159 */ 159 : - return "A159"; + return "A159"; case /* A160 */ 160 : - return "A160"; + return "A160"; case /* A161 */ 161 : - return "A161"; + return "A161"; case /* A162 */ 162 : - return "A162"; + return "A162"; case /* A163 */ 163 : - return "A163"; + return "A163"; case /* A164 */ 164 : - return "A164"; + return "A164"; case /* A165 */ 165 : - return "A165"; + return "A165"; case /* A166 */ 166 : - return "A166"; + return "A166"; case /* A167 */ 167 : - return "A167"; + return "A167"; case /* A168 */ 168 : - return "A168"; + return "A168"; case /* A169 */ 169 : - return "A169"; + return "A169"; case /* A170 */ 170 : - return "A170"; + return "A170"; case /* A171 */ 171 : - return "A171"; + return "A171"; case /* A172 */ 172 : - return "A172"; + return "A172"; case /* A173 */ 173 : - return "A173"; + return "A173"; case /* A174 */ 174 : - return "A174"; + return "A174"; case /* A175 */ 175 : - return "A175"; + return "A175"; case /* A176 */ 176 : - return "A176"; + return "A176"; case /* A177 */ 177 : - return "A177"; + return "A177"; case /* A178 */ 178 : - return "A178"; + return "A178"; case /* A179 */ 179 : - return "A179"; + return "A179"; case /* A180 */ 180 : - return "A180"; + return "A180"; case /* A181 */ 181 : - return "A181"; + return "A181"; case /* A182 */ 182 : - return "A182"; + return "A182"; case /* A183 */ 183 : - return "A183"; + return "A183"; case /* A184 */ 184 : - return "A184"; + return "A184"; case /* A185 */ 185 : - return "A185"; + return "A185"; case /* A186 */ 186 : - return "A186"; + return "A186"; case /* A187 */ 187 : - return "A187"; + return "A187"; case /* A188 */ 188 : - return "A188"; + return "A188"; case /* A189 */ 189 : - return "A189"; + return "A189"; case /* A190 */ 190 : - return "A190"; + return "A190"; case /* A191 */ 191 : - return "A191"; + return "A191"; case /* A192 */ 192 : - return "A192"; + return "A192"; case /* A193 */ 193 : - return "A193"; + return "A193"; case /* A194 */ 194 : - return "A194"; + return "A194"; case /* A195 */ 195 : - return "A195"; + return "A195"; case /* A196 */ 196 : - return "A196"; + return "A196"; case /* A197 */ 197 : - return "A197"; + return "A197"; case /* A198 */ 198 : - return "A198"; + return "A198"; case /* A199 */ 199 : - return "A199"; + return "A199"; case /* A200 */ 200 : - return "A200"; + return "A200"; case /* A201 */ 201 : - return "A201"; + return "A201"; case /* A202 */ 202 : - return "A202"; + return "A202"; case /* A203 */ 203 : - return "A203"; + return "A203"; case /* A204 */ 204 : - return "A204"; + return "A204"; case /* A205 */ 205 : - return "A205"; + return "A205"; case /* A206 */ 206 : - return "A206"; + return "A206"; case /* A207 */ 207 : - return "A207"; + return "A207"; case /* A208 */ 208 : - return "A208"; + return "A208"; case /* A209 */ 209 : - return "A209"; + return "A209"; case /* A210 */ 210 : - return "A210"; + return "A210"; case /* A211 */ 211 : - return "A211"; + return "A211"; case /* A212 */ 212 : - return "A212"; + return "A212"; case /* A213 */ 213 : - return "A213"; + return "A213"; case /* A214 */ 214 : - return "A214"; + return "A214"; case /* A215 */ 215 : - return "A215"; + return "A215"; case /* A216 */ 216 : - return "A216"; + return "A216"; case /* A217 */ 217 : - return "A217"; + return "A217"; case /* A218 */ 218 : - return "A218"; + return "A218"; case /* A219 */ 219 : - return "A219"; + return "A219"; case /* A220 */ 220 : - return "A220"; + return "A220"; case /* A221 */ 221 : - return "A221"; + return "A221"; case /* A222 */ 222 : - return "A222"; + return "A222"; case /* A223 */ 223 : - return "A223"; + return "A223"; case /* A224 */ 224 : - return "A224"; + return "A224"; case /* A225 */ 225 : - return "A225"; + return "A225"; case /* A226 */ 226 : - return "A226"; + return "A226"; case /* A227 */ 227 : - return "A227"; + return "A227"; case /* A228 */ 228 : - return "A228"; + return "A228"; case /* A229 */ 229 : - return "A229"; + return "A229"; case /* A230 */ 230 : - return "A230"; + return "A230"; case /* A231 */ 231 : - return "A231"; + return "A231"; case /* A232 */ 232 : - return "A232"; + return "A232"; case /* A233 */ 233 : - return "A233"; + return "A233"; case /* A234 */ 234 : - return "A234"; + return "A234"; case /* A235 */ 235 : - return "A235"; + return "A235"; case /* A236 */ 236 : - return "A236"; + return "A236"; case /* A237 */ 237 : - return "A237"; + return "A237"; case /* A238 */ 238 : - return "A238"; + return "A238"; case /* A239 */ 239 : - return "A239"; + return "A239"; case /* A240 */ 240 : - return "A240"; + return "A240"; case /* A241 */ 241 : - return "A241"; + return "A241"; case /* A242 */ 242 : - return "A242"; + return "A242"; case /* A243 */ 243 : - return "A243"; + return "A243"; case /* A244 */ 244 : - return "A244"; + return "A244"; case /* A245 */ 245 : - return "A245"; + return "A245"; case /* A246 */ 246 : - return "A246"; + return "A246"; case /* A247 */ 247 : - return "A247"; + return "A247"; case /* A248 */ 248 : - return "A248"; + return "A248"; case /* A249 */ 249 : - return "A249"; + return "A249"; case /* A250 */ 250 : - return "A250"; + return "A250"; case /* A251 */ 251 : - return "A251"; + return "A251"; case /* A252 */ 252 : - return "A252"; + return "A252"; case /* A253 */ 253 : - return "A253"; + return "A253"; case /* A254 */ 254 : - return "A254"; + return "A254"; case /* A255 */ 255 : - return "A255"; + return "A255"; case /* A256 */ 256 : - return "A256"; + return "A256"; case /* A257 */ 257 : - return "A257"; + return "A257"; case /* A258 */ 258 : - return "A258"; + return "A258"; case /* A259 */ 259 : - return "A259"; + return "A259"; case /* A260 */ 260 : - return "A260"; + return "A260"; case /* A261 */ 261 : - return "A261"; + return "A261"; case /* A262 */ 262 : - return "A262"; + return "A262"; case /* A263 */ 263 : - return "A263"; + return "A263"; case /* A264 */ 264 : - return "A264"; + return "A264"; case /* A265 */ 265 : - return "A265"; + return "A265"; case /* A266 */ 266 : - return "A266"; + return "A266"; case /* A267 */ 267 : - return "A267"; + return "A267"; case /* A268 */ 268 : - return "A268"; + return "A268"; case /* A269 */ 269 : - return "A269"; + return "A269"; case /* A270 */ 270 : - return "A270"; + return "A270"; case /* A271 */ 271 : - return "A271"; + return "A271"; case /* A272 */ 272 : - return "A272"; + return "A272"; case /* A273 */ 273 : - return "A273"; + return "A273"; case /* A274 */ 274 : - return "A274"; + return "A274"; case /* A275 */ 275 : - return "A275"; + return "A275"; case /* A276 */ 276 : - return "A276"; + return "A276"; case /* A277 */ 277 : - return "A277"; + return "A277"; case /* A278 */ 278 : - return "A278"; + return "A278"; case /* A279 */ 279 : - return "A279"; + return "A279"; case /* A280 */ 280 : - return "A280"; + return "A280"; case /* A281 */ 281 : - return "A281"; + return "A281"; case /* A282 */ 282 : - return "A282"; + return "A282"; case /* A283 */ 283 : - return "A283"; + return "A283"; case /* A284 */ 284 : - return "A284"; + return "A284"; case /* A285 */ 285 : - return "A285"; + return "A285"; case /* A286 */ 286 : - return "A286"; + return "A286"; case /* A287 */ 287 : - return "A287"; + return "A287"; case /* A288 */ 288 : - return "A288"; + return "A288"; case /* A289 */ 289 : - return "A289"; + return "A289"; case /* A290 */ 290 : - return "A290"; + return "A290"; case /* A291 */ 291 : - return "A291"; + return "A291"; case /* A292 */ 292 : - return "A292"; + return "A292"; case /* A293 */ 293 : - return "A293"; + return "A293"; case /* A294 */ 294 : - return "A294"; + return "A294"; case /* A295 */ 295 : - return "A295"; + return "A295"; case /* A296 */ 296 : - return "A296"; + return "A296"; case /* A297 */ 297 : - return "A297"; + return "A297"; case /* A298 */ 298 : - return "A298"; + return "A298"; case /* A299 */ 299 : - return "A299"; + return "A299"; } } diff --git a/jscomp/test/dist/jscomp/test/caml_format_test.js b/jscomp/test/dist/jscomp/test/caml_format_test.js index 381bb1f248..b4bb3b66e1 100644 --- a/jscomp/test/dist/jscomp/test/caml_format_test.js +++ b/jscomp/test/dist/jscomp/test/caml_format_test.js @@ -1759,17 +1759,17 @@ function kwd(ppf, s) { function pr_exp0(ppf, s) { switch (s.TAG) { case /* Var */ 1 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - }, - _1: "%a" - }), ident, s._0); + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + }, + _1: "%a" + }), ident, s._0); case /* Lambda */ 0 : case /* Apply */ 2 : - break; + break; } Curry._2(Stdlib__Format.fprintf(ppf)({ @@ -1843,28 +1843,28 @@ function pr_other_applications(ppf, f) { switch (f.TAG) { case /* Lambda */ 0 : case /* Var */ 1 : - return pr_exp0(ppf, f); + return pr_exp0(ppf, f); case /* Apply */ 2 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, - _1: "%a@ %a" - }), pr_app, f._0, pr_exp0, f._1); + } + }, + _1: "%a@ %a" + }), pr_app, f._0, pr_exp0, f._1); } } @@ -1872,54 +1872,54 @@ function pr_other_applications(ppf, f) { function pr_lambda(ppf, e) { switch (e.TAG) { case /* Lambda */ 0 : - return Curry._8(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._8(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, - _1: { + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Alpha */ 15, _0: { TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[<1>%a%a%a@ %a@]" - }), kwd, "\\", ident, e._0, kwd, ".", pr_lambda, e._1); + } + }, + _1: "@[<1>%a%a%a@ %a@]" + }), kwd, "\\", ident, e._0, kwd, ".", pr_lambda, e._1); case /* Var */ 1 : case /* Apply */ 2 : - return pr_app(ppf, e); + return pr_app(ppf, e); } } diff --git a/jscomp/test/dist/jscomp/test/compare_test.js b/jscomp/test/dist/jscomp/test/compare_test.js index 81eb4e5e7c..c964f40186 100644 --- a/jscomp/test/dist/jscomp/test/compare_test.js +++ b/jscomp/test/dist/jscomp/test/compare_test.js @@ -5,11 +5,11 @@ function compare(x, y) { switch (x) { case /* A */ 0 : - return y === /* A */ 0; + return y === /* A */ 0; case /* B */ 1 : - return y === /* B */ 1; + return y === /* B */ 1; case /* C */ 2 : - return y === /* C */ 2; + return y === /* C */ 2; } } @@ -17,32 +17,32 @@ function compare(x, y) { function compare2(x, y) { switch (x) { case /* A */ 0 : - switch (y) { - case /* A */ 0 : - return true; - case /* B */ 1 : - case /* C */ 2 : - return false; - - } + switch (y) { + case /* A */ 0 : + return true; + case /* B */ 1 : + case /* C */ 2 : + return false; + + } case /* B */ 1 : - switch (y) { - case /* B */ 1 : - return true; - case /* A */ 0 : - case /* C */ 2 : - return false; - - } + switch (y) { + case /* B */ 1 : + return true; + case /* A */ 0 : + case /* C */ 2 : + return false; + + } case /* C */ 2 : - switch (y) { - case /* A */ 0 : - case /* B */ 1 : - return false; - case /* C */ 2 : - return true; - - } + switch (y) { + case /* A */ 0 : + case /* B */ 1 : + return false; + case /* C */ 2 : + return true; + + } } } diff --git a/jscomp/test/dist/jscomp/test/complete_parmatch_test.js b/jscomp/test/dist/jscomp/test/complete_parmatch_test.js index 1078e4fc50..6890a6038b 100644 --- a/jscomp/test/dist/jscomp/test/complete_parmatch_test.js +++ b/jscomp/test/dist/jscomp/test/complete_parmatch_test.js @@ -5,11 +5,11 @@ function f(x) { switch (x) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } diff --git a/jscomp/test/dist/jscomp/test/complex_if_test.js b/jscomp/test/dist/jscomp/test/complex_if_test.js index e3379e5ceb..45d0900157 100644 --- a/jscomp/test/dist/jscomp/test/complex_if_test.js +++ b/jscomp/test/dist/jscomp/test/complex_if_test.js @@ -62,20 +62,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -86,31 +86,31 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; diff --git a/jscomp/test/dist/jscomp/test/const_test.js b/jscomp/test/dist/jscomp/test/const_test.js index 180cd89c93..cf0ff8af97 100644 --- a/jscomp/test/dist/jscomp/test/const_test.js +++ b/jscomp/test/dist/jscomp/test/const_test.js @@ -17,11 +17,11 @@ function fff(x) { }; switch (x$1.TAG) { case /* A */ 0 : - return x; + return x; case /* B */ 1 : - return 1; + return 1; case /* C */ 2 : - return 2; + return 2; } } diff --git a/jscomp/test/dist/jscomp/test/ext_bytes_test.js b/jscomp/test/dist/jscomp/test/ext_bytes_test.js index 41d0f36809..46b9366b51 100644 --- a/jscomp/test/dist/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/dist/jscomp/test/ext_bytes_test.js @@ -71,20 +71,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -95,31 +95,31 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; diff --git a/jscomp/test/dist/jscomp/test/flow_parser_reg_test.js b/jscomp/test/dist/jscomp/test/flow_parser_reg_test.js index a75f674245..96b39c0007 100644 --- a/jscomp/test/dist/jscomp/test/flow_parser_reg_test.js +++ b/jscomp/test/dist/jscomp/test/flow_parser_reg_test.js @@ -98,10 +98,10 @@ function order_of_filename(param) { } switch (param.TAG) { case /* LibFile */ 0 : - return 2; + return 2; case /* SourceFile */ 1 : case /* JsonFile */ 2 : - return 3; + return 3; } } @@ -154,189 +154,189 @@ function error(str) { if (/* tag */ typeof str === "number" || typeof str === "string") { switch (str) { case /* UnexpectedNumber */ 0 : - return "Unexpected number"; + return "Unexpected number"; case /* UnexpectedString */ 1 : - return "Unexpected string"; + return "Unexpected string"; case /* UnexpectedIdentifier */ 2 : - return "Unexpected identifier"; + return "Unexpected identifier"; case /* UnexpectedReserved */ 3 : - return "Unexpected reserved word"; + return "Unexpected reserved word"; case /* UnexpectedEOS */ 4 : - return "Unexpected end of input"; + return "Unexpected end of input"; case /* UnexpectedTypeAlias */ 5 : - return "Type aliases are not allowed in untyped mode"; + return "Type aliases are not allowed in untyped mode"; case /* UnexpectedTypeAnnotation */ 6 : - return "Type annotations are not allowed in untyped mode"; + return "Type annotations are not allowed in untyped mode"; case /* UnexpectedTypeDeclaration */ 7 : - return "Type declarations are not allowed in untyped mode"; + return "Type declarations are not allowed in untyped mode"; case /* UnexpectedTypeImport */ 8 : - return "Type imports are not allowed in untyped mode"; + return "Type imports are not allowed in untyped mode"; case /* UnexpectedTypeExport */ 9 : - return "Type exports are not allowed in untyped mode"; + return "Type exports are not allowed in untyped mode"; case /* UnexpectedTypeInterface */ 10 : - return "Interfaces are not allowed in untyped mode"; + return "Interfaces are not allowed in untyped mode"; case /* NewlineAfterThrow */ 11 : - return "Illegal newline after throw"; + return "Illegal newline after throw"; case /* InvalidRegExp */ 12 : - return "Invalid regular expression"; + return "Invalid regular expression"; case /* UnterminatedRegExp */ 13 : - return "Invalid regular expression: missing /"; + return "Invalid regular expression: missing /"; case /* InvalidLHSInAssignment */ 14 : - return "Invalid left-hand side in assignment"; + return "Invalid left-hand side in assignment"; case /* InvalidLHSInExponentiation */ 15 : - return "Invalid left-hand side in exponentiation expression"; + return "Invalid left-hand side in exponentiation expression"; case /* InvalidLHSInForIn */ 16 : - return "Invalid left-hand side in for-in"; + return "Invalid left-hand side in for-in"; case /* InvalidLHSInForOf */ 17 : - return "Invalid left-hand side in for-of"; + return "Invalid left-hand side in for-of"; case /* ExpectedPatternFoundExpression */ 18 : - return "Expected an object pattern, array pattern, or an identifier but found an expression instead"; + return "Expected an object pattern, array pattern, or an identifier but found an expression instead"; case /* MultipleDefaultsInSwitch */ 19 : - return "More than one default clause in switch statement"; + return "More than one default clause in switch statement"; case /* NoCatchOrFinally */ 20 : - return "Missing catch or finally after try"; + return "Missing catch or finally after try"; case /* IllegalContinue */ 21 : - return "Illegal continue statement"; + return "Illegal continue statement"; case /* IllegalBreak */ 22 : - return "Illegal break statement"; + return "Illegal break statement"; case /* IllegalReturn */ 23 : - return "Illegal return statement"; + return "Illegal return statement"; case /* IllegalYield */ 24 : - return "Illegal yield expression"; + return "Illegal yield expression"; case /* StrictModeWith */ 25 : - return "Strict mode code may not include a with statement"; + return "Strict mode code may not include a with statement"; case /* StrictCatchVariable */ 26 : - return "Catch variable may not be eval or arguments in strict mode"; + return "Catch variable may not be eval or arguments in strict mode"; case /* StrictVarName */ 27 : - return "Variable name may not be eval or arguments in strict mode"; + return "Variable name may not be eval or arguments in strict mode"; case /* StrictParamName */ 28 : - return "Parameter name eval or arguments is not allowed in strict mode"; + return "Parameter name eval or arguments is not allowed in strict mode"; case /* StrictParamDupe */ 29 : - return "Strict mode function may not have duplicate parameter names"; + return "Strict mode function may not have duplicate parameter names"; case /* StrictFunctionName */ 30 : - return "Function name may not be eval or arguments in strict mode"; + return "Function name may not be eval or arguments in strict mode"; case /* StrictOctalLiteral */ 31 : - return "Octal literals are not allowed in strict mode."; + return "Octal literals are not allowed in strict mode."; case /* StrictDelete */ 32 : - return "Delete of an unqualified identifier in strict mode."; + return "Delete of an unqualified identifier in strict mode."; case /* StrictDuplicateProperty */ 33 : - return "Duplicate data property in object literal not allowed in strict mode"; + return "Duplicate data property in object literal not allowed in strict mode"; case /* AccessorDataProperty */ 34 : - return "Object literal may not have data and accessor property with the same name"; + return "Object literal may not have data and accessor property with the same name"; case /* AccessorGetSet */ 35 : - return "Object literal may not have multiple get/set accessors with the same name"; + return "Object literal may not have multiple get/set accessors with the same name"; case /* StrictLHSAssignment */ 36 : - return "Assignment to eval or arguments is not allowed in strict mode"; + return "Assignment to eval or arguments is not allowed in strict mode"; case /* StrictLHSPostfix */ 37 : - return "Postfix increment/decrement may not have eval or arguments operand in strict mode"; + return "Postfix increment/decrement may not have eval or arguments operand in strict mode"; case /* StrictLHSPrefix */ 38 : - return "Prefix increment/decrement may not have eval or arguments operand in strict mode"; + return "Prefix increment/decrement may not have eval or arguments operand in strict mode"; case /* StrictReservedWord */ 39 : - return "Use of future reserved word in strict mode"; + return "Use of future reserved word in strict mode"; case /* JSXAttributeValueEmptyExpression */ 40 : - return "JSX attributes must only be assigned a non-empty expression"; + return "JSX attributes must only be assigned a non-empty expression"; case /* InvalidJSXAttributeValue */ 41 : - return "JSX value should be either an expression or a quoted JSX text"; + return "JSX value should be either an expression or a quoted JSX text"; case /* NoUninitializedConst */ 42 : - return "Const must be initialized"; + return "Const must be initialized"; case /* NoUninitializedDestructuring */ 43 : - return "Destructuring assignment must be initialized"; + return "Destructuring assignment must be initialized"; case /* NewlineBeforeArrow */ 44 : - return "Illegal newline before arrow"; + return "Illegal newline before arrow"; case /* StrictFunctionStatement */ 45 : - return "In strict mode code, functions can only be declared at top level or immediately within another function."; + return "In strict mode code, functions can only be declared at top level or immediately within another function."; case /* AdjacentJSXElements */ 46 : - return "Unexpected token <. Remember, adjacent JSX elements must be wrapped in an enclosing parent tag"; + return "Unexpected token <. Remember, adjacent JSX elements must be wrapped in an enclosing parent tag"; case /* ParameterAfterRestParameter */ 47 : - return "Rest parameter must be final parameter of an argument list"; + return "Rest parameter must be final parameter of an argument list"; case /* AsyncGenerator */ 48 : - return "A function may not be both async and a generator"; + return "A function may not be both async and a generator"; case /* DeclareAsync */ 49 : - return "async is an implementation detail and isn't necessary for your declare function statement. It is sufficient for your declare function to just have a Promise return type."; + return "async is an implementation detail and isn't necessary for your declare function statement. It is sufficient for your declare function to just have a Promise return type."; case /* DeclareExportLet */ 50 : - return "`declare export let` is not supported. Use `declare export var` instead."; + return "`declare export let` is not supported. Use `declare export var` instead."; case /* DeclareExportConst */ 51 : - return "`declare export const` is not supported. Use `declare export var` instead."; + return "`declare export const` is not supported. Use `declare export var` instead."; case /* DeclareExportType */ 52 : - return "`declare export type` is not supported. Use `export type` instead."; + return "`declare export type` is not supported. Use `export type` instead."; case /* DeclareExportInterface */ 53 : - return "`declare export interface` is not supported. Use `export interface` instead."; + return "`declare export interface` is not supported. Use `export interface` instead."; case /* UnexpectedExportStarAs */ 54 : - return "`export * as` is an early-stage proposal and is not enabled by default. To enable support in the parser, use the `esproposal_export_star_as` option"; + return "`export * as` is an early-stage proposal and is not enabled by default. To enable support in the parser, use the `esproposal_export_star_as` option"; case /* ExportNamelessClass */ 55 : - return "When exporting a class as a named export, you must specify a class name. Did you mean `export default class ...`?"; + return "When exporting a class as a named export, you must specify a class name. Did you mean `export default class ...`?"; case /* ExportNamelessFunction */ 56 : - return "When exporting a function as a named export, you must specify a function name. Did you mean `export default function ...`?"; + return "When exporting a function as a named export, you must specify a function name. Did you mean `export default function ...`?"; case /* UnsupportedDecorator */ 57 : - return "Found a decorator in an unsupported position."; + return "Found a decorator in an unsupported position."; case /* MissingTypeParamDefault */ 58 : - return "Type parameter declaration needs a default, since a preceding type parameter declaration has a default."; + return "Type parameter declaration needs a default, since a preceding type parameter declaration has a default."; case /* WindowsFloatOfString */ 59 : - return "The Windows version of OCaml has a bug in how it parses hexidecimal numbers. It is fixed in OCaml 4.03.0. Until we can switch to 4.03.0, please avoid either hexidecimal notation or Windows."; + return "The Windows version of OCaml has a bug in how it parses hexidecimal numbers. It is fixed in OCaml 4.03.0. Until we can switch to 4.03.0, please avoid either hexidecimal notation or Windows."; case /* DuplicateDeclareModuleExports */ 60 : - return "Duplicate `declare module.exports` statement!"; + return "Duplicate `declare module.exports` statement!"; case /* AmbiguousDeclareModuleKind */ 61 : - return "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module xor they are a CommonJS module."; + return "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module xor they are a CommonJS module."; } } else { switch (str.TAG) { case /* Assertion */ 0 : - return "Unexpected parser state: " + str._0; + return "Unexpected parser state: " + str._0; case /* UnexpectedToken */ 1 : - return "Unexpected token " + str._0; + return "Unexpected token " + str._0; case /* UnexpectedTokenWithSuggestion */ 2 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected token `", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected token `", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "`. Did you mean `", _1: { - TAG: /* String_literal */ 11, - _0: "`. Did you mean `", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "`?", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "`?", + _1: /* End_of_format */ 0 } } } - }, - _1: "Unexpected token `%s`. Did you mean `%s`?" - }), str._0, str._1); + } + }, + _1: "Unexpected token `%s`. Did you mean `%s`?" + }), str._0, str._1); case /* InvalidRegExpFlags */ 3 : - return "Invalid flags supplied to RegExp constructor '" + (str._0 + "'"); + return "Invalid flags supplied to RegExp constructor '" + (str._0 + "'"); case /* UnknownLabel */ 4 : - return "Undefined label '" + (str._0 + "'"); + return "Undefined label '" + (str._0 + "'"); case /* Redeclaration */ 5 : - return str._0 + (" '" + (str._1 + "' has already been declared")); + return str._0 + (" '" + (str._1 + "' has already been declared")); case /* ExpectedJSXClosingTag */ 6 : - return "Expected corresponding JSX closing tag for " + str._0; + return "Expected corresponding JSX closing tag for " + str._0; case /* DuplicateExport */ 7 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Duplicate export for `", + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Duplicate export for `", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '`' */96, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '`' */96, + _1: /* End_of_format */ 0 } - }, - _1: "Duplicate export for `%s`" - }), str._0); + } + }, + _1: "Duplicate export for `%s`" + }), str._0); } } @@ -1696,245 +1696,245 @@ function token_to_string(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* T_IDENTIFIER */ 0 : - return "T_IDENTIFIER"; + return "T_IDENTIFIER"; case /* T_LCURLY */ 1 : - return "T_LCURLY"; + return "T_LCURLY"; case /* T_RCURLY */ 2 : - return "T_RCURLY"; + return "T_RCURLY"; case /* T_LPAREN */ 3 : - return "T_LPAREN"; + return "T_LPAREN"; case /* T_RPAREN */ 4 : - return "T_RPAREN"; + return "T_RPAREN"; case /* T_LBRACKET */ 5 : - return "T_LBRACKET"; + return "T_LBRACKET"; case /* T_RBRACKET */ 6 : - return "T_RBRACKET"; + return "T_RBRACKET"; case /* T_SEMICOLON */ 7 : - return "T_SEMICOLON"; + return "T_SEMICOLON"; case /* T_COMMA */ 8 : - return "T_COMMA"; + return "T_COMMA"; case /* T_PERIOD */ 9 : - return "T_PERIOD"; + return "T_PERIOD"; case /* T_ARROW */ 10 : - return "T_ARROW"; + return "T_ARROW"; case /* T_ELLIPSIS */ 11 : - return "T_ELLIPSIS"; + return "T_ELLIPSIS"; case /* T_AT */ 12 : - return "T_AT"; + return "T_AT"; case /* T_FUNCTION */ 13 : - return "T_FUNCTION"; + return "T_FUNCTION"; case /* T_IF */ 14 : - return "T_IF"; + return "T_IF"; case /* T_IN */ 15 : - return "T_IN"; + return "T_IN"; case /* T_INSTANCEOF */ 16 : - return "T_INSTANCEOF"; + return "T_INSTANCEOF"; case /* T_RETURN */ 17 : - return "T_RETURN"; + return "T_RETURN"; case /* T_SWITCH */ 18 : - return "T_SWITCH"; + return "T_SWITCH"; case /* T_THIS */ 19 : - return "T_THIS"; + return "T_THIS"; case /* T_THROW */ 20 : - return "T_THROW"; + return "T_THROW"; case /* T_TRY */ 21 : - return "T_TRY"; + return "T_TRY"; case /* T_VAR */ 22 : - return "T_VAR"; + return "T_VAR"; case /* T_WHILE */ 23 : - return "T_WHILE"; + return "T_WHILE"; case /* T_WITH */ 24 : - return "T_WITH"; + return "T_WITH"; case /* T_CONST */ 25 : - return "T_CONST"; + return "T_CONST"; case /* T_LET */ 26 : - return "T_LET"; + return "T_LET"; case /* T_NULL */ 27 : - return "T_NULL"; + return "T_NULL"; case /* T_FALSE */ 28 : - return "T_FALSE"; + return "T_FALSE"; case /* T_TRUE */ 29 : - return "T_TRUE"; + return "T_TRUE"; case /* T_BREAK */ 30 : - return "T_BREAK"; + return "T_BREAK"; case /* T_CASE */ 31 : - return "T_CASE"; + return "T_CASE"; case /* T_CATCH */ 32 : - return "T_CATCH"; + return "T_CATCH"; case /* T_CONTINUE */ 33 : - return "T_CONTINUE"; + return "T_CONTINUE"; case /* T_DEFAULT */ 34 : - return "T_DEFAULT"; + return "T_DEFAULT"; case /* T_DO */ 35 : - return "T_DO"; + return "T_DO"; case /* T_FINALLY */ 36 : - return "T_FINALLY"; + return "T_FINALLY"; case /* T_FOR */ 37 : - return "T_FOR"; + return "T_FOR"; case /* T_CLASS */ 38 : - return "T_CLASS"; + return "T_CLASS"; case /* T_EXTENDS */ 39 : - return "T_EXTENDS"; + return "T_EXTENDS"; case /* T_STATIC */ 40 : - return "T_STATIC"; + return "T_STATIC"; case /* T_ELSE */ 41 : - return "T_ELSE"; + return "T_ELSE"; case /* T_NEW */ 42 : - return "T_NEW"; + return "T_NEW"; case /* T_DELETE */ 43 : - return "T_DELETE"; + return "T_DELETE"; case /* T_TYPEOF */ 44 : - return "T_TYPEOF"; + return "T_TYPEOF"; case /* T_VOID */ 45 : - return "T_VOID"; + return "T_VOID"; case /* T_ENUM */ 46 : - return "T_ENUM"; + return "T_ENUM"; case /* T_EXPORT */ 47 : - return "T_EXPORT"; + return "T_EXPORT"; case /* T_IMPORT */ 48 : - return "T_IMPORT"; + return "T_IMPORT"; case /* T_SUPER */ 49 : - return "T_SUPER"; + return "T_SUPER"; case /* T_IMPLEMENTS */ 50 : - return "T_IMPLEMENTS"; + return "T_IMPLEMENTS"; case /* T_INTERFACE */ 51 : - return "T_INTERFACE"; + return "T_INTERFACE"; case /* T_PACKAGE */ 52 : - return "T_PACKAGE"; + return "T_PACKAGE"; case /* T_PRIVATE */ 53 : - return "T_PRIVATE"; + return "T_PRIVATE"; case /* T_PROTECTED */ 54 : - return "T_PROTECTED"; + return "T_PROTECTED"; case /* T_PUBLIC */ 55 : - return "T_PUBLIC"; + return "T_PUBLIC"; case /* T_YIELD */ 56 : - return "T_YIELD"; + return "T_YIELD"; case /* T_DEBUGGER */ 57 : - return "T_DEBUGGER"; + return "T_DEBUGGER"; case /* T_DECLARE */ 58 : - return "T_DECLARE"; + return "T_DECLARE"; case /* T_TYPE */ 59 : - return "T_TYPE"; + return "T_TYPE"; case /* T_OF */ 60 : - return "T_OF"; + return "T_OF"; case /* T_ASYNC */ 61 : - return "T_ASYNC"; + return "T_ASYNC"; case /* T_AWAIT */ 62 : - return "T_AWAIT"; + return "T_AWAIT"; case /* T_RSHIFT3_ASSIGN */ 63 : - return "T_RSHIFT3_ASSIGN"; + return "T_RSHIFT3_ASSIGN"; case /* T_RSHIFT_ASSIGN */ 64 : - return "T_RSHIFT_ASSIGN"; + return "T_RSHIFT_ASSIGN"; case /* T_LSHIFT_ASSIGN */ 65 : - return "T_LSHIFT_ASSIGN"; + return "T_LSHIFT_ASSIGN"; case /* T_BIT_XOR_ASSIGN */ 66 : - return "T_BIT_XOR_ASSIGN"; + return "T_BIT_XOR_ASSIGN"; case /* T_BIT_OR_ASSIGN */ 67 : - return "T_BIT_OR_ASSIGN"; + return "T_BIT_OR_ASSIGN"; case /* T_BIT_AND_ASSIGN */ 68 : - return "T_BIT_AND_ASSIGN"; + return "T_BIT_AND_ASSIGN"; case /* T_MOD_ASSIGN */ 69 : - return "T_MOD_ASSIGN"; + return "T_MOD_ASSIGN"; case /* T_DIV_ASSIGN */ 70 : - return "T_DIV_ASSIGN"; + return "T_DIV_ASSIGN"; case /* T_MULT_ASSIGN */ 71 : - return "T_MULT_ASSIGN"; + return "T_MULT_ASSIGN"; case /* T_EXP_ASSIGN */ 72 : - return "T_EXP_ASSIGN"; + return "T_EXP_ASSIGN"; case /* T_MINUS_ASSIGN */ 73 : - return "T_MINUS_ASSIGN"; + return "T_MINUS_ASSIGN"; case /* T_PLUS_ASSIGN */ 74 : - return "T_PLUS_ASSIGN"; + return "T_PLUS_ASSIGN"; case /* T_ASSIGN */ 75 : - return "T_ASSIGN"; + return "T_ASSIGN"; case /* T_PLING */ 76 : - return "T_PLING"; + return "T_PLING"; case /* T_COLON */ 77 : - return "T_COLON"; + return "T_COLON"; case /* T_OR */ 78 : - return "T_OR"; + return "T_OR"; case /* T_AND */ 79 : - return "T_AND"; + return "T_AND"; case /* T_BIT_OR */ 80 : - return "T_BIT_OR"; + return "T_BIT_OR"; case /* T_BIT_XOR */ 81 : - return "T_BIT_XOR"; + return "T_BIT_XOR"; case /* T_BIT_AND */ 82 : - return "T_BIT_AND"; + return "T_BIT_AND"; case /* T_EQUAL */ 83 : - return "T_EQUAL"; + return "T_EQUAL"; case /* T_NOT_EQUAL */ 84 : - return "T_NOT_EQUAL"; + return "T_NOT_EQUAL"; case /* T_STRICT_EQUAL */ 85 : - return "T_STRICT_EQUAL"; + return "T_STRICT_EQUAL"; case /* T_STRICT_NOT_EQUAL */ 86 : - return "T_STRICT_NOT_EQUAL"; + return "T_STRICT_NOT_EQUAL"; case /* T_LESS_THAN_EQUAL */ 87 : - return "T_LESS_THAN_EQUAL"; + return "T_LESS_THAN_EQUAL"; case /* T_GREATER_THAN_EQUAL */ 88 : - return "T_GREATER_THAN_EQUAL"; + return "T_GREATER_THAN_EQUAL"; case /* T_LESS_THAN */ 89 : - return "T_LESS_THAN"; + return "T_LESS_THAN"; case /* T_GREATER_THAN */ 90 : - return "T_GREATER_THAN"; + return "T_GREATER_THAN"; case /* T_LSHIFT */ 91 : - return "T_LSHIFT"; + return "T_LSHIFT"; case /* T_RSHIFT */ 92 : - return "T_RSHIFT"; + return "T_RSHIFT"; case /* T_RSHIFT3 */ 93 : - return "T_RSHIFT3"; + return "T_RSHIFT3"; case /* T_PLUS */ 94 : - return "T_PLUS"; + return "T_PLUS"; case /* T_MINUS */ 95 : - return "T_MINUS"; + return "T_MINUS"; case /* T_DIV */ 96 : - return "T_DIV"; + return "T_DIV"; case /* T_MULT */ 97 : - return "T_MULT"; + return "T_MULT"; case /* T_EXP */ 98 : - return "T_EXP"; + return "T_EXP"; case /* T_MOD */ 99 : - return "T_MOD"; + return "T_MOD"; case /* T_NOT */ 100 : - return "T_NOT"; + return "T_NOT"; case /* T_BIT_NOT */ 101 : - return "T_BIT_NOT"; + return "T_BIT_NOT"; case /* T_INCR */ 102 : - return "T_INCR"; + return "T_INCR"; case /* T_DECR */ 103 : - return "T_DECR"; + return "T_DECR"; case /* T_ERROR */ 104 : - return "T_ERROR"; + return "T_ERROR"; case /* T_EOF */ 105 : - return "T_EOF"; + return "T_EOF"; case /* T_JSX_IDENTIFIER */ 106 : - return "T_JSX_IDENTIFIER"; + return "T_JSX_IDENTIFIER"; case /* T_ANY_TYPE */ 107 : - return "T_ANY_TYPE"; + return "T_ANY_TYPE"; case /* T_BOOLEAN_TYPE */ 108 : - return "T_BOOLEAN_TYPE"; + return "T_BOOLEAN_TYPE"; case /* T_NUMBER_TYPE */ 109 : - return "T_NUMBER_TYPE"; + return "T_NUMBER_TYPE"; case /* T_STRING_TYPE */ 110 : - return "T_STRING_TYPE"; + return "T_STRING_TYPE"; case /* T_VOID_TYPE */ 111 : - return "T_VOID_TYPE"; + return "T_VOID_TYPE"; } } else { switch (param.TAG) { case /* T_NUMBER */ 0 : - return "T_NUMBER"; + return "T_NUMBER"; case /* T_STRING */ 1 : - return "T_STRING"; + return "T_STRING"; case /* T_TEMPLATE_PART */ 2 : - return "T_TEMPLATE_PART"; + return "T_TEMPLATE_PART"; case /* T_REGEXP */ 3 : - return "T_REGEXP"; + return "T_REGEXP"; case /* T_JSX_TEXT */ 4 : - return "T_JSX_TEXT"; + return "T_JSX_TEXT"; case /* T_NUMBER_SINGLETON_TYPE */ 5 : - return "T_NUMBER_SINGLETON_TYPE"; + return "T_NUMBER_SINGLETON_TYPE"; } } @@ -2022,41 +2022,41 @@ function get_result_and_clear_state(param) { } else { switch (lex_token.TAG) { case /* T_TEMPLATE_PART */ 2 : - const match$2 = lex_token._0; - match$1 = [ - match$2[0], - match$2[1].literal - ]; - break; + const match$2 = lex_token._0; + match$1 = [ + match$2[0], + match$2[1].literal + ]; + break; case /* T_REGEXP */ 3 : - const match$3 = lex_token._0; - match$1 = [ - match$3[0], - "/" + (match$3[1] + ("/" + match$3[2])) - ]; - break; + const match$3 = lex_token._0; + match$1 = [ + match$3[0], + "/" + (match$3[1] + ("/" + match$3[2])) + ]; + break; case /* T_STRING */ 1 : case /* T_JSX_TEXT */ 4 : - exit = 1; - break; + exit = 1; + break; default: exit = 2; } } switch (exit) { case 1 : - const match$4 = lex_token._0; - match$1 = [ - match$4[0], - match$4[2] - ]; - break; + const match$4 = lex_token._0; + match$1 = [ + match$4[0], + match$4[2] + ]; + break; case 2 : - match$1 = [ - from_lb(env.lex_source, env.lex_lb), - Stdlib__Lexing.lexeme(env.lex_lb) - ]; - break; + match$1 = [ + from_lb(env.lex_source, env.lex_lb), + Stdlib__Lexing.lexeme(env.lex_lb) + ]; + break; } return [ @@ -2166,16 +2166,16 @@ function parse_sign(f) { } switch (match.hd) { case 43 : - return eat(f); + return eat(f); case 45 : - const init = eat(f); - return { - negative: true, - mantissa: init.mantissa, - exponent: init.exponent, - decimal_exponent: init.decimal_exponent, - todo: init.todo - }; + const init = eat(f); + return { + negative: true, + mantissa: init.mantissa, + exponent: init.exponent, + decimal_exponent: init.decimal_exponent, + todo: init.todo + }; default: return f; } @@ -2485,15 +2485,15 @@ function mk_num_singleton(number_type, num, neg) { let value; switch (number_type) { case /* LEGACY_OCTAL */ 1 : - value = Caml_format.caml_int_of_string("0o" + num); - break; + value = Caml_format.caml_int_of_string("0o" + num); + break; case /* BINARY */ 0 : case /* OCTAL */ 2 : - value = Caml_format.caml_int_of_string(num); - break; + value = Caml_format.caml_int_of_string(num); + break; case /* NORMAL */ 3 : - value = float_of_string(num); - break; + value = float_of_string(num); + break; } const value$1 = neg === "" ? value : - value; @@ -2904,479 +2904,479 @@ function token(env, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - Stdlib__Lexing.new_line(lexbuf); - return token(env, lexbuf); + Stdlib__Lexing.new_line(lexbuf); + return token(env, lexbuf); case 1 : - const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return token(env$1, lexbuf); + const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return token(env$1, lexbuf); case 2 : - unicode_fix_cols(lexbuf); - return token(env, lexbuf); + unicode_fix_cols(lexbuf); + return token(env, lexbuf); case 3 : - const start = from_lb(env.lex_source, lexbuf); - const buf = Stdlib__Buffer.create(127); - const match = comment(env, buf, lexbuf); - const env$2 = save_comment(match[0], start, match[1], buf, true); - return token(env$2, lexbuf); + const start = from_lb(env.lex_source, lexbuf); + const buf = Stdlib__Buffer.create(127); + const match = comment(env, buf, lexbuf); + const env$2 = save_comment(match[0], start, match[1], buf, true); + return token(env$2, lexbuf); case 4 : - const sp = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, Caml_array.get(lexbuf.lex_mem, 0)); - const escape_type = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - const pattern = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - if (env.lex_enable_comment_syntax) { - let env$3; - if (env.lex_in_comment_syntax) { - const loc = from_lb(env.lex_source, lexbuf); - env$3 = unexpected_error(env, loc, pattern); - } else { - env$3 = env; - } - const env$4 = in_comment_syntax(true, env$3); - if (escape_type === ":") { - return [ - env$4, - /* T_COLON */ 77 - ]; - } else { - return token(env$4, lexbuf); - } - } - const start$1 = from_lb(env.lex_source, lexbuf); - const buf$1 = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_string(buf$1, sp); - Stdlib__Buffer.add_string(buf$1, escape_type); - const match$1 = comment(env, buf$1, lexbuf); - const env$5 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); - return token(env$5, lexbuf); - case 5 : + const sp = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, Caml_array.get(lexbuf.lex_mem, 0)); + const escape_type = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + const pattern = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + if (env.lex_enable_comment_syntax) { + let env$3; if (env.lex_in_comment_syntax) { - const env$6 = in_comment_syntax(false, env); - return token(env$6, lexbuf); + const loc = from_lb(env.lex_source, lexbuf); + env$3 = unexpected_error(env, loc, pattern); + } else { + env$3 = env; } - yyback(1, lexbuf); - return [ - env, - /* T_MULT */ 97 - ]; - case 6 : - const start$2 = from_lb(env.lex_source, lexbuf); - const buf$2 = Stdlib__Buffer.create(127); - const match$2 = line_comment(env, buf$2, lexbuf); - const env$7 = save_comment(match$2[0], start$2, match$2[1], buf$2, false); - return token(env$7, lexbuf); - case 7 : - if (lexbuf.lex_start_pos !== 0) { + const env$4 = in_comment_syntax(true, env$3); + if (escape_type === ":") { return [ - env, - /* T_ERROR */ 104 + env$4, + /* T_COLON */ 77 ]; + } else { + return token(env$4, lexbuf); } - const match$3 = line_comment(env, Stdlib__Buffer.create(127), lexbuf); - return token(match$3[0], lexbuf); - case 8 : - const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const start$3 = from_lb(env.lex_source, lexbuf); - const buf$3 = Stdlib__Buffer.create(127); - const raw = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_char(raw, quote); - const match$4 = string_quote(env, quote, buf$3, raw, false, lexbuf); + } + const start$1 = from_lb(env.lex_source, lexbuf); + const buf$1 = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_string(buf$1, sp); + Stdlib__Buffer.add_string(buf$1, escape_type); + const match$1 = comment(env, buf$1, lexbuf); + const env$5 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); + return token(env$5, lexbuf); + case 5 : + if (env.lex_in_comment_syntax) { + const env$6 = in_comment_syntax(false, env); + return token(env$6, lexbuf); + } + yyback(1, lexbuf); + return [ + env, + /* T_MULT */ 97 + ]; + case 6 : + const start$2 = from_lb(env.lex_source, lexbuf); + const buf$2 = Stdlib__Buffer.create(127); + const match$2 = line_comment(env, buf$2, lexbuf); + const env$7 = save_comment(match$2[0], start$2, match$2[1], buf$2, false); + return token(env$7, lexbuf); + case 7 : + if (lexbuf.lex_start_pos !== 0) { return [ - match$4[0], - { - TAG: /* T_STRING */ 1, - _0: [ - btwn(start$3, match$4[1]), - Stdlib__Buffer.contents(buf$3), - Stdlib__Buffer.contents(raw), - match$4[2] - ] - } + env, + /* T_ERROR */ 104 ]; + } + const match$3 = line_comment(env, Stdlib__Buffer.create(127), lexbuf); + return token(match$3[0], lexbuf); + case 8 : + const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const start$3 = from_lb(env.lex_source, lexbuf); + const buf$3 = Stdlib__Buffer.create(127); + const raw = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_char(raw, quote); + const match$4 = string_quote(env, quote, buf$3, raw, false, lexbuf); + return [ + match$4[0], + { + TAG: /* T_STRING */ 1, + _0: [ + btwn(start$3, match$4[1]), + Stdlib__Buffer.contents(buf$3), + Stdlib__Buffer.contents(raw), + match$4[2] + ] + } + ]; case 9 : - const cooked = Stdlib__Buffer.create(127); - const raw$1 = Stdlib__Buffer.create(127); - const literal = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_string(literal, Stdlib__Lexing.lexeme(lexbuf)); - const start$4 = from_lb(env.lex_source, lexbuf); - const match$5 = template_part(env, start$4, cooked, raw$1, literal, lexbuf); - return [ - match$5[0], - { - TAG: /* T_TEMPLATE_PART */ 2, - _0: [ - match$5[1], - { - cooked: Stdlib__Buffer.contents(cooked), - raw: Stdlib__Buffer.contents(raw$1), - literal: Stdlib__Buffer.contents(literal) - }, - match$5[2] - ] - } - ]; + const cooked = Stdlib__Buffer.create(127); + const raw$1 = Stdlib__Buffer.create(127); + const literal = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_string(literal, Stdlib__Lexing.lexeme(lexbuf)); + const start$4 = from_lb(env.lex_source, lexbuf); + const match$5 = template_part(env, start$4, cooked, raw$1, literal, lexbuf); + return [ + match$5[0], + { + TAG: /* T_TEMPLATE_PART */ 2, + _0: [ + match$5[1], + { + cooked: Stdlib__Buffer.contents(cooked), + raw: Stdlib__Buffer.contents(raw$1), + literal: Stdlib__Buffer.contents(literal) + }, + match$5[2] + ] + } + ]; case 10 : - const w = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w, { - TAG: /* T_NUMBER */ 0, - _0: /* BINARY */ 0 - }); - case 11 : - return [ - env, - { + const w = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w, { TAG: /* T_NUMBER */ 0, _0: /* BINARY */ 0 - } - ]; + }); + case 11 : + return [ + env, + { + TAG: /* T_NUMBER */ 0, + _0: /* BINARY */ 0 + } + ]; case 12 : - const w$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$1, { - TAG: /* T_NUMBER */ 0, - _0: /* OCTAL */ 2 - }); - case 13 : - return [ - env, - { + const w$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$1, { TAG: /* T_NUMBER */ 0, _0: /* OCTAL */ 2 - } - ]; + }); + case 13 : + return [ + env, + { + TAG: /* T_NUMBER */ 0, + _0: /* OCTAL */ 2 + } + ]; case 14 : - const w$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$2, { - TAG: /* T_NUMBER */ 0, - _0: /* LEGACY_OCTAL */ 1 - }); - case 15 : - return [ - env, - { + const w$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$2, { TAG: /* T_NUMBER */ 0, _0: /* LEGACY_OCTAL */ 1 - } - ]; + }); + case 15 : + return [ + env, + { + TAG: /* T_NUMBER */ 0, + _0: /* LEGACY_OCTAL */ 1 + } + ]; case 16 : case 18 : case 20 : - break; + break; case 17 : case 19 : case 21 : + return [ + env, + { + TAG: /* T_NUMBER */ 0, + _0: /* NORMAL */ 3 + } + ]; + case 22 : + const word = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + unicode_fix_cols(lexbuf); + try { return [ env, - { - TAG: /* T_NUMBER */ 0, - _0: /* NORMAL */ 3 - } + Stdlib__Hashtbl.find(keywords, word) ]; - case 22 : - const word = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - unicode_fix_cols(lexbuf); - try { + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { return [ env, - Stdlib__Hashtbl.find(keywords, word) + /* T_IDENTIFIER */ 0 ]; } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return [ - env, - /* T_IDENTIFIER */ 0 - ]; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case 23 : - return [ - env, - /* T_LCURLY */ 1 - ]; + return [ + env, + /* T_LCURLY */ 1 + ]; case 24 : - return [ - env, - /* T_RCURLY */ 2 - ]; + return [ + env, + /* T_RCURLY */ 2 + ]; case 25 : - return [ - env, - /* T_LPAREN */ 3 - ]; + return [ + env, + /* T_LPAREN */ 3 + ]; case 26 : - return [ - env, - /* T_RPAREN */ 4 - ]; + return [ + env, + /* T_RPAREN */ 4 + ]; case 27 : - return [ - env, - /* T_LBRACKET */ 5 - ]; + return [ + env, + /* T_LBRACKET */ 5 + ]; case 28 : - return [ - env, - /* T_RBRACKET */ 6 - ]; + return [ + env, + /* T_RBRACKET */ 6 + ]; case 29 : - return [ - env, - /* T_ELLIPSIS */ 11 - ]; + return [ + env, + /* T_ELLIPSIS */ 11 + ]; case 30 : - return [ - env, - /* T_PERIOD */ 9 - ]; + return [ + env, + /* T_PERIOD */ 9 + ]; case 31 : - return [ - env, - /* T_SEMICOLON */ 7 - ]; + return [ + env, + /* T_SEMICOLON */ 7 + ]; case 32 : - return [ - env, - /* T_COMMA */ 8 - ]; + return [ + env, + /* T_COMMA */ 8 + ]; case 33 : - return [ - env, - /* T_COLON */ 77 - ]; + return [ + env, + /* T_COLON */ 77 + ]; case 34 : - return [ - env, - /* T_PLING */ 76 - ]; + return [ + env, + /* T_PLING */ 76 + ]; case 35 : - return [ - env, - /* T_AND */ 79 - ]; + return [ + env, + /* T_AND */ 79 + ]; case 36 : - return [ - env, - /* T_OR */ 78 - ]; + return [ + env, + /* T_OR */ 78 + ]; case 37 : - return [ - env, - /* T_STRICT_EQUAL */ 85 - ]; + return [ + env, + /* T_STRICT_EQUAL */ 85 + ]; case 38 : - return [ - env, - /* T_STRICT_NOT_EQUAL */ 86 - ]; + return [ + env, + /* T_STRICT_NOT_EQUAL */ 86 + ]; case 39 : - return [ - env, - /* T_LESS_THAN_EQUAL */ 87 - ]; + return [ + env, + /* T_LESS_THAN_EQUAL */ 87 + ]; case 40 : - return [ - env, - /* T_GREATER_THAN_EQUAL */ 88 - ]; + return [ + env, + /* T_GREATER_THAN_EQUAL */ 88 + ]; case 41 : - return [ - env, - /* T_EQUAL */ 83 - ]; + return [ + env, + /* T_EQUAL */ 83 + ]; case 42 : - return [ - env, - /* T_NOT_EQUAL */ 84 - ]; + return [ + env, + /* T_NOT_EQUAL */ 84 + ]; case 43 : - return [ - env, - /* T_INCR */ 102 - ]; + return [ + env, + /* T_INCR */ 102 + ]; case 44 : - return [ - env, - /* T_DECR */ 103 - ]; + return [ + env, + /* T_DECR */ 103 + ]; case 45 : - return [ - env, - /* T_LSHIFT_ASSIGN */ 65 - ]; + return [ + env, + /* T_LSHIFT_ASSIGN */ 65 + ]; case 46 : - return [ - env, - /* T_LSHIFT */ 91 - ]; + return [ + env, + /* T_LSHIFT */ 91 + ]; case 47 : - return [ - env, - /* T_RSHIFT_ASSIGN */ 64 - ]; + return [ + env, + /* T_RSHIFT_ASSIGN */ 64 + ]; case 48 : - return [ - env, - /* T_RSHIFT3_ASSIGN */ 63 - ]; + return [ + env, + /* T_RSHIFT3_ASSIGN */ 63 + ]; case 49 : - return [ - env, - /* T_RSHIFT3 */ 93 - ]; + return [ + env, + /* T_RSHIFT3 */ 93 + ]; case 50 : - return [ - env, - /* T_RSHIFT */ 92 - ]; + return [ + env, + /* T_RSHIFT */ 92 + ]; case 51 : - return [ - env, - /* T_PLUS_ASSIGN */ 74 - ]; + return [ + env, + /* T_PLUS_ASSIGN */ 74 + ]; case 52 : - return [ - env, - /* T_MINUS_ASSIGN */ 73 - ]; + return [ + env, + /* T_MINUS_ASSIGN */ 73 + ]; case 53 : - return [ - env, - /* T_MULT_ASSIGN */ 71 - ]; + return [ + env, + /* T_MULT_ASSIGN */ 71 + ]; case 54 : - return [ - env, - /* T_EXP_ASSIGN */ 72 - ]; + return [ + env, + /* T_EXP_ASSIGN */ 72 + ]; case 55 : - return [ - env, - /* T_MOD_ASSIGN */ 69 - ]; + return [ + env, + /* T_MOD_ASSIGN */ 69 + ]; case 56 : - return [ - env, - /* T_BIT_AND_ASSIGN */ 68 - ]; + return [ + env, + /* T_BIT_AND_ASSIGN */ 68 + ]; case 57 : - return [ - env, - /* T_BIT_OR_ASSIGN */ 67 - ]; + return [ + env, + /* T_BIT_OR_ASSIGN */ 67 + ]; case 58 : - return [ - env, - /* T_BIT_XOR_ASSIGN */ 66 - ]; + return [ + env, + /* T_BIT_XOR_ASSIGN */ 66 + ]; case 59 : - return [ - env, - /* T_LESS_THAN */ 89 - ]; + return [ + env, + /* T_LESS_THAN */ 89 + ]; case 60 : - return [ - env, - /* T_GREATER_THAN */ 90 - ]; + return [ + env, + /* T_GREATER_THAN */ 90 + ]; case 61 : - return [ - env, - /* T_PLUS */ 94 - ]; + return [ + env, + /* T_PLUS */ 94 + ]; case 62 : - return [ - env, - /* T_MINUS */ 95 - ]; + return [ + env, + /* T_MINUS */ 95 + ]; case 63 : - return [ - env, - /* T_MULT */ 97 - ]; + return [ + env, + /* T_MULT */ 97 + ]; case 64 : - return [ - env, - /* T_EXP */ 98 - ]; + return [ + env, + /* T_EXP */ 98 + ]; case 65 : - return [ - env, - /* T_MOD */ 99 - ]; + return [ + env, + /* T_MOD */ 99 + ]; case 66 : - return [ - env, - /* T_BIT_OR */ 80 - ]; + return [ + env, + /* T_BIT_OR */ 80 + ]; case 67 : - return [ - env, - /* T_BIT_AND */ 82 - ]; + return [ + env, + /* T_BIT_AND */ 82 + ]; case 68 : - return [ - env, - /* T_BIT_XOR */ 81 - ]; + return [ + env, + /* T_BIT_XOR */ 81 + ]; case 69 : - return [ - env, - /* T_NOT */ 100 - ]; + return [ + env, + /* T_NOT */ 100 + ]; case 70 : - return [ - env, - /* T_BIT_NOT */ 101 - ]; + return [ + env, + /* T_BIT_NOT */ 101 + ]; case 71 : - return [ - env, - /* T_ASSIGN */ 75 - ]; + return [ + env, + /* T_ASSIGN */ 75 + ]; case 72 : - return [ - env, - /* T_ARROW */ 10 - ]; + return [ + env, + /* T_ARROW */ 10 + ]; case 73 : - return [ - env, - /* T_DIV_ASSIGN */ 70 - ]; + return [ + env, + /* T_DIV_ASSIGN */ 70 + ]; case 74 : - return [ - env, - /* T_DIV */ 96 - ]; + return [ + env, + /* T_DIV */ 96 + ]; case 75 : - return [ - env, - /* T_AT */ 12 - ]; + return [ + env, + /* T_AT */ 12 + ]; case 76 : - let env$8; - if (env.lex_in_comment_syntax) { - const loc$1 = from_lb(env.lex_source, lexbuf); - env$8 = lex_error(env, loc$1, /* UnexpectedEOS */ 4); - } else { - env$8 = env; - } - return [ - env$8, - /* T_EOF */ 105 - ]; + let env$8; + if (env.lex_in_comment_syntax) { + const loc$1 = from_lb(env.lex_source, lexbuf); + env$8 = lex_error(env, loc$1, /* UnexpectedEOS */ 4); + } else { + env$8 = env; + } + return [ + env$8, + /* T_EOF */ 105 + ]; case 77 : - const env$9 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$9, - /* T_ERROR */ 104 - ]; + const env$9 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$9, + /* T_ERROR */ 104 + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -3397,856 +3397,856 @@ function jsx_text(env, mode, buf, raw, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - switch (mode) { - case /* JSX_SINGLE_QUOTED_TEXT */ 0 : - if (c === 39) { - return [ - env, - from_lb(env.lex_source, lexbuf) - ]; - } - break; - case /* JSX_DOUBLE_QUOTED_TEXT */ 1 : - if (c === 34) { - return [ - env, - from_lb(env.lex_source, lexbuf) - ]; - } - break; - case /* JSX_CHILD_TEXT */ 2 : - let exit = 0; - if (!(c !== 60 && c !== 123)) { - exit = 2; - } - if (exit === 2) { - back(lexbuf); - return [ - env, - from_lb(env.lex_source, lexbuf) - ]; - } - break; - - } - Stdlib__Buffer.add_char(raw, c); - Stdlib__Buffer.add_char(buf, c); - return jsx_text(env, mode, buf, raw, lexbuf); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + switch (mode) { + case /* JSX_SINGLE_QUOTED_TEXT */ 0 : + if (c === 39) { + return [ + env, + from_lb(env.lex_source, lexbuf) + ]; + } + break; + case /* JSX_DOUBLE_QUOTED_TEXT */ 1 : + if (c === 34) { + return [ + env, + from_lb(env.lex_source, lexbuf) + ]; + } + break; + case /* JSX_CHILD_TEXT */ 2 : + let exit = 0; + if (!(c !== 60 && c !== 123)) { + exit = 2; + } + if (exit === 2) { + back(lexbuf); + return [ + env, + from_lb(env.lex_source, lexbuf) + ]; + } + break; + + } + Stdlib__Buffer.add_char(raw, c); + Stdlib__Buffer.add_char(buf, c); + return jsx_text(env, mode, buf, raw, lexbuf); case 1 : - const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$1, - from_lb(env$1.lex_source, lexbuf) - ]; + const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$1, + from_lb(env$1.lex_source, lexbuf) + ]; case 2 : - const lt = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, lt); - Stdlib__Buffer.add_string(buf, lt); - Stdlib__Lexing.new_line(lexbuf); - return jsx_text(env, mode, buf, raw, lexbuf); + const lt = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, lt); + Stdlib__Buffer.add_string(buf, lt); + Stdlib__Lexing.new_line(lexbuf); + return jsx_text(env, mode, buf, raw, lexbuf); case 3 : - const n = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 3 | 0, lexbuf.lex_curr_pos - 1 | 0); - const s = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, s); - const code = Caml_format.caml_int_of_string("0x" + n); - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code)); - return jsx_text(env, mode, buf, raw, lexbuf); + const n = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 3 | 0, lexbuf.lex_curr_pos - 1 | 0); + const s = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, s); + const code = Caml_format.caml_int_of_string("0x" + n); + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code)); + return jsx_text(env, mode, buf, raw, lexbuf); case 4 : - const n$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, lexbuf.lex_curr_pos - 1 | 0); - const s$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, s$1); - const code$1 = Caml_format.caml_int_of_string(n$1); - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$1)); - return jsx_text(env, mode, buf, raw, lexbuf); + const n$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, lexbuf.lex_curr_pos - 1 | 0); + const s$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, s$1); + const code$1 = Caml_format.caml_int_of_string(n$1); + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$1)); + return jsx_text(env, mode, buf, raw, lexbuf); case 5 : - const entity = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 1 | 0, lexbuf.lex_curr_pos - 1 | 0); - const s$2 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, s$2); - let code$2; - switch (entity) { - case "'int'" : - code$2 = 8747; - break; - case "AElig" : - code$2 = 198; - break; - case "Aacute" : - code$2 = 193; - break; - case "Acirc" : - code$2 = 194; - break; - case "Agrave" : - code$2 = 192; - break; - case "Alpha" : - code$2 = 913; - break; - case "Aring" : - code$2 = 197; - break; - case "Atilde" : - code$2 = 195; - break; - case "Auml" : - code$2 = 196; - break; - case "Beta" : - code$2 = 914; - break; - case "Ccedil" : - code$2 = 199; - break; - case "Chi" : - code$2 = 935; - break; - case "Dagger" : - code$2 = 8225; - break; - case "Delta" : - code$2 = 916; - break; - case "ETH" : - code$2 = 208; - break; - case "Eacute" : - code$2 = 201; - break; - case "Ecirc" : - code$2 = 202; - break; - case "Egrave" : - code$2 = 200; - break; - case "Epsilon" : - code$2 = 917; - break; - case "Eta" : - code$2 = 919; - break; - case "Euml" : - code$2 = 203; - break; - case "Gamma" : - code$2 = 915; - break; - case "Iacute" : - code$2 = 205; - break; - case "Icirc" : - code$2 = 206; - break; - case "Igrave" : - code$2 = 204; - break; - case "Iota" : - code$2 = 921; - break; - case "Iuml" : - code$2 = 207; - break; - case "Kappa" : - code$2 = 922; - break; - case "Lambda" : - code$2 = 923; - break; - case "Mu" : - code$2 = 924; - break; - case "Ntilde" : - code$2 = 209; - break; - case "Nu" : - code$2 = 925; - break; - case "OElig" : - code$2 = 338; - break; - case "Oacute" : - code$2 = 211; - break; - case "Ocirc" : - code$2 = 212; - break; - case "Ograve" : - code$2 = 210; - break; - case "Omega" : - code$2 = 937; - break; - case "Omicron" : - code$2 = 927; - break; - case "Oslash" : - code$2 = 216; - break; - case "Otilde" : - code$2 = 213; - break; - case "Ouml" : - code$2 = 214; - break; - case "Phi" : - code$2 = 934; - break; - case "Pi" : - code$2 = 928; - break; - case "Prime" : - code$2 = 8243; - break; - case "Psi" : - code$2 = 936; - break; - case "Rho" : - code$2 = 929; - break; - case "Scaron" : - code$2 = 352; - break; - case "Sigma" : - code$2 = 931; - break; - case "THORN" : - code$2 = 222; - break; - case "Tau" : - code$2 = 932; - break; - case "Theta" : - code$2 = 920; - break; - case "Uacute" : - code$2 = 218; - break; - case "Ucirc" : - code$2 = 219; - break; - case "Ugrave" : - code$2 = 217; - break; - case "Upsilon" : - code$2 = 933; - break; - case "Uuml" : - code$2 = 220; - break; - case "Xi" : - code$2 = 926; - break; - case "Yacute" : - code$2 = 221; - break; - case "Yuml" : - code$2 = 376; - break; - case "Zeta" : - code$2 = 918; - break; - case "aacute" : - code$2 = 225; - break; - case "acirc" : - code$2 = 226; - break; - case "acute" : - code$2 = 180; - break; - case "aelig" : - code$2 = 230; - break; - case "agrave" : - code$2 = 224; - break; - case "alefsym" : - code$2 = 8501; - break; - case "alpha" : - code$2 = 945; - break; - case "amp" : - code$2 = 38; - break; - case "and" : - code$2 = 8743; - break; - case "ang" : - code$2 = 8736; - break; - case "apos" : - code$2 = 39; - break; - case "aring" : - code$2 = 229; - break; - case "asymp" : - code$2 = 8776; - break; - case "atilde" : - code$2 = 227; - break; - case "auml" : - code$2 = 228; - break; - case "bdquo" : - code$2 = 8222; - break; - case "beta" : - code$2 = 946; - break; - case "brvbar" : - code$2 = 166; - break; - case "bull" : - code$2 = 8226; - break; - case "cap" : - code$2 = 8745; - break; - case "ccedil" : - code$2 = 231; - break; - case "cedil" : - code$2 = 184; - break; - case "cent" : - code$2 = 162; - break; - case "chi" : - code$2 = 967; - break; - case "circ" : - code$2 = 710; - break; - case "clubs" : - code$2 = 9827; - break; - case "cong" : - code$2 = 8773; - break; - case "copy" : - code$2 = 169; - break; - case "crarr" : - code$2 = 8629; - break; - case "cup" : - code$2 = 8746; - break; - case "curren" : - code$2 = 164; - break; - case "dArr" : - code$2 = 8659; - break; - case "dagger" : - code$2 = 8224; - break; - case "darr" : - code$2 = 8595; - break; - case "deg" : - code$2 = 176; - break; - case "delta" : - code$2 = 948; - break; - case "diams" : - code$2 = 9830; - break; - case "divide" : - code$2 = 247; - break; - case "eacute" : - code$2 = 233; - break; - case "ecirc" : - code$2 = 234; - break; - case "egrave" : - code$2 = 232; - break; - case "empty" : - code$2 = 8709; - break; - case "emsp" : - code$2 = 8195; - break; - case "ensp" : - code$2 = 8194; - break; - case "epsilon" : - code$2 = 949; - break; - case "equiv" : - code$2 = 8801; - break; - case "eta" : - code$2 = 951; - break; - case "eth" : - code$2 = 240; - break; - case "euml" : - code$2 = 235; - break; - case "euro" : - code$2 = 8364; - break; - case "exist" : - code$2 = 8707; - break; - case "fnof" : - code$2 = 402; - break; - case "forall" : - code$2 = 8704; - break; - case "frac12" : - code$2 = 189; - break; - case "frac14" : - code$2 = 188; - break; - case "frac34" : - code$2 = 190; - break; - case "frasl" : - code$2 = 8260; - break; - case "gamma" : - code$2 = 947; - break; - case "ge" : - code$2 = 8805; - break; - case "gt" : - code$2 = 62; - break; - case "hArr" : - code$2 = 8660; - break; - case "harr" : - code$2 = 8596; - break; - case "hearts" : - code$2 = 9829; - break; - case "hellip" : - code$2 = 8230; - break; - case "iacute" : - code$2 = 237; - break; - case "icirc" : - code$2 = 238; - break; - case "iexcl" : - code$2 = 161; - break; - case "igrave" : - code$2 = 236; - break; - case "image" : - code$2 = 8465; - break; - case "infin" : - code$2 = 8734; - break; - case "iota" : - code$2 = 953; - break; - case "iquest" : - code$2 = 191; - break; - case "isin" : - code$2 = 8712; - break; - case "iuml" : - code$2 = 239; - break; - case "kappa" : - code$2 = 954; - break; - case "lArr" : - code$2 = 8656; - break; - case "lambda" : - code$2 = 955; - break; - case "lang" : - code$2 = 10216; - break; - case "laquo" : - code$2 = 171; - break; - case "larr" : - code$2 = 8592; - break; - case "lceil" : - code$2 = 8968; - break; - case "ldquo" : - code$2 = 8220; - break; - case "le" : - code$2 = 8804; - break; - case "lfloor" : - code$2 = 8970; - break; - case "lowast" : - code$2 = 8727; - break; - case "loz" : - code$2 = 9674; - break; - case "lrm" : - code$2 = 8206; - break; - case "lsaquo" : - code$2 = 8249; - break; - case "lsquo" : - code$2 = 8216; - break; - case "lt" : - code$2 = 60; - break; - case "macr" : - code$2 = 175; - break; - case "mdash" : - code$2 = 8212; - break; - case "micro" : - code$2 = 181; - break; - case "middot" : - code$2 = 183; - break; - case "minus" : - code$2 = 8722; - break; - case "mu" : - code$2 = 956; - break; - case "nabla" : - code$2 = 8711; - break; - case "nbsp" : - code$2 = 160; - break; - case "ndash" : - code$2 = 8211; - break; - case "ne" : - code$2 = 8800; - break; - case "ni" : - code$2 = 8715; - break; - case "not" : - code$2 = 172; - break; - case "notin" : - code$2 = 8713; - break; - case "nsub" : - code$2 = 8836; - break; - case "ntilde" : - code$2 = 241; - break; - case "nu" : - code$2 = 957; - break; - case "oacute" : - code$2 = 243; - break; - case "ocirc" : - code$2 = 244; - break; - case "oelig" : - code$2 = 339; - break; - case "ograve" : - code$2 = 242; - break; - case "oline" : - code$2 = 8254; - break; - case "omega" : - code$2 = 969; - break; - case "omicron" : - code$2 = 959; - break; - case "oplus" : - code$2 = 8853; - break; - case "or" : - code$2 = 8744; - break; - case "ordf" : - code$2 = 170; - break; - case "ordm" : - code$2 = 186; - break; - case "oslash" : - code$2 = 248; - break; - case "otilde" : - code$2 = 245; - break; - case "otimes" : - code$2 = 8855; - break; - case "ouml" : - code$2 = 246; - break; - case "para" : - code$2 = 182; - break; - case "part" : - code$2 = 8706; - break; - case "permil" : - code$2 = 8240; - break; - case "perp" : - code$2 = 8869; - break; - case "phi" : - code$2 = 966; - break; - case "pi" : - code$2 = 960; - break; - case "piv" : - code$2 = 982; - break; - case "plusmn" : - code$2 = 177; - break; - case "pound" : - code$2 = 163; - break; - case "prime" : - code$2 = 8242; - break; - case "prod" : - code$2 = 8719; - break; - case "prop" : - code$2 = 8733; - break; - case "psi" : - code$2 = 968; - break; - case "quot" : - code$2 = 34; - break; - case "rArr" : - code$2 = 8658; - break; - case "radic" : - code$2 = 8730; - break; - case "rang" : - code$2 = 10217; - break; - case "raquo" : - code$2 = 187; - break; - case "rarr" : - code$2 = 8594; - break; - case "rceil" : - code$2 = 8969; - break; - case "rdquo" : - code$2 = 8221; - break; - case "real" : - code$2 = 8476; - break; - case "reg" : - code$2 = 174; - break; - case "rfloor" : - code$2 = 8971; - break; - case "rho" : - code$2 = 961; - break; - case "rlm" : - code$2 = 8207; - break; - case "rsaquo" : - code$2 = 8250; - break; - case "rsquo" : - code$2 = 8217; - break; - case "sbquo" : - code$2 = 8218; - break; - case "scaron" : - code$2 = 353; - break; - case "sdot" : - code$2 = 8901; - break; - case "sect" : - code$2 = 167; - break; - case "shy" : - code$2 = 173; - break; - case "sigma" : - code$2 = 963; - break; - case "sigmaf" : - code$2 = 962; - break; - case "sim" : - code$2 = 8764; - break; - case "spades" : - code$2 = 9824; - break; - case "sub" : - code$2 = 8834; - break; - case "sube" : - code$2 = 8838; - break; - case "sum" : - code$2 = 8721; - break; - case "sup" : - code$2 = 8835; - break; - case "sup1" : - code$2 = 185; - break; - case "sup2" : - code$2 = 178; - break; - case "sup3" : - code$2 = 179; - break; - case "supe" : - code$2 = 8839; - break; - case "szlig" : - code$2 = 223; - break; - case "tau" : - code$2 = 964; - break; - case "there4" : - code$2 = 8756; - break; - case "theta" : - code$2 = 952; - break; - case "thetasym" : - code$2 = 977; - break; - case "thinsp" : - code$2 = 8201; - break; - case "thorn" : - code$2 = 254; - break; - case "tilde" : - code$2 = 732; - break; - case "times" : - code$2 = 215; - break; - case "trade" : - code$2 = 8482; - break; - case "uArr" : - code$2 = 8657; - break; - case "uacute" : - code$2 = 250; - break; - case "uarr" : - code$2 = 8593; - break; - case "ucirc" : - code$2 = 251; - break; - case "ugrave" : - code$2 = 249; - break; - case "uml" : - code$2 = 168; - break; - case "upsih" : - code$2 = 978; - break; - case "upsilon" : - code$2 = 965; - break; - case "uuml" : - code$2 = 252; - break; - case "weierp" : - code$2 = 8472; - break; - case "xi" : - code$2 = 958; - break; - case "yacute" : - code$2 = 253; - break; - case "yen" : - code$2 = 165; - break; - case "yuml" : - code$2 = 255; - break; - case "zeta" : - code$2 = 950; - break; - case "zwj" : - code$2 = 8205; - break; - case "zwnj" : - code$2 = 8204; - break; - default: - code$2 = undefined; - } - if (code$2 !== undefined) { - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$2)); - } else { - Stdlib__Buffer.add_string(buf, "&" + (entity + ";")); - } - return jsx_text(env, mode, buf, raw, lexbuf); + const entity = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 1 | 0, lexbuf.lex_curr_pos - 1 | 0); + const s$2 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, s$2); + let code$2; + switch (entity) { + case "'int'" : + code$2 = 8747; + break; + case "AElig" : + code$2 = 198; + break; + case "Aacute" : + code$2 = 193; + break; + case "Acirc" : + code$2 = 194; + break; + case "Agrave" : + code$2 = 192; + break; + case "Alpha" : + code$2 = 913; + break; + case "Aring" : + code$2 = 197; + break; + case "Atilde" : + code$2 = 195; + break; + case "Auml" : + code$2 = 196; + break; + case "Beta" : + code$2 = 914; + break; + case "Ccedil" : + code$2 = 199; + break; + case "Chi" : + code$2 = 935; + break; + case "Dagger" : + code$2 = 8225; + break; + case "Delta" : + code$2 = 916; + break; + case "ETH" : + code$2 = 208; + break; + case "Eacute" : + code$2 = 201; + break; + case "Ecirc" : + code$2 = 202; + break; + case "Egrave" : + code$2 = 200; + break; + case "Epsilon" : + code$2 = 917; + break; + case "Eta" : + code$2 = 919; + break; + case "Euml" : + code$2 = 203; + break; + case "Gamma" : + code$2 = 915; + break; + case "Iacute" : + code$2 = 205; + break; + case "Icirc" : + code$2 = 206; + break; + case "Igrave" : + code$2 = 204; + break; + case "Iota" : + code$2 = 921; + break; + case "Iuml" : + code$2 = 207; + break; + case "Kappa" : + code$2 = 922; + break; + case "Lambda" : + code$2 = 923; + break; + case "Mu" : + code$2 = 924; + break; + case "Ntilde" : + code$2 = 209; + break; + case "Nu" : + code$2 = 925; + break; + case "OElig" : + code$2 = 338; + break; + case "Oacute" : + code$2 = 211; + break; + case "Ocirc" : + code$2 = 212; + break; + case "Ograve" : + code$2 = 210; + break; + case "Omega" : + code$2 = 937; + break; + case "Omicron" : + code$2 = 927; + break; + case "Oslash" : + code$2 = 216; + break; + case "Otilde" : + code$2 = 213; + break; + case "Ouml" : + code$2 = 214; + break; + case "Phi" : + code$2 = 934; + break; + case "Pi" : + code$2 = 928; + break; + case "Prime" : + code$2 = 8243; + break; + case "Psi" : + code$2 = 936; + break; + case "Rho" : + code$2 = 929; + break; + case "Scaron" : + code$2 = 352; + break; + case "Sigma" : + code$2 = 931; + break; + case "THORN" : + code$2 = 222; + break; + case "Tau" : + code$2 = 932; + break; + case "Theta" : + code$2 = 920; + break; + case "Uacute" : + code$2 = 218; + break; + case "Ucirc" : + code$2 = 219; + break; + case "Ugrave" : + code$2 = 217; + break; + case "Upsilon" : + code$2 = 933; + break; + case "Uuml" : + code$2 = 220; + break; + case "Xi" : + code$2 = 926; + break; + case "Yacute" : + code$2 = 221; + break; + case "Yuml" : + code$2 = 376; + break; + case "Zeta" : + code$2 = 918; + break; + case "aacute" : + code$2 = 225; + break; + case "acirc" : + code$2 = 226; + break; + case "acute" : + code$2 = 180; + break; + case "aelig" : + code$2 = 230; + break; + case "agrave" : + code$2 = 224; + break; + case "alefsym" : + code$2 = 8501; + break; + case "alpha" : + code$2 = 945; + break; + case "amp" : + code$2 = 38; + break; + case "and" : + code$2 = 8743; + break; + case "ang" : + code$2 = 8736; + break; + case "apos" : + code$2 = 39; + break; + case "aring" : + code$2 = 229; + break; + case "asymp" : + code$2 = 8776; + break; + case "atilde" : + code$2 = 227; + break; + case "auml" : + code$2 = 228; + break; + case "bdquo" : + code$2 = 8222; + break; + case "beta" : + code$2 = 946; + break; + case "brvbar" : + code$2 = 166; + break; + case "bull" : + code$2 = 8226; + break; + case "cap" : + code$2 = 8745; + break; + case "ccedil" : + code$2 = 231; + break; + case "cedil" : + code$2 = 184; + break; + case "cent" : + code$2 = 162; + break; + case "chi" : + code$2 = 967; + break; + case "circ" : + code$2 = 710; + break; + case "clubs" : + code$2 = 9827; + break; + case "cong" : + code$2 = 8773; + break; + case "copy" : + code$2 = 169; + break; + case "crarr" : + code$2 = 8629; + break; + case "cup" : + code$2 = 8746; + break; + case "curren" : + code$2 = 164; + break; + case "dArr" : + code$2 = 8659; + break; + case "dagger" : + code$2 = 8224; + break; + case "darr" : + code$2 = 8595; + break; + case "deg" : + code$2 = 176; + break; + case "delta" : + code$2 = 948; + break; + case "diams" : + code$2 = 9830; + break; + case "divide" : + code$2 = 247; + break; + case "eacute" : + code$2 = 233; + break; + case "ecirc" : + code$2 = 234; + break; + case "egrave" : + code$2 = 232; + break; + case "empty" : + code$2 = 8709; + break; + case "emsp" : + code$2 = 8195; + break; + case "ensp" : + code$2 = 8194; + break; + case "epsilon" : + code$2 = 949; + break; + case "equiv" : + code$2 = 8801; + break; + case "eta" : + code$2 = 951; + break; + case "eth" : + code$2 = 240; + break; + case "euml" : + code$2 = 235; + break; + case "euro" : + code$2 = 8364; + break; + case "exist" : + code$2 = 8707; + break; + case "fnof" : + code$2 = 402; + break; + case "forall" : + code$2 = 8704; + break; + case "frac12" : + code$2 = 189; + break; + case "frac14" : + code$2 = 188; + break; + case "frac34" : + code$2 = 190; + break; + case "frasl" : + code$2 = 8260; + break; + case "gamma" : + code$2 = 947; + break; + case "ge" : + code$2 = 8805; + break; + case "gt" : + code$2 = 62; + break; + case "hArr" : + code$2 = 8660; + break; + case "harr" : + code$2 = 8596; + break; + case "hearts" : + code$2 = 9829; + break; + case "hellip" : + code$2 = 8230; + break; + case "iacute" : + code$2 = 237; + break; + case "icirc" : + code$2 = 238; + break; + case "iexcl" : + code$2 = 161; + break; + case "igrave" : + code$2 = 236; + break; + case "image" : + code$2 = 8465; + break; + case "infin" : + code$2 = 8734; + break; + case "iota" : + code$2 = 953; + break; + case "iquest" : + code$2 = 191; + break; + case "isin" : + code$2 = 8712; + break; + case "iuml" : + code$2 = 239; + break; + case "kappa" : + code$2 = 954; + break; + case "lArr" : + code$2 = 8656; + break; + case "lambda" : + code$2 = 955; + break; + case "lang" : + code$2 = 10216; + break; + case "laquo" : + code$2 = 171; + break; + case "larr" : + code$2 = 8592; + break; + case "lceil" : + code$2 = 8968; + break; + case "ldquo" : + code$2 = 8220; + break; + case "le" : + code$2 = 8804; + break; + case "lfloor" : + code$2 = 8970; + break; + case "lowast" : + code$2 = 8727; + break; + case "loz" : + code$2 = 9674; + break; + case "lrm" : + code$2 = 8206; + break; + case "lsaquo" : + code$2 = 8249; + break; + case "lsquo" : + code$2 = 8216; + break; + case "lt" : + code$2 = 60; + break; + case "macr" : + code$2 = 175; + break; + case "mdash" : + code$2 = 8212; + break; + case "micro" : + code$2 = 181; + break; + case "middot" : + code$2 = 183; + break; + case "minus" : + code$2 = 8722; + break; + case "mu" : + code$2 = 956; + break; + case "nabla" : + code$2 = 8711; + break; + case "nbsp" : + code$2 = 160; + break; + case "ndash" : + code$2 = 8211; + break; + case "ne" : + code$2 = 8800; + break; + case "ni" : + code$2 = 8715; + break; + case "not" : + code$2 = 172; + break; + case "notin" : + code$2 = 8713; + break; + case "nsub" : + code$2 = 8836; + break; + case "ntilde" : + code$2 = 241; + break; + case "nu" : + code$2 = 957; + break; + case "oacute" : + code$2 = 243; + break; + case "ocirc" : + code$2 = 244; + break; + case "oelig" : + code$2 = 339; + break; + case "ograve" : + code$2 = 242; + break; + case "oline" : + code$2 = 8254; + break; + case "omega" : + code$2 = 969; + break; + case "omicron" : + code$2 = 959; + break; + case "oplus" : + code$2 = 8853; + break; + case "or" : + code$2 = 8744; + break; + case "ordf" : + code$2 = 170; + break; + case "ordm" : + code$2 = 186; + break; + case "oslash" : + code$2 = 248; + break; + case "otilde" : + code$2 = 245; + break; + case "otimes" : + code$2 = 8855; + break; + case "ouml" : + code$2 = 246; + break; + case "para" : + code$2 = 182; + break; + case "part" : + code$2 = 8706; + break; + case "permil" : + code$2 = 8240; + break; + case "perp" : + code$2 = 8869; + break; + case "phi" : + code$2 = 966; + break; + case "pi" : + code$2 = 960; + break; + case "piv" : + code$2 = 982; + break; + case "plusmn" : + code$2 = 177; + break; + case "pound" : + code$2 = 163; + break; + case "prime" : + code$2 = 8242; + break; + case "prod" : + code$2 = 8719; + break; + case "prop" : + code$2 = 8733; + break; + case "psi" : + code$2 = 968; + break; + case "quot" : + code$2 = 34; + break; + case "rArr" : + code$2 = 8658; + break; + case "radic" : + code$2 = 8730; + break; + case "rang" : + code$2 = 10217; + break; + case "raquo" : + code$2 = 187; + break; + case "rarr" : + code$2 = 8594; + break; + case "rceil" : + code$2 = 8969; + break; + case "rdquo" : + code$2 = 8221; + break; + case "real" : + code$2 = 8476; + break; + case "reg" : + code$2 = 174; + break; + case "rfloor" : + code$2 = 8971; + break; + case "rho" : + code$2 = 961; + break; + case "rlm" : + code$2 = 8207; + break; + case "rsaquo" : + code$2 = 8250; + break; + case "rsquo" : + code$2 = 8217; + break; + case "sbquo" : + code$2 = 8218; + break; + case "scaron" : + code$2 = 353; + break; + case "sdot" : + code$2 = 8901; + break; + case "sect" : + code$2 = 167; + break; + case "shy" : + code$2 = 173; + break; + case "sigma" : + code$2 = 963; + break; + case "sigmaf" : + code$2 = 962; + break; + case "sim" : + code$2 = 8764; + break; + case "spades" : + code$2 = 9824; + break; + case "sub" : + code$2 = 8834; + break; + case "sube" : + code$2 = 8838; + break; + case "sum" : + code$2 = 8721; + break; + case "sup" : + code$2 = 8835; + break; + case "sup1" : + code$2 = 185; + break; + case "sup2" : + code$2 = 178; + break; + case "sup3" : + code$2 = 179; + break; + case "supe" : + code$2 = 8839; + break; + case "szlig" : + code$2 = 223; + break; + case "tau" : + code$2 = 964; + break; + case "there4" : + code$2 = 8756; + break; + case "theta" : + code$2 = 952; + break; + case "thetasym" : + code$2 = 977; + break; + case "thinsp" : + code$2 = 8201; + break; + case "thorn" : + code$2 = 254; + break; + case "tilde" : + code$2 = 732; + break; + case "times" : + code$2 = 215; + break; + case "trade" : + code$2 = 8482; + break; + case "uArr" : + code$2 = 8657; + break; + case "uacute" : + code$2 = 250; + break; + case "uarr" : + code$2 = 8593; + break; + case "ucirc" : + code$2 = 251; + break; + case "ugrave" : + code$2 = 249; + break; + case "uml" : + code$2 = 168; + break; + case "upsih" : + code$2 = 978; + break; + case "upsilon" : + code$2 = 965; + break; + case "uuml" : + code$2 = 252; + break; + case "weierp" : + code$2 = 8472; + break; + case "xi" : + code$2 = 958; + break; + case "yacute" : + code$2 = 253; + break; + case "yen" : + code$2 = 165; + break; + case "yuml" : + code$2 = 255; + break; + case "zeta" : + code$2 = 950; + break; + case "zwj" : + code$2 = 8205; + break; + case "zwnj" : + code$2 = 8204; + break; + default: + code$2 = undefined; + } + if (code$2 !== undefined) { + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$2)); + } else { + Stdlib__Buffer.add_string(buf, "&" + (entity + ";")); + } + return jsx_text(env, mode, buf, raw, lexbuf); case 6 : - const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, c$1); - Stdlib__Buffer.add_char(buf, c$1); - return jsx_text(env, mode, buf, raw, lexbuf); + const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, c$1); + Stdlib__Buffer.add_char(buf, c$1); + return jsx_text(env, mode, buf, raw, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4262,102 +4262,102 @@ function __ocaml_lex_jsx_tag_rec(_env, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return [ - env, - /* T_EOF */ 105 - ]; + return [ + env, + /* T_EOF */ 105 + ]; case 1 : - Stdlib__Lexing.new_line(lexbuf); - ___ocaml_lex_state = 333; - continue; + Stdlib__Lexing.new_line(lexbuf); + ___ocaml_lex_state = 333; + continue; case 2 : - unicode_fix_cols(lexbuf); - ___ocaml_lex_state = 333; - continue; + unicode_fix_cols(lexbuf); + ___ocaml_lex_state = 333; + continue; case 3 : - const start = from_lb(env.lex_source, lexbuf); - const buf = Stdlib__Buffer.create(127); - const match = line_comment(env, buf, lexbuf); - const env$1 = save_comment(match[0], start, match[1], buf, true); - ___ocaml_lex_state = 333; - _env = env$1; - continue; + const start = from_lb(env.lex_source, lexbuf); + const buf = Stdlib__Buffer.create(127); + const match = line_comment(env, buf, lexbuf); + const env$1 = save_comment(match[0], start, match[1], buf, true); + ___ocaml_lex_state = 333; + _env = env$1; + continue; case 4 : - const start$1 = from_lb(env.lex_source, lexbuf); - const buf$1 = Stdlib__Buffer.create(127); - const match$1 = comment(env, buf$1, lexbuf); - const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); - ___ocaml_lex_state = 333; - _env = env$2; - continue; + const start$1 = from_lb(env.lex_source, lexbuf); + const buf$1 = Stdlib__Buffer.create(127); + const match$1 = comment(env, buf$1, lexbuf); + const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); + ___ocaml_lex_state = 333; + _env = env$2; + continue; case 5 : - return [ - env, - /* T_LESS_THAN */ 89 - ]; + return [ + env, + /* T_LESS_THAN */ 89 + ]; case 6 : - return [ - env, - /* T_DIV */ 96 - ]; + return [ + env, + /* T_DIV */ 96 + ]; case 7 : - return [ - env, - /* T_GREATER_THAN */ 90 - ]; + return [ + env, + /* T_GREATER_THAN */ 90 + ]; case 8 : - return [ - env, - /* T_LCURLY */ 1 - ]; + return [ + env, + /* T_LCURLY */ 1 + ]; case 9 : - return [ - env, - /* T_COLON */ 77 - ]; + return [ + env, + /* T_COLON */ 77 + ]; case 10 : - return [ - env, - /* T_PERIOD */ 9 - ]; + return [ + env, + /* T_PERIOD */ 9 + ]; case 11 : - return [ - env, - /* T_ASSIGN */ 75 - ]; + return [ + env, + /* T_ASSIGN */ 75 + ]; case 12 : - unicode_fix_cols(lexbuf); - return [ - env, - /* T_JSX_IDENTIFIER */ 106 - ]; + unicode_fix_cols(lexbuf); + return [ + env, + /* T_JSX_IDENTIFIER */ 106 + ]; case 13 : - const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const start$2 = from_lb(env.lex_source, lexbuf); - const buf$2 = Stdlib__Buffer.create(127); - const raw = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_char(raw, quote); - const mode = quote === /* '\'' */39 ? /* JSX_SINGLE_QUOTED_TEXT */ 0 : /* JSX_DOUBLE_QUOTED_TEXT */ 1; - const match$2 = jsx_text(env, mode, buf$2, raw, lexbuf); - Stdlib__Buffer.add_char(raw, quote); - const value = Stdlib__Buffer.contents(buf$2); - const raw$1 = Stdlib__Buffer.contents(raw); - return [ - match$2[0], - { - TAG: /* T_JSX_TEXT */ 4, - _0: [ - btwn(start$2, match$2[1]), - value, - raw$1 - ] - } - ]; + const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const start$2 = from_lb(env.lex_source, lexbuf); + const buf$2 = Stdlib__Buffer.create(127); + const raw = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_char(raw, quote); + const mode = quote === /* '\'' */39 ? /* JSX_SINGLE_QUOTED_TEXT */ 0 : /* JSX_DOUBLE_QUOTED_TEXT */ 1; + const match$2 = jsx_text(env, mode, buf$2, raw, lexbuf); + Stdlib__Buffer.add_char(raw, quote); + const value = Stdlib__Buffer.contents(buf$2); + const raw$1 = Stdlib__Buffer.contents(raw); + return [ + match$2[0], + { + TAG: /* T_JSX_TEXT */ 4, + _0: [ + btwn(start$2, match$2[1]), + value, + raw$1 + ] + } + ]; case 14 : - return [ - env, - /* T_ERROR */ 104 - ]; + return [ + env, + /* T_ERROR */ 104 + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4373,57 +4373,57 @@ function template_part(env, start, cooked, raw, literal, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$1, - btwn(start, from_lb(env$1.lex_source, lexbuf)), - true - ]; + const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$1, + btwn(start, from_lb(env$1.lex_source, lexbuf)), + true + ]; case 1 : - Stdlib__Buffer.add_char(literal, /* '`' */96); - return [ - env, - btwn(start, from_lb(env.lex_source, lexbuf)), - true - ]; + Stdlib__Buffer.add_char(literal, /* '`' */96); + return [ + env, + btwn(start, from_lb(env.lex_source, lexbuf)), + true + ]; case 2 : - Stdlib__Buffer.add_string(literal, "${"); - return [ - env, - btwn(start, from_lb(env.lex_source, lexbuf)), - false - ]; + Stdlib__Buffer.add_string(literal, "${"); + return [ + env, + btwn(start, from_lb(env.lex_source, lexbuf)), + false + ]; case 3 : - Stdlib__Buffer.add_char(raw, /* '\\' */92); - Stdlib__Buffer.add_char(literal, /* '\\' */92); - const match = string_escape(env, cooked, lexbuf); - const str = Stdlib__Lexing.lexeme(lexbuf); - Stdlib__Buffer.add_string(raw, str); - Stdlib__Buffer.add_string(literal, str); - return template_part(match[0], start, cooked, raw, literal, lexbuf); + Stdlib__Buffer.add_char(raw, /* '\\' */92); + Stdlib__Buffer.add_char(literal, /* '\\' */92); + const match = string_escape(env, cooked, lexbuf); + const str = Stdlib__Lexing.lexeme(lexbuf); + Stdlib__Buffer.add_string(raw, str); + Stdlib__Buffer.add_string(literal, str); + return template_part(match[0], start, cooked, raw, literal, lexbuf); case 4 : - const lf = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_start_pos + 2 | 0); - Stdlib__Buffer.add_string(raw, lf); - Stdlib__Buffer.add_string(literal, lf); - Stdlib__Buffer.add_string(cooked, "\n"); - Stdlib__Lexing.new_line(lexbuf); - return template_part(env, start, cooked, raw, literal, lexbuf); + const lf = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_start_pos + 2 | 0); + Stdlib__Buffer.add_string(raw, lf); + Stdlib__Buffer.add_string(literal, lf); + Stdlib__Buffer.add_string(cooked, "\n"); + Stdlib__Lexing.new_line(lexbuf); + return template_part(env, start, cooked, raw, literal, lexbuf); case 5 : - const lf$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, lf$1); - Stdlib__Buffer.add_char(literal, lf$1); - Stdlib__Buffer.add_char(cooked, /* '\n' */10); - Stdlib__Lexing.new_line(lexbuf); - return template_part(env, start, cooked, raw, literal, lexbuf); + const lf$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, lf$1); + Stdlib__Buffer.add_char(literal, lf$1); + Stdlib__Buffer.add_char(cooked, /* '\n' */10); + Stdlib__Lexing.new_line(lexbuf); + return template_part(env, start, cooked, raw, literal, lexbuf); case 6 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, c); - Stdlib__Buffer.add_char(literal, c); - Stdlib__Buffer.add_char(cooked, c); - return template_part(env, start, cooked, raw, literal, lexbuf); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, c); + Stdlib__Buffer.add_char(literal, c); + Stdlib__Buffer.add_char(cooked, c); + return template_part(env, start, cooked, raw, literal, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4439,39 +4439,39 @@ function comment(env, buf, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$1, - from_lb(env$1.lex_source, lexbuf) - ]; + const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$1, + from_lb(env$1.lex_source, lexbuf) + ]; case 1 : - Stdlib__Lexing.new_line(lexbuf); - Stdlib__Buffer.add_char(buf, /* '\n' */10); - return comment(env, buf, lexbuf); + Stdlib__Lexing.new_line(lexbuf); + Stdlib__Buffer.add_char(buf, /* '\n' */10); + return comment(env, buf, lexbuf); case 2 : - const loc = from_lb(env.lex_source, lexbuf); - const env$2 = env.lex_in_comment_syntax ? unexpected_error_w_suggest(env, loc, "*/", "*-/") : env; + const loc = from_lb(env.lex_source, lexbuf); + const env$2 = env.lex_in_comment_syntax ? unexpected_error_w_suggest(env, loc, "*/", "*-/") : env; + return [ + env$2, + loc + ]; + case 3 : + if (env.lex_in_comment_syntax) { return [ - env$2, - loc + env, + from_lb(env.lex_source, lexbuf) ]; - case 3 : - if (env.lex_in_comment_syntax) { - return [ - env, - from_lb(env.lex_source, lexbuf) - ]; - } else { - Stdlib__Buffer.add_string(buf, "*-/"); - return comment(env, buf, lexbuf); - } - case 4 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c); + } else { + Stdlib__Buffer.add_string(buf, "*-/"); return comment(env, buf, lexbuf); + } + case 4 : + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c); + return comment(env, buf, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4487,71 +4487,71 @@ function __ocaml_lex_template_tail_rec(_env, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - Stdlib__Lexing.new_line(lexbuf); - ___ocaml_lex_state = 393; - continue; + Stdlib__Lexing.new_line(lexbuf); + ___ocaml_lex_state = 393; + continue; case 1 : - unicode_fix_cols(lexbuf); - ___ocaml_lex_state = 393; - continue; + unicode_fix_cols(lexbuf); + ___ocaml_lex_state = 393; + continue; case 2 : - const start = from_lb(env.lex_source, lexbuf); - const buf = Stdlib__Buffer.create(127); - const match = line_comment(env, buf, lexbuf); - const env$1 = save_comment(match[0], start, match[1], buf, true); - ___ocaml_lex_state = 393; - _env = env$1; - continue; + const start = from_lb(env.lex_source, lexbuf); + const buf = Stdlib__Buffer.create(127); + const match = line_comment(env, buf, lexbuf); + const env$1 = save_comment(match[0], start, match[1], buf, true); + ___ocaml_lex_state = 393; + _env = env$1; + continue; case 3 : - const start$1 = from_lb(env.lex_source, lexbuf); - const buf$1 = Stdlib__Buffer.create(127); - const match$1 = comment(env, buf$1, lexbuf); - const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); - ___ocaml_lex_state = 393; - _env = env$2; - continue; + const start$1 = from_lb(env.lex_source, lexbuf); + const buf$1 = Stdlib__Buffer.create(127); + const match$1 = comment(env, buf$1, lexbuf); + const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); + ___ocaml_lex_state = 393; + _env = env$2; + continue; case 4 : - const start$2 = from_lb(env.lex_source, lexbuf); - const cooked = Stdlib__Buffer.create(127); - const raw = Stdlib__Buffer.create(127); - const literal = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_string(literal, "}"); - const match$2 = template_part(env, start$2, cooked, raw, literal, lexbuf); - return [ - match$2[0], - { - TAG: /* T_TEMPLATE_PART */ 2, - _0: [ - match$2[1], - { - cooked: Stdlib__Buffer.contents(cooked), - raw: Stdlib__Buffer.contents(raw), - literal: Stdlib__Buffer.contents(literal) - }, - match$2[2] - ] - } - ]; + const start$2 = from_lb(env.lex_source, lexbuf); + const cooked = Stdlib__Buffer.create(127); + const raw = Stdlib__Buffer.create(127); + const literal = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_string(literal, "}"); + const match$2 = template_part(env, start$2, cooked, raw, literal, lexbuf); + return [ + match$2[0], + { + TAG: /* T_TEMPLATE_PART */ 2, + _0: [ + match$2[1], + { + cooked: Stdlib__Buffer.contents(cooked), + raw: Stdlib__Buffer.contents(raw), + literal: Stdlib__Buffer.contents(literal) + }, + match$2[2] + ] + } + ]; case 5 : - const env$3 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$3, - { - TAG: /* T_TEMPLATE_PART */ 2, - _0: [ - from_lb(env$3.lex_source, lexbuf), - { - cooked: "", - raw: "", - literal: "" - }, - true - ] - } - ]; + const env$3 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$3, + { + TAG: /* T_TEMPLATE_PART */ 2, + _0: [ + from_lb(env$3.lex_source, lexbuf), + { + cooked: "", + raw: "", + literal: "" + }, + true + ] + } + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4567,34 +4567,34 @@ function line_comment(env, buf, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return [ - env, - from_lb(env.lex_source, lexbuf) - ]; + return [ + env, + from_lb(env.lex_source, lexbuf) + ]; case 1 : - const match = from_lb(env.lex_source, lexbuf); - const match$1 = match._end; - Stdlib__Lexing.new_line(lexbuf); - const _end_line = match$1.line; - const _end_column = match$1.column - 1 | 0; - const _end_offset = match$1.offset - 1 | 0; - const _end = { - line: _end_line, - column: _end_column, - offset: _end_offset - }; - return [ - env, - { - source: match.source, - start: match.start, - _end: _end - } - ]; + const match = from_lb(env.lex_source, lexbuf); + const match$1 = match._end; + Stdlib__Lexing.new_line(lexbuf); + const _end_line = match$1.line; + const _end_column = match$1.column - 1 | 0; + const _end_offset = match$1.offset - 1 | 0; + const _end = { + line: _end_line, + column: _end_column, + offset: _end_offset + }; + return [ + env, + { + source: match.source, + start: match.start, + _end: _end + } + ]; case 2 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c); - return line_comment(env, buf, lexbuf); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c); + return line_comment(env, buf, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4610,18 +4610,18 @@ function regexp_class(env, buf, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return env; + return env; case 1 : case 2 : - break; + break; case 3 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c); - return env; + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c); + return env; case 4 : - const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c$1); - return regexp_class(env, buf, lexbuf); + const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c$1); + return regexp_class(env, buf, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4640,43 +4640,43 @@ function string_quote(env, q, buf, raw, octal, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const q$p = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, q$p); - if (q === q$p) { - return [ - env, - from_lb(env.lex_source, lexbuf), - octal - ]; - } else { - Stdlib__Buffer.add_char(buf, q$p); - return string_quote(env, q, buf, raw, octal, lexbuf); - } - case 1 : - const e = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, e); - const match = string_escape(env, buf, lexbuf); - const octal$1 = match[1] || octal; - Stdlib__Buffer.add_string(raw, Stdlib__Lexing.lexeme(lexbuf)); - return string_quote(match[0], q, buf, raw, octal$1, lexbuf); - case 2 : - const x = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, x); - const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - Stdlib__Buffer.add_string(buf, x); + const q$p = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, q$p); + if (q === q$p) { return [ - env$1, - from_lb(env$1.lex_source, lexbuf), + env, + from_lb(env.lex_source, lexbuf), octal ]; - case 3 : - const x$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, x$1); - Stdlib__Buffer.add_char(buf, x$1); + } else { + Stdlib__Buffer.add_char(buf, q$p); return string_quote(env, q, buf, raw, octal, lexbuf); + } + case 1 : + const e = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, e); + const match = string_escape(env, buf, lexbuf); + const octal$1 = match[1] || octal; + Stdlib__Buffer.add_string(raw, Stdlib__Lexing.lexeme(lexbuf)); + return string_quote(match[0], q, buf, raw, octal$1, lexbuf); + case 2 : + const x = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, x); + const env$1 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + Stdlib__Buffer.add_string(buf, x); + return [ + env$1, + from_lb(env$1.lex_source, lexbuf), + octal + ]; + case 3 : + const x$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, x$1); + Stdlib__Buffer.add_char(buf, x$1); + return string_quote(env, q, buf, raw, octal, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4692,161 +4692,161 @@ function string_escape(env, buf, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return [ - env, - false - ]; + return [ + env, + false + ]; case 1 : - Stdlib__Buffer.add_string(buf, "\\"); - return [ - env, - false - ]; + Stdlib__Buffer.add_string(buf, "\\"); + return [ + env, + false + ]; case 2 : - const a = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); - const b = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); - const code = (hexa_to_int(a) << 4) + hexa_to_int(b) | 0; + const a = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); + const b = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); + const code = (hexa_to_int(a) << 4) + hexa_to_int(b) | 0; + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code)); + return [ + env, + false + ]; + case 3 : + const a$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const b$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); + const code$1 = ((oct_to_int(a$1) << 6) + (oct_to_int(b$1) << 3) | 0) + oct_to_int(c) | 0; + if (code$1 < 256) { Stdlib__List.iter((function (param) { return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code)); - return [ - env, - false - ]; - case 3 : - const a$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const b$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); - const code$1 = ((oct_to_int(a$1) << 6) + (oct_to_int(b$1) << 3) | 0) + oct_to_int(c) | 0; - if (code$1 < 256) { - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$1)); - } else { - const code$2 = (oct_to_int(a$1) << 3) + oct_to_int(b$1) | 0; - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$2)); - Stdlib__Buffer.add_char(buf, c); - } - return [ - env, - true - ]; - case 4 : - const a$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const b$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); - const code$3 = (oct_to_int(a$2) << 3) + oct_to_int(b$2) | 0; + }), utf16to8(code$1)); + } else { + const code$2 = (oct_to_int(a$1) << 3) + oct_to_int(b$1) | 0; Stdlib__List.iter((function (param) { return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$3)); - return [ - env, - true - ]; + }), utf16to8(code$2)); + Stdlib__Buffer.add_char(buf, c); + } + return [ + env, + true + ]; + case 4 : + const a$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const b$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); + const code$3 = (oct_to_int(a$2) << 3) + oct_to_int(b$2) | 0; + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$3)); + return [ + env, + true + ]; case 5 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(0)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(0)); + return [ + env, + false + ]; case 6 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(8)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(8)); + return [ + env, + false + ]; case 7 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(12)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(12)); + return [ + env, + false + ]; case 8 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(10)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(10)); + return [ + env, + false + ]; case 9 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(13)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(13)); + return [ + env, + false + ]; case 10 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(9)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(9)); + return [ + env, + false + ]; case 11 : - Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(11)); - return [ - env, - false - ]; + Stdlib__Buffer.add_char(buf, Stdlib__Char.chr(11)); + return [ + env, + false + ]; case 12 : - const a$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const code$4 = oct_to_int(a$3); - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$4)); - return [ - env, - true - ]; + const a$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const code$4 = oct_to_int(a$3); + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$4)); + return [ + env, + true + ]; case 13 : - const a$4 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); - const b$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); - const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 3 | 0); - const d = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 4 | 0); - const code$5 = (((hexa_to_int(a$4) << 12) + (hexa_to_int(b$3) << 8) | 0) + (hexa_to_int(c$1) << 4) | 0) + hexa_to_int(d) | 0; - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$5)); - return [ - env, - false - ]; + const a$4 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 1 | 0); + const b$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 2 | 0); + const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 3 | 0); + const d = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos + 4 | 0); + const code$5 = (((hexa_to_int(a$4) << 12) + (hexa_to_int(b$3) << 8) | 0) + (hexa_to_int(c$1) << 4) | 0) + hexa_to_int(d) | 0; + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$5)); + return [ + env, + false + ]; case 14 : - const hex_code = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, lexbuf.lex_curr_pos - 1 | 0); - const code$6 = Caml_format.caml_int_of_string("0x" + hex_code); - const env$1 = code$6 > 1114111 ? lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }) : env; - Stdlib__List.iter((function (param) { - return Stdlib__Buffer.add_char(buf, param); - }), utf16to8(code$6)); - return [ - env$1, - false - ]; - case 15 : - const c$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const env$2 = lex_error(env, from_lb(env.lex_source, lexbuf), { + const hex_code = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, lexbuf.lex_curr_pos - 1 | 0); + const code$6 = Caml_format.caml_int_of_string("0x" + hex_code); + const env$1 = code$6 > 1114111 ? lex_error(env, from_lb(env.lex_source, lexbuf), { TAG: /* UnexpectedToken */ 1, _0: "ILLEGAL" - }); - Stdlib__Buffer.add_char(buf, c$2); - return [ - env$2, - false - ]; + }) : env; + Stdlib__List.iter((function (param) { + return Stdlib__Buffer.add_char(buf, param); + }), utf16to8(code$6)); + return [ + env$1, + false + ]; + case 15 : + const c$2 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const env$2 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + Stdlib__Buffer.add_char(buf, c$2); + return [ + env$2, + false + ]; case 16 : - Stdlib__Lexing.new_line(lexbuf); - return [ - env, - false - ]; + Stdlib__Lexing.new_line(lexbuf); + return [ + env, + false + ]; case 17 : - const c$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c$3); - return [ - env, - false - ]; + const c$3 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c$3); + return [ + env, + false + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -4877,344 +4877,344 @@ function type_token(env, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - Stdlib__Lexing.new_line(lexbuf); - return type_token(env, lexbuf); + Stdlib__Lexing.new_line(lexbuf); + return type_token(env, lexbuf); case 1 : - unicode_fix_cols(lexbuf); - return type_token(env, lexbuf); + unicode_fix_cols(lexbuf); + return type_token(env, lexbuf); case 2 : - const start = from_lb(env.lex_source, lexbuf); - const buf = Stdlib__Buffer.create(127); - const match = comment(env, buf, lexbuf); - const env$1 = save_comment(match[0], start, match[1], buf, true); - return type_token(env$1, lexbuf); + const start = from_lb(env.lex_source, lexbuf); + const buf = Stdlib__Buffer.create(127); + const match = comment(env, buf, lexbuf); + const env$1 = save_comment(match[0], start, match[1], buf, true); + return type_token(env$1, lexbuf); case 3 : - const sp = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, Caml_array.get(lexbuf.lex_mem, 0)); - const escape_type = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - const pattern = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - if (env.lex_enable_comment_syntax) { - let env$2; - if (env.lex_in_comment_syntax) { - const loc = from_lb(env.lex_source, lexbuf); - env$2 = unexpected_error(env, loc, pattern); - } else { - env$2 = env; - } - const env$3 = in_comment_syntax(true, env$2); - if (escape_type === ":") { - return [ - env$3, - /* T_COLON */ 77 - ]; - } else { - return type_token(env$3, lexbuf); - } - } - const start$1 = from_lb(env.lex_source, lexbuf); - const buf$1 = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_string(buf$1, sp); - Stdlib__Buffer.add_string(buf$1, escape_type); - const match$1 = comment(env, buf$1, lexbuf); - const env$4 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); - return type_token(env$4, lexbuf); - case 4 : + const sp = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 2 | 0, Caml_array.get(lexbuf.lex_mem, 0)); + const escape_type = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + const pattern = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + if (env.lex_enable_comment_syntax) { + let env$2; if (env.lex_in_comment_syntax) { - const env$5 = in_comment_syntax(false, env); - return type_token(env$5, lexbuf); + const loc = from_lb(env.lex_source, lexbuf); + env$2 = unexpected_error(env, loc, pattern); + } else { + env$2 = env; } - yyback(1, lexbuf); - return [ - env, - /* T_MULT */ 97 - ]; + const env$3 = in_comment_syntax(true, env$2); + if (escape_type === ":") { + return [ + env$3, + /* T_COLON */ 77 + ]; + } else { + return type_token(env$3, lexbuf); + } + } + const start$1 = from_lb(env.lex_source, lexbuf); + const buf$1 = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_string(buf$1, sp); + Stdlib__Buffer.add_string(buf$1, escape_type); + const match$1 = comment(env, buf$1, lexbuf); + const env$4 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); + return type_token(env$4, lexbuf); + case 4 : + if (env.lex_in_comment_syntax) { + const env$5 = in_comment_syntax(false, env); + return type_token(env$5, lexbuf); + } + yyback(1, lexbuf); + return [ + env, + /* T_MULT */ 97 + ]; case 5 : - const start$2 = from_lb(env.lex_source, lexbuf); - const buf$2 = Stdlib__Buffer.create(127); - const match$2 = line_comment(env, buf$2, lexbuf); - const env$6 = save_comment(match$2[0], start$2, match$2[1], buf$2, true); - return type_token(env$6, lexbuf); + const start$2 = from_lb(env.lex_source, lexbuf); + const buf$2 = Stdlib__Buffer.create(127); + const match$2 = line_comment(env, buf$2, lexbuf); + const env$6 = save_comment(match$2[0], start$2, match$2[1], buf$2, true); + return type_token(env$6, lexbuf); case 6 : - const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - const start$3 = from_lb(env.lex_source, lexbuf); - const buf$3 = Stdlib__Buffer.create(127); - const raw = Stdlib__Buffer.create(127); - Stdlib__Buffer.add_char(raw, quote); - const match$3 = string_quote(env, quote, buf$3, raw, false, lexbuf); - return [ - match$3[0], - { - TAG: /* T_STRING */ 1, - _0: [ - btwn(start$3, match$3[1]), - Stdlib__Buffer.contents(buf$3), - Stdlib__Buffer.contents(raw), - match$3[2] - ] - } - ]; + const quote = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + const start$3 = from_lb(env.lex_source, lexbuf); + const buf$3 = Stdlib__Buffer.create(127); + const raw = Stdlib__Buffer.create(127); + Stdlib__Buffer.add_char(raw, quote); + const match$3 = string_quote(env, quote, buf$3, raw, false, lexbuf); + return [ + match$3[0], + { + TAG: /* T_STRING */ 1, + _0: [ + btwn(start$3, match$3[1]), + Stdlib__Buffer.contents(buf$3), + Stdlib__Buffer.contents(raw), + match$3[2] + ] + } + ]; case 7 : - const neg = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w, mk_num_singleton(/* BINARY */ 0, num, neg)); + const neg = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w, mk_num_singleton(/* BINARY */ 0, num, neg)); case 8 : - const neg$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return [ - env, - mk_num_singleton(/* BINARY */ 0, num$1, neg$1) - ]; + const neg$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return [ + env, + mk_num_singleton(/* BINARY */ 0, num$1, neg$1) + ]; case 9 : - const neg$2 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$1, mk_num_singleton(/* OCTAL */ 2, num$2, neg$2)); + const neg$2 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w$1 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$1, mk_num_singleton(/* OCTAL */ 2, num$2, neg$2)); case 10 : - const neg$3 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$3 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return [ - env, - mk_num_singleton(/* OCTAL */ 2, num$3, neg$3) - ]; + const neg$3 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$3 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return [ + env, + mk_num_singleton(/* OCTAL */ 2, num$3, neg$3) + ]; case 11 : - const neg$4 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$4 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$2, mk_num_singleton(/* LEGACY_OCTAL */ 1, num$4, neg$4)); + const neg$4 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$4 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w$2 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$2, mk_num_singleton(/* LEGACY_OCTAL */ 1, num$4, neg$4)); case 12 : - const neg$5 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$5 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return [ + const neg$5 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$5 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return [ + env, + mk_num_singleton(/* LEGACY_OCTAL */ 1, num$5, neg$5) + ]; + case 13 : + const neg$6 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$6 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w$3 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + let match$4; + try { + match$4 = [ env, - mk_num_singleton(/* LEGACY_OCTAL */ 1, num$5, neg$5) + mk_num_singleton(/* NORMAL */ 3, num$6, neg$6) ]; - case 13 : - const neg$6 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$6 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w$3 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - let match$4; - try { + } + catch (exn){ + if (Stdlib__Sys.win32) { + const loc$1 = from_lb(env.lex_source, lexbuf); + const env$7 = lex_error(env, loc$1, /* WindowsFloatOfString */ 59); match$4 = [ - env, - mk_num_singleton(/* NORMAL */ 3, num$6, neg$6) + env$7, + { + TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, + _0: /* NORMAL */ 3, + _1: 789.0 + } ]; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - catch (exn){ - if (Stdlib__Sys.win32) { - const loc$1 = from_lb(env.lex_source, lexbuf); - const env$7 = lex_error(env, loc$1, /* WindowsFloatOfString */ 59); - match$4 = [ - env$7, - { - TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, - _0: /* NORMAL */ 3, - _1: 789.0 - } - ]; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - } - return illegal_number(match$4[0], lexbuf, w$3, match$4[1]); + } + return illegal_number(match$4[0], lexbuf, w$3, match$4[1]); case 14 : - const neg$7 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$7 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - try { + const neg$7 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$7 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + try { + return [ + env, + mk_num_singleton(/* NORMAL */ 3, num$7, neg$7) + ]; + } + catch (exn$1){ + if (Stdlib__Sys.win32) { + const loc$2 = from_lb(env.lex_source, lexbuf); + const env$8 = lex_error(env, loc$2, /* WindowsFloatOfString */ 59); return [ - env, - mk_num_singleton(/* NORMAL */ 3, num$7, neg$7) + env$8, + { + TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, + _0: /* NORMAL */ 3, + _1: 789.0 + } ]; } - catch (exn$1){ - if (Stdlib__Sys.win32) { - const loc$2 = from_lb(env.lex_source, lexbuf); - const env$8 = lex_error(env, loc$2, /* WindowsFloatOfString */ 59); - return [ - env$8, - { - TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, - _0: /* NORMAL */ 3, - _1: 789.0 - } - ]; - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } case 15 : - const neg$8 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$8 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w$4 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$4, mk_num_singleton(/* NORMAL */ 3, num$8, neg$8)); + const neg$8 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$8 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w$4 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$4, mk_num_singleton(/* NORMAL */ 3, num$8, neg$8)); case 16 : - const neg$9 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$9 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - return [ - env, - mk_num_singleton(/* NORMAL */ 3, num$9, neg$9) - ]; + const neg$9 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$9 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + return [ + env, + mk_num_singleton(/* NORMAL */ 3, num$9, neg$9) + ]; case 17 : - const neg$10 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); - const num$10 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const w$5 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); - return illegal_number(env, lexbuf, w$5, mk_num_singleton(/* NORMAL */ 3, num$10, neg$10)); + const neg$10 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, Caml_array.get(lexbuf.lex_mem, 0)); + const num$10 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const w$5 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), lexbuf.lex_curr_pos); + return illegal_number(env, lexbuf, w$5, mk_num_singleton(/* NORMAL */ 3, num$10, neg$10)); case 18 : - const neg$11 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), Caml_array.get(lexbuf.lex_mem, 0)); - const num$11 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); + const neg$11 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 1), Caml_array.get(lexbuf.lex_mem, 0)); + const num$11 = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); + return [ + env, + mk_num_singleton(/* NORMAL */ 3, num$11, neg$11) + ]; + case 19 : + const word = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + unicode_fix_cols(lexbuf); + try { return [ env, - mk_num_singleton(/* NORMAL */ 3, num$11, neg$11) + Stdlib__Hashtbl.find(type_keywords, word) ]; - case 19 : - const word = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - unicode_fix_cols(lexbuf); - try { + } + catch (raw_exn){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { return [ env, - Stdlib__Hashtbl.find(type_keywords, word) + /* T_IDENTIFIER */ 0 ]; } - catch (raw_exn){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - return [ - env, - /* T_IDENTIFIER */ 0 - ]; - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } case 22 : - return [ - env, - /* T_LCURLY */ 1 - ]; + return [ + env, + /* T_LCURLY */ 1 + ]; case 23 : - return [ - env, - /* T_RCURLY */ 2 - ]; + return [ + env, + /* T_RCURLY */ 2 + ]; case 24 : - return [ - env, - /* T_LPAREN */ 3 - ]; + return [ + env, + /* T_LPAREN */ 3 + ]; case 25 : - return [ - env, - /* T_RPAREN */ 4 - ]; + return [ + env, + /* T_RPAREN */ 4 + ]; case 26 : - return [ - env, - /* T_ELLIPSIS */ 11 - ]; + return [ + env, + /* T_ELLIPSIS */ 11 + ]; case 27 : - return [ - env, - /* T_PERIOD */ 9 - ]; + return [ + env, + /* T_PERIOD */ 9 + ]; case 28 : - return [ - env, - /* T_SEMICOLON */ 7 - ]; + return [ + env, + /* T_SEMICOLON */ 7 + ]; case 29 : - return [ - env, - /* T_COMMA */ 8 - ]; + return [ + env, + /* T_COMMA */ 8 + ]; case 20 : case 32 : - return [ - env, - /* T_LBRACKET */ 5 - ]; + return [ + env, + /* T_LBRACKET */ 5 + ]; case 21 : case 33 : - return [ - env, - /* T_RBRACKET */ 6 - ]; + return [ + env, + /* T_RBRACKET */ 6 + ]; case 34 : - return [ - env, - /* T_LESS_THAN */ 89 - ]; + return [ + env, + /* T_LESS_THAN */ 89 + ]; case 35 : - return [ - env, - /* T_GREATER_THAN */ 90 - ]; + return [ + env, + /* T_GREATER_THAN */ 90 + ]; case 31 : case 37 : - return [ - env, - /* T_PLING */ 76 - ]; + return [ + env, + /* T_PLING */ 76 + ]; case 38 : - return [ - env, - /* T_MULT */ 97 - ]; + return [ + env, + /* T_MULT */ 97 + ]; case 30 : case 39 : - return [ - env, - /* T_COLON */ 77 - ]; + return [ + env, + /* T_COLON */ 77 + ]; case 40 : - return [ - env, - /* T_BIT_OR */ 80 - ]; + return [ + env, + /* T_BIT_OR */ 80 + ]; case 41 : - return [ - env, - /* T_BIT_AND */ 82 - ]; + return [ + env, + /* T_BIT_AND */ 82 + ]; case 42 : - return [ - env, - /* T_TYPEOF */ 44 - ]; + return [ + env, + /* T_TYPEOF */ 44 + ]; case 43 : - return [ - env, - /* T_ARROW */ 10 - ]; + return [ + env, + /* T_ARROW */ 10 + ]; case 36 : case 44 : - return [ - env, - /* T_ASSIGN */ 75 - ]; + return [ + env, + /* T_ASSIGN */ 75 + ]; case 45 : - return [ - env, - /* T_PLUS */ 94 - ]; + return [ + env, + /* T_PLUS */ 94 + ]; case 46 : - return [ - env, - /* T_MINUS */ 95 - ]; + return [ + env, + /* T_MINUS */ 95 + ]; case 47 : - let env$9; - if (env.lex_in_comment_syntax) { - const loc$3 = from_lb(env.lex_source, lexbuf); - env$9 = lex_error(env, loc$3, /* UnexpectedEOS */ 4); - } else { - env$9 = env; - } - return [ - env$9, - /* T_EOF */ 105 - ]; + let env$9; + if (env.lex_in_comment_syntax) { + const loc$3 = from_lb(env.lex_source, lexbuf); + env$9 = lex_error(env, loc$3, /* UnexpectedEOS */ 4); + } else { + env$9 = env; + } + return [ + env$9, + /* T_EOF */ 105 + ]; case 48 : - return [ - env, - /* T_ERROR */ 104 - ]; + return [ + env, + /* T_ERROR */ 104 + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -5230,61 +5230,61 @@ function __ocaml_lex_regexp_rec(_env, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return [ - env, - /* T_EOF */ 105 - ]; + return [ + env, + /* T_EOF */ 105 + ]; case 1 : - Stdlib__Lexing.new_line(lexbuf); - ___ocaml_lex_state = 291; - continue; + Stdlib__Lexing.new_line(lexbuf); + ___ocaml_lex_state = 291; + continue; case 2 : - unicode_fix_cols(lexbuf); - ___ocaml_lex_state = 291; - continue; + unicode_fix_cols(lexbuf); + ___ocaml_lex_state = 291; + continue; case 3 : - const start = from_lb(env.lex_source, lexbuf); - const buf = Stdlib__Buffer.create(127); - const match = line_comment(env, buf, lexbuf); - const env$1 = save_comment(match[0], start, match[1], buf, true); - ___ocaml_lex_state = 291; - _env = env$1; - continue; + const start = from_lb(env.lex_source, lexbuf); + const buf = Stdlib__Buffer.create(127); + const match = line_comment(env, buf, lexbuf); + const env$1 = save_comment(match[0], start, match[1], buf, true); + ___ocaml_lex_state = 291; + _env = env$1; + continue; case 4 : - const start$1 = from_lb(env.lex_source, lexbuf); - const buf$1 = Stdlib__Buffer.create(127); - const match$1 = comment(env, buf$1, lexbuf); - const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); - ___ocaml_lex_state = 291; - _env = env$2; - continue; + const start$1 = from_lb(env.lex_source, lexbuf); + const buf$1 = Stdlib__Buffer.create(127); + const match$1 = comment(env, buf$1, lexbuf); + const env$2 = save_comment(match$1[0], start$1, match$1[1], buf$1, true); + ___ocaml_lex_state = 291; + _env = env$2; + continue; case 5 : - const start$2 = from_lb(env.lex_source, lexbuf); - const buf$2 = Stdlib__Buffer.create(127); - const match$2 = regexp_body(env, buf$2, lexbuf); - const env$3 = match$2[0]; - const end_ = from_lb(env$3.lex_source, lexbuf); - const loc = btwn(start$2, end_); - return [ - env$3, - { - TAG: /* T_REGEXP */ 3, - _0: [ - loc, - Stdlib__Buffer.contents(buf$2), - match$2[1] - ] - } - ]; + const start$2 = from_lb(env.lex_source, lexbuf); + const buf$2 = Stdlib__Buffer.create(127); + const match$2 = regexp_body(env, buf$2, lexbuf); + const env$3 = match$2[0]; + const end_ = from_lb(env$3.lex_source, lexbuf); + const loc = btwn(start$2, end_); + return [ + env$3, + { + TAG: /* T_REGEXP */ 3, + _0: [ + loc, + Stdlib__Buffer.contents(buf$2), + match$2[1] + ] + } + ]; case 6 : - const env$4 = lex_error(env, from_lb(env.lex_source, lexbuf), { - TAG: /* UnexpectedToken */ 1, - _0: "ILLEGAL" - }); - return [ - env$4, - /* T_ERROR */ 104 - ]; + const env$4 = lex_error(env, from_lb(env.lex_source, lexbuf), { + TAG: /* UnexpectedToken */ 1, + _0: "ILLEGAL" + }); + return [ + env$4, + /* T_ERROR */ 104 + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -5300,50 +5300,50 @@ function regexp_body(env, buf, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const loc = from_lb(env.lex_source, lexbuf); - const env$1 = lex_error(env, loc, /* UnterminatedRegExp */ 13); - return [ - env$1, - "" - ]; + const loc = from_lb(env.lex_source, lexbuf); + const env$1 = lex_error(env, loc, /* UnterminatedRegExp */ 13); + return [ + env$1, + "" + ]; case 1 : - const loc$1 = from_lb(env.lex_source, lexbuf); - const env$2 = lex_error(env, loc$1, /* UnterminatedRegExp */ 13); - return [ - env$2, - "" - ]; + const loc$1 = from_lb(env.lex_source, lexbuf); + const env$2 = lex_error(env, loc$1, /* UnterminatedRegExp */ 13); + return [ + env$2, + "" + ]; case 2 : - const s = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_start_pos + 2 | 0); - Stdlib__Buffer.add_string(buf, s); - return regexp_body(env, buf, lexbuf); + const s = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_start_pos + 2 | 0); + Stdlib__Buffer.add_string(buf, s); + return regexp_body(env, buf, lexbuf); case 3 : - const flags = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 1 | 0, lexbuf.lex_curr_pos); - return [ - env, - flags - ]; + const flags = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos + 1 | 0, lexbuf.lex_curr_pos); + return [ + env, + flags + ]; case 4 : - return [ - env, - "" - ]; + return [ + env, + "" + ]; case 5 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c); - const env$3 = regexp_class(env, buf, lexbuf); - return regexp_body(env$3, buf, lexbuf); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c); + const env$3 = regexp_class(env, buf, lexbuf); + return regexp_body(env$3, buf, lexbuf); case 6 : - const loc$2 = from_lb(env.lex_source, lexbuf); - const env$4 = lex_error(env, loc$2, /* UnterminatedRegExp */ 13); - return [ - env$4, - "" - ]; + const loc$2 = from_lb(env.lex_source, lexbuf); + const env$4 = lex_error(env, loc$2, /* UnterminatedRegExp */ 13); + return [ + env$4, + "" + ]; case 7 : - const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(buf, c$1); - return regexp_body(env, buf, lexbuf); + const c$1 = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(buf, c$1); + return regexp_body(env, buf, lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -5359,57 +5359,57 @@ function jsx_child(env, start, buf, raw, lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const lt = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - Stdlib__Buffer.add_string(raw, lt); - Stdlib__Buffer.add_string(buf, lt); - Stdlib__Lexing.new_line(lexbuf); - const match = jsx_text(env, /* JSX_CHILD_TEXT */ 2, buf, raw, lexbuf); - const value = Stdlib__Buffer.contents(buf); - const raw$1 = Stdlib__Buffer.contents(raw); - return [ - match[0], - { - TAG: /* T_JSX_TEXT */ 4, - _0: [ - btwn(start, match[1]), - value, - raw$1 - ] - } - ]; + const lt = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + Stdlib__Buffer.add_string(raw, lt); + Stdlib__Buffer.add_string(buf, lt); + Stdlib__Lexing.new_line(lexbuf); + const match = jsx_text(env, /* JSX_CHILD_TEXT */ 2, buf, raw, lexbuf); + const value = Stdlib__Buffer.contents(buf); + const raw$1 = Stdlib__Buffer.contents(raw); + return [ + match[0], + { + TAG: /* T_JSX_TEXT */ 4, + _0: [ + btwn(start, match[1]), + value, + raw$1 + ] + } + ]; case 1 : - return [ - env, - /* T_EOF */ 105 - ]; + return [ + env, + /* T_EOF */ 105 + ]; case 2 : - return [ - env, - /* T_LESS_THAN */ 89 - ]; + return [ + env, + /* T_LESS_THAN */ 89 + ]; case 3 : - return [ - env, - /* T_LCURLY */ 1 - ]; + return [ + env, + /* T_LCURLY */ 1 + ]; case 4 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - Stdlib__Buffer.add_char(raw, c); - Stdlib__Buffer.add_char(buf, c); - const match$1 = jsx_text(env, /* JSX_CHILD_TEXT */ 2, buf, raw, lexbuf); - const value$1 = Stdlib__Buffer.contents(buf); - const raw$2 = Stdlib__Buffer.contents(raw); - return [ - match$1[0], - { - TAG: /* T_JSX_TEXT */ 4, - _0: [ - btwn(start, match$1[1]), - value$1, - raw$2 - ] - } - ]; + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + Stdlib__Buffer.add_char(raw, c); + Stdlib__Buffer.add_char(buf, c); + const match$1 = jsx_text(env, /* JSX_CHILD_TEXT */ 2, buf, raw, lexbuf); + const value$1 = Stdlib__Buffer.contents(buf); + const raw$2 = Stdlib__Buffer.contents(raw); + return [ + match$1[0], + { + TAG: /* T_JSX_TEXT */ 4, + _0: [ + btwn(start, match$1[1]), + value$1, + raw$2 + ] + } + ]; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -5637,24 +5637,24 @@ function lex(t) { let match$1; switch (match) { case /* TYPE */ 1 : - match$1 = type_token$1(lex_env); - break; + match$1 = type_token$1(lex_env); + break; case /* JSX_TAG */ 2 : - match$1 = jsx_tag(lex_env); - break; + match$1 = jsx_tag(lex_env); + break; case /* JSX_CHILD */ 3 : - match$1 = jsx_child$1(lex_env); - break; + match$1 = jsx_child$1(lex_env); + break; case /* TEMPLATE */ 4 : - match$1 = template_tail(lex_env); - break; + match$1 = template_tail(lex_env); + break; case /* REGEXP */ 5 : - match$1 = regexp(lex_env); - break; + match$1 = regexp(lex_env); + break; case /* NORMAL */ 0 : case /* PREDICATE */ 6 : - match$1 = token$1(lex_env); - break; + match$1 = token$1(lex_env); + break; } const lex_env$1 = match$1[0]; @@ -5936,7 +5936,7 @@ function is_strict_reserved(param) { case "public" : case "static" : case "yield" : - return true; + return true; default: return false; } @@ -5946,7 +5946,7 @@ function is_restricted(param) { switch (param) { case "arguments" : case "eval" : - return true; + return true; default: return false; } @@ -6007,10 +6007,10 @@ function is_implicit_semicolon(env) { } switch (match) { case /* T_SEMICOLON */ 7 : - return false; + return false; case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return true; + return true; default: return is_line_terminator(env); } @@ -6042,7 +6042,7 @@ function is_identifier(iOpt, env) { case /* T_OF */ 60 : case /* T_ASYNC */ 61 : case /* T_AWAIT */ 62 : - return true; + return true; default: return false; } @@ -6068,7 +6068,7 @@ function is_class(iOpt, env) { switch (match) { case /* T_AT */ 12 : case /* T_CLASS */ 38 : - return true; + return true; default: return false; } @@ -6087,18 +6087,18 @@ function get_unexpected_error(param) { if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { switch (tmp) { case /* T_IDENTIFIER */ 0 : - return /* UnexpectedIdentifier */ 2; + return /* UnexpectedIdentifier */ 2; case /* T_EOF */ 105 : - return /* UnexpectedEOS */ 4; + return /* UnexpectedEOS */ 4; } } else { switch (tmp.TAG) { case /* T_NUMBER */ 0 : - return /* UnexpectedNumber */ 0; + return /* UnexpectedNumber */ 0; case /* T_STRING */ 1 : case /* T_JSX_TEXT */ 4 : - return /* UnexpectedString */ 1; + return /* UnexpectedString */ 1; } } @@ -7027,24 +7027,24 @@ function param_list_or_type(env) { if (/* tag */ typeof token$5 === "number" || typeof token$5 === "string") { switch (token$5) { case /* T_IDENTIFIER */ 0 : - ret = function_param_or_generic_type(env); - break; + ret = function_param_or_generic_type(env); + break; case /* T_RPAREN */ 4 : - ret = { - TAG: /* ParamList */ 0, - _0: [ - undefined, - /* [] */ 0 - ] - }; - break; + ret = { + TAG: /* ParamList */ 0, + _0: [ + undefined, + /* [] */ 0 + ] + }; + break; case /* T_ELLIPSIS */ 11 : case /* T_EOF */ 105 : - ret = { - TAG: /* ParamList */ 0, - _0: Curry._2(function_param_list_without_parens, env, /* [] */ 0) - }; - break; + ret = { + TAG: /* ParamList */ 0, + _0: Curry._2(function_param_list_without_parens, env, /* [] */ 0) + }; + break; default: exit = 1; } @@ -7060,8 +7060,8 @@ function param_list_or_type(env) { switch (match$1) { case /* T_PLING */ 76 : case /* T_COLON */ 77 : - exit$1 = 2; - break; + exit$1 = 2; + break; default: ret = { TAG: /* Type */ 1, @@ -7130,187 +7130,187 @@ function primary(env) { if (/* tag */ typeof token$5 === "number" || typeof token$5 === "string") { switch (token$5) { case /* T_IDENTIFIER */ 0 : - const match = generic(env); - return [ - match[0], - { - TAG: /* Generic */ 4, - _0: match[1] - } - ]; + const match = generic(env); + return [ + match[0], + { + TAG: /* Generic */ 4, + _0: match[1] + } + ]; case /* T_LCURLY */ 1 : - const match$1 = Curry._2(_object, undefined, env); - return [ - match$1[0], - { - TAG: /* Object */ 2, - _0: match$1[1] - } - ]; - case /* T_LPAREN */ 3 : - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - const _type = param_list_or_type(env); - if (_type.TAG !== /* ParamList */ 0) { - return _type._0; + const match$1 = Curry._2(_object, undefined, env); + return [ + match$1[0], + { + TAG: /* Object */ 2, + _0: match$1[1] } - const match$2 = _type._0; - token$4(env, /* T_ARROW */ 10); - const returnType = union(env); - const end_loc = returnType[0]; - return [ - btwn(start_loc, end_loc), - { - TAG: /* Function */ 1, - _0: { - params: match$2[1], - returnType: returnType, - rest: match$2[0], - typeParameters: undefined - } + ]; + case /* T_LPAREN */ 3 : + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + const _type = param_list_or_type(env); + if (_type.TAG !== /* ParamList */ 0) { + return _type._0; + } + const match$2 = _type._0; + token$4(env, /* T_ARROW */ 10); + const returnType = union(env); + const end_loc = returnType[0]; + return [ + btwn(start_loc, end_loc), + { + TAG: /* Function */ 1, + _0: { + params: match$2[1], + returnType: returnType, + rest: match$2[0], + typeParameters: undefined } - ]; + } + ]; case /* T_LBRACKET */ 5 : - const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_LBRACKET */ 5); - const tl = types(env, /* [] */ 0); - const end_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_RBRACKET */ 6); - return [ - btwn(start_loc$1, end_loc$1), - { - TAG: /* Tuple */ 8, - _0: tl - } - ]; + const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_LBRACKET */ 5); + const tl = types(env, /* [] */ 0); + const end_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_RBRACKET */ 6); + return [ + btwn(start_loc$1, end_loc$1), + { + TAG: /* Tuple */ 8, + _0: tl + } + ]; case /* T_FALSE */ 28 : case /* T_TRUE */ 29 : - exit = 2; - break; + exit = 2; + break; case /* T_TYPEOF */ 44 : - const start_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_TYPEOF */ 44); - const t = primary(env); - return [ - btwn(start_loc$2, t[0]), - { - TAG: /* Typeof */ 7, - _0: t - } - ]; + const start_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_TYPEOF */ 44); + const t = primary(env); + return [ + btwn(start_loc$2, t[0]), + { + TAG: /* Typeof */ 7, + _0: t + } + ]; case /* T_LESS_THAN */ 89 : - const start_loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env); - const typeParameters = Curry._2(type_parameter_declaration, false, env); - const match$3 = function_param_list(env); - token$4(env, /* T_ARROW */ 10); - const returnType$1 = union(env); - const end_loc$2 = returnType$1[0]; - return [ - btwn(start_loc$3, end_loc$2), - { - TAG: /* Function */ 1, - _0: { - params: match$3[1], - returnType: returnType$1, - rest: match$3[0], - typeParameters: typeParameters - } + const start_loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env); + const typeParameters = Curry._2(type_parameter_declaration, false, env); + const match$3 = function_param_list(env); + token$4(env, /* T_ARROW */ 10); + const returnType$1 = union(env); + const end_loc$2 = returnType$1[0]; + return [ + btwn(start_loc$3, end_loc$2), + { + TAG: /* Function */ 1, + _0: { + params: match$3[1], + returnType: returnType$1, + rest: match$3[0], + typeParameters: typeParameters } - ]; + } + ]; case /* T_MULT */ 97 : - token$4(env, /* T_MULT */ 97); - return [ - loc, - /* Exists */ 6 - ]; + token$4(env, /* T_MULT */ 97); + return [ + loc, + /* Exists */ 6 + ]; default: exit = 1; } } else { switch (token$5.TAG) { case /* T_STRING */ 1 : - const match$4 = token$5._0; - const octal = match$4[3]; - const raw = match$4[2]; - const value = match$4[1]; - const loc$1 = match$4[0]; - if (octal) { - strict_error(env, /* StrictOctalLiteral */ 31); - } - token$4(env, { - TAG: /* T_STRING */ 1, - _0: [ - loc$1, - value, - raw, - octal - ] - }); - return [ - loc$1, - { - TAG: /* StringLiteral */ 9, - _0: { - value: value, - raw: raw - } + const match$4 = token$5._0; + const octal = match$4[3]; + const raw = match$4[2]; + const value = match$4[1]; + const loc$1 = match$4[0]; + if (octal) { + strict_error(env, /* StrictOctalLiteral */ 31); + } + token$4(env, { + TAG: /* T_STRING */ 1, + _0: [ + loc$1, + value, + raw, + octal + ] + }); + return [ + loc$1, + { + TAG: /* StringLiteral */ 9, + _0: { + value: value, + raw: raw } - ]; - case /* T_NUMBER_SINGLETON_TYPE */ 5 : - const value$1 = token$5._1; - const number_type = token$5._0; - const raw$1 = Curry._2(Parser_env_Peek.value, undefined, env); - token$4(env, { - TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, - _0: number_type, - _1: value$1 - }); - if (number_type === /* LEGACY_OCTAL */ 1) { - strict_error(env, /* StrictOctalLiteral */ 31); } - return [ - loc, - { - TAG: /* NumberLiteral */ 10, - _0: { - value: value$1, - raw: raw$1 - } + ]; + case /* T_NUMBER_SINGLETON_TYPE */ 5 : + const value$1 = token$5._1; + const number_type = token$5._0; + const raw$1 = Curry._2(Parser_env_Peek.value, undefined, env); + token$4(env, { + TAG: /* T_NUMBER_SINGLETON_TYPE */ 5, + _0: number_type, + _1: value$1 + }); + if (number_type === /* LEGACY_OCTAL */ 1) { + strict_error(env, /* StrictOctalLiteral */ 31); + } + return [ + loc, + { + TAG: /* NumberLiteral */ 10, + _0: { + value: value$1, + raw: raw$1 } - ]; + } + ]; default: exit = 1; } } switch (exit) { case 1 : - const t$1 = primitive(token$5); - if (t$1 !== undefined) { - token$4(env, token$5); - return [ - loc, - t$1 - ]; - } else { - error_unexpected(env); - return [ - loc, - /* Any */ 0 - ]; - } - case 2 : - const raw$2 = Curry._2(Parser_env_Peek.value, undefined, env); + const t$1 = primitive(token$5); + if (t$1 !== undefined) { token$4(env, token$5); - const value$2 = Caml_obj.caml_equal(token$5, /* T_TRUE */ 29); return [ loc, - { - TAG: /* BooleanLiteral */ 11, - _0: { - value: value$2, - raw: raw$2 - } - } + t$1 + ]; + } else { + error_unexpected(env); + return [ + loc, + /* Any */ 0 ]; + } + case 2 : + const raw$2 = Curry._2(Parser_env_Peek.value, undefined, env); + token$4(env, token$5); + const value$2 = Caml_obj.caml_equal(token$5, /* T_TRUE */ 29); + return [ + loc, + { + TAG: /* BooleanLiteral */ 11, + _0: { + value: value$2, + raw: raw$2 + } + } + ]; } } @@ -7321,17 +7321,17 @@ function primitive(param) { } switch (param) { case /* T_NULL */ 27 : - return /* Null */ 2; + return /* Null */ 2; case /* T_ANY_TYPE */ 107 : - return /* Any */ 0; + return /* Any */ 0; case /* T_BOOLEAN_TYPE */ 108 : - return /* Boolean */ 5; + return /* Boolean */ 5; case /* T_NUMBER_TYPE */ 109 : - return /* Number */ 3; + return /* Number */ 3; case /* T_STRING_TYPE */ 110 : - return /* String */ 4; + return /* String */ 4; case /* T_VOID_TYPE */ 111 : - return /* Void */ 1; + return /* Void */ 1; default: return; } @@ -7345,8 +7345,8 @@ function function_param_or_generic_type(env) { switch (match) { case /* T_PLING */ 76 : case /* T_COLON */ 77 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } @@ -7355,20 +7355,20 @@ function function_param_or_generic_type(env) { } switch (exit) { case 1 : - return { - TAG: /* Type */ 1, - _0: Curry._2(union_with, env, Curry._2(intersection_with, env, postfix_with(env, generic_type_with_identifier(env, id)))) - }; + return { + TAG: /* Type */ 1, + _0: Curry._2(union_with, env, Curry._2(intersection_with, env, postfix_with(env, generic_type_with_identifier(env, id)))) + }; case 2 : - const param = function_param_with_id(env, id); - maybe(env, /* T_COMMA */ 8); - return { - TAG: /* ParamList */ 0, - _0: Curry._2(function_param_list_without_parens, env, { - hd: param, - tl: /* [] */ 0 - }) - }; + const param = function_param_with_id(env, id); + maybe(env, /* T_COMMA */ 8); + return { + TAG: /* ParamList */ 0, + _0: Curry._2(function_param_list_without_parens, env, { + hd: param, + tl: /* [] */ 0 + }) + }; } } @@ -7461,8 +7461,8 @@ function function_param_list_without_parens(env) { case /* T_RPAREN */ 4 : case /* T_ELLIPSIS */ 11 : case /* T_EOF */ 105 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } @@ -7471,22 +7471,22 @@ function function_param_list_without_parens(env) { } switch (exit) { case 1 : - const acc_0 = param(env); - const acc$1 = { - hd: acc_0, - tl: acc - }; - if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { - token$4(env, /* T_COMMA */ 8); - } - _acc = acc$1; - continue; + const acc_0 = param(env); + const acc$1 = { + hd: acc_0, + tl: acc + }; + if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { + token$4(env, /* T_COMMA */ 8); + } + _acc = acc$1; + continue; case 2 : - const rest = Caml_obj.caml_equal(t, /* T_ELLIPSIS */ 11) ? (token$4(env, /* T_ELLIPSIS */ 11), param(env)) : undefined; - return [ - rest, - Stdlib__List.rev(acc) - ]; + const rest = Caml_obj.caml_equal(t, /* T_ELLIPSIS */ 11) ? (token$4(env, /* T_ELLIPSIS */ 11), param(env)) : undefined; + return [ + rest, + Stdlib__List.rev(acc) + ]; } }; @@ -7556,7 +7556,7 @@ function params(env, _acc) { switch (match) { case /* T_GREATER_THAN */ 90 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -7599,13 +7599,13 @@ function params$1(env, allow_default, _require_default, _acc) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_PLUS */ 94 : - token$3(env); - variance = /* Plus */ 0; - break; + token$3(env); + variance = /* Plus */ 0; + break; case /* T_MINUS */ 95 : - token$3(env); - variance = /* Minus */ 1; - break; + token$3(env); + variance = /* Minus */ 1; + break; default: variance = undefined; } @@ -7666,7 +7666,7 @@ function params$1(env, allow_default, _require_default, _acc) { switch (match$4) { case /* T_GREATER_THAN */ 90 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc$1); + return Stdlib__List.rev(acc$1); } } @@ -7708,7 +7708,7 @@ function types(env, _acc) { switch (match) { case /* T_RBRACKET */ 6 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -7821,10 +7821,10 @@ function semicolon$1(env) { } switch (match) { case /* T_RCURLY */ 2 : - return; + return; case /* T_SEMICOLON */ 7 : case /* T_COMMA */ 8 : - return token$3(env); + return token$3(env); default: return error_unexpected(env); } @@ -7843,25 +7843,25 @@ function properties(allow_static, env, _param) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_LBRACKET */ 5 : - const indexer = indexer_property(env, start_loc, $$static); - semicolon$1(env); - _param = [ - acc, - { - hd: indexer, - tl: indexers - }, - callProperties - ]; - continue; + const indexer = indexer_property(env, start_loc, $$static); + semicolon$1(env); + _param = [ + acc, + { + hd: indexer, + tl: indexers + }, + callProperties + ]; + continue; case /* T_LPAREN */ 3 : case /* T_LESS_THAN */ 89 : - exit = 3; - break; + exit = 3; + break; case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } @@ -7870,89 +7870,89 @@ function properties(allow_static, env, _param) { } switch (exit) { case 1 : - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); - let match$2; - let exit$1 = 0; - if ($$static && /* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1 === /* T_COLON */ 77) { - strict_error_at(env, [ - start_loc, - /* StrictReservedWord */ 39 - ]); - const static_key_1 = { - TAG: /* Identifier */ 1, - _0: [ + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); + let match$2; + let exit$1 = 0; + if ($$static && /* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1 === /* T_COLON */ 77) { + strict_error_at(env, [ start_loc, - { - name: "static", - typeAnnotation: undefined, - optional: false - } - ] - }; - const static_key = [ + /* StrictReservedWord */ 39 + ]); + const static_key_1 = { + TAG: /* Identifier */ 1, + _0: [ start_loc, - static_key_1 - ]; - match$2 = [ - false, - static_key - ]; - } else { - exit$1 = 4; - } - if (exit$1 === 4) { - push_lex_mode(env, /* NORMAL */ 0); - const key = Curry._1(Parse.object_key, env); - pop_lex_mode(env); - match$2 = [ - $$static, - key - ]; - } - const key$1 = match$2[1][1]; - const $$static$1 = match$2[0]; - const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); - let property$1; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - switch (match$3) { - case /* T_LPAREN */ 3 : - case /* T_LESS_THAN */ 89 : - property$1 = method_property(env, start_loc, $$static$1, key$1); - break; - default: - property$1 = property(env, start_loc, $$static$1, key$1); - } - } else { - property$1 = property(env, start_loc, $$static$1, key$1); - } - semicolon$1(env); - _param = [ - { - hd: property$1, - tl: acc - }, - indexers, - callProperties + { + name: "static", + typeAnnotation: undefined, + optional: false + } + ] + }; + const static_key = [ + start_loc, + static_key_1 ]; - continue; - case 2 : - return [ - Stdlib__List.rev(acc), - Stdlib__List.rev(indexers), - Stdlib__List.rev(callProperties) + match$2 = [ + false, + static_key ]; - case 3 : - const call_prop = call_property(env, start_loc, $$static); - semicolon$1(env); - _param = [ - acc, - indexers, - { - hd: call_prop, - tl: callProperties - } + } else { + exit$1 = 4; + } + if (exit$1 === 4) { + push_lex_mode(env, /* NORMAL */ 0); + const key = Curry._1(Parse.object_key, env); + pop_lex_mode(env); + match$2 = [ + $$static, + key ]; - continue; + } + const key$1 = match$2[1][1]; + const $$static$1 = match$2[0]; + const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); + let property$1; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + switch (match$3) { + case /* T_LPAREN */ 3 : + case /* T_LESS_THAN */ 89 : + property$1 = method_property(env, start_loc, $$static$1, key$1); + break; + default: + property$1 = property(env, start_loc, $$static$1, key$1); + } + } else { + property$1 = property(env, start_loc, $$static$1, key$1); + } + semicolon$1(env); + _param = [ + { + hd: property$1, + tl: acc + }, + indexers, + callProperties + ]; + continue; + case 2 : + return [ + Stdlib__List.rev(acc), + Stdlib__List.rev(indexers), + Stdlib__List.rev(callProperties) + ]; + case 3 : + const call_prop = call_property(env, start_loc, $$static); + semicolon$1(env); + _param = [ + acc, + indexers, + { + hd: call_prop, + tl: callProperties + } + ]; + continue; } }; @@ -8047,39 +8047,39 @@ function pattern(check_env, _param) { const p = param[1]; switch (p.TAG) { case /* Object */ 0 : - let o = p._0; - return Stdlib__List.fold_left(object_property, check_env, o.properties); + let o = p._0; + return Stdlib__List.fold_left(object_property, check_env, o.properties); case /* Array */ 1 : - let arr = p._0; - return Stdlib__List.fold_left(array_element, check_env, arr.elements); + let arr = p._0; + return Stdlib__List.fold_left(array_element, check_env, arr.elements); case /* Assignment */ 2 : - _param = p._0.left; - continue; + _param = p._0.left; + continue; case /* Identifier */ 3 : - let id = p._0; - const name = id[1].name; - const param_names = check_env[1]; - const env = check_env[0]; - if (Curry._2(mem$1, name, param_names)) { - error_at(env, [ - id[0], - /* StrictParamDupe */ 29 - ]); - } - const match = identifier_no_dupe_check([ - env, - param_names - ], id); - return [ - match[0], - Curry._2(add$1, name, match[1]) - ]; - case /* Expression */ 4 : - error_at(check_env[0], [ - param[0], - /* ExpectedPatternFoundExpression */ 18 + let id = p._0; + const name = id[1].name; + const param_names = check_env[1]; + const env = check_env[0]; + if (Curry._2(mem$1, name, param_names)) { + error_at(env, [ + id[0], + /* StrictParamDupe */ 29 ]); - return check_env; + } + const match = identifier_no_dupe_check([ + env, + param_names + ], id); + return [ + match[0], + Curry._2(add$1, name, match[1]) + ]; + case /* Expression */ 4 : + error_at(check_env[0], [ + param[0], + /* ExpectedPatternFoundExpression */ 18 + ]); + return check_env; } }; @@ -8095,12 +8095,12 @@ function object_property(check_env) { let check_env$1; switch (id.TAG) { case /* Identifier */ 1 : - check_env$1 = identifier_no_dupe_check(check_env, id._0); - break; + check_env$1 = identifier_no_dupe_check(check_env, id._0); + break; case /* Literal */ 0 : case /* Computed */ 2 : - check_env$1 = check_env; - break; + check_env$1 = check_env; + break; } return pattern(check_env$1, property.pattern); @@ -8200,8 +8200,8 @@ function param_list(env, _param) { case /* T_RPAREN */ 4 : case /* T_ELLIPSIS */ 11 : case /* T_EOF */ 105 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } @@ -8210,34 +8210,34 @@ function param_list(env, _param) { } switch (exit) { case 1 : - const match = param$1(env); - const $$default = match[1]; - const has_default$1 = has_default || $$default !== undefined; - if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { - token$4(env, /* T_COMMA */ 8); - } - _param = [ - { - hd: match[0], - tl: params - }, - { - hd: $$default, - tl: defaults - }, - has_default$1 - ]; - continue; + const match = param$1(env); + const $$default = match[1]; + const has_default$1 = has_default || $$default !== undefined; + if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { + token$4(env, /* T_COMMA */ 8); + } + _param = [ + { + hd: match[0], + tl: params + }, + { + hd: $$default, + tl: defaults + }, + has_default$1 + ]; + continue; case 2 : - const rest = Caml_obj.caml_equal(t, /* T_ELLIPSIS */ 11) ? (token$4(env, /* T_ELLIPSIS */ 11), Curry._2(Parse.identifier_with_type, env, /* StrictParamName */ 28)) : undefined; - if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { - error$1(env, /* ParameterAfterRestParameter */ 47); - } - return [ - Stdlib__List.rev(params), - has_default ? Stdlib__List.rev(defaults) : /* [] */ 0, - rest - ]; + const rest = Caml_obj.caml_equal(t, /* T_ELLIPSIS */ 11) ? (token$4(env, /* T_ELLIPSIS */ 11), Curry._2(Parse.identifier_with_type, env, /* StrictParamName */ 28)) : undefined; + if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_RPAREN */ 4)) { + error$1(env, /* ParameterAfterRestParameter */ 47); + } + return [ + Stdlib__List.rev(params), + has_default ? Stdlib__List.rev(defaults) : /* [] */ 0, + rest + ]; } }; @@ -8313,19 +8313,19 @@ function _function(env) { if (match && /* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { switch (match$1) { case /* T_LPAREN */ 3 : - match$2 = [ - undefined, - undefined - ]; - break; + match$2 = [ + undefined, + undefined + ]; + break; case /* T_LESS_THAN */ 89 : - const typeParams = Curry._1(type_parameter_declaration$1, env); - const id = Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_LPAREN */ 3) ? undefined : Curry._2(Parse.identifier, /* StrictFunctionName */ 30, env); - match$2 = [ - typeParams, - id - ]; - break; + const typeParams = Curry._1(type_parameter_declaration$1, env); + const id = Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_LPAREN */ 3) ? undefined : Curry._2(Parse.identifier, /* StrictFunctionName */ 30, env); + match$2 = [ + typeParams, + id + ]; + break; default: exit = 1; } @@ -8500,14 +8500,14 @@ function variable(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_VAR */ 22 : - match$1 = declarations(/* T_VAR */ 22, /* Var */ 0, env); - break; + match$1 = declarations(/* T_VAR */ 22, /* Var */ 0, env); + break; case /* T_CONST */ 25 : - match$1 = $$const(env); - break; + match$1 = $$const(env); + break; case /* T_LET */ 26 : - match$1 = _let(env); - break; + match$1 = _let(env); + break; default: error_unexpected(env); match$1 = declarations(/* T_VAR */ 22, /* Var */ 0, env); @@ -8543,7 +8543,7 @@ function is_lhs(param) { switch (tmp.TAG) { case /* Member */ 13 : case /* Identifier */ 18 : - return true; + return true; default: return false; } @@ -8559,7 +8559,7 @@ function is_assignable_lhs(param) { case /* Object */ 1 : case /* Member */ 13 : case /* Identifier */ 18 : - return true; + return true; default: return false; } @@ -8571,44 +8571,44 @@ function assignment_op(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_RSHIFT3_ASSIGN */ 63 : - op = /* RShift3Assign */ 9; - break; + op = /* RShift3Assign */ 9; + break; case /* T_RSHIFT_ASSIGN */ 64 : - op = /* RShiftAssign */ 8; - break; + op = /* RShiftAssign */ 8; + break; case /* T_LSHIFT_ASSIGN */ 65 : - op = /* LShiftAssign */ 7; - break; + op = /* LShiftAssign */ 7; + break; case /* T_BIT_XOR_ASSIGN */ 66 : - op = /* BitXorAssign */ 11; - break; + op = /* BitXorAssign */ 11; + break; case /* T_BIT_OR_ASSIGN */ 67 : - op = /* BitOrAssign */ 10; - break; + op = /* BitOrAssign */ 10; + break; case /* T_BIT_AND_ASSIGN */ 68 : - op = /* BitAndAssign */ 12; - break; + op = /* BitAndAssign */ 12; + break; case /* T_MOD_ASSIGN */ 69 : - op = /* ModAssign */ 6; - break; + op = /* ModAssign */ 6; + break; case /* T_DIV_ASSIGN */ 70 : - op = /* DivAssign */ 5; - break; + op = /* DivAssign */ 5; + break; case /* T_MULT_ASSIGN */ 71 : - op = /* MultAssign */ 3; - break; + op = /* MultAssign */ 3; + break; case /* T_EXP_ASSIGN */ 72 : - op = /* ExpAssign */ 4; - break; + op = /* ExpAssign */ 4; + break; case /* T_MINUS_ASSIGN */ 73 : - op = /* MinusAssign */ 2; - break; + op = /* MinusAssign */ 2; + break; case /* T_PLUS_ASSIGN */ 74 : - op = /* PlusAssign */ 1; - break; + op = /* PlusAssign */ 1; + break; case /* T_ASSIGN */ 75 : - op = /* Assign */ 0; - break; + op = /* Assign */ 0; + break; default: op = undefined; } @@ -8653,25 +8653,25 @@ function peek_unary_op(env) { } switch (match) { case /* T_DELETE */ 43 : - return /* Delete */ 6; + return /* Delete */ 6; case /* T_TYPEOF */ 44 : - return /* Typeof */ 4; + return /* Typeof */ 4; case /* T_VOID */ 45 : - return /* Void */ 5; + return /* Void */ 5; case /* T_AWAIT */ 62 : - if (env.allow_await) { - return /* Await */ 7; - } else { - return; - } + if (env.allow_await) { + return /* Await */ 7; + } else { + return; + } case /* T_PLUS */ 94 : - return /* Plus */ 1; + return /* Plus */ 1; case /* T_MINUS */ 95 : - return /* Minus */ 0; + return /* Minus */ 0; case /* T_NOT */ 100 : - return /* Not */ 2; + return /* Not */ 2; case /* T_BIT_NOT */ 101 : - return /* BitNot */ 3; + return /* BitNot */ 3; default: return; } @@ -8711,11 +8711,11 @@ function unary(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_INCR */ 102 : - op$1 = /* Increment */ 0; - break; + op$1 = /* Increment */ 0; + break; case /* T_DECR */ 103 : - op$1 = /* Decrement */ 1; - break; + op$1 = /* Decrement */ 1; + break; default: op$1 = undefined; } @@ -8732,11 +8732,11 @@ function unary(env) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { switch (match$1) { case /* T_INCR */ 102 : - op$2 = /* Increment */ 0; - break; + op$2 = /* Increment */ 0; + break; case /* T_DECR */ 103 : - op$2 = /* Decrement */ 1; - break; + op$2 = /* Decrement */ 1; + break; default: op$2 = undefined; } @@ -8843,61 +8843,61 @@ function call(env, _left) { } switch (part) { case /* T_LPAREN */ 3 : - if (env.no_call) { - return left; - } - const match = Curry._1($$arguments, env); - _left = [ - btwn(left[0], match[0]), - { - TAG: /* Call */ 12, - _0: { - callee: left, - arguments: match[1] - } + if (env.no_call) { + return left; + } + const match = Curry._1($$arguments, env); + _left = [ + btwn(left[0], match[0]), + { + TAG: /* Call */ 12, + _0: { + callee: left, + arguments: match[1] } - ]; - continue; + } + ]; + continue; case /* T_LBRACKET */ 5 : - token$4(env, /* T_LBRACKET */ 5); - const expr = Curry._1(Parse.expression, env); - const last_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - const loc = btwn(left[0], last_loc); - token$4(env, /* T_RBRACKET */ 6); - _left = [ - loc, - { - TAG: /* Member */ 13, - _0: { - _object: left, - property: { - TAG: /* PropertyExpression */ 1, - _0: expr - }, - computed: true - } + token$4(env, /* T_LBRACKET */ 5); + const expr = Curry._1(Parse.expression, env); + const last_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + const loc = btwn(left[0], last_loc); + token$4(env, /* T_RBRACKET */ 6); + _left = [ + loc, + { + TAG: /* Member */ 13, + _0: { + _object: left, + property: { + TAG: /* PropertyExpression */ 1, + _0: expr + }, + computed: true } - ]; - continue; + } + ]; + continue; case /* T_PERIOD */ 9 : - token$4(env, /* T_PERIOD */ 9); - const match$1 = identifier_or_reserved_keyword(env); - const id = match$1[0]; - _left = [ - btwn(left[0], id[0]), - { - TAG: /* Member */ 13, - _0: { - _object: left, - property: { - TAG: /* PropertyIdentifier */ 0, - _0: id - }, - computed: false - } + token$4(env, /* T_PERIOD */ 9); + const match$1 = identifier_or_reserved_keyword(env); + const id = match$1[0]; + _left = [ + btwn(left[0], id[0]), + { + TAG: /* Member */ 13, + _0: { + _object: left, + property: { + TAG: /* PropertyIdentifier */ 0, + _0: id + }, + computed: false } - ]; - continue; + } + ]; + continue; default: return left; } @@ -8956,42 +8956,42 @@ function member(env, left) { } switch (match) { case /* T_LBRACKET */ 5 : - token$4(env, /* T_LBRACKET */ 5); - const expr = Curry._1(Parse.expression, with_no_call(false, env)); - const last_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_RBRACKET */ 6); - return call(env, [ - btwn(left[0], last_loc), - { - TAG: /* Member */ 13, - _0: { - _object: left, - property: { - TAG: /* PropertyExpression */ 1, - _0: expr - }, - computed: true - } + token$4(env, /* T_LBRACKET */ 5); + const expr = Curry._1(Parse.expression, with_no_call(false, env)); + const last_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_RBRACKET */ 6); + return call(env, [ + btwn(left[0], last_loc), + { + TAG: /* Member */ 13, + _0: { + _object: left, + property: { + TAG: /* PropertyExpression */ 1, + _0: expr + }, + computed: true } - ]); + } + ]); case /* T_PERIOD */ 9 : - token$4(env, /* T_PERIOD */ 9); - const match$1 = identifier_or_reserved_keyword(env); - const id = match$1[0]; - return call(env, [ - btwn(left[0], id[0]), - { - TAG: /* Member */ 13, - _0: { - _object: left, - property: { - TAG: /* PropertyIdentifier */ 0, - _0: id - }, - computed: false - } + token$4(env, /* T_PERIOD */ 9); + const match$1 = identifier_or_reserved_keyword(env); + const id = match$1[0]; + return call(env, [ + btwn(left[0], id[0]), + { + TAG: /* Member */ 13, + _0: { + _object: left, + property: { + TAG: /* PropertyIdentifier */ 0, + _0: id + }, + computed: false } - ]); + } + ]); default: return left; } @@ -9056,26 +9056,26 @@ function number(env, number_type) { let value$1; switch (number_type) { case /* LEGACY_OCTAL */ 1 : - strict_error(env, /* StrictOctalLiteral */ 31); - value$1 = Caml_format.caml_int_of_string("0o" + value); - break; + strict_error(env, /* StrictOctalLiteral */ 31); + value$1 = Caml_format.caml_int_of_string("0o" + value); + break; case /* BINARY */ 0 : case /* OCTAL */ 2 : - value$1 = Caml_format.caml_int_of_string(value); - break; + value$1 = Caml_format.caml_int_of_string(value); + break; case /* NORMAL */ 3 : - try { - value$1 = float_of_string(value); - } - catch (exn){ - if (Stdlib__Sys.win32) { - error$1(env, /* WindowsFloatOfString */ 59); - value$1 = 789.0; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + try { + value$1 = float_of_string(value); + } + catch (exn){ + if (Stdlib__Sys.win32) { + error$1(env, /* WindowsFloatOfString */ 59); + value$1 = 789.0; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - break; + } + break; } token$4(env, { @@ -9092,305 +9092,305 @@ function primary$1(env) { if (/* tag */ typeof number_type === "number" || typeof number_type === "string") { switch (number_type) { case /* T_LCURLY */ 1 : - const match = Curry._1(Parse.object_initializer, env); - return [ - match[0], - { - TAG: /* Object */ 1, - _0: match[1] - } - ]; + const match = Curry._1(Parse.object_initializer, env); + return [ + match[0], + { + TAG: /* Object */ 1, + _0: match[1] + } + ]; case /* T_LPAREN */ 3 : - token$4(env, /* T_LPAREN */ 3); - const expression = Curry._1(assignment, env); - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); - let ret; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - switch (match$1) { - case /* T_COMMA */ 8 : - ret = sequence(env, { - hd: expression, - tl: /* [] */ 0 - }); - break; - case /* T_COLON */ 77 : - const typeAnnotation = wrap(annotation, env); - ret = [ - btwn(expression[0], typeAnnotation[0]), - { - TAG: /* TypeCast */ 24, - _0: { - expression: expression, - typeAnnotation: typeAnnotation - } - } - ]; - break; - default: - ret = expression; - } - } else { - ret = expression; + token$4(env, /* T_LPAREN */ 3); + const expression = Curry._1(assignment, env); + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); + let ret; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + switch (match$1) { + case /* T_COMMA */ 8 : + ret = sequence(env, { + hd: expression, + tl: /* [] */ 0 + }); + break; + case /* T_COLON */ 77 : + const typeAnnotation = wrap(annotation, env); + ret = [ + btwn(expression[0], typeAnnotation[0]), + { + TAG: /* TypeCast */ 24, + _0: { + expression: expression, + typeAnnotation: typeAnnotation + } + } + ]; + break; + default: + ret = expression; } - token$4(env, /* T_RPAREN */ 4); - return ret; + } else { + ret = expression; + } + token$4(env, /* T_RPAREN */ 4); + return ret; case /* T_LBRACKET */ 5 : - const match$2 = Curry._1(array_initializer, env); - return [ - match$2[0], - { - TAG: /* Array */ 0, - _0: match$2[1] - } - ]; + const match$2 = Curry._1(array_initializer, env); + return [ + match$2[0], + { + TAG: /* Array */ 0, + _0: match$2[1] + } + ]; case /* T_THIS */ 19 : - token$4(env, /* T_THIS */ 19); - return [ - loc, - /* This */ 0 - ]; + token$4(env, /* T_THIS */ 19); + return [ + loc, + /* This */ 0 + ]; case /* T_NULL */ 27 : - const raw = Curry._2(Parser_env_Peek.value, undefined, env); - token$4(env, /* T_NULL */ 27); - return [ - loc, - { - TAG: /* Literal */ 19, - _0: { - value: /* Null */ 0, - raw: raw - } + const raw = Curry._2(Parser_env_Peek.value, undefined, env); + token$4(env, /* T_NULL */ 27); + return [ + loc, + { + TAG: /* Literal */ 19, + _0: { + value: /* Null */ 0, + raw: raw } - ]; + } + ]; case /* T_FALSE */ 28 : case /* T_TRUE */ 29 : - exit = 2; - break; + exit = 2; + break; case /* T_CLASS */ 38 : - return Curry._1(Parse.class_expression, env); + return Curry._1(Parse.class_expression, env); case /* T_SUPER */ 49 : - const loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_SUPER */ 49); - const id_1 = { - name: "super", - typeAnnotation: undefined, - optional: false - }; - const id = [ - loc$1, - id_1 - ]; - return [ - loc$1, - { - TAG: /* Identifier */ 18, - _0: id - } - ]; - case /* T_LESS_THAN */ 89 : - const match$3 = Curry._1(Parse.jsx_element, env); - return [ - match$3[0], - { - TAG: /* JSXElement */ 22, - _0: match$3[1] - } - ]; - case /* T_DIV_ASSIGN */ 70 : - case /* T_DIV */ 96 : - push_lex_mode(env, /* REGEXP */ 5); - const loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); - const match$4 = Curry._2(Parser_env_Peek.token, undefined, env); - let match$5; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 1699, - 15 - ] - }); + const loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_SUPER */ 49); + const id_1 = { + name: "super", + typeAnnotation: undefined, + optional: false + }; + const id = [ + loc$1, + id_1 + ]; + return [ + loc$1, + { + TAG: /* Identifier */ 18, + _0: id } - if (match$4.TAG === /* T_REGEXP */ 3) { - const match$6 = match$4._0; - const raw$1 = Curry._2(Parser_env_Peek.value, undefined, env); - token$3(env); - match$5 = [ - raw$1, - match$6[1], - match$6[2] - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 1699, - 15 - ] - }); + ]; + case /* T_LESS_THAN */ 89 : + const match$3 = Curry._1(Parse.jsx_element, env); + return [ + match$3[0], + { + TAG: /* JSXElement */ 22, + _0: match$3[1] } - const raw_flags = match$5[2]; - pop_lex_mode(env); - const filtered_flags = Stdlib__Buffer.create(raw_flags.length); - Stdlib__String.iter((function (c) { - if (c >= 110) { - if (c !== 121) { - return; - } else { - return Stdlib__Buffer.add_char(filtered_flags, c); - } - } - if (c < 103) { + ]; + case /* T_DIV_ASSIGN */ 70 : + case /* T_DIV */ 96 : + push_lex_mode(env, /* REGEXP */ 5); + const loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); + const match$4 = Curry._2(Parser_env_Peek.token, undefined, env); + let match$5; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 1699, + 15 + ] + }); + } + if (match$4.TAG === /* T_REGEXP */ 3) { + const match$6 = match$4._0; + const raw$1 = Curry._2(Parser_env_Peek.value, undefined, env); + token$3(env); + match$5 = [ + raw$1, + match$6[1], + match$6[2] + ]; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 1699, + 15 + ] + }); + } + const raw_flags = match$5[2]; + pop_lex_mode(env); + const filtered_flags = Stdlib__Buffer.create(raw_flags.length); + Stdlib__String.iter((function (c) { + if (c >= 110) { + if (c !== 121) { return; + } else { + return Stdlib__Buffer.add_char(filtered_flags, c); } - switch (c) { - case 104 : - case 106 : - case 107 : - case 108 : - return; - case 103 : - case 105 : - case 109 : - return Stdlib__Buffer.add_char(filtered_flags, c); - - } - }), raw_flags); - const flags = Stdlib__Buffer.contents(filtered_flags); - if (flags !== raw_flags) { - error$1(env, { - TAG: /* InvalidRegExpFlags */ 3, - _0: raw_flags - }); + } + if (c < 103) { + return; + } + switch (c) { + case 104 : + case 106 : + case 107 : + case 108 : + return; + case 103 : + case 105 : + case 109 : + return Stdlib__Buffer.add_char(filtered_flags, c); + + } + }), raw_flags); + const flags = Stdlib__Buffer.contents(filtered_flags); + if (flags !== raw_flags) { + error$1(env, { + TAG: /* InvalidRegExpFlags */ 3, + _0: raw_flags + }); + } + const value = { + TAG: /* RegExp */ 3, + _0: { + pattern: match$5[1], + flags: flags } - const value = { - TAG: /* RegExp */ 3, + }; + return [ + loc$2, + { + TAG: /* Literal */ 19, _0: { - pattern: match$5[1], - flags: flags - } - }; - return [ - loc$2, - { - TAG: /* Literal */ 19, - _0: { - value: value, - raw: match$5[0] - } + value: value, + raw: match$5[0] } - ]; + } + ]; default: exit = 1; } } else { switch (number_type.TAG) { case /* T_NUMBER */ 0 : - const raw$2 = Curry._2(Parser_env_Peek.value, undefined, env); - const value$1 = { - TAG: /* Number */ 2, - _0: number(env, number_type._0) - }; - return [ - loc, - { - TAG: /* Literal */ 19, - _0: { - value: value$1, - raw: raw$2 - } - } - ]; - case /* T_STRING */ 1 : - const match$7 = number_type._0; - const octal = match$7[3]; - const raw$3 = match$7[2]; - const value$2 = match$7[1]; - const loc$3 = match$7[0]; - if (octal) { - strict_error(env, /* StrictOctalLiteral */ 31); - } - token$4(env, { - TAG: /* T_STRING */ 1, - _0: [ - loc$3, - value$2, - raw$3, - octal - ] - }); - const value$3 = { - TAG: /* String */ 0, - _0: value$2 - }; - return [ - loc$3, - { - TAG: /* Literal */ 19, - _0: { - value: value$3, - raw: raw$3 - } - } - ]; - case /* T_TEMPLATE_PART */ 2 : - const match$8 = Curry._2(template_literal, env, number_type._0); - return [ - match$8[0], - { - TAG: /* TemplateLiteral */ 20, - _0: match$8[1] - } - ]; - default: - exit = 1; - } - } - switch (exit) { - case 1 : - if (Curry._2(Parser_env_Peek.is_identifier, undefined, env)) { - const id$1 = Curry._2(Parse.identifier, undefined, env); - return [ - id$1[0], - { - TAG: /* Identifier */ 18, - _0: id$1 - } - ]; - } - error_unexpected(env); - if (Caml_obj.caml_equal(number_type, /* T_ERROR */ 104)) { - token$3(env); - } + const raw$2 = Curry._2(Parser_env_Peek.value, undefined, env); + const value$1 = { + TAG: /* Number */ 2, + _0: number(env, number_type._0) + }; return [ loc, { TAG: /* Literal */ 19, _0: { - value: /* Null */ 0, - raw: "null" + value: value$1, + raw: raw$2 } } ]; - case 2 : - const raw$4 = Curry._2(Parser_env_Peek.value, undefined, env); - token$4(env, number_type); - const value$4 = { - TAG: /* Boolean */ 1, - _0: Caml_obj.caml_equal(number_type, /* T_TRUE */ 29) + case /* T_STRING */ 1 : + const match$7 = number_type._0; + const octal = match$7[3]; + const raw$3 = match$7[2]; + const value$2 = match$7[1]; + const loc$3 = match$7[0]; + if (octal) { + strict_error(env, /* StrictOctalLiteral */ 31); + } + token$4(env, { + TAG: /* T_STRING */ 1, + _0: [ + loc$3, + value$2, + raw$3, + octal + ] + }); + const value$3 = { + TAG: /* String */ 0, + _0: value$2 }; return [ - loc, + loc$3, { TAG: /* Literal */ 19, _0: { - value: value$4, - raw: raw$4 + value: value$3, + raw: raw$3 } } ]; + case /* T_TEMPLATE_PART */ 2 : + const match$8 = Curry._2(template_literal, env, number_type._0); + return [ + match$8[0], + { + TAG: /* TemplateLiteral */ 20, + _0: match$8[1] + } + ]; + default: + exit = 1; + } + } + switch (exit) { + case 1 : + if (Curry._2(Parser_env_Peek.is_identifier, undefined, env)) { + const id$1 = Curry._2(Parse.identifier, undefined, env); + return [ + id$1[0], + { + TAG: /* Identifier */ 18, + _0: id$1 + } + ]; + } + error_unexpected(env); + if (Caml_obj.caml_equal(number_type, /* T_ERROR */ 104)) { + token$3(env); + } + return [ + loc, + { + TAG: /* Literal */ 19, + _0: { + value: /* Null */ 0, + raw: "null" + } + } + ]; + case 2 : + const raw$4 = Curry._2(Parser_env_Peek.value, undefined, env); + token$4(env, number_type); + const value$4 = { + TAG: /* Boolean */ 1, + _0: Caml_obj.caml_equal(number_type, /* T_TRUE */ 29) + }; + return [ + loc, + { + TAG: /* Literal */ 19, + _0: { + value: value$4, + raw: raw$4 + } + } + ]; } } @@ -9449,8 +9449,8 @@ function identifier_or_reserved_keyword(env) { case /* T_TYPE */ 59 : case /* T_OF */ 60 : case /* T_ASYNC */ 61 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } @@ -9459,97 +9459,97 @@ function identifier_or_reserved_keyword(env) { } switch (exit) { case 1 : - let err; - let exit$1 = 0; - if (/* tag */ typeof lex_token === "number" || typeof lex_token === "string") { - switch (lex_token) { - case /* T_FUNCTION */ 13 : - case /* T_IF */ 14 : - case /* T_IN */ 15 : - case /* T_INSTANCEOF */ 16 : - case /* T_RETURN */ 17 : - case /* T_SWITCH */ 18 : - case /* T_THIS */ 19 : - case /* T_THROW */ 20 : - case /* T_TRY */ 21 : - case /* T_VAR */ 22 : - case /* T_WHILE */ 23 : - case /* T_WITH */ 24 : - case /* T_CONST */ 25 : - case /* T_LET */ 26 : - case /* T_NULL */ 27 : - case /* T_FALSE */ 28 : - case /* T_TRUE */ 29 : - case /* T_BREAK */ 30 : - case /* T_CASE */ 31 : - case /* T_CATCH */ 32 : - case /* T_CONTINUE */ 33 : - case /* T_DEFAULT */ 34 : - case /* T_DO */ 35 : - case /* T_FINALLY */ 36 : - case /* T_FOR */ 37 : - case /* T_CLASS */ 38 : - case /* T_EXTENDS */ 39 : - case /* T_STATIC */ 40 : - case /* T_ELSE */ 41 : - case /* T_NEW */ 42 : - case /* T_DELETE */ 43 : - case /* T_TYPEOF */ 44 : - case /* T_VOID */ 45 : - case /* T_ENUM */ 46 : - case /* T_EXPORT */ 47 : - case /* T_IMPORT */ 48 : - case /* T_SUPER */ 49 : - case /* T_IMPLEMENTS */ 50 : - case /* T_INTERFACE */ 51 : - case /* T_PACKAGE */ 52 : - case /* T_PRIVATE */ 53 : - case /* T_PROTECTED */ 54 : - case /* T_PUBLIC */ 55 : - case /* T_YIELD */ 56 : - case /* T_DEBUGGER */ 57 : - case /* T_AWAIT */ 62 : - case /* T_ANY_TYPE */ 107 : - case /* T_BOOLEAN_TYPE */ 108 : - case /* T_NUMBER_TYPE */ 109 : - case /* T_STRING_TYPE */ 110 : - case /* T_VOID_TYPE */ 111 : - exit$1 = 3; - break; - default: - error_unexpected(env); - err = undefined; - } - } else { - error_unexpected(env); - err = undefined; - } - if (exit$1 === 3) { - err = [ - lex_loc, - get_unexpected_error([ - lex_token, - lex_value - ]) - ]; + let err; + let exit$1 = 0; + if (/* tag */ typeof lex_token === "number" || typeof lex_token === "string") { + switch (lex_token) { + case /* T_FUNCTION */ 13 : + case /* T_IF */ 14 : + case /* T_IN */ 15 : + case /* T_INSTANCEOF */ 16 : + case /* T_RETURN */ 17 : + case /* T_SWITCH */ 18 : + case /* T_THIS */ 19 : + case /* T_THROW */ 20 : + case /* T_TRY */ 21 : + case /* T_VAR */ 22 : + case /* T_WHILE */ 23 : + case /* T_WITH */ 24 : + case /* T_CONST */ 25 : + case /* T_LET */ 26 : + case /* T_NULL */ 27 : + case /* T_FALSE */ 28 : + case /* T_TRUE */ 29 : + case /* T_BREAK */ 30 : + case /* T_CASE */ 31 : + case /* T_CATCH */ 32 : + case /* T_CONTINUE */ 33 : + case /* T_DEFAULT */ 34 : + case /* T_DO */ 35 : + case /* T_FINALLY */ 36 : + case /* T_FOR */ 37 : + case /* T_CLASS */ 38 : + case /* T_EXTENDS */ 39 : + case /* T_STATIC */ 40 : + case /* T_ELSE */ 41 : + case /* T_NEW */ 42 : + case /* T_DELETE */ 43 : + case /* T_TYPEOF */ 44 : + case /* T_VOID */ 45 : + case /* T_ENUM */ 46 : + case /* T_EXPORT */ 47 : + case /* T_IMPORT */ 48 : + case /* T_SUPER */ 49 : + case /* T_IMPLEMENTS */ 50 : + case /* T_INTERFACE */ 51 : + case /* T_PACKAGE */ 52 : + case /* T_PRIVATE */ 53 : + case /* T_PROTECTED */ 54 : + case /* T_PUBLIC */ 55 : + case /* T_YIELD */ 56 : + case /* T_DEBUGGER */ 57 : + case /* T_AWAIT */ 62 : + case /* T_ANY_TYPE */ 107 : + case /* T_BOOLEAN_TYPE */ 108 : + case /* T_NUMBER_TYPE */ 109 : + case /* T_STRING_TYPE */ 110 : + case /* T_VOID_TYPE */ 111 : + exit$1 = 3; + break; + default: + error_unexpected(env); + err = undefined; } - token$3(env); - return [ - [ - lex_loc, - { - name: lex_value, - typeAnnotation: undefined, - optional: false - } - ], - err + } else { + error_unexpected(env); + err = undefined; + } + if (exit$1 === 3) { + err = [ + lex_loc, + get_unexpected_error([ + lex_token, + lex_value + ]) ]; + } + token$3(env); + return [ + [ + lex_loc, + { + name: lex_value, + typeAnnotation: undefined, + optional: false + } + ], + err + ]; case 2 : - return [ - Curry._2(Parse.identifier, undefined, env), - undefined - ]; + return [ + Curry._2(Parse.identifier, undefined, env), + undefined + ]; } } @@ -9606,9 +9606,9 @@ function try_assignment_but_not_arrow_function(env) { switch (match) { case /* T_ARROW */ 10 : case /* T_COLON */ 77 : - throw new Caml_js_exceptions.MelangeError(Parser_env_Try.Rollback, { - MEL_EXN_ID: Parser_env_Try.Rollback - }); + throw new Caml_js_exceptions.MelangeError(Parser_env_Try.Rollback, { + MEL_EXN_ID: Parser_env_Try.Rollback + }); } } @@ -9645,40 +9645,40 @@ function assignment(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_YIELD */ 56 : - if (env.allow_yield) { - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_YIELD */ 56); - if (!env.allow_yield) { - error$1(env, /* IllegalYield */ 24); - } - const delegate = maybe(env, /* T_MULT */ 97); - const has_argument = !(Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)); - const argument = delegate || has_argument ? Curry._1(assignment, env) : undefined; - let end_loc; - if (argument !== undefined) { - end_loc = argument[0]; - } else { - const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$1 = loc !== undefined ? loc : start_loc; - semicolon(env); - end_loc = end_loc$1; - } - return [ - btwn(start_loc, end_loc), - { - TAG: /* Yield */ 14, - _0: { - argument: argument, - delegate: delegate - } - } - ]; + if (env.allow_yield) { + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_YIELD */ 56); + if (!env.allow_yield) { + error$1(env, /* IllegalYield */ 24); } - exit = 2; - break; + const delegate = maybe(env, /* T_MULT */ 97); + const has_argument = !(Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)); + const argument = delegate || has_argument ? Curry._1(assignment, env) : undefined; + let end_loc; + if (argument !== undefined) { + end_loc = argument[0]; + } else { + const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$1 = loc !== undefined ? loc : start_loc; + semicolon(env); + end_loc = end_loc$1; + } + return [ + btwn(start_loc, end_loc), + { + TAG: /* Yield */ 14, + _0: { + argument: argument, + delegate: delegate + } + } + ]; + } + exit = 2; + break; case /* T_LPAREN */ 3 : case /* T_LESS_THAN */ 89 : - break; + break; default: exit = 2; } @@ -9779,203 +9779,203 @@ function binary_op(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_IN */ 15 : - ret = env.no_in ? undefined : [ - /* In */ 20, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; - case /* T_INSTANCEOF */ 16 : - ret = [ - /* Instanceof */ 21, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; - case /* T_BIT_OR */ 80 : - ret = [ - /* BitOr */ 17, + ret = env.no_in ? undefined : [ + /* In */ 20, { TAG: /* Left_assoc */ 0, - _0: 2 + _0: 6 } ]; - break; + break; + case /* T_INSTANCEOF */ 16 : + ret = [ + /* Instanceof */ 21, + { + TAG: /* Left_assoc */ 0, + _0: 6 + } + ]; + break; + case /* T_BIT_OR */ 80 : + ret = [ + /* BitOr */ 17, + { + TAG: /* Left_assoc */ 0, + _0: 2 + } + ]; + break; case /* T_BIT_XOR */ 81 : - ret = [ - /* Xor */ 18, - { - TAG: /* Left_assoc */ 0, - _0: 3 - } - ]; - break; + ret = [ + /* Xor */ 18, + { + TAG: /* Left_assoc */ 0, + _0: 3 + } + ]; + break; case /* T_BIT_AND */ 82 : - ret = [ - /* BitAnd */ 19, - { - TAG: /* Left_assoc */ 0, - _0: 4 - } - ]; - break; + ret = [ + /* BitAnd */ 19, + { + TAG: /* Left_assoc */ 0, + _0: 4 + } + ]; + break; case /* T_EQUAL */ 83 : - ret = [ - /* Equal */ 0, - { - TAG: /* Left_assoc */ 0, - _0: 5 - } - ]; - break; + ret = [ + /* Equal */ 0, + { + TAG: /* Left_assoc */ 0, + _0: 5 + } + ]; + break; case /* T_NOT_EQUAL */ 84 : - ret = [ - /* NotEqual */ 1, - { - TAG: /* Left_assoc */ 0, - _0: 5 - } - ]; - break; + ret = [ + /* NotEqual */ 1, + { + TAG: /* Left_assoc */ 0, + _0: 5 + } + ]; + break; case /* T_STRICT_EQUAL */ 85 : - ret = [ - /* StrictEqual */ 2, - { - TAG: /* Left_assoc */ 0, - _0: 5 - } - ]; - break; + ret = [ + /* StrictEqual */ 2, + { + TAG: /* Left_assoc */ 0, + _0: 5 + } + ]; + break; case /* T_STRICT_NOT_EQUAL */ 86 : - ret = [ - /* StrictNotEqual */ 3, - { - TAG: /* Left_assoc */ 0, - _0: 5 - } - ]; - break; + ret = [ + /* StrictNotEqual */ 3, + { + TAG: /* Left_assoc */ 0, + _0: 5 + } + ]; + break; case /* T_LESS_THAN_EQUAL */ 87 : - ret = [ - /* LessThanEqual */ 5, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; + ret = [ + /* LessThanEqual */ 5, + { + TAG: /* Left_assoc */ 0, + _0: 6 + } + ]; + break; case /* T_GREATER_THAN_EQUAL */ 88 : - ret = [ - /* GreaterThanEqual */ 7, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; + ret = [ + /* GreaterThanEqual */ 7, + { + TAG: /* Left_assoc */ 0, + _0: 6 + } + ]; + break; case /* T_LESS_THAN */ 89 : - ret = [ - /* LessThan */ 4, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; + ret = [ + /* LessThan */ 4, + { + TAG: /* Left_assoc */ 0, + _0: 6 + } + ]; + break; case /* T_GREATER_THAN */ 90 : - ret = [ - /* GreaterThan */ 6, - { - TAG: /* Left_assoc */ 0, - _0: 6 - } - ]; - break; + ret = [ + /* GreaterThan */ 6, + { + TAG: /* Left_assoc */ 0, + _0: 6 + } + ]; + break; case /* T_LSHIFT */ 91 : - ret = [ - /* LShift */ 8, - { - TAG: /* Left_assoc */ 0, - _0: 7 - } - ]; - break; + ret = [ + /* LShift */ 8, + { + TAG: /* Left_assoc */ 0, + _0: 7 + } + ]; + break; case /* T_RSHIFT */ 92 : - ret = [ - /* RShift */ 9, - { - TAG: /* Left_assoc */ 0, - _0: 7 - } - ]; - break; + ret = [ + /* RShift */ 9, + { + TAG: /* Left_assoc */ 0, + _0: 7 + } + ]; + break; case /* T_RSHIFT3 */ 93 : - ret = [ - /* RShift3 */ 10, - { - TAG: /* Left_assoc */ 0, - _0: 7 - } - ]; - break; + ret = [ + /* RShift3 */ 10, + { + TAG: /* Left_assoc */ 0, + _0: 7 + } + ]; + break; case /* T_PLUS */ 94 : - ret = [ - /* Plus */ 11, - { - TAG: /* Left_assoc */ 0, - _0: 8 - } - ]; - break; + ret = [ + /* Plus */ 11, + { + TAG: /* Left_assoc */ 0, + _0: 8 + } + ]; + break; case /* T_MINUS */ 95 : - ret = [ - /* Minus */ 12, - { - TAG: /* Left_assoc */ 0, - _0: 8 - } - ]; - break; + ret = [ + /* Minus */ 12, + { + TAG: /* Left_assoc */ 0, + _0: 8 + } + ]; + break; case /* T_DIV */ 96 : - ret = [ - /* Div */ 15, - { - TAG: /* Left_assoc */ 0, - _0: 9 - } - ]; - break; + ret = [ + /* Div */ 15, + { + TAG: /* Left_assoc */ 0, + _0: 9 + } + ]; + break; case /* T_MULT */ 97 : - ret = [ - /* Mult */ 13, - { - TAG: /* Left_assoc */ 0, - _0: 9 - } - ]; - break; + ret = [ + /* Mult */ 13, + { + TAG: /* Left_assoc */ 0, + _0: 9 + } + ]; + break; case /* T_EXP */ 98 : - ret = [ - /* Exp */ 14, - { - TAG: /* Right_assoc */ 1, - _0: 10 - } - ]; - break; + ret = [ + /* Exp */ 14, + { + TAG: /* Right_assoc */ 1, + _0: 10 + } + ]; + break; case /* T_MOD */ 99 : - ret = [ - /* Mod */ 16, - { - TAG: /* Left_assoc */ 0, - _0: 9 - } - ]; - break; + ret = [ + /* Mod */ 16, + { + TAG: /* Left_assoc */ 0, + _0: 9 + } + ]; + break; default: ret = undefined; } @@ -10130,7 +10130,7 @@ function arguments$p(env, _acc) { switch (match) { case /* T_RPAREN */ 4 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -10301,34 +10301,34 @@ function elements(env, _acc) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_COMMA */ 8 : - token$4(env, /* T_COMMA */ 8); - _acc = { - hd: undefined, - tl: acc - }; - continue; + token$4(env, /* T_COMMA */ 8); + _acc = { + hd: undefined, + tl: acc + }; + continue; case /* T_ELLIPSIS */ 11 : - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_ELLIPSIS */ 11); - const argument = Curry._1(assignment, env); - const loc = btwn(start_loc, argument[0]); - const elem = { - TAG: /* Spread */ 1, - _0: [ - loc, - { - argument: argument - } - ] - }; - _acc = { - hd: elem, - tl: acc - }; - continue; + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_ELLIPSIS */ 11); + const argument = Curry._1(assignment, env); + const loc = btwn(start_loc, argument[0]); + const elem = { + TAG: /* Spread */ 1, + _0: [ + loc, + { + argument: argument + } + ] + }; + _acc = { + hd: elem, + tl: acc + }; + continue; case /* T_RBRACKET */ 6 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -10368,7 +10368,7 @@ function error_callback$1(param) { case /* StrictParamName */ 28 : case /* NewlineBeforeArrow */ 44 : case /* ParameterAfterRestParameter */ 47 : - return; + return; default: throw new Caml_js_exceptions.MelangeError(Parser_env_Try.Rollback, { MEL_EXN_ID: Parser_env_Try.Rollback @@ -10512,73 +10512,73 @@ function key(env) { const expr = Curry._1(Parse.assignment, with_no_in(false, env)); const end_loc = Curry._2(Parser_env_Peek.loc, undefined, env); token$4(env, /* T_RBRACKET */ 6); - return [ - btwn(start_loc, end_loc), - { - TAG: /* Computed */ 2, - _0: expr - } - ]; - } - - } else { - switch (number_type.TAG) { - case /* T_NUMBER */ 0 : - const raw = Curry._2(Parser_env_Peek.value, undefined, env); - const loc = Curry._2(Parser_env_Peek.loc, undefined, env); - const value = number(env, number_type._0); - const value$1 = { - TAG: /* Number */ 2, - _0: value - }; - return [ - loc, - { - TAG: /* Literal */ 0, - _0: [ - loc, - { - value: value$1, - raw: raw - } - ] - } - ]; - case /* T_STRING */ 1 : - const match = number_type._0; - const octal = match[3]; - const raw$1 = match[2]; - const value$2 = match[1]; - const loc$1 = match[0]; - if (octal) { - strict_error(env, /* StrictOctalLiteral */ 31); + return [ + btwn(start_loc, end_loc), + { + TAG: /* Computed */ 2, + _0: expr + } + ]; + } + + } else { + switch (number_type.TAG) { + case /* T_NUMBER */ 0 : + const raw = Curry._2(Parser_env_Peek.value, undefined, env); + const loc = Curry._2(Parser_env_Peek.loc, undefined, env); + const value = number(env, number_type._0); + const value$1 = { + TAG: /* Number */ 2, + _0: value + }; + return [ + loc, + { + TAG: /* Literal */ 0, + _0: [ + loc, + { + value: value$1, + raw: raw + } + ] } - token$4(env, { - TAG: /* T_STRING */ 1, - _0: [ - loc$1, - value$2, - raw$1, - octal - ] - }); - const value$3 = { - TAG: /* String */ 0, - _0: value$2 - }; - return [ - loc$1, - { - TAG: /* Literal */ 0, + ]; + case /* T_STRING */ 1 : + const match = number_type._0; + const octal = match[3]; + const raw$1 = match[2]; + const value$2 = match[1]; + const loc$1 = match[0]; + if (octal) { + strict_error(env, /* StrictOctalLiteral */ 31); + } + token$4(env, { + TAG: /* T_STRING */ 1, _0: [ loc$1, - { - value: value$3, - raw: raw$1 - } + value$2, + raw$1, + octal ] - } - ]; + }); + const value$3 = { + TAG: /* String */ 0, + _0: value$2 + }; + return [ + loc$1, + { + TAG: /* Literal */ 0, + _0: [ + loc$1, + { + value: value$3, + raw: raw$1 + } + ] + } + ]; } } @@ -10599,42 +10599,42 @@ function _method(env, kind) { let typeParameters; switch (kind) { case /* Init */ 0 : - typeParameters = Curry._1(type_parameter_declaration$1, env); - break; + typeParameters = Curry._1(type_parameter_declaration$1, env); + break; case /* Get */ 1 : case /* Set */ 2 : - typeParameters = undefined; - break; + typeParameters = undefined; + break; } token$4(env, /* T_LPAREN */ 3); let params; switch (kind) { case /* Init */ 0 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 1954, - 16 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 1954, + 16 + ] + }); case /* Get */ 1 : - params = /* [] */ 0; - break; + params = /* [] */ 0; + break; case /* Set */ 2 : - const param = Curry._2(Parse.identifier_with_type, env, /* StrictParamName */ 28); - params = { - hd: [ - param[0], - { - TAG: /* Identifier */ 3, - _0: param - } - ], - tl: /* [] */ 0 - }; - break; + const param = Curry._2(Parse.identifier_with_type, env, /* StrictParamName */ 28); + params = { + hd: [ + param[0], + { + TAG: /* Identifier */ 3, + _0: param + } + ], + tl: /* [] */ 0 + }; + break; } token$4(env, /* T_RPAREN */ 4); @@ -10701,55 +10701,55 @@ function property$1(env) { const key$1 = match$1[1]; switch (key$1.TAG) { case /* Identifier */ 1 : - switch (key$1._0[1].name) { - case "get" : - const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); - let exit$1 = 0; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { - switch (match$2) { - case /* T_LPAREN */ 3 : - case /* T_COLON */ 77 : - case /* T_LESS_THAN */ 89 : - exit$1 = 2; - break; - default: - tmp = get(env, start_loc); - } - } else { + switch (key$1._0[1].name) { + case "get" : + const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); + let exit$1 = 0; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + switch (match$2) { + case /* T_LPAREN */ 3 : + case /* T_COLON */ 77 : + case /* T_LESS_THAN */ 89 : + exit$1 = 2; + break; + default: tmp = get(env, start_loc); - } - if (exit$1 === 2) { - tmp = init(env, start_loc, key$1, false, false); - } - break; - case "set" : - const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); - let exit$2 = 0; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - switch (match$3) { - case /* T_LPAREN */ 3 : - case /* T_COLON */ 77 : - case /* T_LESS_THAN */ 89 : - exit$2 = 2; - break; - default: - tmp = set(env, start_loc); - } - } else { + } + } else { + tmp = get(env, start_loc); + } + if (exit$1 === 2) { + tmp = init(env, start_loc, key$1, false, false); + } + break; + case "set" : + const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); + let exit$2 = 0; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + switch (match$3) { + case /* T_LPAREN */ 3 : + case /* T_COLON */ 77 : + case /* T_LESS_THAN */ 89 : + exit$2 = 2; + break; + default: tmp = set(env, start_loc); - } - if (exit$2 === 2) { - tmp = init(env, start_loc, key$1, false, false); - } - break; - default: - exit = 1; - } - break; + } + } else { + tmp = set(env, start_loc); + } + if (exit$2 === 2) { + tmp = init(env, start_loc, key$1, false, false); + } + break; + default: + exit = 1; + } + break; case /* Literal */ 0 : case /* Computed */ 2 : - exit = 1; - break; + exit = 1; + break; } } @@ -10818,12 +10818,12 @@ function init(env, start_loc, key, async, generator) { switch (match) { case /* T_RCURLY */ 2 : case /* T_COMMA */ 8 : - exit = 2; - break; + exit = 2; + break; case /* T_LPAREN */ 3 : case /* T_LESS_THAN */ 89 : - exit = 3; - break; + exit = 3; + break; default: exit = 1; } @@ -10832,93 +10832,93 @@ function init(env, start_loc, key, async, generator) { } switch (exit) { case 1 : - token$4(env, /* T_COLON */ 77); - match$1 = [ - Curry._1(Parse.assignment, env), - false, - false - ]; - break; + token$4(env, /* T_COLON */ 77); + match$1 = [ + Curry._1(Parse.assignment, env), + false, + false + ]; + break; case 2 : - let tmp; - switch (key.TAG) { - case /* Literal */ 0 : - const lit = key._0; - tmp = [ - lit[0], - { - TAG: /* Literal */ 19, - _0: lit[1] - } - ]; - break; - case /* Identifier */ 1 : - const id = key._0; - tmp = [ - id[0], - { - TAG: /* Identifier */ 18, - _0: id - } - ]; - break; - case /* Computed */ 2 : - tmp = key._0; - break; - - } - match$1 = [ - tmp, - true, - false - ]; - break; - case 3 : - const typeParameters = Curry._1(type_parameter_declaration$1, env); - const match$2 = function_params(env); - const rest = match$2[2]; - const defaults = match$2[1]; - const params = match$2[0]; - const returnType = wrap(annotation_opt, env); - const match$3 = function_body(env, async, generator); - const body = match$3[1]; - const simple = is_simple_function_params(params, defaults, rest); - strict_post_check(env, match$3[2], simple, undefined, params); - let match$4; - match$4 = body.TAG === /* BodyBlock */ 0 ? [ - body._0[0], - false - ] : [ - body._0[0], - true + let tmp; + switch (key.TAG) { + case /* Literal */ 0 : + const lit = key._0; + tmp = [ + lit[0], + { + TAG: /* Literal */ 19, + _0: lit[1] + } ]; - const value_0 = match$4[0]; - const value_1 = { - TAG: /* Function */ 2, - _0: { - id: undefined, - params: params, - defaults: defaults, - rest: rest, - body: body, - async: async, - generator: generator, - predicate: undefined, - expression: match$4[1], - returnType: returnType, - typeParameters: typeParameters - } - }; - const value = [ - value_0, - value_1 - ]; - match$1 = [ - value, - false, + break; + case /* Identifier */ 1 : + const id = key._0; + tmp = [ + id[0], + { + TAG: /* Identifier */ 18, + _0: id + } + ]; + break; + case /* Computed */ 2 : + tmp = key._0; + break; + + } + match$1 = [ + tmp, + true, + false + ]; + break; + case 3 : + const typeParameters = Curry._1(type_parameter_declaration$1, env); + const match$2 = function_params(env); + const rest = match$2[2]; + const defaults = match$2[1]; + const params = match$2[0]; + const returnType = wrap(annotation_opt, env); + const match$3 = function_body(env, async, generator); + const body = match$3[1]; + const simple = is_simple_function_params(params, defaults, rest); + strict_post_check(env, match$3[2], simple, undefined, params); + let match$4; + match$4 = body.TAG === /* BodyBlock */ 0 ? [ + body._0[0], + false + ] : [ + body._0[0], true ]; - break; + const value_0 = match$4[0]; + const value_1 = { + TAG: /* Function */ 2, + _0: { + id: undefined, + params: params, + defaults: defaults, + rest: rest, + body: body, + async: async, + generator: generator, + predicate: undefined, + expression: match$4[1], + returnType: returnType, + typeParameters: typeParameters + } + }; + const value = [ + value_0, + value_1 + ]; + match$1 = [ + value, + false, + true + ]; + break; } const value$1 = match$1[0]; @@ -10945,10 +10945,10 @@ function check_property(env, prop_map, prop) { switch (prop$1.key.TAG) { case /* Literal */ 0 : case /* Identifier */ 1 : - exit = 1; - break; + exit = 1; + break; case /* Computed */ 2 : - return prop_map; + return prop_map; } if (exit === 1) { @@ -10956,42 +10956,42 @@ function check_property(env, prop_map, prop) { let key; switch (match$1.TAG) { case /* Literal */ 0 : - const s = match$1._0[1].value; - if (/* tag */ typeof s === "number" || typeof s === "string") { - key = "null"; - } else { - switch (s.TAG) { - case /* String */ 0 : - key = s._0; - break; - case /* Boolean */ 1 : - const b = s._0; - key = b ? "true" : "false"; - break; - case /* Number */ 2 : - key = Stdlib.string_of_float(s._0); - break; - case /* RegExp */ 3 : - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "RegExp cannot be property key" - }); - - } + const s = match$1._0[1].value; + if (/* tag */ typeof s === "number" || typeof s === "string") { + key = "null"; + } else { + switch (s.TAG) { + case /* String */ 0 : + key = s._0; + break; + case /* Boolean */ 1 : + const b = s._0; + key = b ? "true" : "false"; + break; + case /* Number */ 2 : + key = Stdlib.string_of_float(s._0); + break; + case /* RegExp */ 3 : + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "RegExp cannot be property key" + }); + } - break; + } + break; case /* Identifier */ 1 : - key = match$1._0[1].name; - break; + key = match$1._0[1].name; + break; case /* Computed */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 2103, - 30 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 2103, + 30 + ] + }); } let prev_kinds; @@ -11010,35 +11010,35 @@ function check_property(env, prop_map, prop) { let kind_string; switch (match$2) { case /* Init */ 0 : - kind_string = "Init"; - break; + kind_string = "Init"; + break; case /* Get */ 1 : - kind_string = "Get"; - break; + kind_string = "Get"; + break; case /* Set */ 2 : - kind_string = "Set"; - break; + kind_string = "Set"; + break; } let exit$1 = 0; switch (kind_string) { case "Init" : - if (Curry._2(mem$1, "Init", prev_kinds)) { - strict_error_at(env, [ - prop_loc, - /* StrictDuplicateProperty */ 33 - ]); - } else if (Curry._2(mem$1, "Set", prev_kinds) || Curry._2(mem$1, "Get", prev_kinds)) { - error_at(env, [ - prop_loc, - /* AccessorDataProperty */ 34 - ]); - } - break; + if (Curry._2(mem$1, "Init", prev_kinds)) { + strict_error_at(env, [ + prop_loc, + /* StrictDuplicateProperty */ 33 + ]); + } else if (Curry._2(mem$1, "Set", prev_kinds) || Curry._2(mem$1, "Get", prev_kinds)) { + error_at(env, [ + prop_loc, + /* AccessorDataProperty */ 34 + ]); + } + break; case "Get" : case "Set" : - exit$1 = 2; - break; + exit$1 = 2; + break; } if (exit$1 === 2) { @@ -11070,7 +11070,7 @@ function properties$1(env, _param) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -11182,8 +11182,8 @@ function init$1(env, start_loc, decorators, key, async, generator, $$static) { case /* T_SEMICOLON */ 7 : case /* T_ASSIGN */ 75 : case /* T_COLON */ 77 : - exit = 2; - break; + exit = 2; + break; } } @@ -11250,15 +11250,15 @@ function init$1(env, start_loc, decorators, key, async, generator, $$static) { let kind; switch (key.TAG) { case /* Literal */ 0 : - const match$4 = key._0[1].value; - kind = /* tag */ typeof match$4 === "number" || typeof match$4 === "string" || !(match$4.TAG === /* String */ 0 && match$4._0 === "constructor") ? /* Method */ 1 : /* Constructor */ 0; - break; + const match$4 = key._0[1].value; + kind = /* tag */ typeof match$4 === "number" || typeof match$4 === "string" || !(match$4.TAG === /* String */ 0 && match$4._0 === "constructor") ? /* Method */ 1 : /* Constructor */ 0; + break; case /* Identifier */ 1 : - kind = key._0[1].name === "constructor" ? /* Constructor */ 0 : /* Method */ 1; - break; + kind = key._0[1].name === "constructor" ? /* Constructor */ 0 : /* Method */ 1; + break; case /* Computed */ 2 : - kind = /* Method */ 1; - break; + kind = /* Method */ 1; + break; } return { @@ -11287,55 +11287,55 @@ function class_element(env) { const key$1 = match[1]; switch (key$1.TAG) { case /* Identifier */ 1 : - switch (key$1._0[1].name) { - case "get" : - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); - let exit = 0; - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - return get$1(env, start_loc, decorators, $$static); - } - switch (match$1) { - case /* T_LPAREN */ 3 : - case /* T_SEMICOLON */ 7 : - case /* T_ASSIGN */ 75 : - case /* T_COLON */ 77 : - case /* T_LESS_THAN */ 89 : - exit = 2; - break; - default: - return get$1(env, start_loc, decorators, $$static); - } - if (exit === 2) { - return init$1(env, start_loc, decorators, key$1, async, generator$1, $$static); - } + switch (key$1._0[1].name) { + case "get" : + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); + let exit = 0; + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + return get$1(env, start_loc, decorators, $$static); + } + switch (match$1) { + case /* T_LPAREN */ 3 : + case /* T_SEMICOLON */ 7 : + case /* T_ASSIGN */ 75 : + case /* T_COLON */ 77 : + case /* T_LESS_THAN */ 89 : + exit = 2; break; - case "set" : - const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); - let exit$1 = 0; - if (!/* tag */ (typeof match$2 === "number" || typeof match$2 === "string")) { - return set$1(env, start_loc, decorators, $$static); - } - switch (match$2) { - case /* T_LPAREN */ 3 : - case /* T_SEMICOLON */ 7 : - case /* T_ASSIGN */ 75 : - case /* T_COLON */ 77 : - case /* T_LESS_THAN */ 89 : - exit$1 = 2; - break; - default: - return set$1(env, start_loc, decorators, $$static); - } - if (exit$1 === 2) { - return init$1(env, start_loc, decorators, key$1, async, generator$1, $$static); - } + default: + return get$1(env, start_loc, decorators, $$static); + } + if (exit === 2) { + return init$1(env, start_loc, decorators, key$1, async, generator$1, $$static); + } + break; + case "set" : + const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); + let exit$1 = 0; + if (!/* tag */ (typeof match$2 === "number" || typeof match$2 === "string")) { + return set$1(env, start_loc, decorators, $$static); + } + switch (match$2) { + case /* T_LPAREN */ 3 : + case /* T_SEMICOLON */ 7 : + case /* T_ASSIGN */ 75 : + case /* T_COLON */ 77 : + case /* T_LESS_THAN */ 89 : + exit$1 = 2; break; - - } - break; + default: + return set$1(env, start_loc, decorators, $$static); + } + if (exit$1 === 2) { + return init$1(env, start_loc, decorators, key$1, async, generator$1, $$static); + } + break; + + } + break; case /* Literal */ 0 : case /* Computed */ 2 : - break; + break; } } @@ -11349,11 +11349,11 @@ function elements$1(env, _acc) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_SEMICOLON */ 7 : - token$4(env, /* T_SEMICOLON */ 7); - continue; + token$4(env, /* T_SEMICOLON */ 7); + continue; case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); default: _acc = { hd: Curry._1(class_element, env), @@ -11453,11 +11453,11 @@ function class_expression(env) { case /* T_LCURLY */ 1 : case /* T_EXTENDS */ 39 : case /* T_LESS_THAN */ 89 : - match$1 = [ - undefined, - undefined - ]; - break; + match$1 = [ + undefined, + undefined + ]; + break; default: exit = 1; } @@ -11595,130 +11595,130 @@ function declare(in_moduleOpt, env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_IDENTIFIER */ 0 : - if (Curry._2(Parser_env_Peek.value, 1, env) === "module") { - token$4(env, /* T_DECLARE */ 58); - contextual(env, "module"); - if (in_module || Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_PERIOD */ 9)) { - token$4(env, /* T_PERIOD */ 9); - contextual(env, "exports"); - const type_annot = wrap(annotation, env); - const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc = loc !== undefined ? loc : type_annot[0]; - semicolon(env); - const loc$1 = btwn(start_loc, end_loc); - return [ - loc$1, - { - TAG: /* DeclareModuleExports */ 26, - _0: type_annot - } - ]; + if (Curry._2(Parser_env_Peek.value, 1, env) === "module") { + token$4(env, /* T_DECLARE */ 58); + contextual(env, "module"); + if (in_module || Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_PERIOD */ 9)) { + token$4(env, /* T_PERIOD */ 9); + contextual(env, "exports"); + const type_annot = wrap(annotation, env); + const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc = loc !== undefined ? loc : type_annot[0]; + semicolon(env); + const loc$1 = btwn(start_loc, end_loc); + return [ + loc$1, + { + TAG: /* DeclareModuleExports */ 26, + _0: type_annot + } + ]; + } else { + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); + let id; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* T_STRING */ 1) { + id = { + TAG: /* Identifier */ 0, + _0: Curry._2(Parse.identifier, undefined, env) + }; } else { - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); - let id; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* T_STRING */ 1) { - id = { - TAG: /* Identifier */ 0, - _0: Curry._2(Parse.identifier, undefined, env) - }; - } else { - const match$2 = match$1._0; - const octal = match$2[3]; - const raw = match$2[2]; - const value = match$2[1]; - const loc$2 = match$2[0]; - if (octal) { - strict_error(env, /* StrictOctalLiteral */ 31); - } - token$4(env, { - TAG: /* T_STRING */ 1, - _0: [ - loc$2, - value, - raw, - octal - ] - }); - const value$1 = { - TAG: /* String */ 0, - _0: value - }; - id = { - TAG: /* Literal */ 1, - _0: [ - loc$2, - { - value: value$1, - raw: raw - } - ] - }; + const match$2 = match$1._0; + const octal = match$2[3]; + const raw = match$2[2]; + const value = match$2[1]; + const loc$2 = match$2[0]; + if (octal) { + strict_error(env, /* StrictOctalLiteral */ 31); } - const body_start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_LCURLY */ 1); - const match$3 = module_items(env, undefined, /* [] */ 0); - const module_kind = match$3[0]; - token$4(env, /* T_RCURLY */ 2); - const body_end_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - const body_loc = btwn(body_start_loc, body_end_loc); - const body_1 = { - body: match$3[1] + token$4(env, { + TAG: /* T_STRING */ 1, + _0: [ + loc$2, + value, + raw, + octal + ] + }); + const value$1 = { + TAG: /* String */ 0, + _0: value }; - const body = [ - body_loc, - body_1 - ]; - const loc$3 = btwn(start_loc, body_loc); - const kind = module_kind !== undefined ? module_kind : ({ - TAG: /* CommonJS */ 0, - _0: loc$3 - }); - return [ - loc$3, - { - TAG: /* DeclareModule */ 25, - _0: { - id: id, - body: body, - kind: kind + id = { + TAG: /* Literal */ 1, + _0: [ + loc$2, + { + value: value$1, + raw: raw } - } - ]; + ] + }; } + const body_start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_LCURLY */ 1); + const match$3 = module_items(env, undefined, /* [] */ 0); + const module_kind = match$3[0]; + token$4(env, /* T_RCURLY */ 2); + const body_end_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + const body_loc = btwn(body_start_loc, body_end_loc); + const body_1 = { + body: match$3[1] + }; + const body = [ + body_loc, + body_1 + ]; + const loc$3 = btwn(start_loc, body_loc); + const kind = module_kind !== undefined ? module_kind : ({ + TAG: /* CommonJS */ 0, + _0: loc$3 + }); + return [ + loc$3, + { + TAG: /* DeclareModule */ 25, + _0: { + id: id, + body: body, + kind: kind + } + } + ]; } - break; + } + break; case /* T_FUNCTION */ 13 : - token$4(env, /* T_DECLARE */ 58); - return declare_function_statement(env, start_loc); + token$4(env, /* T_DECLARE */ 58); + return declare_function_statement(env, start_loc); case /* T_VAR */ 22 : - token$4(env, /* T_DECLARE */ 58); - return declare_var_statement(env, start_loc); + token$4(env, /* T_DECLARE */ 58); + return declare_var_statement(env, start_loc); case /* T_CLASS */ 38 : - token$4(env, /* T_DECLARE */ 58); - const match$4 = Curry._2(declare_class, env, start_loc); - return [ - match$4[0], - { - TAG: /* DeclareClass */ 24, - _0: match$4[1] - } - ]; - case /* T_EXPORT */ 47 : - if (in_module) { - return declare_export_declaration(in_module, env); + token$4(env, /* T_DECLARE */ 58); + const match$4 = Curry._2(declare_class, env, start_loc); + return [ + match$4[0], + { + TAG: /* DeclareClass */ 24, + _0: match$4[1] } - break; + ]; + case /* T_EXPORT */ 47 : + if (in_module) { + return declare_export_declaration(in_module, env); + } + break; case /* T_INTERFACE */ 51 : - token$4(env, /* T_DECLARE */ 58); - return $$interface(env); + token$4(env, /* T_DECLARE */ 58); + return $$interface(env); case /* T_TYPE */ 59 : - token$4(env, /* T_DECLARE */ 58); - return type_alias(env); + token$4(env, /* T_DECLARE */ 58); + return type_alias(env); case /* T_ASYNC */ 61 : - token$4(env, /* T_DECLARE */ 58); - error$1(env, /* DeclareAsync */ 49); - token$4(env, /* T_ASYNC */ 61); - return declare_function_statement(env, start_loc); + token$4(env, /* T_DECLARE */ 58); + error$1(env, /* DeclareAsync */ 49); + token$4(env, /* T_ASYNC */ 61); + return declare_function_statement(env, start_loc); } } @@ -11743,10 +11743,10 @@ function export_specifiers_and_errs(env, _specifiers, _errs) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return [ - Stdlib__List.rev(specifiers), - Stdlib__List.rev(errs) - ]; + return [ + Stdlib__List.rev(specifiers), + Stdlib__List.rev(errs) + ]; } } @@ -11829,281 +11829,281 @@ function declare_export_declaration(allow_export_typeOpt, env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_DEFAULT */ 34 : - token$4(env$1, /* T_DEFAULT */ 34); - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env$1); - let match$2; - let exit$1 = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - switch (match$1) { - case /* T_FUNCTION */ 13 : - const fn = declare_function(env$1, start_loc); - match$2 = [ - fn[0], - { - TAG: /* Function */ 1, - _0: fn - } - ]; - break; - case /* T_CLASS */ 38 : - const _class = Curry._2(declare_class, env$1, start_loc); - match$2 = [ - _class[0], - { - TAG: /* Class */ 2, - _0: _class - } - ]; - break; - default: - exit$1 = 3; - } - } else { - exit$1 = 3; - } - if (exit$1 === 3) { - const _type$1 = wrap(_type, env$1); - const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc = loc !== undefined ? loc : _type$1[0]; - semicolon(env$1); - match$2 = [ - end_loc, - { - TAG: /* DefaultType */ 3, - _0: _type$1 - } - ]; + token$4(env$1, /* T_DEFAULT */ 34); + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env$1); + let match$2; + let exit$1 = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + switch (match$1) { + case /* T_FUNCTION */ 13 : + const fn = declare_function(env$1, start_loc); + match$2 = [ + fn[0], + { + TAG: /* Function */ 1, + _0: fn + } + ]; + break; + case /* T_CLASS */ 38 : + const _class = Curry._2(declare_class, env$1, start_loc); + match$2 = [ + _class[0], + { + TAG: /* Class */ 2, + _0: _class + } + ]; + break; + default: + exit$1 = 3; } - return [ - btwn(start_loc, match$2[0]), + } else { + exit$1 = 3; + } + if (exit$1 === 3) { + const _type$1 = wrap(_type, env$1); + const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc = loc !== undefined ? loc : _type$1[0]; + semicolon(env$1); + match$2 = [ + end_loc, { - TAG: /* DeclareExportDeclaration */ 27, - _0: { - default: true, - declaration: match$2[1], - specifiers: undefined, - source: undefined - } + TAG: /* DefaultType */ 3, + _0: _type$1 } ]; + } + return [ + btwn(start_loc, match$2[0]), + { + TAG: /* DeclareExportDeclaration */ 27, + _0: { + default: true, + declaration: match$2[1], + specifiers: undefined, + source: undefined + } + } + ]; case /* T_FUNCTION */ 13 : case /* T_VAR */ 22 : case /* T_CONST */ 25 : case /* T_LET */ 26 : case /* T_CLASS */ 38 : - exit = 2; - break; + exit = 2; + break; case /* T_INTERFACE */ 51 : - if (allow_export_type) { - const match$3 = Curry._1(interface_helper, env$1); - const iface_loc = match$3[0]; - const loc$1 = btwn(start_loc, iface_loc); - return [ - loc$1, - { - TAG: /* DeclareExportDeclaration */ 27, - _0: { - default: false, - declaration: { - TAG: /* Interface */ 5, - _0: [ - iface_loc, - match$3[1] - ] - }, - specifiers: undefined, - source: undefined - } + if (allow_export_type) { + const match$3 = Curry._1(interface_helper, env$1); + const iface_loc = match$3[0]; + const loc$1 = btwn(start_loc, iface_loc); + return [ + loc$1, + { + TAG: /* DeclareExportDeclaration */ 27, + _0: { + default: false, + declaration: { + TAG: /* Interface */ 5, + _0: [ + iface_loc, + match$3[1] + ] + }, + specifiers: undefined, + source: undefined } - ]; - } - exit = 1; - break; + } + ]; + } + exit = 1; + break; case /* T_TYPE */ 59 : - if (allow_export_type) { - const match$4 = type_alias_helper(env$1); - const alias_loc = match$4[0]; - const loc$2 = btwn(start_loc, alias_loc); - return [ - loc$2, - { - TAG: /* DeclareExportDeclaration */ 27, - _0: { - default: false, - declaration: { - TAG: /* NamedType */ 4, - _0: [ - alias_loc, - match$4[1] - ] - }, - specifiers: undefined, - source: undefined - } - } - ]; - } - exit = 1; - break; - case /* T_MULT */ 97 : - const loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env$1); - token$4(env$1, /* T_MULT */ 97); - const parse_export_star_as = env$1.parse_options.esproposal_export_star_as; - const local_name = Curry._2(Parser_env_Peek.value, undefined, env$1) === "as" ? (contextual(env$1, "as"), parse_export_star_as ? Curry._2(Parse.identifier, undefined, env$1) : (error$1(env$1, /* UnexpectedTypeDeclaration */ 7), undefined)) : undefined; - const specifiers = { - TAG: /* ExportBatchSpecifier */ 1, - _0: loc$3, - _1: local_name - }; - const source = export_source(env$1); - const loc$4 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc$1 = loc$4 !== undefined ? loc$4 : source[0]; - const source$1 = source; - semicolon(env$1); + if (allow_export_type) { + const match$4 = type_alias_helper(env$1); + const alias_loc = match$4[0]; + const loc$2 = btwn(start_loc, alias_loc); return [ - btwn(start_loc, end_loc$1), + loc$2, { TAG: /* DeclareExportDeclaration */ 27, _0: { default: false, - declaration: undefined, - specifiers: specifiers, - source: source$1 + declaration: { + TAG: /* NamedType */ 4, + _0: [ + alias_loc, + match$4[1] + ] + }, + specifiers: undefined, + source: undefined } } ]; - default: - exit = 1; - } - } else { - exit = 1; - } - switch (exit) { - case 1 : - const match$5 = Curry._2(Parser_env_Peek.token, undefined, env$1); - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - switch (match$5) { - case /* T_INTERFACE */ 51 : - error$1(env$1, /* DeclareExportInterface */ 53); - break; - case /* T_TYPE */ 59 : - error$1(env$1, /* DeclareExportType */ 52); - break; - - } } - token$4(env$1, /* T_LCURLY */ 1); - const match$6 = export_specifiers_and_errs(env$1, /* [] */ 0, /* [] */ 0); - const specifiers$1 = { - TAG: /* ExportSpecifiers */ 0, - _0: match$6[0] + exit = 1; + break; + case /* T_MULT */ 97 : + const loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env$1); + token$4(env$1, /* T_MULT */ 97); + const parse_export_star_as = env$1.parse_options.esproposal_export_star_as; + const local_name = Curry._2(Parser_env_Peek.value, undefined, env$1) === "as" ? (contextual(env$1, "as"), parse_export_star_as ? Curry._2(Parse.identifier, undefined, env$1) : (error$1(env$1, /* UnexpectedTypeDeclaration */ 7), undefined)) : undefined; + const specifiers = { + TAG: /* ExportBatchSpecifier */ 1, + _0: loc$3, + _1: local_name }; - const end_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env$1); - token$4(env$1, /* T_RCURLY */ 2); - const source$2 = Curry._2(Parser_env_Peek.value, undefined, env$1) === "from" ? export_source(env$1) : (Stdlib__List.iter((function (param) { - return error_at(env$1, param); - }), match$6[1]), undefined); - const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc$3 = loc$5 !== undefined ? loc$5 : ( - source$2 !== undefined ? source$2[0] : end_loc$2 - ); + const source = export_source(env$1); + const loc$4 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc$1 = loc$4 !== undefined ? loc$4 : source[0]; + const source$1 = source; semicolon(env$1); return [ - btwn(start_loc, end_loc$3), + btwn(start_loc, end_loc$1), { TAG: /* DeclareExportDeclaration */ 27, _0: { default: false, declaration: undefined, - specifiers: specifiers$1, - source: source$2 + specifiers: specifiers, + source: source$1 } } ]; + default: + exit = 1; + } + } else { + exit = 1; + } + switch (exit) { + case 1 : + const match$5 = Curry._2(Parser_env_Peek.token, undefined, env$1); + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + switch (match$5) { + case /* T_INTERFACE */ 51 : + error$1(env$1, /* DeclareExportInterface */ 53); + break; + case /* T_TYPE */ 59 : + error$1(env$1, /* DeclareExportType */ 52); + break; + + } + } + token$4(env$1, /* T_LCURLY */ 1); + const match$6 = export_specifiers_and_errs(env$1, /* [] */ 0, /* [] */ 0); + const specifiers$1 = { + TAG: /* ExportSpecifiers */ 0, + _0: match$6[0] + }; + const end_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env$1); + token$4(env$1, /* T_RCURLY */ 2); + const source$2 = Curry._2(Parser_env_Peek.value, undefined, env$1) === "from" ? export_source(env$1) : (Stdlib__List.iter((function (param) { + return error_at(env$1, param); + }), match$6[1]), undefined); + const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc$3 = loc$5 !== undefined ? loc$5 : ( + source$2 !== undefined ? source$2[0] : end_loc$2 + ); + semicolon(env$1); + return [ + btwn(start_loc, end_loc$3), + { + TAG: /* DeclareExportDeclaration */ 27, + _0: { + default: false, + declaration: undefined, + specifiers: specifiers$1, + source: source$2 + } + } + ]; case 2 : - const token$5 = Curry._2(Parser_env_Peek.token, undefined, env$1); - let match$7; - let exit$2 = 0; + const token$5 = Curry._2(Parser_env_Peek.token, undefined, env$1); + let match$7; + let exit$2 = 0; + if (/* tag */ typeof token$5 === "number" || typeof token$5 === "string") { + switch (token$5) { + case /* T_FUNCTION */ 13 : + const fn$1 = declare_function(env$1, start_loc); + match$7 = [ + fn$1[0], + { + TAG: /* Function */ 1, + _0: fn$1 + } + ]; + break; + case /* T_VAR */ 22 : + case /* T_CONST */ 25 : + case /* T_LET */ 26 : + exit$2 = 3; + break; + case /* T_CLASS */ 38 : + const _class$1 = Curry._2(declare_class, env$1, start_loc); + match$7 = [ + _class$1[0], + { + TAG: /* Class */ 2, + _0: _class$1 + } + ]; + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 3480, + 17 + ] + }); + } + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 3480, + 17 + ] + }); + } + if (exit$2 === 3) { if (/* tag */ typeof token$5 === "number" || typeof token$5 === "string") { switch (token$5) { - case /* T_FUNCTION */ 13 : - const fn$1 = declare_function(env$1, start_loc); - match$7 = [ - fn$1[0], - { - TAG: /* Function */ 1, - _0: fn$1 - } - ]; - break; - case /* T_VAR */ 22 : case /* T_CONST */ 25 : + error$1(env$1, /* DeclareExportConst */ 51); + break; case /* T_LET */ 26 : - exit$2 = 3; - break; - case /* T_CLASS */ 38 : - const _class$1 = Curry._2(declare_class, env$1, start_loc); - match$7 = [ - _class$1[0], - { - TAG: /* Class */ 2, - _0: _class$1 - } - ]; - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 3480, - 17 - ] - }); - } - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 3480, - 17 - ] - }); - } - if (exit$2 === 3) { - if (/* tag */ typeof token$5 === "number" || typeof token$5 === "string") { - switch (token$5) { - case /* T_CONST */ 25 : - error$1(env$1, /* DeclareExportConst */ 51); - break; - case /* T_LET */ 26 : - error$1(env$1, /* DeclareExportLet */ 50); - break; - - } + error$1(env$1, /* DeclareExportLet */ 50); + break; + } - const $$var = declare_var(env$1, start_loc); - match$7 = [ - $$var[0], - { - TAG: /* Variable */ 0, - _0: $$var - } - ]; } - return [ - btwn(start_loc, match$7[0]), + const $$var = declare_var(env$1, start_loc); + match$7 = [ + $$var[0], { - TAG: /* DeclareExportDeclaration */ 27, - _0: { - default: false, - declaration: match$7[1], - specifiers: undefined, - source: undefined - } + TAG: /* Variable */ 0, + _0: $$var } ]; + } + return [ + btwn(start_loc, match$7[0]), + { + TAG: /* DeclareExportDeclaration */ 27, + _0: { + default: false, + declaration: match$7[1], + specifiers: undefined, + source: undefined + } + } + ]; } } @@ -12308,10 +12308,10 @@ function module_items(env, _module_kind, _acc) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return [ - module_kind, - Stdlib__List.rev(acc) - ]; + return [ + module_kind, + Stdlib__List.rev(acc) + ]; } } @@ -12326,24 +12326,24 @@ function module_items(env, _module_kind, _acc) { } else { switch (stmt$1.TAG) { case /* DeclareModuleExports */ 26 : - error$1(env, /* DuplicateDeclareModuleExports */ 60); - module_kind$1 = module_kind; - break; + error$1(env, /* DuplicateDeclareModuleExports */ 60); + module_kind$1 = module_kind; + break; case /* DeclareExportDeclaration */ 27 : - const declaration = stmt$1._0.declaration; - if (declaration !== undefined) { - switch (declaration.TAG) { - case /* NamedType */ 4 : - case /* Interface */ 5 : - break; - default: - error$1(env, /* AmbiguousDeclareModuleKind */ 61); - } - } else { - error$1(env, /* AmbiguousDeclareModuleKind */ 61); + const declaration = stmt$1._0.declaration; + if (declaration !== undefined) { + switch (declaration.TAG) { + case /* NamedType */ 4 : + case /* Interface */ 5 : + break; + default: + error$1(env, /* AmbiguousDeclareModuleKind */ 61); } - module_kind$1 = module_kind; - break; + } else { + error$1(env, /* AmbiguousDeclareModuleKind */ 61); + } + module_kind$1 = module_kind; + break; default: module_kind$1 = module_kind; } @@ -12359,32 +12359,32 @@ function module_items(env, _module_kind, _acc) { } else { switch (stmt$1.TAG) { case /* DeclareModuleExports */ 26 : + module_kind$1 = { + TAG: /* CommonJS */ 0, + _0: loc + }; + break; + case /* DeclareExportDeclaration */ 27 : + const declaration$1 = stmt$1._0.declaration; + if (declaration$1 !== undefined) { + switch (declaration$1.TAG) { + case /* NamedType */ 4 : + case /* Interface */ 5 : + module_kind$1 = module_kind; + break; + default: + module_kind$1 = { + TAG: /* ES */ 1, + _0: loc + }; + } + } else { module_kind$1 = { - TAG: /* CommonJS */ 0, + TAG: /* ES */ 1, _0: loc }; - break; - case /* DeclareExportDeclaration */ 27 : - const declaration$1 = stmt$1._0.declaration; - if (declaration$1 !== undefined) { - switch (declaration$1.TAG) { - case /* NamedType */ 4 : - case /* Interface */ 5 : - module_kind$1 = module_kind; - break; - default: - module_kind$1 = { - TAG: /* ES */ 1, - _0: loc - }; - } - } else { - module_kind$1 = { - TAG: /* ES */ 1, - _0: loc - }; - } - break; + } + break; default: module_kind$1 = module_kind; } @@ -12403,41 +12403,41 @@ function fold(acc) { const match = param[1]; switch (match.TAG) { case /* Object */ 0 : - return Stdlib__List.fold_left((function (acc, prop) { - if (prop.TAG === /* Property */ 0) { - return fold(acc)(prop._0[1].pattern); - } else { - return fold(acc)(prop._0[1].argument); - } - }), acc, match._0.properties); + return Stdlib__List.fold_left((function (acc, prop) { + if (prop.TAG === /* Property */ 0) { + return fold(acc)(prop._0[1].pattern); + } else { + return fold(acc)(prop._0[1].argument); + } + }), acc, match._0.properties); case /* Array */ 1 : - return Stdlib__List.fold_left((function (acc, elem) { - if (elem !== undefined) { - if (elem.TAG === /* Element */ 0) { - return fold(acc)(elem._0); - } else { - return fold(acc)(elem._0[1].argument); - } + return Stdlib__List.fold_left((function (acc, elem) { + if (elem !== undefined) { + if (elem.TAG === /* Element */ 0) { + return fold(acc)(elem._0); } else { - return acc; + return fold(acc)(elem._0[1].argument); } - }), acc, match._0.elements); + } else { + return acc; + } + }), acc, match._0.elements); case /* Assignment */ 2 : - return fold(acc)(match._0.left); + return fold(acc)(match._0.left); case /* Identifier */ 3 : - const match$1 = match._0; - return { - hd: [ - match$1[0], - match$1[1].name - ], - tl: acc - }; + const match$1 = match._0; + return { + hd: [ + match$1[0], + match$1[1].name + ], + tl: acc + }; case /* Expression */ 4 : - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Parser error: No such thing as an expression pattern!" - }); + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Parser error: No such thing as an expression pattern!" + }); } }; @@ -12507,7 +12507,7 @@ function case_list(env, _param) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -12535,7 +12535,7 @@ function case_list(env, _param) { case /* T_RCURLY */ 2 : case /* T_CASE */ 31 : case /* T_DEFAULT */ 34 : - return true; + return true; default: return false; } @@ -12637,7 +12637,7 @@ function specifier_list(env, _acc) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -12737,111 +12737,111 @@ function from_expr(env, param) { if (!/* tag */ (typeof expr === "number" || typeof expr === "string")) { switch (expr.TAG) { case /* Array */ 0 : - let param$1 = [ - loc, - expr._0 - ]; - const elements = Stdlib__List.map(element(env), param$1[1].elements); - return [ - param$1[0], - { - TAG: /* Array */ 1, - _0: { - elements: elements, - typeAnnotation: undefined - } + let param$1 = [ + loc, + expr._0 + ]; + const elements = Stdlib__List.map(element(env), param$1[1].elements); + return [ + param$1[0], + { + TAG: /* Array */ 1, + _0: { + elements: elements, + typeAnnotation: undefined } - ]; + } + ]; case /* Object */ 1 : - let param$2 = [ - loc, - expr._0 - ]; - const properties = Stdlib__List.map((function (param) { - if (param.TAG === /* Property */ 0) { - const match = param._0; - const match$1 = match[1]; - const key = match$1.key; - let key$1; - switch (key.TAG) { - case /* Literal */ 0 : - key$1 = { - TAG: /* Literal */ 0, - _0: key._0 - }; - break; - case /* Identifier */ 1 : - key$1 = { - TAG: /* Identifier */ 1, - _0: key._0 - }; - break; - case /* Computed */ 2 : - key$1 = { - TAG: /* Computed */ 2, - _0: key._0 - }; - break; - - } - const pattern = Curry._2(Parse.pattern_from_expr, env, match$1.value); - return { - TAG: /* Property */ 0, - _0: [ - match[0], - { - key: key$1, - pattern: pattern, - shorthand: match$1.shorthand - } - ] - }; + let param$2 = [ + loc, + expr._0 + ]; + const properties = Stdlib__List.map((function (param) { + if (param.TAG === /* Property */ 0) { + const match = param._0; + const match$1 = match[1]; + const key = match$1.key; + let key$1; + switch (key.TAG) { + case /* Literal */ 0 : + key$1 = { + TAG: /* Literal */ 0, + _0: key._0 + }; + break; + case /* Identifier */ 1 : + key$1 = { + TAG: /* Identifier */ 1, + _0: key._0 + }; + break; + case /* Computed */ 2 : + key$1 = { + TAG: /* Computed */ 2, + _0: key._0 + }; + break; + } - const match$2 = param._0; - const argument = Curry._2(Parse.pattern_from_expr, env, match$2[1].argument); + const pattern = Curry._2(Parse.pattern_from_expr, env, match$1.value); return { - TAG: /* SpreadProperty */ 1, + TAG: /* Property */ 0, _0: [ - match$2[0], + match[0], { - argument: argument + key: key$1, + pattern: pattern, + shorthand: match$1.shorthand } ] }; - }), param$2[1].properties); - return [ - param$2[0], - { - TAG: /* Object */ 0, - _0: { - properties: properties, - typeAnnotation: undefined } + const match$2 = param._0; + const argument = Curry._2(Parse.pattern_from_expr, env, match$2[1].argument); + return { + TAG: /* SpreadProperty */ 1, + _0: [ + match$2[0], + { + argument: argument + } + ] + }; + }), param$2[1].properties); + return [ + param$2[0], + { + TAG: /* Object */ 0, + _0: { + properties: properties, + typeAnnotation: undefined } - ]; - case /* Assignment */ 7 : - const match = expr._0; - if (match.operator === /* Assign */ 0) { - return [ - loc, - { - TAG: /* Assignment */ 2, - _0: { - left: match.left, - right: match.right - } - } - ]; } - break; - case /* Identifier */ 18 : + ]; + case /* Assignment */ 7 : + const match = expr._0; + if (match.operator === /* Assign */ 0) { return [ loc, { - TAG: /* Identifier */ 3, - _0: expr._0 + TAG: /* Assignment */ 2, + _0: { + left: match.left, + right: match.right + } } ]; + } + break; + case /* Identifier */ 18 : + return [ + loc, + { + TAG: /* Identifier */ 3, + _0: expr._0 + } + ]; } } @@ -12878,23 +12878,23 @@ function _object$2(restricted_error) { let key; switch (lit.TAG) { case /* Literal */ 0 : - key = { - TAG: /* Literal */ 0, - _0: lit._0 - }; - break; + key = { + TAG: /* Literal */ 0, + _0: lit._0 + }; + break; case /* Identifier */ 1 : - key = { - TAG: /* Identifier */ 1, - _0: lit._0 - }; - break; + key = { + TAG: /* Identifier */ 1, + _0: lit._0 + }; + break; case /* Computed */ 2 : - key = { - TAG: /* Computed */ 2, - _0: lit._0 - }; - break; + key = { + TAG: /* Computed */ 2, + _0: lit._0 + }; + break; } const match$1 = Curry._2(Parser_env_Peek.token, undefined, env); @@ -12906,32 +12906,32 @@ function _object$2(restricted_error) { pattern$1(env, restricted_error), false ]; - } else { - exit = 1; - } - if (exit === 1) { - switch (key.TAG) { - case /* Identifier */ 1 : - const id = key._0; - const pattern_0 = id[0]; - const pattern_1 = { - TAG: /* Identifier */ 3, - _0: id - }; - const pattern$2 = [ - pattern_0, - pattern_1 - ]; - prop = [ - pattern$2, - true - ]; - break; + } else { + exit = 1; + } + if (exit === 1) { + switch (key.TAG) { + case /* Identifier */ 1 : + const id = key._0; + const pattern_0 = id[0]; + const pattern_1 = { + TAG: /* Identifier */ 3, + _0: id + }; + const pattern$2 = [ + pattern_0, + pattern_1 + ]; + prop = [ + pattern$2, + true + ]; + break; case /* Literal */ 0 : case /* Computed */ 2 : - error_unexpected(env); - prop = undefined; - break; + error_unexpected(env); + prop = undefined; + break; } } @@ -12979,7 +12979,7 @@ function _object$2(restricted_error) { switch (match) { case /* T_RCURLY */ 2 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -13037,34 +13037,34 @@ function _array(restricted_error) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_COMMA */ 8 : - token$4(env, /* T_COMMA */ 8); - _acc = { - hd: undefined, - tl: acc - }; - continue; + token$4(env, /* T_COMMA */ 8); + _acc = { + hd: undefined, + tl: acc + }; + continue; case /* T_ELLIPSIS */ 11 : - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_ELLIPSIS */ 11); - const argument = pattern$1(env, restricted_error); - const loc = btwn(start_loc, argument[0]); - const element = { - TAG: /* Spread */ 1, - _0: [ - loc, - { - argument: argument - } - ] - }; - _acc = { - hd: element, - tl: acc - }; - continue; + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_ELLIPSIS */ 11); + const argument = pattern$1(env, restricted_error); + const loc = btwn(start_loc, argument[0]); + const element = { + TAG: /* Spread */ 1, + _0: [ + loc, + { + argument: argument + } + ] + }; + _acc = { + hd: element, + tl: acc + }; + continue; case /* T_RBRACKET */ 6 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -13139,9 +13139,9 @@ function pattern$1(env, restricted_error) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_LCURLY */ 1 : - return _object$2(restricted_error)(env); + return _object$2(restricted_error)(env); case /* T_LBRACKET */ 5 : - return _array(restricted_error)(env); + return _array(restricted_error)(env); } } @@ -13253,39 +13253,39 @@ function name(env) { } switch (match) { case /* T_PERIOD */ 9 : - const _object = { - TAG: /* Identifier */ 0, - _0: name$1 - }; - token$4(env, /* T_PERIOD */ 9); - const property = identifier$1(env); - const loc = btwn(name$1[0], property[0]); - const member_1 = { - _object: _object, - property: property - }; - const member = [ - loc, - member_1 - ]; - return { - TAG: /* MemberExpression */ 2, - _0: member_expression(env, member) - }; + const _object = { + TAG: /* Identifier */ 0, + _0: name$1 + }; + token$4(env, /* T_PERIOD */ 9); + const property = identifier$1(env); + const loc = btwn(name$1[0], property[0]); + const member_1 = { + _object: _object, + property: property + }; + const member = [ + loc, + member_1 + ]; + return { + TAG: /* MemberExpression */ 2, + _0: member_expression(env, member) + }; case /* T_COLON */ 77 : - token$4(env, /* T_COLON */ 77); - const name$2 = identifier$1(env); - const loc$1 = btwn(name$1[0], name$2[0]); - return { - TAG: /* NamespacedName */ 1, - _0: [ - loc$1, - { - namespace: name$1, - name: name$2 - } - ] - }; + token$4(env, /* T_COLON */ 77); + const name$2 = identifier$1(env); + const loc$1 = btwn(name$1[0], name$2[0]); + return { + TAG: /* NamespacedName */ 1, + _0: [ + loc$1, + { + namespace: name$1, + name: name$2 + } + ] + }; default: return { TAG: /* Identifier */ 0, @@ -13412,19 +13412,19 @@ function attributes(env, _acc) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_LCURLY */ 1 : - const attribute$1 = { - TAG: /* SpreadAttribute */ 1, - _0: spread_attribute(env) - }; - _acc = { - hd: attribute$1, - tl: acc - }; - continue; + const attribute$1 = { + TAG: /* SpreadAttribute */ 1, + _0: spread_attribute(env) + }; + _acc = { + hd: attribute$1, + tl: acc + }; + continue; case /* T_GREATER_THAN */ 90 : case /* T_DIV */ 96 : case /* T_EOF */ 105 : - return Stdlib__List.rev(acc); + return Stdlib__List.rev(acc); } } @@ -13533,10 +13533,10 @@ function element_or_closing(env) { switch (match) { case /* T_DIV */ 96 : case /* T_EOF */ 105 : - return { - TAG: /* Closing */ 0, - _0: closing_element_without_lt(env, start_loc) - }; + return { + TAG: /* Closing */ 0, + _0: closing_element_without_lt(env, start_loc) + }; default: return { TAG: /* ChildElement */ 1, @@ -13552,34 +13552,34 @@ function children_and_closing(env, _acc) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_LESS_THAN */ 89 : - const closingElement = element_or_closing(env); - if (closingElement.TAG === /* Closing */ 0) { - return [ - Stdlib__List.rev(acc), - closingElement._0 - ]; - } - const element = closingElement._0; - const element_0 = element[0]; - const element_1 = { - TAG: /* Element */ 0, - _0: element[1] - }; - const element$1 = [ - element_0, - element_1 - ]; - _acc = { - hd: element$1, - tl: acc - }; - continue; - case /* T_EOF */ 105 : - error_unexpected(env); + const closingElement = element_or_closing(env); + if (closingElement.TAG === /* Closing */ 0) { return [ Stdlib__List.rev(acc), - undefined + closingElement._0 ]; + } + const element = closingElement._0; + const element_0 = element[0]; + const element_1 = { + TAG: /* Element */ 0, + _0: element[1] + }; + const element$1 = [ + element_0, + element_1 + ]; + _acc = { + hd: element$1, + tl: acc + }; + continue; + case /* T_EOF */ 105 : + error_unexpected(env); + return [ + Stdlib__List.rev(acc), + undefined + ]; default: _acc = { hd: child(env), @@ -13600,19 +13600,19 @@ function children_and_closing(env, _acc) { function normalize(name) { switch (name.TAG) { case /* Identifier */ 0 : - return name._0[1].name; + return name._0[1].name; case /* NamespacedName */ 1 : - const match = name._0[1]; - return match.namespace[1].name + (":" + match.name[1].name); + const match = name._0[1]; + return match.namespace[1].name + (":" + match.name[1].name); case /* MemberExpression */ 2 : - const match$1 = name._0[1]; - const _object = match$1._object; - let _object$1; - _object$1 = _object.TAG === /* Identifier */ 0 ? _object._0[1].name : normalize({ - TAG: /* MemberExpression */ 2, - _0: _object._0 - }); - return _object$1 + ("." + match$1.property[1].name); + const match$1 = name._0[1]; + const _object = match$1._object; + let _object$1; + _object$1 = _object.TAG === /* Identifier */ 0 ? _object._0[1].name : normalize({ + TAG: /* MemberExpression */ 2, + _0: _object._0 + }); + return _object$1 + ("." + match$1.property[1].name); } } @@ -13655,525 +13655,525 @@ function module_item(env) { } switch (match) { case /* T_EXPORT */ 47 : - const env$1 = with_in_export(true, with_strict(true, env)); - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env$1); - token$4(env$1, /* T_EXPORT */ 47); - const match$1 = Curry._2(Parser_env_Peek.token, undefined, env$1); - let exit = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - switch (match$1) { - case /* T_DEFAULT */ 34 : - token$4(env$1, /* T_DEFAULT */ 34); - record_export(env$1, [ - btwn(start_loc, Curry._2(Parser_env_Peek.loc, undefined, env$1)), - "default" - ]); - const match$2 = Curry._2(Parser_env_Peek.token, undefined, env$1); - let match$3; - let exit$1 = 0; - if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && match$2 === /* T_FUNCTION */ 13) { - const fn = _function(env$1); - match$3 = [ - fn[0], - { - TAG: /* Declaration */ 0, - _0: fn - } - ]; - } else { - exit$1 = 3; - } - if (exit$1 === 3) { - if (Curry._2(Parser_env_Peek.is_class, undefined, env$1)) { - const _class = class_declaration(env$1, decorators); - match$3 = [ - _class[0], - { - TAG: /* Declaration */ 0, - _0: _class - } - ]; - } else { - const expr = Curry._1(Parse.assignment, env$1); - const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc = loc !== undefined ? loc : expr[0]; - semicolon(env$1); - match$3 = [ - end_loc, - { - TAG: /* Expression */ 1, - _0: expr - } - ]; - } - } - return [ - btwn(start_loc, match$3[0]), - { - TAG: /* ExportDeclaration */ 28, - _0: { - default: true, - declaration: match$3[1], - specifiers: undefined, - source: undefined, - exportKind: /* ExportValue */ 1 - } - } - ]; - case /* T_INTERFACE */ 51 : - if (!env$1.parse_options.types) { - error$1(env$1, /* UnexpectedTypeExport */ 9); - } - const $$interface$1 = $$interface(env$1); - const match$4 = $$interface$1[1]; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Parsed `export interface` into something other than an interface declaration!" - }); - } - if (match$4.TAG === /* InterfaceDeclaration */ 21) { - record_export(env$1, [ - $$interface$1[0], - extract_ident_name(match$4._0.id) - ]); - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Parsed `export interface` into something other than an interface declaration!" - }); + const env$1 = with_in_export(true, with_strict(true, env)); + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env$1); + token$4(env$1, /* T_EXPORT */ 47); + const match$1 = Curry._2(Parser_env_Peek.token, undefined, env$1); + let exit = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + switch (match$1) { + case /* T_DEFAULT */ 34 : + token$4(env$1, /* T_DEFAULT */ 34); + record_export(env$1, [ + btwn(start_loc, Curry._2(Parser_env_Peek.loc, undefined, env$1)), + "default" + ]); + const match$2 = Curry._2(Parser_env_Peek.token, undefined, env$1); + let match$3; + let exit$1 = 0; + if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && match$2 === /* T_FUNCTION */ 13) { + const fn = _function(env$1); + match$3 = [ + fn[0], + { + TAG: /* Declaration */ 0, + _0: fn } - const end_loc$1 = $$interface$1[0]; - return [ - btwn(start_loc, end_loc$1), + ]; + } else { + exit$1 = 3; + } + if (exit$1 === 3) { + if (Curry._2(Parser_env_Peek.is_class, undefined, env$1)) { + const _class = class_declaration(env$1, decorators); + match$3 = [ + _class[0], { - TAG: /* ExportDeclaration */ 28, - _0: { - default: false, - declaration: { - TAG: /* Declaration */ 0, - _0: $$interface$1 - }, - specifiers: undefined, - source: undefined, - exportKind: /* ExportType */ 0 - } + TAG: /* Declaration */ 0, + _0: _class } ]; - case /* T_TYPE */ 59 : - if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, 1, env$1), /* T_LCURLY */ 1)) { - if (!env$1.parse_options.types) { - error$1(env$1, /* UnexpectedTypeExport */ 9); - } - const type_alias$1 = type_alias(env$1); - const match$5 = type_alias$1[1]; - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Parsed `export type` into something other than a type alias!" - }); - } - if (match$5.TAG === /* TypeAlias */ 7) { - record_export(env$1, [ - type_alias$1[0], - extract_ident_name(match$5._0.id) - ]); - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Parsed `export type` into something other than a type alias!" - }); - } - const end_loc$2 = type_alias$1[0]; - return [ - btwn(start_loc, end_loc$2), - { - TAG: /* ExportDeclaration */ 28, - _0: { - default: false, - declaration: { - TAG: /* Declaration */ 0, - _0: type_alias$1 - }, - specifiers: undefined, - source: undefined, - exportKind: /* ExportType */ 0 - } - } - ]; - } - exit = 1; - break; - case /* T_AT */ 12 : - case /* T_FUNCTION */ 13 : - case /* T_VAR */ 22 : - case /* T_CONST */ 25 : - case /* T_LET */ 26 : - case /* T_CLASS */ 38 : - case /* T_ASYNC */ 61 : - exit = 2; - break; - case /* T_MULT */ 97 : - const loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env$1); - token$4(env$1, /* T_MULT */ 97); - const parse_export_star_as = env$1.parse_options.esproposal_export_star_as; - const local_name = Curry._2(Parser_env_Peek.value, undefined, env$1) === "as" ? (contextual(env$1, "as"), parse_export_star_as ? Curry._2(Parse.identifier, undefined, env$1) : (error$1(env$1, /* UnexpectedTypeDeclaration */ 7), undefined)) : undefined; - const specifiers = { - TAG: /* ExportBatchSpecifier */ 1, - _0: loc$1, - _1: local_name - }; - const source$1 = export_source(env$1); - const loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc$3 = loc$2 !== undefined ? loc$2 : source$1[0]; - const source$2 = source$1; + } else { + const expr = Curry._1(Parse.assignment, env$1); + const loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc = loc !== undefined ? loc : expr[0]; semicolon(env$1); - return [ - btwn(start_loc, end_loc$3), + match$3 = [ + end_loc, { - TAG: /* ExportDeclaration */ 28, - _0: { - default: false, - declaration: undefined, - specifiers: specifiers, - source: source$2, - exportKind: /* ExportValue */ 1 - } + TAG: /* Expression */ 1, + _0: expr } ]; - default: - exit = 1; - } - } else { - exit = 1; - } - switch (exit) { - case 1 : - const match$6 = Curry._2(Parser_env_Peek.token, undefined, env$1); - let exportKind; - if (/* tag */ (typeof match$6 === "number" || typeof match$6 === "string") && match$6 === /* T_TYPE */ 59) { - token$3(env$1); - exportKind = /* ExportType */ 0; - } else { - exportKind = /* ExportValue */ 1; } - token$4(env$1, /* T_LCURLY */ 1); - const match$7 = export_specifiers_and_errs(env$1, /* [] */ 0, /* [] */ 0); - const specifiers$1 = { - TAG: /* ExportSpecifiers */ 0, - _0: match$7[0] - }; - const end_loc$4 = Curry._2(Parser_env_Peek.loc, undefined, env$1); - token$4(env$1, /* T_RCURLY */ 2); - const source$3 = Curry._2(Parser_env_Peek.value, undefined, env$1) === "from" ? export_source(env$1) : (Stdlib__List.iter((function (param) { - return error_at(env$1, param); - }), match$7[1]), undefined); - const loc$3 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); - const end_loc$5 = loc$3 !== undefined ? loc$3 : ( - source$3 !== undefined ? source$3[0] : end_loc$4 - ); - semicolon(env$1); - return [ - btwn(start_loc, end_loc$5), - { - TAG: /* ExportDeclaration */ 28, - _0: { - default: false, - declaration: undefined, - specifiers: specifiers$1, - source: source$3, - exportKind: exportKind - } + } + return [ + btwn(start_loc, match$3[0]), + { + TAG: /* ExportDeclaration */ 28, + _0: { + default: true, + declaration: match$3[1], + specifiers: undefined, + source: undefined, + exportKind: /* ExportValue */ 1 } - ]; - case 2 : - const stmt = Curry._2(Parse.statement_list_item, decorators, env$1); - const match$8 = stmt[1]; - const loc$4 = stmt[0]; - let names; - if (/* tag */ typeof match$8 === "number" || typeof match$8 === "string") { + } + ]; + case /* T_INTERFACE */ 51 : + if (!env$1.parse_options.types) { + error$1(env$1, /* UnexpectedTypeExport */ 9); + } + const $$interface$1 = $$interface(env$1); + const match$4 = $$interface$1[1]; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Internal Flow Error! Parsed `export interface` into something other than an interface declaration!" + }); + } + if (match$4.TAG === /* InterfaceDeclaration */ 21) { + record_export(env$1, [ + $$interface$1[0], + extract_ident_name(match$4._0.id) + ]); + } else { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Internal Flow Error! Parsed `export interface` into something other than an interface declaration!" + }); + } + const end_loc$1 = $$interface$1[0]; + return [ + btwn(start_loc, end_loc$1), + { + TAG: /* ExportDeclaration */ 28, + _0: { + default: false, + declaration: { + TAG: /* Declaration */ 0, + _0: $$interface$1 + }, + specifiers: undefined, + source: undefined, + exportKind: /* ExportType */ 0 + } + } + ]; + case /* T_TYPE */ 59 : + if (Caml_obj.caml_notequal(Curry._2(Parser_env_Peek.token, 1, env$1), /* T_LCURLY */ 1)) { + if (!env$1.parse_options.types) { + error$1(env$1, /* UnexpectedTypeExport */ 9); + } + const type_alias$1 = type_alias(env$1); + const match$5 = type_alias$1[1]; + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Unexpected export statement declaration!" + _1: "Internal Flow Error! Parsed `export type` into something other than a type alias!" }); } - switch (match$8.TAG) { - case /* FunctionDeclaration */ 18 : - const id = match$8._0.id; - if (id !== undefined) { - names = { - hd: [ - loc$4, - extract_ident_name(id) - ], - tl: /* [] */ 0 - }; - } else { - error_at(env$1, [ - loc$4, - /* ExportNamelessFunction */ 56 - ]); - names = /* [] */ 0; - } - break; - case /* VariableDeclaration */ 19 : - names = Stdlib__List.fold_left((function (names, param) { - const id = param[1].id; - let param$1 = { - hd: id, - tl: /* [] */ 0 - }; - return Stdlib__List.fold_left(fold, names, param$1); - }), /* [] */ 0, match$8._0.declarations); - break; - case /* ClassDeclaration */ 20 : - const id$1 = match$8._0.id; - if (id$1 !== undefined) { - names = { - hd: [ - loc$4, - extract_ident_name(id$1) - ], - tl: /* [] */ 0 - }; - } else { - error_at(env$1, [ - loc$4, - /* ExportNamelessClass */ 55 - ]); - names = /* [] */ 0; - } - break; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Internal Flow Error! Unexpected export statement declaration!" - }); + if (match$5.TAG === /* TypeAlias */ 7) { + record_export(env$1, [ + type_alias$1[0], + extract_ident_name(match$5._0.id) + ]); + } else { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Internal Flow Error! Parsed `export type` into something other than a type alias!" + }); } - Stdlib__List.iter((function (param) { - return record_export(env$1, param); - }), names); - const declaration = { - TAG: /* Declaration */ 0, - _0: stmt - }; + const end_loc$2 = type_alias$1[0]; return [ - btwn(start_loc, stmt[0]), + btwn(start_loc, end_loc$2), { TAG: /* ExportDeclaration */ 28, _0: { default: false, - declaration: declaration, + declaration: { + TAG: /* Declaration */ 0, + _0: type_alias$1 + }, specifiers: undefined, source: undefined, - exportKind: /* ExportValue */ 1 + exportKind: /* ExportType */ 0 } } ]; - - } - case /* T_IMPORT */ 48 : - error_on_decorators(env)(decorators); - const env$2 = with_strict(true, env); - const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env$2); - token$4(env$2, /* T_IMPORT */ 48); - const match$9 = Curry._2(Parser_env_Peek.token, undefined, env$2); - let match$10; - if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { - switch (match$9) { - case /* T_TYPEOF */ 44 : - if (!env$2.parse_options.types) { - error$1(env$2, /* UnexpectedTypeImport */ 8); - } - token$4(env$2, /* T_TYPEOF */ 44); - match$10 = [ - /* ImportTypeof */ 1, - undefined - ]; - break; - case /* T_TYPE */ 59 : - if (!env$2.parse_options.types) { - error$1(env$2, /* UnexpectedTypeImport */ 8); - } - match$10 = [ - /* ImportType */ 0, - Curry._2(Parse.identifier, undefined, env$2) - ]; - break; - default: - match$10 = [ - /* ImportValue */ 2, - undefined - ]; - } - } else { - match$10 = [ - /* ImportValue */ 2, - undefined - ]; - } - const type_ident = match$10[1]; - const importKind = match$10[0]; - const match$11 = Curry._2(Parser_env_Peek.token, undefined, env$2); - const match$12 = Curry._2(Parser_env_Peek.is_identifier, undefined, env$2); - let exit$2 = 0; - let exit$3 = 0; - if (/* tag */ typeof match$11 === "number" || typeof match$11 === "string") { - if (match$11 === /* T_COMMA */ 8) { - exit$2 = 1; - } else { - exit$3 = 2; - } - } else if (match$11.TAG === /* T_STRING */ 1) { - if (importKind === /* ImportValue */ 2) { - const match$13 = match$11._0; - const octal = match$13[3]; - const raw = match$13[2]; - const value = match$13[1]; - const str_loc = match$13[0]; - if (octal) { - strict_error(env$2, /* StrictOctalLiteral */ 31); } - token$4(env$2, { - TAG: /* T_STRING */ 1, - _0: [ - str_loc, - value, - raw, - octal - ] - }); - const value$1 = { - TAG: /* String */ 0, - _0: value - }; - const source_1 = { - value: value$1, - raw: raw + exit = 1; + break; + case /* T_AT */ 12 : + case /* T_FUNCTION */ 13 : + case /* T_VAR */ 22 : + case /* T_CONST */ 25 : + case /* T_LET */ 26 : + case /* T_CLASS */ 38 : + case /* T_ASYNC */ 61 : + exit = 2; + break; + case /* T_MULT */ 97 : + const loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env$1); + token$4(env$1, /* T_MULT */ 97); + const parse_export_star_as = env$1.parse_options.esproposal_export_star_as; + const local_name = Curry._2(Parser_env_Peek.value, undefined, env$1) === "as" ? (contextual(env$1, "as"), parse_export_star_as ? Curry._2(Parse.identifier, undefined, env$1) : (error$1(env$1, /* UnexpectedTypeDeclaration */ 7), undefined)) : undefined; + const specifiers = { + TAG: /* ExportBatchSpecifier */ 1, + _0: loc$1, + _1: local_name }; - const source$4 = [ - str_loc, - source_1 - ]; - const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); - const end_loc$6 = loc$5 !== undefined ? loc$5 : str_loc; - semicolon(env$2); + const source$1 = export_source(env$1); + const loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc$3 = loc$2 !== undefined ? loc$2 : source$1[0]; + const source$2 = source$1; + semicolon(env$1); return [ - btwn(start_loc$1, end_loc$6), + btwn(start_loc, end_loc$3), { - TAG: /* ImportDeclaration */ 29, + TAG: /* ExportDeclaration */ 28, _0: { - importKind: importKind, - source: source$4, - specifiers: /* [] */ 0 + default: false, + declaration: undefined, + specifiers: specifiers, + source: source$2, + exportKind: /* ExportValue */ 1 } } ]; - } - exit$3 = 2; - } else { - exit$3 = 2; + default: + exit = 1; } - if (exit$3 === 2) { - if (match$12) { - exit$2 = 1; + } else { + exit = 1; + } + switch (exit) { + case 1 : + const match$6 = Curry._2(Parser_env_Peek.token, undefined, env$1); + let exportKind; + if (/* tag */ (typeof match$6 === "number" || typeof match$6 === "string") && match$6 === /* T_TYPE */ 59) { + token$3(env$1); + exportKind = /* ExportType */ 0; } else { - const specifiers$2 = named_or_namespace_specifier(env$2); - const source$5 = source(env$2); - const loc$6 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); - const end_loc$7 = loc$6 !== undefined ? loc$6 : source$5[0]; - semicolon(env$2); - return [ - btwn(start_loc$1, end_loc$7), - { - TAG: /* ImportDeclaration */ 29, - _0: { - importKind: importKind, - source: source$5, - specifiers: specifiers$2 - } - } - ]; + exportKind = /* ExportValue */ 1; } - } - if (exit$2 === 1) { - const match$14 = Curry._2(Parser_env_Peek.token, undefined, env$2); - const match$15 = Curry._2(Parser_env_Peek.value, undefined, env$2); - let match$16; - let exit$4 = 0; - if (type_ident !== undefined && /* tag */ (typeof match$14 === "number" || typeof match$14 === "string")) { - switch (match$14) { - case /* T_IDENTIFIER */ 0 : - if (match$15 === "from") { - match$16 = [ - /* ImportValue */ 2, - { - TAG: /* ImportDefaultSpecifier */ 1, - _0: type_ident - } - ]; - } else { - exit$4 = 2; - } - break; - case /* T_COMMA */ 8 : - match$16 = [ - /* ImportValue */ 2, - { - TAG: /* ImportDefaultSpecifier */ 1, - _0: type_ident - } - ]; - break; - default: - exit$4 = 2; + token$4(env$1, /* T_LCURLY */ 1); + const match$7 = export_specifiers_and_errs(env$1, /* [] */ 0, /* [] */ 0); + const specifiers$1 = { + TAG: /* ExportSpecifiers */ 0, + _0: match$7[0] + }; + const end_loc$4 = Curry._2(Parser_env_Peek.loc, undefined, env$1); + token$4(env$1, /* T_RCURLY */ 2); + const source$3 = Curry._2(Parser_env_Peek.value, undefined, env$1) === "from" ? export_source(env$1) : (Stdlib__List.iter((function (param) { + return error_at(env$1, param); + }), match$7[1]), undefined); + const loc$3 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$1); + const end_loc$5 = loc$3 !== undefined ? loc$3 : ( + source$3 !== undefined ? source$3[0] : end_loc$4 + ); + semicolon(env$1); + return [ + btwn(start_loc, end_loc$5), + { + TAG: /* ExportDeclaration */ 28, + _0: { + default: false, + declaration: undefined, + specifiers: specifiers$1, + source: source$3, + exportKind: exportKind + } } - } else { - exit$4 = 2; + ]; + case 2 : + const stmt = Curry._2(Parse.statement_list_item, decorators, env$1); + const match$8 = stmt[1]; + const loc$4 = stmt[0]; + let names; + if (/* tag */ typeof match$8 === "number" || typeof match$8 === "string") { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Internal Flow Error! Unexpected export statement declaration!" + }); } - if (exit$4 === 2) { - match$16 = [ - importKind, - { - TAG: /* ImportDefaultSpecifier */ 1, - _0: Curry._2(Parse.identifier, undefined, env$2) + switch (match$8.TAG) { + case /* FunctionDeclaration */ 18 : + const id = match$8._0.id; + if (id !== undefined) { + names = { + hd: [ + loc$4, + extract_ident_name(id) + ], + tl: /* [] */ 0 + }; + } else { + error_at(env$1, [ + loc$4, + /* ExportNamelessFunction */ 56 + ]); + names = /* [] */ 0; } - ]; + break; + case /* VariableDeclaration */ 19 : + names = Stdlib__List.fold_left((function (names, param) { + const id = param[1].id; + let param$1 = { + hd: id, + tl: /* [] */ 0 + }; + return Stdlib__List.fold_left(fold, names, param$1); + }), /* [] */ 0, match$8._0.declarations); + break; + case /* ClassDeclaration */ 20 : + const id$1 = match$8._0.id; + if (id$1 !== undefined) { + names = { + hd: [ + loc$4, + extract_ident_name(id$1) + ], + tl: /* [] */ 0 + }; + } else { + error_at(env$1, [ + loc$4, + /* ExportNamelessClass */ 55 + ]); + names = /* [] */ 0; + } + break; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Internal Flow Error! Unexpected export statement declaration!" + }); } - const match$17 = Curry._2(Parser_env_Peek.token, undefined, env$2); - let additional_specifiers; - if (/* tag */ (typeof match$17 === "number" || typeof match$17 === "string") && match$17 === /* T_COMMA */ 8) { - token$4(env$2, /* T_COMMA */ 8); - additional_specifiers = named_or_namespace_specifier(env$2); - } else { - additional_specifiers = /* [] */ 0; + Stdlib__List.iter((function (param) { + return record_export(env$1, param); + }), names); + const declaration = { + TAG: /* Declaration */ 0, + _0: stmt + }; + return [ + btwn(start_loc, stmt[0]), + { + TAG: /* ExportDeclaration */ 28, + _0: { + default: false, + declaration: declaration, + specifiers: undefined, + source: undefined, + exportKind: /* ExportValue */ 1 + } + } + ]; + + } + case /* T_IMPORT */ 48 : + error_on_decorators(env)(decorators); + const env$2 = with_strict(true, env); + const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env$2); + token$4(env$2, /* T_IMPORT */ 48); + const match$9 = Curry._2(Parser_env_Peek.token, undefined, env$2); + let match$10; + if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { + switch (match$9) { + case /* T_TYPEOF */ 44 : + if (!env$2.parse_options.types) { + error$1(env$2, /* UnexpectedTypeImport */ 8); + } + token$4(env$2, /* T_TYPEOF */ 44); + match$10 = [ + /* ImportTypeof */ 1, + undefined + ]; + break; + case /* T_TYPE */ 59 : + if (!env$2.parse_options.types) { + error$1(env$2, /* UnexpectedTypeImport */ 8); + } + match$10 = [ + /* ImportType */ 0, + Curry._2(Parse.identifier, undefined, env$2) + ]; + break; + default: + match$10 = [ + /* ImportValue */ 2, + undefined + ]; + } + } else { + match$10 = [ + /* ImportValue */ 2, + undefined + ]; + } + const type_ident = match$10[1]; + const importKind = match$10[0]; + const match$11 = Curry._2(Parser_env_Peek.token, undefined, env$2); + const match$12 = Curry._2(Parser_env_Peek.is_identifier, undefined, env$2); + let exit$2 = 0; + let exit$3 = 0; + if (/* tag */ typeof match$11 === "number" || typeof match$11 === "string") { + if (match$11 === /* T_COMMA */ 8) { + exit$2 = 1; + } else { + exit$3 = 2; + } + } else if (match$11.TAG === /* T_STRING */ 1) { + if (importKind === /* ImportValue */ 2) { + const match$13 = match$11._0; + const octal = match$13[3]; + const raw = match$13[2]; + const value = match$13[1]; + const str_loc = match$13[0]; + if (octal) { + strict_error(env$2, /* StrictOctalLiteral */ 31); } - const source$6 = source(env$2); - const loc$7 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); - const end_loc$8 = loc$7 !== undefined ? loc$7 : source$6[0]; + token$4(env$2, { + TAG: /* T_STRING */ 1, + _0: [ + str_loc, + value, + raw, + octal + ] + }); + const value$1 = { + TAG: /* String */ 0, + _0: value + }; + const source_1 = { + value: value$1, + raw: raw + }; + const source$4 = [ + str_loc, + source_1 + ]; + const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); + const end_loc$6 = loc$5 !== undefined ? loc$5 : str_loc; semicolon(env$2); return [ - btwn(start_loc$1, end_loc$8), + btwn(start_loc$1, end_loc$6), { TAG: /* ImportDeclaration */ 29, _0: { - importKind: match$16[0], - source: source$6, - specifiers: { - hd: match$16[1], - tl: additional_specifiers - } + importKind: importKind, + source: source$4, + specifiers: /* [] */ 0 } } ]; } - case /* T_DECLARE */ 58 : - if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, 1, env), /* T_EXPORT */ 47)) { - error_on_decorators(env)(decorators); - return declare_export_declaration(undefined, env); + exit$3 = 2; + } else { + exit$3 = 2; + } + if (exit$3 === 2) { + if (match$12) { + exit$2 = 1; + } else { + const specifiers$2 = named_or_namespace_specifier(env$2); + const source$5 = source(env$2); + const loc$6 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); + const end_loc$7 = loc$6 !== undefined ? loc$6 : source$5[0]; + semicolon(env$2); + return [ + btwn(start_loc$1, end_loc$7), + { + TAG: /* ImportDeclaration */ 29, + _0: { + importKind: importKind, + source: source$5, + specifiers: specifiers$2 + } + } + ]; + } + } + if (exit$2 === 1) { + const match$14 = Curry._2(Parser_env_Peek.token, undefined, env$2); + const match$15 = Curry._2(Parser_env_Peek.value, undefined, env$2); + let match$16; + let exit$4 = 0; + if (type_ident !== undefined && /* tag */ (typeof match$14 === "number" || typeof match$14 === "string")) { + switch (match$14) { + case /* T_IDENTIFIER */ 0 : + if (match$15 === "from") { + match$16 = [ + /* ImportValue */ 2, + { + TAG: /* ImportDefaultSpecifier */ 1, + _0: type_ident + } + ]; + } else { + exit$4 = 2; + } + break; + case /* T_COMMA */ 8 : + match$16 = [ + /* ImportValue */ 2, + { + TAG: /* ImportDefaultSpecifier */ 1, + _0: type_ident + } + ]; + break; + default: + exit$4 = 2; + } + } else { + exit$4 = 2; + } + if (exit$4 === 2) { + match$16 = [ + importKind, + { + TAG: /* ImportDefaultSpecifier */ 1, + _0: Curry._2(Parse.identifier, undefined, env$2) + } + ]; + } + const match$17 = Curry._2(Parser_env_Peek.token, undefined, env$2); + let additional_specifiers; + if (/* tag */ (typeof match$17 === "number" || typeof match$17 === "string") && match$17 === /* T_COMMA */ 8) { + token$4(env$2, /* T_COMMA */ 8); + additional_specifiers = named_or_namespace_specifier(env$2); } else { - return statement_list_item(decorators, env); + additional_specifiers = /* [] */ 0; } + const source$6 = source(env$2); + const loc$7 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env$2); + const end_loc$8 = loc$7 !== undefined ? loc$7 : source$6[0]; + semicolon(env$2); + return [ + btwn(start_loc$1, end_loc$8), + { + TAG: /* ImportDeclaration */ 29, + _0: { + importKind: match$16[0], + source: source$6, + specifiers: { + hd: match$16[1], + tl: additional_specifiers + } + } + } + ]; + } + case /* T_DECLARE */ 58 : + if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, 1, env), /* T_EXPORT */ 47)) { + error_on_decorators(env)(decorators); + return declare_export_declaration(undefined, env); + } else { + return statement_list_item(decorators, env); + } default: return statement_list_item(decorators, env); } @@ -14188,57 +14188,57 @@ function statement_list_item(decoratorsOpt, env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_CONST */ 25 : - return var_or_const(env); + return var_or_const(env); case /* T_LET */ 26 : - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_LET */ 26); - if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_LPAREN */ 3)) { - token$4(env, /* T_LPAREN */ 3); - const match$1 = helper(with_no_let(true, env), /* [] */ 0, /* [] */ 0); - const head = Stdlib__List.map((function (param) { - const match = param[1]; - return { - id: match.id, - init: match.init - }; - }), match$1[1]); - token$4(env, /* T_RPAREN */ 4); - const body = Curry._1(Parse.statement, env); - const end_loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$1 = end_loc !== undefined ? end_loc : match$1[0]; - semicolon(env); - Stdlib__List.iter((function (param) { - return error_at(env, param); - }), match$1[2]); - return [ - btwn(start_loc, end_loc$1), - { - TAG: /* Let */ 17, - _0: { - head: head, - body: body - } - } - ]; - } - const match$2 = helper(with_no_let(true, env), /* [] */ 0, /* [] */ 0); - const declaration = { - TAG: /* VariableDeclaration */ 19, - _0: { - declarations: match$2[1], - kind: /* Let */ 1 - } - }; - const end_loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$3 = end_loc$2 !== undefined ? end_loc$2 : match$2[0]; + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_LET */ 26); + if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_LPAREN */ 3)) { + token$4(env, /* T_LPAREN */ 3); + const match$1 = helper(with_no_let(true, env), /* [] */ 0, /* [] */ 0); + const head = Stdlib__List.map((function (param) { + const match = param[1]; + return { + id: match.id, + init: match.init + }; + }), match$1[1]); + token$4(env, /* T_RPAREN */ 4); + const body = Curry._1(Parse.statement, env); + const end_loc = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$1 = end_loc !== undefined ? end_loc : match$1[0]; semicolon(env); Stdlib__List.iter((function (param) { return error_at(env, param); - }), match$2[2]); + }), match$1[2]); return [ - btwn(start_loc, end_loc$3), - declaration + btwn(start_loc, end_loc$1), + { + TAG: /* Let */ 17, + _0: { + head: head, + body: body + } + } ]; + } + const match$2 = helper(with_no_let(true, env), /* [] */ 0, /* [] */ 0); + const declaration = { + TAG: /* VariableDeclaration */ 19, + _0: { + declarations: match$2[1], + kind: /* Let */ 1 + } + }; + const end_loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$3 = end_loc$2 !== undefined ? end_loc$2 : match$2[0]; + semicolon(env); + Stdlib__List.iter((function (param) { + return error_at(env, param); + }), match$2[2]); + return [ + btwn(start_loc, end_loc$3), + declaration + ]; } } @@ -14253,11 +14253,11 @@ function statement_list_item(decoratorsOpt, env) { } switch (match) { case /* T_INTERFACE */ 51 : - return $$interface(env); + return $$interface(env); case /* T_DECLARE */ 58 : - return declare(undefined, env); + return declare(undefined, env); case /* T_TYPE */ 59 : - return type_alias(env); + return type_alias(env); default: return statement(env); } @@ -14270,473 +14270,473 @@ function statement(env) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* T_LCURLY */ 1 : - const match$1 = Curry._1(Parse.block_body, env); - return [ - match$1[0], - { - TAG: /* Block */ 0, - _0: match$1[1] + const match$1 = Curry._1(Parse.block_body, env); + return [ + match$1[0], + { + TAG: /* Block */ 0, + _0: match$1[1] + } + ]; + case /* T_SEMICOLON */ 7 : + const loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_SEMICOLON */ 7); + return [ + loc, + /* Empty */ 0 + ]; + case /* T_IF */ 14 : + return _if(env); + case /* T_RETURN */ 17 : + if (!env.in_function) { + error$1(env, /* IllegalReturn */ 23); + } + const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_RETURN */ 17); + const argument = Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env) ? undefined : Curry._1(Parse.expression, env); + const loc$1 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc = loc$1 !== undefined ? loc$1 : ( + argument !== undefined ? argument[0] : start_loc + ); + semicolon(env); + return [ + btwn(start_loc, end_loc), + { + TAG: /* Return */ 9, + _0: { + argument: argument + } + } + ]; + case /* T_SWITCH */ 18 : + const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_SWITCH */ 18); + token$4(env, /* T_LPAREN */ 3); + const discriminant = Curry._1(Parse.expression, env); + token$4(env, /* T_RPAREN */ 4); + token$4(env, /* T_LCURLY */ 1); + const cases = case_list(env, [ + false, + /* [] */ 0 + ]); + const end_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_RCURLY */ 2); + return [ + btwn(start_loc$1, end_loc$1), + { + TAG: /* Switch */ 8, + _0: { + discriminant: discriminant, + cases: cases, + lexical: false + } + } + ]; + case /* T_THROW */ 20 : + const start_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_THROW */ 20); + if (Curry._1(Parser_env_Peek.is_line_terminator, env)) { + error_at(env, [ + start_loc$2, + /* NewlineAfterThrow */ 11 + ]); + } + const argument$1 = Curry._1(Parse.expression, env); + const loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$2 = loc$2 !== undefined ? loc$2 : argument$1[0]; + semicolon(env); + return [ + btwn(start_loc$2, end_loc$2), + { + TAG: /* Throw */ 10, + _0: { + argument: argument$1 } - ]; - case /* T_SEMICOLON */ 7 : - const loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_SEMICOLON */ 7); - return [ - loc, - /* Empty */ 0 - ]; - case /* T_IF */ 14 : - return _if(env); - case /* T_RETURN */ 17 : - if (!env.in_function) { - error$1(env, /* IllegalReturn */ 23); } - const start_loc = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_RETURN */ 17); - const argument = Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env) ? undefined : Curry._1(Parse.expression, env); - const loc$1 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc = loc$1 !== undefined ? loc$1 : ( - argument !== undefined ? argument[0] : start_loc - ); - semicolon(env); - return [ - btwn(start_loc, end_loc), - { - TAG: /* Return */ 9, - _0: { - argument: argument - } - } - ]; - case /* T_SWITCH */ 18 : - const start_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_SWITCH */ 18); + ]; + case /* T_TRY */ 21 : + const start_loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_TRY */ 21); + const block = Curry._1(Parse.block_body, env); + const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); + let handler; + if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && match$2 === /* T_CATCH */ 32) { + const start_loc$4 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_CATCH */ 32); token$4(env, /* T_LPAREN */ 3); - const discriminant = Curry._1(Parse.expression, env); + const id = Curry._2(Parse.identifier, /* StrictCatchVariable */ 26, env); + const param_0 = id[0]; + const param_1 = { + TAG: /* Identifier */ 3, + _0: id + }; + const param = [ + param_0, + param_1 + ]; token$4(env, /* T_RPAREN */ 4); - token$4(env, /* T_LCURLY */ 1); - const cases = case_list(env, [ - false, - /* [] */ 0 - ]); - const end_loc$1 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_RCURLY */ 2); - return [ - btwn(start_loc$1, end_loc$1), + const body = Curry._1(Parse.block_body, env); + const loc$3 = btwn(start_loc$4, body[0]); + handler = [ + loc$3, { - TAG: /* Switch */ 8, - _0: { - discriminant: discriminant, - cases: cases, - lexical: false - } + param: param, + guard: undefined, + body: body } ]; - case /* T_THROW */ 20 : - const start_loc$2 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_THROW */ 20); - if (Curry._1(Parser_env_Peek.is_line_terminator, env)) { - error_at(env, [ - start_loc$2, - /* NewlineAfterThrow */ 11 - ]); - } - const argument$1 = Curry._1(Parse.expression, env); - const loc$2 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$2 = loc$2 !== undefined ? loc$2 : argument$1[0]; - semicolon(env); - return [ - btwn(start_loc$2, end_loc$2), - { - TAG: /* Throw */ 10, - _0: { - argument: argument$1 - } + } else { + handler = undefined; + } + const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); + let finalizer; + if (/* tag */ (typeof match$3 === "number" || typeof match$3 === "string") && match$3 === /* T_FINALLY */ 36) { + token$4(env, /* T_FINALLY */ 36); + finalizer = Curry._1(Parse.block_body, env); + } else { + finalizer = undefined; + } + const end_loc$3 = finalizer !== undefined ? finalizer[0] : ( + handler !== undefined ? handler[0] : (error_at(env, [ + block[0], + /* NoCatchOrFinally */ 20 + ]), block[0]) + ); + return [ + btwn(start_loc$3, end_loc$3), + { + TAG: /* Try */ 11, + _0: { + block: block, + handler: handler, + guardedHandlers: /* [] */ 0, + finalizer: finalizer } - ]; - case /* T_TRY */ 21 : - const start_loc$3 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_TRY */ 21); - const block = Curry._1(Parse.block_body, env); - const match$2 = Curry._2(Parser_env_Peek.token, undefined, env); - let handler; - if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && match$2 === /* T_CATCH */ 32) { - const start_loc$4 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_CATCH */ 32); - token$4(env, /* T_LPAREN */ 3); - const id = Curry._2(Parse.identifier, /* StrictCatchVariable */ 26, env); - const param_0 = id[0]; - const param_1 = { - TAG: /* Identifier */ 3, - _0: id - }; - const param = [ - param_0, - param_1 - ]; - token$4(env, /* T_RPAREN */ 4); - const body = Curry._1(Parse.block_body, env); - const loc$3 = btwn(start_loc$4, body[0]); - handler = [ - loc$3, - { - param: param, - guard: undefined, - body: body - } - ]; - } else { - handler = undefined; } - const match$3 = Curry._2(Parser_env_Peek.token, undefined, env); - let finalizer; - if (/* tag */ (typeof match$3 === "number" || typeof match$3 === "string") && match$3 === /* T_FINALLY */ 36) { - token$4(env, /* T_FINALLY */ 36); - finalizer = Curry._1(Parse.block_body, env); - } else { - finalizer = undefined; - } - const end_loc$3 = finalizer !== undefined ? finalizer[0] : ( - handler !== undefined ? handler[0] : (error_at(env, [ - block[0], - /* NoCatchOrFinally */ 20 - ]), block[0]) - ); - return [ - btwn(start_loc$3, end_loc$3), - { - TAG: /* Try */ 11, - _0: { - block: block, - handler: handler, - guardedHandlers: /* [] */ 0, - finalizer: finalizer - } - } - ]; + ]; case /* T_VAR */ 22 : - return var_or_const(env); + return var_or_const(env); case /* T_WHILE */ 23 : - const start_loc$5 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_WHILE */ 23); - token$4(env, /* T_LPAREN */ 3); - const test = Curry._1(Parse.expression, env); - token$4(env, /* T_RPAREN */ 4); - const body$1 = Curry._1(Parse.statement, with_in_loop(true, env)); - return [ - btwn(start_loc$5, body$1[0]), - { - TAG: /* While */ 12, - _0: { - test: test, - body: body$1 - } + const start_loc$5 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_WHILE */ 23); + token$4(env, /* T_LPAREN */ 3); + const test = Curry._1(Parse.expression, env); + token$4(env, /* T_RPAREN */ 4); + const body$1 = Curry._1(Parse.statement, with_in_loop(true, env)); + return [ + btwn(start_loc$5, body$1[0]), + { + TAG: /* While */ 12, + _0: { + test: test, + body: body$1 } - ]; + } + ]; case /* T_WITH */ 24 : - const start_loc$6 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_WITH */ 24); - token$4(env, /* T_LPAREN */ 3); - const _object = Curry._1(Parse.expression, env); - token$4(env, /* T_RPAREN */ 4); - const body$2 = Curry._1(Parse.statement, env); - const loc$4 = btwn(start_loc$6, body$2[0]); - strict_error_at(env, [ - loc$4, - /* StrictModeWith */ 25 - ]); - return [ - loc$4, - { - TAG: /* With */ 6, - _0: { - _object: _object, - body: body$2 - } - } - ]; - case /* T_BREAK */ 30 : - const start_loc$7 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_BREAK */ 30); - let label; - if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)) { - label = undefined; - } else { - const label$1 = Curry._2(Parse.identifier, undefined, env); - const name = label$1[1].name; - if (!Curry._2(mem$1, name, env.labels)) { - error$1(env, { - TAG: /* UnknownLabel */ 4, - _0: name - }); + const start_loc$6 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_WITH */ 24); + token$4(env, /* T_LPAREN */ 3); + const _object = Curry._1(Parse.expression, env); + token$4(env, /* T_RPAREN */ 4); + const body$2 = Curry._1(Parse.statement, env); + const loc$4 = btwn(start_loc$6, body$2[0]); + strict_error_at(env, [ + loc$4, + /* StrictModeWith */ 25 + ]); + return [ + loc$4, + { + TAG: /* With */ 6, + _0: { + _object: _object, + body: body$2 } - label = label$1; } - const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$4 = loc$5 !== undefined ? loc$5 : ( - label !== undefined ? label[0] : start_loc$7 - ); - const loc$6 = btwn(start_loc$7, end_loc$4); - if (label === undefined && !(env.in_loop || env.in_switch)) { - error_at(env, [ - loc$6, - /* IllegalBreak */ 22 - ]); + ]; + case /* T_BREAK */ 30 : + const start_loc$7 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_BREAK */ 30); + let label; + if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)) { + label = undefined; + } else { + const label$1 = Curry._2(Parse.identifier, undefined, env); + const name = label$1[1].name; + if (!Curry._2(mem$1, name, env.labels)) { + error$1(env, { + TAG: /* UnknownLabel */ 4, + _0: name + }); } - semicolon(env); - return [ - loc$6, - { - TAG: /* Break */ 4, - _0: { - label: label - } + label = label$1; + } + const loc$5 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$4 = loc$5 !== undefined ? loc$5 : ( + label !== undefined ? label[0] : start_loc$7 + ); + const loc$6 = btwn(start_loc$7, end_loc$4); + if (label === undefined && !(env.in_loop || env.in_switch)) { + error_at(env, [ + loc$6, + /* IllegalBreak */ 22 + ]); + } + semicolon(env); + return [ + loc$6, + { + TAG: /* Break */ 4, + _0: { + label: label } - ]; + } + ]; case /* T_CONTINUE */ 33 : - const start_loc$8 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_CONTINUE */ 33); - let label$2; - if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)) { - label$2 = undefined; - } else { - const label$3 = Curry._2(Parse.identifier, undefined, env); - const name$1 = label$3[1].name; - if (!Curry._2(mem$1, name$1, env.labels)) { - error$1(env, { - TAG: /* UnknownLabel */ 4, - _0: name$1 - }); - } - label$2 = label$3; + const start_loc$8 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_CONTINUE */ 33); + let label$2; + if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7) || Curry._1(Parser_env_Peek.is_implicit_semicolon, env)) { + label$2 = undefined; + } else { + const label$3 = Curry._2(Parse.identifier, undefined, env); + const name$1 = label$3[1].name; + if (!Curry._2(mem$1, name$1, env.labels)) { + error$1(env, { + TAG: /* UnknownLabel */ 4, + _0: name$1 + }); } - const loc$7 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$5 = loc$7 !== undefined ? loc$7 : ( - label$2 !== undefined ? label$2[0] : start_loc$8 - ); - const loc$8 = btwn(start_loc$8, end_loc$5); - if (!env.in_loop) { - error_at(env, [ - loc$8, - /* IllegalContinue */ 21 - ]); + label$2 = label$3; + } + const loc$7 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$5 = loc$7 !== undefined ? loc$7 : ( + label$2 !== undefined ? label$2[0] : start_loc$8 + ); + const loc$8 = btwn(start_loc$8, end_loc$5); + if (!env.in_loop) { + error_at(env, [ + loc$8, + /* IllegalContinue */ 21 + ]); + } + semicolon(env); + return [ + loc$8, + { + TAG: /* Continue */ 5, + _0: { + label: label$2 + } } + ]; + case /* T_DO */ 35 : + const start_loc$9 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_DO */ 35); + const body$3 = Curry._1(Parse.statement, with_in_loop(true, env)); + token$4(env, /* T_WHILE */ 23); + token$4(env, /* T_LPAREN */ 3); + const test$1 = Curry._1(Parse.expression, env); + const end_loc$6 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_RPAREN */ 4); + const loc$9 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$7 = loc$9 !== undefined ? loc$9 : end_loc$6; + if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7)) { semicolon(env); - return [ - loc$8, - { - TAG: /* Continue */ 5, - _0: { - label: label$2 - } + } + return [ + btwn(start_loc$9, end_loc$7), + { + TAG: /* DoWhile */ 13, + _0: { + body: body$3, + test: test$1 } - ]; - case /* T_DO */ 35 : - const start_loc$9 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_DO */ 35); - const body$3 = Curry._1(Parse.statement, with_in_loop(true, env)); - token$4(env, /* T_WHILE */ 23); - token$4(env, /* T_LPAREN */ 3); - const test$1 = Curry._1(Parse.expression, env); - const end_loc$6 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_RPAREN */ 4); - const loc$9 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$7 = loc$9 !== undefined ? loc$9 : end_loc$6; - if (Caml_obj.caml_equal(Curry._2(Parser_env_Peek.token, undefined, env), /* T_SEMICOLON */ 7)) { - semicolon(env); } - return [ - btwn(start_loc$9, end_loc$7), - { - TAG: /* DoWhile */ 13, - _0: { - body: body$3, - test: test$1 - } - } - ]; + ]; case /* T_FOR */ 37 : - const start_loc$10 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_FOR */ 37); - token$4(env, /* T_LPAREN */ 3); - const match$4 = Curry._2(Parser_env_Peek.token, undefined, env); - let match$5; - let exit$1 = 0; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - switch (match$4) { - case /* T_SEMICOLON */ 7 : - match$5 = [ - undefined, - /* [] */ 0 - ]; - break; - case /* T_VAR */ 22 : - const match$6 = declarations(/* T_VAR */ 22, /* Var */ 0, with_no_in(true, env)); - match$5 = [ - { - TAG: /* InitDeclaration */ 0, - _0: match$6[0] - }, - match$6[1] - ]; - break; - case /* T_CONST */ 25 : - const match$7 = $$const(with_no_in(true, env)); - match$5 = [ - { - TAG: /* InitDeclaration */ 0, - _0: match$7[0] - }, - match$7[1] - ]; - break; - case /* T_LET */ 26 : - const match$8 = _let(with_no_in(true, env)); - match$5 = [ - { - TAG: /* InitDeclaration */ 0, - _0: match$8[0] - }, - match$8[1] - ]; - break; - default: - exit$1 = 1; - } - } else { - exit$1 = 1; - } - if (exit$1 === 1) { - const expr = Curry._1(Parse.expression, with_no_let(true, with_no_in(true, env))); - match$5 = [ - { - TAG: /* InitExpression */ 1, - _0: expr - }, - /* [] */ 0 - ]; + const start_loc$10 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_FOR */ 37); + token$4(env, /* T_LPAREN */ 3); + const match$4 = Curry._2(Parser_env_Peek.token, undefined, env); + let match$5; + let exit$1 = 0; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + switch (match$4) { + case /* T_SEMICOLON */ 7 : + match$5 = [ + undefined, + /* [] */ 0 + ]; + break; + case /* T_VAR */ 22 : + const match$6 = declarations(/* T_VAR */ 22, /* Var */ 0, with_no_in(true, env)); + match$5 = [ + { + TAG: /* InitDeclaration */ 0, + _0: match$6[0] + }, + match$6[1] + ]; + break; + case /* T_CONST */ 25 : + const match$7 = $$const(with_no_in(true, env)); + match$5 = [ + { + TAG: /* InitDeclaration */ 0, + _0: match$7[0] + }, + match$7[1] + ]; + break; + case /* T_LET */ 26 : + const match$8 = _let(with_no_in(true, env)); + match$5 = [ + { + TAG: /* InitDeclaration */ 0, + _0: match$8[0] + }, + match$8[1] + ]; + break; + default: + exit$1 = 1; } - const init = match$5[0]; - const match$9 = Curry._2(Parser_env_Peek.token, undefined, env); - if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { - switch (match$9) { - case /* T_IN */ 15 : - assert_can_be_forin_or_forof(env, /* InvalidLHSInForIn */ 16)(init); - let left; - if (init !== undefined) { - left = init.TAG === /* InitDeclaration */ 0 ? ({ - TAG: /* LeftDeclaration */ 0, - _0: init._0 - }) : ({ - TAG: /* LeftExpression */ 1, - _0: init._0 - }); - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 2556, - 22 - ] - }); + } else { + exit$1 = 1; + } + if (exit$1 === 1) { + const expr = Curry._1(Parse.expression, with_no_let(true, with_no_in(true, env))); + match$5 = [ + { + TAG: /* InitExpression */ 1, + _0: expr + }, + /* [] */ 0 + ]; + } + const init = match$5[0]; + const match$9 = Curry._2(Parser_env_Peek.token, undefined, env); + if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { + switch (match$9) { + case /* T_IN */ 15 : + assert_can_be_forin_or_forof(env, /* InvalidLHSInForIn */ 16)(init); + let left; + if (init !== undefined) { + left = init.TAG === /* InitDeclaration */ 0 ? ({ + TAG: /* LeftDeclaration */ 0, + _0: init._0 + }) : ({ + TAG: /* LeftExpression */ 1, + _0: init._0 + }); + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 2556, + 22 + ] + }); + } + token$4(env, /* T_IN */ 15); + const right = Curry._1(Parse.expression, env); + token$4(env, /* T_RPAREN */ 4); + const body$4 = Curry._1(Parse.statement, with_in_loop(true, env)); + return [ + btwn(start_loc$10, body$4[0]), + { + TAG: /* ForIn */ 15, + _0: { + left: left, + right: right, + body: body$4, + each: false } - token$4(env, /* T_IN */ 15); - const right = Curry._1(Parse.expression, env); - token$4(env, /* T_RPAREN */ 4); - const body$4 = Curry._1(Parse.statement, with_in_loop(true, env)); - return [ - btwn(start_loc$10, body$4[0]), - { - TAG: /* ForIn */ 15, - _0: { - left: left, - right: right, - body: body$4, - each: false - } - } - ]; - case /* T_OF */ 60 : - assert_can_be_forin_or_forof(env, /* InvalidLHSInForOf */ 17)(init); - let left$1; - if (init !== undefined) { - left$1 = init.TAG === /* InitDeclaration */ 0 ? ({ - TAG: /* LeftDeclaration */ 0, - _0: init._0 - }) : ({ - TAG: /* LeftExpression */ 1, - _0: init._0 - }); - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parser_flow.ml", - 2573, - 22 - ] - }); + } + ]; + case /* T_OF */ 60 : + assert_can_be_forin_or_forof(env, /* InvalidLHSInForOf */ 17)(init); + let left$1; + if (init !== undefined) { + left$1 = init.TAG === /* InitDeclaration */ 0 ? ({ + TAG: /* LeftDeclaration */ 0, + _0: init._0 + }) : ({ + TAG: /* LeftExpression */ 1, + _0: init._0 + }); + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parser_flow.ml", + 2573, + 22 + ] + }); + } + token$4(env, /* T_OF */ 60); + const right$1 = Curry._1(Parse.assignment, env); + token$4(env, /* T_RPAREN */ 4); + const body$5 = Curry._1(Parse.statement, with_in_loop(true, env)); + return [ + btwn(start_loc$10, body$5[0]), + { + TAG: /* ForOf */ 16, + _0: { + left: left$1, + right: right$1, + body: body$5 } - token$4(env, /* T_OF */ 60); - const right$1 = Curry._1(Parse.assignment, env); - token$4(env, /* T_RPAREN */ 4); - const body$5 = Curry._1(Parse.statement, with_in_loop(true, env)); - return [ - btwn(start_loc$10, body$5[0]), - { - TAG: /* ForOf */ 16, - _0: { - left: left$1, - right: right$1, - body: body$5 - } - } - ]; - - } + } + ]; + } - Stdlib__List.iter((function (param) { - return error_at(env, param); - }), match$5[1]); - token$4(env, /* T_SEMICOLON */ 7); - const match$10 = Curry._2(Parser_env_Peek.token, undefined, env); - let test$2; - test$2 = /* tag */ (typeof match$10 === "number" || typeof match$10 === "string") && match$10 === /* T_SEMICOLON */ 7 ? undefined : Curry._1(Parse.expression, env); - token$4(env, /* T_SEMICOLON */ 7); - const match$11 = Curry._2(Parser_env_Peek.token, undefined, env); - let update; - update = /* tag */ (typeof match$11 === "number" || typeof match$11 === "string") && match$11 === /* T_RPAREN */ 4 ? undefined : Curry._1(Parse.expression, env); - token$4(env, /* T_RPAREN */ 4); - const body$6 = Curry._1(Parse.statement, with_in_loop(true, env)); - return [ - btwn(start_loc$10, body$6[0]), - { - TAG: /* For */ 14, - _0: { - init: init, - test: test$2, - update: update, - body: body$6 - } + } + Stdlib__List.iter((function (param) { + return error_at(env, param); + }), match$5[1]); + token$4(env, /* T_SEMICOLON */ 7); + const match$10 = Curry._2(Parser_env_Peek.token, undefined, env); + let test$2; + test$2 = /* tag */ (typeof match$10 === "number" || typeof match$10 === "string") && match$10 === /* T_SEMICOLON */ 7 ? undefined : Curry._1(Parse.expression, env); + token$4(env, /* T_SEMICOLON */ 7); + const match$11 = Curry._2(Parser_env_Peek.token, undefined, env); + let update; + update = /* tag */ (typeof match$11 === "number" || typeof match$11 === "string") && match$11 === /* T_RPAREN */ 4 ? undefined : Curry._1(Parse.expression, env); + token$4(env, /* T_RPAREN */ 4); + const body$6 = Curry._1(Parse.statement, with_in_loop(true, env)); + return [ + btwn(start_loc$10, body$6[0]), + { + TAG: /* For */ 14, + _0: { + init: init, + test: test$2, + update: update, + body: body$6 } - ]; + } + ]; case /* T_DEBUGGER */ 57 : - const start_loc$11 = Curry._2(Parser_env_Peek.loc, undefined, env); - token$4(env, /* T_DEBUGGER */ 57); - const loc$10 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); - const end_loc$8 = loc$10 !== undefined ? loc$10 : start_loc$11; - semicolon(env); - return [ - btwn(start_loc$11, end_loc$8), - /* Debugger */ 1 - ]; + const start_loc$11 = Curry._2(Parser_env_Peek.loc, undefined, env); + token$4(env, /* T_DEBUGGER */ 57); + const loc$10 = Curry._2(Parser_env_Peek.semicolon_loc, undefined, env); + const end_loc$8 = loc$10 !== undefined ? loc$10 : start_loc$11; + semicolon(env); + return [ + btwn(start_loc$11, end_loc$8), + /* Debugger */ 1 + ]; case /* T_EOF */ 105 : - error_unexpected(env); - return [ - Curry._2(Parser_env_Peek.loc, undefined, env), - /* Empty */ 0 - ]; + error_unexpected(env); + return [ + Curry._2(Parser_env_Peek.loc, undefined, env), + /* Empty */ 0 + ]; default: exit = 2; } @@ -14795,7 +14795,7 @@ function statement(env) { } switch (match) { case /* T_ELSE */ 41 : - return _if(env); + return _if(env); case /* T_RCURLY */ 2 : case /* T_RPAREN */ 4 : case /* T_RBRACKET */ 6 : @@ -14814,7 +14814,7 @@ function statement(env) { case /* T_EXPORT */ 47 : case /* T_IMPORT */ 48 : case /* T_COLON */ 77 : - break; + break; default: return expression(env); } @@ -15036,8 +15036,8 @@ function identifier$2(restricted_error, env) { case /* T_OF */ 60 : case /* T_ASYNC */ 61 : case /* T_AWAIT */ 62 : - token$4(env, t); - break; + token$4(env, t); + break; default: token$4(env, /* T_IDENTIFIER */ 0); } @@ -15479,148 +15479,148 @@ function parse(content, options) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* Any */ 0 : - return node("AnyTypeAnnotation", loc, []); + return node("AnyTypeAnnotation", loc, []); case /* Void */ 1 : - return node("VoidTypeAnnotation", loc, []); + return node("VoidTypeAnnotation", loc, []); case /* Null */ 2 : - return node("NullTypeAnnotation", loc, []); + return node("NullTypeAnnotation", loc, []); case /* Number */ 3 : - return node("NumberTypeAnnotation", loc, []); + return node("NumberTypeAnnotation", loc, []); case /* String */ 4 : - return node("StringTypeAnnotation", loc, []); + return node("StringTypeAnnotation", loc, []); case /* Boolean */ 5 : - return node("BooleanTypeAnnotation", loc, []); + return node("BooleanTypeAnnotation", loc, []); case /* Exists */ 6 : - return node("ExistsTypeAnnotation", loc, []); + return node("ExistsTypeAnnotation", loc, []); } } else { switch (t.TAG) { case /* Nullable */ 0 : - let t$1 = t._0; - return node("NullableTypeAnnotation", loc, [[ - "typeAnnotation", - _type(t$1) - ]]); + let t$1 = t._0; + return node("NullableTypeAnnotation", loc, [[ + "typeAnnotation", + _type(t$1) + ]]); case /* Function */ 1 : - return function_type([ - loc, - t._0 - ]); + return function_type([ + loc, + t._0 + ]); case /* Object */ 2 : - return object_type([ - loc, - t._0 - ]); + return object_type([ + loc, + t._0 + ]); case /* Array */ 3 : - let t$2 = t._0; - return node("ArrayTypeAnnotation", loc, [[ - "elementType", - _type(t$2) - ]]); + let t$2 = t._0; + return node("ArrayTypeAnnotation", loc, [[ + "elementType", + _type(t$2) + ]]); case /* Generic */ 4 : - let param$1 = [ - loc, - t._0 - ]; - const g = param$1[1]; - const id = g.id; - let id$1; - id$1 = id.TAG === /* Unqualified */ 0 ? identifier(id._0) : generic_type_qualified_identifier(id._0); - return node("GenericTypeAnnotation", param$1[0], [ - [ - "id", - id$1 - ], - [ - "typeParameters", - option(type_parameter_instantiation, g.typeParameters) - ] - ]); + let param$1 = [ + loc, + t._0 + ]; + const g = param$1[1]; + const id = g.id; + let id$1; + id$1 = id.TAG === /* Unqualified */ 0 ? identifier(id._0) : generic_type_qualified_identifier(id._0); + return node("GenericTypeAnnotation", param$1[0], [ + [ + "id", + id$1 + ], + [ + "typeParameters", + option(type_parameter_instantiation, g.typeParameters) + ] + ]); case /* Union */ 5 : - let param$2 = [ - loc, - t._0 - ]; - return node("UnionTypeAnnotation", param$2[0], [[ - "types", - array_of_list(_type, param$2[1]) - ]]); + let param$2 = [ + loc, + t._0 + ]; + return node("UnionTypeAnnotation", param$2[0], [[ + "types", + array_of_list(_type, param$2[1]) + ]]); case /* Intersection */ 6 : - let param$3 = [ - loc, - t._0 - ]; - return node("IntersectionTypeAnnotation", param$3[0], [[ - "types", - array_of_list(_type, param$3[1]) - ]]); + let param$3 = [ + loc, + t._0 + ]; + return node("IntersectionTypeAnnotation", param$3[0], [[ + "types", + array_of_list(_type, param$3[1]) + ]]); case /* Typeof */ 7 : - let param$4 = [ - loc, - t._0 - ]; - return node("TypeofTypeAnnotation", param$4[0], [[ - "argument", - _type(param$4[1]) - ]]); + let param$4 = [ + loc, + t._0 + ]; + return node("TypeofTypeAnnotation", param$4[0], [[ + "argument", + _type(param$4[1]) + ]]); case /* Tuple */ 8 : - let param$5 = [ - loc, - t._0 - ]; - return node("TupleTypeAnnotation", param$5[0], [[ - "types", - array_of_list(_type, param$5[1]) - ]]); + let param$5 = [ + loc, + t._0 + ]; + return node("TupleTypeAnnotation", param$5[0], [[ + "types", + array_of_list(_type, param$5[1]) + ]]); case /* StringLiteral */ 9 : - let param$6 = [ - loc, - t._0 - ]; - const s = param$6[1]; - return node("StringLiteralTypeAnnotation", param$6[0], [ - [ - "value", - string(s.value) - ], - [ - "raw", - string(s.raw) - ] - ]); + let param$6 = [ + loc, + t._0 + ]; + const s = param$6[1]; + return node("StringLiteralTypeAnnotation", param$6[0], [ + [ + "value", + string(s.value) + ], + [ + "raw", + string(s.raw) + ] + ]); case /* NumberLiteral */ 10 : - let param$7 = [ - loc, - t._0 - ]; - const s$1 = param$7[1]; - return node("NumberLiteralTypeAnnotation", param$7[0], [ - [ - "value", - number$1(s$1.value) - ], - [ - "raw", - string(s$1.raw) - ] - ]); + let param$7 = [ + loc, + t._0 + ]; + const s$1 = param$7[1]; + return node("NumberLiteralTypeAnnotation", param$7[0], [ + [ + "value", + number$1(s$1.value) + ], + [ + "raw", + string(s$1.raw) + ] + ]); case /* BooleanLiteral */ 11 : - let param$8 = [ - loc, - t._0 - ]; - const s$2 = param$8[1]; - return node("BooleanLiteralTypeAnnotation", param$8[0], [ - [ - "value", - bool(s$2.value) - ], - [ - "raw", - string(s$2.raw) - ] - ]); + let param$8 = [ + loc, + t._0 + ]; + const s$2 = param$8[1]; + return node("BooleanLiteralTypeAnnotation", param$8[0], [ + [ + "value", + bool(s$2.value) + ], + [ + "raw", + string(s$2.raw) + ] + ]); } } @@ -15656,503 +15656,503 @@ function parse(content, options) { } switch (arr.TAG) { case /* Array */ 0 : - return node("ArrayExpression", loc, [[ - "elements", - array_of_list((function (param) { - return option(expression_or_spread, param); - }), arr._0.elements) - ]]); + return node("ArrayExpression", loc, [[ + "elements", + array_of_list((function (param) { + return option(expression_or_spread, param); + }), arr._0.elements) + ]]); case /* Object */ 1 : - return node("ObjectExpression", loc, [[ - "properties", - array_of_list(object_property, arr._0.properties) - ]]); + return node("ObjectExpression", loc, [[ + "properties", + array_of_list(object_property, arr._0.properties) + ]]); case /* Function */ 2 : - return function_expression([ - loc, - arr._0 - ]); + return function_expression([ + loc, + arr._0 + ]); case /* ArrowFunction */ 3 : - const arrow = arr._0; - const b = arrow.body; - let body; - body = b.TAG === /* BodyBlock */ 0 ? block(b._0) : expression(b._0); - return node("ArrowFunctionExpression", loc, [ - [ - "id", - option(identifier, arrow.id) - ], - [ - "params", - array_of_list(pattern, arrow.params) - ], - [ - "defaults", - array_of_list((function (param) { - return option(expression, param); - }), arrow.defaults) - ], - [ - "rest", - option(identifier, arrow.rest) - ], - [ - "body", - body - ], - [ - "async", - bool(arrow.async) - ], - [ - "generator", - bool(arrow.generator) - ], - [ - "expression", - bool(arrow.expression) - ], - [ - "returnType", - option(type_annotation, arrow.returnType) - ], - [ - "typeParameters", - option(type_parameter_declaration, arrow.typeParameters) - ] - ]); + const arrow = arr._0; + const b = arrow.body; + let body; + body = b.TAG === /* BodyBlock */ 0 ? block(b._0) : expression(b._0); + return node("ArrowFunctionExpression", loc, [ + [ + "id", + option(identifier, arrow.id) + ], + [ + "params", + array_of_list(pattern, arrow.params) + ], + [ + "defaults", + array_of_list((function (param) { + return option(expression, param); + }), arrow.defaults) + ], + [ + "rest", + option(identifier, arrow.rest) + ], + [ + "body", + body + ], + [ + "async", + bool(arrow.async) + ], + [ + "generator", + bool(arrow.generator) + ], + [ + "expression", + bool(arrow.expression) + ], + [ + "returnType", + option(type_annotation, arrow.returnType) + ], + [ + "typeParameters", + option(type_parameter_declaration, arrow.typeParameters) + ] + ]); case /* Sequence */ 4 : - return node("SequenceExpression", loc, [[ - "expressions", - array_of_list(expression, arr._0.expressions) - ]]); + return node("SequenceExpression", loc, [[ + "expressions", + array_of_list(expression, arr._0.expressions) + ]]); case /* Unary */ 5 : - const unary = arr._0; - const match = unary.operator; - if (match === /* Await */ 7) { - return node("AwaitExpression", loc, [[ - "argument", - expression(unary.argument) - ]]); - } - const match$1 = unary.operator; - let operator; - switch (match$1) { - case /* Minus */ 0 : - operator = "-"; - break; - case /* Plus */ 1 : - operator = "+"; - break; - case /* Not */ 2 : - operator = "!"; - break; - case /* BitNot */ 3 : - operator = "~"; - break; - case /* Typeof */ 4 : - operator = "typeof"; - break; - case /* Void */ 5 : - operator = "void"; - break; - case /* Delete */ 6 : - operator = "delete"; - break; - case /* Await */ 7 : - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "matched above" - }); - - } - return node("UnaryExpression", loc, [ - [ - "operator", - string(operator) - ], - [ - "prefix", - bool(unary.prefix) - ], - [ + const unary = arr._0; + const match = unary.operator; + if (match === /* Await */ 7) { + return node("AwaitExpression", loc, [[ "argument", expression(unary.argument) - ] - ]); + ]]); + } + const match$1 = unary.operator; + let operator; + switch (match$1) { + case /* Minus */ 0 : + operator = "-"; + break; + case /* Plus */ 1 : + operator = "+"; + break; + case /* Not */ 2 : + operator = "!"; + break; + case /* BitNot */ 3 : + operator = "~"; + break; + case /* Typeof */ 4 : + operator = "typeof"; + break; + case /* Void */ 5 : + operator = "void"; + break; + case /* Delete */ 6 : + operator = "delete"; + break; + case /* Await */ 7 : + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "matched above" + }); + + } + return node("UnaryExpression", loc, [ + [ + "operator", + string(operator) + ], + [ + "prefix", + bool(unary.prefix) + ], + [ + "argument", + expression(unary.argument) + ] + ]); case /* Binary */ 6 : - const binary = arr._0; - const match$2 = binary.operator; - let operator$1; - switch (match$2) { - case /* Equal */ 0 : - operator$1 = "=="; - break; - case /* NotEqual */ 1 : - operator$1 = "!="; - break; - case /* StrictEqual */ 2 : - operator$1 = "==="; - break; - case /* StrictNotEqual */ 3 : - operator$1 = "!=="; - break; - case /* LessThan */ 4 : - operator$1 = "<"; - break; - case /* LessThanEqual */ 5 : - operator$1 = "<="; - break; - case /* GreaterThan */ 6 : - operator$1 = ">"; - break; - case /* GreaterThanEqual */ 7 : - operator$1 = ">="; - break; - case /* LShift */ 8 : - operator$1 = "<<"; - break; - case /* RShift */ 9 : - operator$1 = ">>"; - break; - case /* RShift3 */ 10 : - operator$1 = ">>>"; - break; - case /* Plus */ 11 : - operator$1 = "+"; - break; - case /* Minus */ 12 : - operator$1 = "-"; - break; - case /* Mult */ 13 : - operator$1 = "*"; - break; - case /* Exp */ 14 : - operator$1 = "**"; - break; - case /* Div */ 15 : - operator$1 = "/"; - break; - case /* Mod */ 16 : - operator$1 = "%"; - break; - case /* BitOr */ 17 : - operator$1 = "|"; - break; - case /* Xor */ 18 : - operator$1 = "^"; - break; - case /* BitAnd */ 19 : - operator$1 = "&"; - break; - case /* In */ 20 : - operator$1 = "in"; - break; - case /* Instanceof */ 21 : - operator$1 = "instanceof"; - break; - - } - return node("BinaryExpression", loc, [ - [ - "operator", - string(operator$1) - ], - [ - "left", - expression(binary.left) - ], - [ - "right", - expression(binary.right) - ] - ]); + const binary = arr._0; + const match$2 = binary.operator; + let operator$1; + switch (match$2) { + case /* Equal */ 0 : + operator$1 = "=="; + break; + case /* NotEqual */ 1 : + operator$1 = "!="; + break; + case /* StrictEqual */ 2 : + operator$1 = "==="; + break; + case /* StrictNotEqual */ 3 : + operator$1 = "!=="; + break; + case /* LessThan */ 4 : + operator$1 = "<"; + break; + case /* LessThanEqual */ 5 : + operator$1 = "<="; + break; + case /* GreaterThan */ 6 : + operator$1 = ">"; + break; + case /* GreaterThanEqual */ 7 : + operator$1 = ">="; + break; + case /* LShift */ 8 : + operator$1 = "<<"; + break; + case /* RShift */ 9 : + operator$1 = ">>"; + break; + case /* RShift3 */ 10 : + operator$1 = ">>>"; + break; + case /* Plus */ 11 : + operator$1 = "+"; + break; + case /* Minus */ 12 : + operator$1 = "-"; + break; + case /* Mult */ 13 : + operator$1 = "*"; + break; + case /* Exp */ 14 : + operator$1 = "**"; + break; + case /* Div */ 15 : + operator$1 = "/"; + break; + case /* Mod */ 16 : + operator$1 = "%"; + break; + case /* BitOr */ 17 : + operator$1 = "|"; + break; + case /* Xor */ 18 : + operator$1 = "^"; + break; + case /* BitAnd */ 19 : + operator$1 = "&"; + break; + case /* In */ 20 : + operator$1 = "in"; + break; + case /* Instanceof */ 21 : + operator$1 = "instanceof"; + break; + + } + return node("BinaryExpression", loc, [ + [ + "operator", + string(operator$1) + ], + [ + "left", + expression(binary.left) + ], + [ + "right", + expression(binary.right) + ] + ]); case /* Assignment */ 7 : - const assignment = arr._0; - const match$3 = assignment.operator; - let operator$2; - switch (match$3) { - case /* Assign */ 0 : - operator$2 = "="; - break; - case /* PlusAssign */ 1 : - operator$2 = "+="; - break; - case /* MinusAssign */ 2 : - operator$2 = "-="; - break; - case /* MultAssign */ 3 : - operator$2 = "*="; - break; - case /* ExpAssign */ 4 : - operator$2 = "**="; - break; - case /* DivAssign */ 5 : - operator$2 = "/="; - break; - case /* ModAssign */ 6 : - operator$2 = "%="; - break; - case /* LShiftAssign */ 7 : - operator$2 = "<<="; - break; - case /* RShiftAssign */ 8 : - operator$2 = ">>="; - break; - case /* RShift3Assign */ 9 : - operator$2 = ">>>="; - break; - case /* BitOrAssign */ 10 : - operator$2 = "|="; - break; - case /* BitXorAssign */ 11 : - operator$2 = "^="; - break; - case /* BitAndAssign */ 12 : - operator$2 = "&="; - break; - - } - return node("AssignmentExpression", loc, [ - [ - "operator", - string(operator$2) - ], - [ - "left", - pattern(assignment.left) - ], - [ - "right", - expression(assignment.right) - ] - ]); + const assignment = arr._0; + const match$3 = assignment.operator; + let operator$2; + switch (match$3) { + case /* Assign */ 0 : + operator$2 = "="; + break; + case /* PlusAssign */ 1 : + operator$2 = "+="; + break; + case /* MinusAssign */ 2 : + operator$2 = "-="; + break; + case /* MultAssign */ 3 : + operator$2 = "*="; + break; + case /* ExpAssign */ 4 : + operator$2 = "**="; + break; + case /* DivAssign */ 5 : + operator$2 = "/="; + break; + case /* ModAssign */ 6 : + operator$2 = "%="; + break; + case /* LShiftAssign */ 7 : + operator$2 = "<<="; + break; + case /* RShiftAssign */ 8 : + operator$2 = ">>="; + break; + case /* RShift3Assign */ 9 : + operator$2 = ">>>="; + break; + case /* BitOrAssign */ 10 : + operator$2 = "|="; + break; + case /* BitXorAssign */ 11 : + operator$2 = "^="; + break; + case /* BitAndAssign */ 12 : + operator$2 = "&="; + break; + + } + return node("AssignmentExpression", loc, [ + [ + "operator", + string(operator$2) + ], + [ + "left", + pattern(assignment.left) + ], + [ + "right", + expression(assignment.right) + ] + ]); case /* Update */ 8 : - const update = arr._0; - const match$4 = update.operator; - let operator$3; - operator$3 = match$4 === /* Increment */ 0 ? "++" : "--"; - return node("UpdateExpression", loc, [ - [ - "operator", - string(operator$3) - ], - [ - "argument", - expression(update.argument) - ], - [ - "prefix", - bool(update.prefix) - ] - ]); + const update = arr._0; + const match$4 = update.operator; + let operator$3; + operator$3 = match$4 === /* Increment */ 0 ? "++" : "--"; + return node("UpdateExpression", loc, [ + [ + "operator", + string(operator$3) + ], + [ + "argument", + expression(update.argument) + ], + [ + "prefix", + bool(update.prefix) + ] + ]); case /* Logical */ 9 : - const logical = arr._0; - const match$5 = logical.operator; - let operator$4; - operator$4 = match$5 === /* Or */ 0 ? "||" : "&&"; - return node("LogicalExpression", loc, [ - [ - "operator", - string(operator$4) - ], - [ - "left", - expression(logical.left) - ], - [ - "right", - expression(logical.right) - ] - ]); + const logical = arr._0; + const match$5 = logical.operator; + let operator$4; + operator$4 = match$5 === /* Or */ 0 ? "||" : "&&"; + return node("LogicalExpression", loc, [ + [ + "operator", + string(operator$4) + ], + [ + "left", + expression(logical.left) + ], + [ + "right", + expression(logical.right) + ] + ]); case /* Conditional */ 10 : - const conditional = arr._0; - return node("ConditionalExpression", loc, [ - [ - "test", - expression(conditional.test) - ], - [ - "consequent", - expression(conditional.consequent) - ], - [ - "alternate", - expression(conditional.alternate) - ] - ]); + const conditional = arr._0; + return node("ConditionalExpression", loc, [ + [ + "test", + expression(conditional.test) + ], + [ + "consequent", + expression(conditional.consequent) + ], + [ + "alternate", + expression(conditional.alternate) + ] + ]); case /* New */ 11 : - const _new = arr._0; - return node("NewExpression", loc, [ - [ - "callee", - expression(_new.callee) - ], - [ - "arguments", - array_of_list(expression_or_spread, _new.arguments) - ] - ]); + const _new = arr._0; + return node("NewExpression", loc, [ + [ + "callee", + expression(_new.callee) + ], + [ + "arguments", + array_of_list(expression_or_spread, _new.arguments) + ] + ]); case /* Call */ 12 : - const call = arr._0; - return node("CallExpression", loc, [ - [ - "callee", - expression(call.callee) - ], - [ - "arguments", - array_of_list(expression_or_spread, call.arguments) - ] - ]); + const call = arr._0; + return node("CallExpression", loc, [ + [ + "callee", + expression(call.callee) + ], + [ + "arguments", + array_of_list(expression_or_spread, call.arguments) + ] + ]); case /* Member */ 13 : - const member = arr._0; - const id = member.property; - let property; - property = id.TAG === /* PropertyIdentifier */ 0 ? identifier(id._0) : expression(id._0); - return node("MemberExpression", loc, [ - [ - "object", - expression(member._object) - ], - [ - "property", - property - ], - [ - "computed", - bool(member.computed) - ] - ]); + const member = arr._0; + const id = member.property; + let property; + property = id.TAG === /* PropertyIdentifier */ 0 ? identifier(id._0) : expression(id._0); + return node("MemberExpression", loc, [ + [ + "object", + expression(member._object) + ], + [ + "property", + property + ], + [ + "computed", + bool(member.computed) + ] + ]); case /* Yield */ 14 : - const $$yield = arr._0; - return node("YieldExpression", loc, [ - [ - "argument", - option(expression, $$yield.argument) - ], - [ - "delegate", - bool($$yield.delegate) - ] - ]); + const $$yield = arr._0; + return node("YieldExpression", loc, [ + [ + "argument", + option(expression, $$yield.argument) + ], + [ + "delegate", + bool($$yield.delegate) + ] + ]); case /* Comprehension */ 15 : - const comp = arr._0; - return node("ComprehensionExpression", loc, [ - [ - "blocks", - array_of_list(comprehension_block, comp.blocks) - ], - [ - "filter", - option(expression, comp.filter) - ] - ]); + const comp = arr._0; + return node("ComprehensionExpression", loc, [ + [ + "blocks", + array_of_list(comprehension_block, comp.blocks) + ], + [ + "filter", + option(expression, comp.filter) + ] + ]); case /* Generator */ 16 : - const gen = arr._0; - return node("GeneratorExpression", loc, [ - [ - "blocks", - array_of_list(comprehension_block, gen.blocks) - ], - [ - "filter", - option(expression, gen.filter) - ] - ]); + const gen = arr._0; + return node("GeneratorExpression", loc, [ + [ + "blocks", + array_of_list(comprehension_block, gen.blocks) + ], + [ + "filter", + option(expression, gen.filter) + ] + ]); case /* Let */ 17 : - const _let = arr._0; - return node("LetExpression", loc, [ - [ - "head", - array_of_list(let_assignment, _let.head) - ], - [ - "body", - expression(_let.body) - ] - ]); + const _let = arr._0; + return node("LetExpression", loc, [ + [ + "head", + array_of_list(let_assignment, _let.head) + ], + [ + "body", + expression(_let.body) + ] + ]); case /* Identifier */ 18 : - return identifier(arr._0); + return identifier(arr._0); case /* Literal */ 19 : - return literal([ - loc, - arr._0 - ]); + return literal([ + loc, + arr._0 + ]); case /* TemplateLiteral */ 20 : - return template_literal([ - loc, - arr._0 - ]); + return template_literal([ + loc, + arr._0 + ]); case /* TaggedTemplate */ 21 : - let param$1 = [ - loc, - arr._0 - ]; - const tagged = param$1[1]; - return node("TaggedTemplateExpression", param$1[0], [ - [ - "tag", - expression(tagged.tag) - ], - [ - "quasi", - template_literal(tagged.quasi) - ] - ]); + let param$1 = [ + loc, + arr._0 + ]; + const tagged = param$1[1]; + return node("TaggedTemplateExpression", param$1[0], [ + [ + "tag", + expression(tagged.tag) + ], + [ + "quasi", + template_literal(tagged.quasi) + ] + ]); case /* JSXElement */ 22 : - return jsx_element([ - loc, - arr._0 - ]); + return jsx_element([ + loc, + arr._0 + ]); case /* Class */ 23 : - let param$2 = [ - loc, - arr._0 - ]; - const c = param$2[1]; - return node("ClassExpression", param$2[0], [ - [ - "id", - option(identifier, c.id) - ], - [ - "body", - class_body(c.body) - ], - [ - "superClass", - option(expression, c.superClass) - ], - [ - "typeParameters", - option(type_parameter_declaration, c.typeParameters) - ], - [ - "superTypeParameters", - option(type_parameter_instantiation, c.superTypeParameters) - ], - [ - "implements", - array_of_list(class_implements, c.implements) - ], - [ - "decorators", - array_of_list(expression, c.classDecorators) - ] - ]); + let param$2 = [ + loc, + arr._0 + ]; + const c = param$2[1]; + return node("ClassExpression", param$2[0], [ + [ + "id", + option(identifier, c.id) + ], + [ + "body", + class_body(c.body) + ], + [ + "superClass", + option(expression, c.superClass) + ], + [ + "typeParameters", + option(type_parameter_declaration, c.typeParameters) + ], + [ + "superTypeParameters", + option(type_parameter_instantiation, c.superTypeParameters) + ], + [ + "implements", + array_of_list(class_implements, c.implements) + ], + [ + "decorators", + array_of_list(expression, c.classDecorators) + ] + ]); case /* TypeCast */ 24 : - const typecast = arr._0; - return node("TypeCastExpression", loc, [ - [ - "expression", - expression(typecast.expression) - ], - [ - "typeAnnotation", - type_annotation(typecast.typeAnnotation) - ] - ]); + const typecast = arr._0; + return node("TypeCastExpression", loc, [ + [ + "expression", + expression(typecast.expression) + ], + [ + "typeAnnotation", + type_annotation(typecast.typeAnnotation) + ] + ]); } }; @@ -16167,18 +16167,18 @@ function parse(content, options) { } else { switch (value.TAG) { case /* String */ 0 : - value_ = string(value._0); - break; + value_ = string(value._0); + break; case /* Boolean */ 1 : - value_ = bool(value._0); - break; + value_ = bool(value._0); + break; case /* Number */ 2 : - value_ = number$1(value._0); - break; + value_ = number$1(value._0); + break; case /* RegExp */ 3 : - const match = value._0; - value_ = regexp$1(loc, match.pattern, match.flags); - break; + const match = value._0; + value_ = regexp$1(loc, match.pattern, match.flags); + break; } } @@ -16232,58 +16232,58 @@ function parse(content, options) { const loc = param[0]; switch (obj.TAG) { case /* Object */ 0 : - const obj$1 = obj._0; - return node("ObjectPattern", loc, [ - [ - "properties", - array_of_list(object_pattern_property, obj$1.properties) - ], - [ - "typeAnnotation", - option(type_annotation, obj$1.typeAnnotation) - ] - ]); + const obj$1 = obj._0; + return node("ObjectPattern", loc, [ + [ + "properties", + array_of_list(object_pattern_property, obj$1.properties) + ], + [ + "typeAnnotation", + option(type_annotation, obj$1.typeAnnotation) + ] + ]); case /* Array */ 1 : - const arr = obj._0; - return node("ArrayPattern", loc, [ - [ - "elements", - array_of_list((function (param) { - return option(array_pattern_element, param); - }), arr.elements) - ], - [ - "typeAnnotation", - option(type_annotation, arr.typeAnnotation) - ] - ]); + const arr = obj._0; + return node("ArrayPattern", loc, [ + [ + "elements", + array_of_list((function (param) { + return option(array_pattern_element, param); + }), arr.elements) + ], + [ + "typeAnnotation", + option(type_annotation, arr.typeAnnotation) + ] + ]); case /* Assignment */ 2 : - const match = obj._0; - return node("AssignmentPattern", loc, [ - [ - "left", - pattern(match.left) - ], - [ - "right", - expression(match.right) - ] - ]); + const match = obj._0; + return node("AssignmentPattern", loc, [ + [ + "left", + pattern(match.left) + ], + [ + "right", + expression(match.right) + ] + ]); case /* Identifier */ 3 : - return identifier(obj._0); + return identifier(obj._0); case /* Expression */ 4 : - return expression(obj._0); + return expression(obj._0); } }; const jsx_name = function (id) { switch (id.TAG) { case /* Identifier */ 0 : - return jsx_identifier(id._0); + return jsx_identifier(id._0); case /* NamespacedName */ 1 : - return jsx_namespaced_name(id._0); + return jsx_namespaced_name(id._0); case /* MemberExpression */ 2 : - return jsx_member_expression(id._0); + return jsx_member_expression(id._0); } }; @@ -16433,31 +16433,31 @@ function parse(content, options) { const loc = param[0]; switch (element.TAG) { case /* Element */ 0 : - return jsx_element([ - loc, - element._0 - ]); + return jsx_element([ + loc, + element._0 + ]); case /* ExpressionContainer */ 1 : - return jsx_expression_container([ - loc, - element._0 - ]); + return jsx_expression_container([ + loc, + element._0 + ]); case /* Text */ 2 : - let param$1 = [ - loc, - element._0 - ]; - const text = param$1[1]; - return node("JSXText", param$1[0], [ - [ - "value", - string(text.value) - ], - [ - "raw", - string(text.raw) - ] - ]); + let param$1 = [ + loc, + element._0 + ]; + const text = param$1[1]; + return node("JSXText", param$1[0], [ + [ + "value", + string(text.value) + ], + [ + "raw", + string(text.raw) + ] + ]); } }; @@ -16636,16 +16636,16 @@ function parse(content, options) { let key; switch (lit.TAG) { case /* Literal */ 0 : - key = literal(lit._0); - break; + key = literal(lit._0); + break; case /* Identifier */ 1 : - key = identifier(lit._0); - break; + key = identifier(lit._0); + break; case /* Computed */ 2 : - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "There should not be computed object type property keys" - }); + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "There should not be computed object type property keys" + }); } return node("ObjectTypeProperty", param[0], [ @@ -16725,39 +16725,39 @@ function parse(content, options) { let match; switch (key.TAG) { case /* Literal */ 0 : - match = [ - literal(key._0), - false - ]; - break; + match = [ + literal(key._0), + false + ]; + break; case /* Identifier */ 1 : - match = [ - identifier(key._0), - false - ]; - break; + match = [ + identifier(key._0), + false + ]; + break; case /* Computed */ 2 : - match = [ - expression(key._0), - true - ]; - break; + match = [ + expression(key._0), + true + ]; + break; } let kind; switch (method_.kind) { case /* Constructor */ 0 : - kind = "constructor"; - break; + kind = "constructor"; + break; case /* Method */ 1 : - kind = "method"; - break; + kind = "method"; + break; case /* Get */ 2 : - kind = "get"; - break; + kind = "get"; + break; case /* Set */ 3 : - kind = "set"; - break; + kind = "set"; + break; } return node("MethodDefinition", param[0], [ @@ -16793,23 +16793,23 @@ function parse(content, options) { let match$1; switch (lit.TAG) { case /* Literal */ 0 : - match$1 = [ - literal(lit._0), - false - ]; - break; + match$1 = [ + literal(lit._0), + false + ]; + break; case /* Identifier */ 1 : - match$1 = [ - identifier(lit._0), - false - ]; - break; + match$1 = [ + identifier(lit._0), + false + ]; + break; case /* Computed */ 2 : - match$1 = [ - expression(lit._0), - true - ]; - break; + match$1 = [ + expression(lit._0), + true + ]; + break; } return node("ClassProperty", param$1[0], [ @@ -16863,511 +16863,511 @@ function parse(content, options) { } switch (b.TAG) { case /* Block */ 0 : - return block([ - loc, - b._0 - ]); + return block([ + loc, + b._0 + ]); case /* Expression */ 1 : - return node("ExpressionStatement", loc, [[ - "expression", - expression(b._0.expression) - ]]); + return node("ExpressionStatement", loc, [[ + "expression", + expression(b._0.expression) + ]]); case /* If */ 2 : - const _if = b._0; - return node("IfStatement", loc, [ - [ - "test", - expression(_if.test) - ], - [ - "consequent", - statement(_if.consequent) - ], - [ - "alternate", - option(statement, _if.alternate) - ] - ]); + const _if = b._0; + return node("IfStatement", loc, [ + [ + "test", + expression(_if.test) + ], + [ + "consequent", + statement(_if.consequent) + ], + [ + "alternate", + option(statement, _if.alternate) + ] + ]); case /* Labeled */ 3 : - const labeled = b._0; - return node("LabeledStatement", loc, [ - [ - "label", - identifier(labeled.label) - ], - [ - "body", - statement(labeled.body) - ] - ]); + const labeled = b._0; + return node("LabeledStatement", loc, [ + [ + "label", + identifier(labeled.label) + ], + [ + "body", + statement(labeled.body) + ] + ]); case /* Break */ 4 : - return node("BreakStatement", loc, [[ - "label", - option(identifier, b._0.label) - ]]); + return node("BreakStatement", loc, [[ + "label", + option(identifier, b._0.label) + ]]); case /* Continue */ 5 : - return node("ContinueStatement", loc, [[ - "label", - option(identifier, b._0.label) - ]]); + return node("ContinueStatement", loc, [[ + "label", + option(identifier, b._0.label) + ]]); case /* With */ 6 : - const _with = b._0; - return node("WithStatement", loc, [ - [ - "object", - expression(_with._object) - ], - [ - "body", - statement(_with.body) - ] - ]); + const _with = b._0; + return node("WithStatement", loc, [ + [ + "object", + expression(_with._object) + ], + [ + "body", + statement(_with.body) + ] + ]); case /* TypeAlias */ 7 : - return type_alias([ - loc, - b._0 - ]); + return type_alias([ + loc, + b._0 + ]); case /* Switch */ 8 : - const $$switch = b._0; - return node("SwitchStatement", loc, [ - [ - "discriminant", - expression($$switch.discriminant) - ], - [ - "cases", - array_of_list($$case, $$switch.cases) - ], - [ - "lexical", - bool($$switch.lexical) - ] - ]); + const $$switch = b._0; + return node("SwitchStatement", loc, [ + [ + "discriminant", + expression($$switch.discriminant) + ], + [ + "cases", + array_of_list($$case, $$switch.cases) + ], + [ + "lexical", + bool($$switch.lexical) + ] + ]); case /* Return */ 9 : - return node("ReturnStatement", loc, [[ - "argument", - option(expression, b._0.argument) - ]]); + return node("ReturnStatement", loc, [[ + "argument", + option(expression, b._0.argument) + ]]); case /* Throw */ 10 : - return node("ThrowStatement", loc, [[ - "argument", - expression(b._0.argument) - ]]); + return node("ThrowStatement", loc, [[ + "argument", + expression(b._0.argument) + ]]); case /* Try */ 11 : - const _try = b._0; - return node("TryStatement", loc, [ - [ - "block", - block(_try.block) - ], - [ - "handler", - option($$catch, _try.handler) - ], - [ - "guardedHandlers", - array_of_list($$catch, _try.guardedHandlers) - ], - [ - "finalizer", - option(block, _try.finalizer) - ] - ]); + const _try = b._0; + return node("TryStatement", loc, [ + [ + "block", + block(_try.block) + ], + [ + "handler", + option($$catch, _try.handler) + ], + [ + "guardedHandlers", + array_of_list($$catch, _try.guardedHandlers) + ], + [ + "finalizer", + option(block, _try.finalizer) + ] + ]); case /* While */ 12 : - const _while = b._0; - return node("WhileStatement", loc, [ - [ - "test", - expression(_while.test) - ], - [ - "body", - statement(_while.body) - ] - ]); + const _while = b._0; + return node("WhileStatement", loc, [ + [ + "test", + expression(_while.test) + ], + [ + "body", + statement(_while.body) + ] + ]); case /* DoWhile */ 13 : - const dowhile = b._0; - return node("DoWhileStatement", loc, [ - [ - "body", - statement(dowhile.body) - ], - [ - "test", - expression(dowhile.test) - ] - ]); + const dowhile = b._0; + return node("DoWhileStatement", loc, [ + [ + "body", + statement(dowhile.body) + ], + [ + "test", + expression(dowhile.test) + ] + ]); case /* For */ 14 : - const _for = b._0; - const init = function (init$1) { - if (init$1.TAG === /* InitDeclaration */ 0) { - return variable_declaration(init$1._0); - } else { - return expression(init$1._0); - } - }; - return node("ForStatement", loc, [ - [ - "init", - option(init, _for.init) - ], - [ - "test", - option(expression, _for.test) - ], - [ - "update", - option(expression, _for.update) - ], - [ - "body", - statement(_for.body) - ] - ]); + const _for = b._0; + const init = function (init$1) { + if (init$1.TAG === /* InitDeclaration */ 0) { + return variable_declaration(init$1._0); + } else { + return expression(init$1._0); + } + }; + return node("ForStatement", loc, [ + [ + "init", + option(init, _for.init) + ], + [ + "test", + option(expression, _for.test) + ], + [ + "update", + option(expression, _for.update) + ], + [ + "body", + statement(_for.body) + ] + ]); case /* ForIn */ 15 : - const forin = b._0; - const left = forin.left; - let left$1; - left$1 = left.TAG === /* LeftDeclaration */ 0 ? variable_declaration(left._0) : expression(left._0); - return node("ForInStatement", loc, [ - [ - "left", - left$1 - ], - [ - "right", - expression(forin.right) - ], - [ - "body", - statement(forin.body) - ], - [ - "each", - bool(forin.each) - ] - ]); + const forin = b._0; + const left = forin.left; + let left$1; + left$1 = left.TAG === /* LeftDeclaration */ 0 ? variable_declaration(left._0) : expression(left._0); + return node("ForInStatement", loc, [ + [ + "left", + left$1 + ], + [ + "right", + expression(forin.right) + ], + [ + "body", + statement(forin.body) + ], + [ + "each", + bool(forin.each) + ] + ]); case /* ForOf */ 16 : - const forof = b._0; - const left$2 = forof.left; - let left$3; - left$3 = left$2.TAG === /* LeftDeclaration */ 0 ? variable_declaration(left$2._0) : expression(left$2._0); - return node("ForOfStatement", loc, [ - [ - "left", - left$3 - ], - [ - "right", - expression(forof.right) - ], - [ - "body", - statement(forof.body) - ] - ]); - case /* Let */ 17 : - const _let = b._0; - return node("LetStatement", loc, [ - [ - "head", - array_of_list(let_assignment, _let.head) - ], - [ - "body", - statement(_let.body) - ] - ]); + const forof = b._0; + const left$2 = forof.left; + let left$3; + left$3 = left$2.TAG === /* LeftDeclaration */ 0 ? variable_declaration(left$2._0) : expression(left$2._0); + return node("ForOfStatement", loc, [ + [ + "left", + left$3 + ], + [ + "right", + expression(forof.right) + ], + [ + "body", + statement(forof.body) + ] + ]); + case /* Let */ 17 : + const _let = b._0; + return node("LetStatement", loc, [ + [ + "head", + array_of_list(let_assignment, _let.head) + ], + [ + "body", + statement(_let.body) + ] + ]); case /* FunctionDeclaration */ 18 : - const fn = b._0; - const id = fn.id; - const match = id !== undefined ? [ - "FunctionDeclaration", - identifier(id) - ] : [ - "FunctionExpression", - $$null - ]; - const b$1 = fn.body; - let body; - body = b$1.TAG === /* BodyBlock */ 0 ? block(b$1._0) : expression(b$1._0); - return node(match[0], loc, [ - [ - "id", - match[1] - ], - [ - "params", - array_of_list(pattern, fn.params) - ], - [ - "defaults", - array_of_list((function (param) { - return option(expression, param); - }), fn.defaults) - ], - [ - "rest", - option(identifier, fn.rest) - ], - [ - "body", - body - ], - [ - "async", - bool(fn.async) - ], - [ - "generator", - bool(fn.generator) - ], - [ - "expression", - bool(fn.expression) - ], - [ - "returnType", - option(type_annotation, fn.returnType) - ], - [ - "typeParameters", - option(type_parameter_declaration, fn.typeParameters) - ] - ]); + const fn = b._0; + const id = fn.id; + const match = id !== undefined ? [ + "FunctionDeclaration", + identifier(id) + ] : [ + "FunctionExpression", + $$null + ]; + const b$1 = fn.body; + let body; + body = b$1.TAG === /* BodyBlock */ 0 ? block(b$1._0) : expression(b$1._0); + return node(match[0], loc, [ + [ + "id", + match[1] + ], + [ + "params", + array_of_list(pattern, fn.params) + ], + [ + "defaults", + array_of_list((function (param) { + return option(expression, param); + }), fn.defaults) + ], + [ + "rest", + option(identifier, fn.rest) + ], + [ + "body", + body + ], + [ + "async", + bool(fn.async) + ], + [ + "generator", + bool(fn.generator) + ], + [ + "expression", + bool(fn.expression) + ], + [ + "returnType", + option(type_annotation, fn.returnType) + ], + [ + "typeParameters", + option(type_parameter_declaration, fn.typeParameters) + ] + ]); case /* VariableDeclaration */ 19 : - return variable_declaration([ - loc, - b._0 - ]); + return variable_declaration([ + loc, + b._0 + ]); case /* ClassDeclaration */ 20 : - let param$1 = [ - loc, - b._0 + let param$1 = [ + loc, + b._0 + ]; + const c = param$1[1]; + const id$1 = c.id; + const match$1 = id$1 !== undefined ? [ + "ClassDeclaration", + identifier(id$1) + ] : [ + "ClassExpression", + $$null ]; - const c = param$1[1]; - const id$1 = c.id; - const match$1 = id$1 !== undefined ? [ - "ClassDeclaration", - identifier(id$1) - ] : [ - "ClassExpression", - $$null - ]; - return node(match$1[0], param$1[0], [ - [ - "id", - match$1[1] - ], - [ - "body", - class_body(c.body) - ], - [ - "superClass", - option(expression, c.superClass) - ], - [ - "typeParameters", - option(type_parameter_declaration, c.typeParameters) - ], - [ - "superTypeParameters", - option(type_parameter_instantiation, c.superTypeParameters) - ], - [ - "implements", - array_of_list(class_implements, c.implements) - ], - [ - "decorators", - array_of_list(expression, c.classDecorators) - ] - ]); + return node(match$1[0], param$1[0], [ + [ + "id", + match$1[1] + ], + [ + "body", + class_body(c.body) + ], + [ + "superClass", + option(expression, c.superClass) + ], + [ + "typeParameters", + option(type_parameter_declaration, c.typeParameters) + ], + [ + "superTypeParameters", + option(type_parameter_instantiation, c.superTypeParameters) + ], + [ + "implements", + array_of_list(class_implements, c.implements) + ], + [ + "decorators", + array_of_list(expression, c.classDecorators) + ] + ]); case /* InterfaceDeclaration */ 21 : - return interface_declaration([ - loc, - b._0 - ]); + return interface_declaration([ + loc, + b._0 + ]); case /* DeclareVariable */ 22 : - return declare_variable([ - loc, - b._0 - ]); + return declare_variable([ + loc, + b._0 + ]); case /* DeclareFunction */ 23 : - return declare_function([ - loc, - b._0 - ]); + return declare_function([ + loc, + b._0 + ]); case /* DeclareClass */ 24 : - return declare_class([ - loc, - b._0 - ]); + return declare_class([ + loc, + b._0 + ]); case /* DeclareModule */ 25 : - const m = b._0; - const lit = m.id; - let id$2; - id$2 = lit.TAG === /* Identifier */ 0 ? identifier(lit._0) : literal(lit._0); - const match$2 = m.kind; - let tmp; - tmp = match$2.TAG === /* CommonJS */ 0 ? string("CommonJS") : string("ES"); - return node("DeclareModule", loc, [ - [ - "id", - id$2 - ], - [ - "body", - block(m.body) - ], - [ - "kind", - tmp - ] - ]); + const m = b._0; + const lit = m.id; + let id$2; + id$2 = lit.TAG === /* Identifier */ 0 ? identifier(lit._0) : literal(lit._0); + const match$2 = m.kind; + let tmp; + tmp = match$2.TAG === /* CommonJS */ 0 ? string("CommonJS") : string("ES"); + return node("DeclareModule", loc, [ + [ + "id", + id$2 + ], + [ + "body", + block(m.body) + ], + [ + "kind", + tmp + ] + ]); case /* DeclareModuleExports */ 26 : - return node("DeclareModuleExports", loc, [[ - "typeAnnotation", - type_annotation(b._0) - ]]); + return node("DeclareModuleExports", loc, [[ + "typeAnnotation", + type_annotation(b._0) + ]]); case /* DeclareExportDeclaration */ 27 : - const $$export = b._0; - const match$3 = $$export.declaration; - let declaration; - if (match$3 !== undefined) { - switch (match$3.TAG) { - case /* Variable */ 0 : - declaration = declare_variable(match$3._0); - break; - case /* Function */ 1 : - declaration = declare_function(match$3._0); - break; - case /* Class */ 2 : - declaration = declare_class(match$3._0); - break; - case /* DefaultType */ 3 : - declaration = _type(match$3._0); - break; - case /* NamedType */ 4 : - declaration = type_alias(match$3._0); - break; - case /* Interface */ 5 : - declaration = interface_declaration(match$3._0); - break; - - } - } else { - declaration = $$null; + const $$export = b._0; + const match$3 = $$export.declaration; + let declaration; + if (match$3 !== undefined) { + switch (match$3.TAG) { + case /* Variable */ 0 : + declaration = declare_variable(match$3._0); + break; + case /* Function */ 1 : + declaration = declare_function(match$3._0); + break; + case /* Class */ 2 : + declaration = declare_class(match$3._0); + break; + case /* DefaultType */ 3 : + declaration = _type(match$3._0); + break; + case /* NamedType */ 4 : + declaration = type_alias(match$3._0); + break; + case /* Interface */ 5 : + declaration = interface_declaration(match$3._0); + break; + } - return node("DeclareExportDeclaration", loc, [ - [ - "default", - bool($$export.default) - ], - [ - "declaration", - declaration - ], - [ - "specifiers", - export_specifiers($$export.specifiers) - ], - [ - "source", - option(literal, $$export.source) - ] - ]); + } else { + declaration = $$null; + } + return node("DeclareExportDeclaration", loc, [ + [ + "default", + bool($$export.default) + ], + [ + "declaration", + declaration + ], + [ + "specifiers", + export_specifiers($$export.specifiers) + ], + [ + "source", + option(literal, $$export.source) + ] + ]); case /* ExportDeclaration */ 28 : - const $$export$1 = b._0; - const match$4 = $$export$1.declaration; - const declaration$1 = match$4 !== undefined ? ( - match$4.TAG === /* Declaration */ 0 ? statement(match$4._0) : expression(match$4._0) - ) : $$null; - return node("ExportDeclaration", loc, [ - [ - "default", - bool($$export$1.default) - ], - [ - "declaration", - declaration$1 - ], - [ - "specifiers", - export_specifiers($$export$1.specifiers) - ], - [ - "source", - option(literal, $$export$1.source) - ], - [ - "exportKind", - string(export_kind($$export$1.exportKind)) - ] - ]); + const $$export$1 = b._0; + const match$4 = $$export$1.declaration; + const declaration$1 = match$4 !== undefined ? ( + match$4.TAG === /* Declaration */ 0 ? statement(match$4._0) : expression(match$4._0) + ) : $$null; + return node("ExportDeclaration", loc, [ + [ + "default", + bool($$export$1.default) + ], + [ + "declaration", + declaration$1 + ], + [ + "specifiers", + export_specifiers($$export$1.specifiers) + ], + [ + "source", + option(literal, $$export$1.source) + ], + [ + "exportKind", + string(export_kind($$export$1.exportKind)) + ] + ]); case /* ImportDeclaration */ 29 : - const $$import = b._0; - const specifiers = Stdlib__List.map((function (id) { - switch (id.TAG) { - case /* ImportNamedSpecifier */ 0 : - const match = id._0; - let local_id = match.local; - let remote_id = match.remote; - const span_loc = local_id !== undefined ? btwn(remote_id[0], local_id[0]) : remote_id[0]; - return node("ImportSpecifier", span_loc, [ - [ - "id", - identifier(remote_id) - ], - [ - "name", - option(identifier, local_id) - ] - ]); - case /* ImportDefaultSpecifier */ 1 : - let id$1 = id._0; - return node("ImportDefaultSpecifier", id$1[0], [[ - "id", - identifier(id$1) - ]]); - case /* ImportNamespaceSpecifier */ 2 : - let param = id._0; - return node("ImportNamespaceSpecifier", param[0], [[ - "id", - identifier(param[1]) - ]]); - - } - }), $$import.specifiers); - const match$5 = $$import.importKind; - let import_kind; - switch (match$5) { - case /* ImportType */ 0 : - import_kind = "type"; - break; - case /* ImportTypeof */ 1 : - import_kind = "typeof"; - break; - case /* ImportValue */ 2 : - import_kind = "value"; - break; - - } - return node("ImportDeclaration", loc, [ - [ - "specifiers", - array(Stdlib__Array.of_list(specifiers)) - ], - [ - "source", - literal($$import.source) - ], - [ - "importKind", - string(import_kind) - ] - ]); + const $$import = b._0; + const specifiers = Stdlib__List.map((function (id) { + switch (id.TAG) { + case /* ImportNamedSpecifier */ 0 : + const match = id._0; + let local_id = match.local; + let remote_id = match.remote; + const span_loc = local_id !== undefined ? btwn(remote_id[0], local_id[0]) : remote_id[0]; + return node("ImportSpecifier", span_loc, [ + [ + "id", + identifier(remote_id) + ], + [ + "name", + option(identifier, local_id) + ] + ]); + case /* ImportDefaultSpecifier */ 1 : + let id$1 = id._0; + return node("ImportDefaultSpecifier", id$1[0], [[ + "id", + identifier(id$1) + ]]); + case /* ImportNamespaceSpecifier */ 2 : + let param = id._0; + return node("ImportNamespaceSpecifier", param[0], [[ + "id", + identifier(param[1]) + ]]); + + } + }), $$import.specifiers); + const match$5 = $$import.importKind; + let import_kind; + switch (match$5) { + case /* ImportType */ 0 : + import_kind = "type"; + break; + case /* ImportTypeof */ 1 : + import_kind = "typeof"; + break; + case /* ImportValue */ 2 : + import_kind = "value"; + break; + + } + return node("ImportDeclaration", loc, [ + [ + "specifiers", + array(Stdlib__Array.of_list(specifiers)) + ], + [ + "source", + literal($$import.source) + ], + [ + "importKind", + string(import_kind) + ] + ]); } }; @@ -17428,14 +17428,14 @@ function parse(content, options) { let kind; switch (match) { case /* Var */ 0 : - kind = "var"; - break; + kind = "var"; + break; case /* Let */ 1 : - kind = "let"; - break; + kind = "let"; + break; case /* Const */ 2 : - kind = "const"; - break; + kind = "const"; + break; } return node("VariableDeclaration", param[0], [ @@ -17581,23 +17581,23 @@ function parse(content, options) { let match$1; switch (lit.TAG) { case /* Literal */ 0 : - match$1 = [ - literal(lit._0), - false - ]; - break; + match$1 = [ + literal(lit._0), + false + ]; + break; case /* Identifier */ 1 : - match$1 = [ - identifier(lit._0), - false - ]; - break; + match$1 = [ + identifier(lit._0), + false + ]; + break; case /* Computed */ 2 : - match$1 = [ - expression(lit._0), - true - ]; - break; + match$1 = [ + expression(lit._0), + true + ]; + break; } return node("PropertyPattern", match[0], [ @@ -17662,37 +17662,37 @@ function parse(content, options) { let match$1; switch (lit.TAG) { case /* Literal */ 0 : - match$1 = [ - literal(lit._0), - false - ]; - break; + match$1 = [ + literal(lit._0), + false + ]; + break; case /* Identifier */ 1 : - match$1 = [ - identifier(lit._0), - false - ]; - break; + match$1 = [ + identifier(lit._0), + false + ]; + break; case /* Computed */ 2 : - match$1 = [ - expression(lit._0), - true - ]; - break; + match$1 = [ + expression(lit._0), + true + ]; + break; } const match$2 = prop.kind; let kind; switch (match$2) { case /* Init */ 0 : - kind = "init"; - break; + kind = "init"; + break; case /* Get */ 1 : - kind = "get"; - break; + kind = "get"; + break; case /* Set */ 2 : - kind = "set"; - break; + kind = "set"; + break; } return node("Property", match[0], [ diff --git a/jscomp/test/dist/jscomp/test/gpr_1438.js b/jscomp/test/dist/jscomp/test/gpr_1438.js index b447cd1692..e3c9644692 100644 --- a/jscomp/test/dist/jscomp/test/gpr_1438.js +++ b/jscomp/test/dist/jscomp/test/gpr_1438.js @@ -5,16 +5,16 @@ function actionKey(key, a, b, c, d, e) { switch (key) { case 98 : - return c; + return c; case 106 : - return d; + return d; case 107 : - return e; + return e; case 116 : - return b; + return b; case 99 : case 118 : - return a; + return a; } return function (param) { diff --git a/jscomp/test/dist/jscomp/test/gpr_1698_test.js b/jscomp/test/dist/jscomp/test/gpr_1698_test.js index 676ce17e35..85c65ce10e 100644 --- a/jscomp/test/dist/jscomp/test/gpr_1698_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_1698_test.js @@ -8,19 +8,19 @@ function is_number(_expr) { const expr = _expr; switch (expr.TAG) { case /* Val */ 0 : - if (expr._0.TAG === /* Natural */ 0) { - return true; - } else { - return false; - } + if (expr._0.TAG === /* Natural */ 0) { + return true; + } else { + return false; + } case /* Neg */ 1 : - _expr = expr._0; - continue; + _expr = expr._0; + continue; case /* Sum */ 2 : case /* Pow */ 3 : case /* Frac */ 4 : case /* Gcd */ 5 : - return false; + return false; } }; @@ -40,88 +40,88 @@ function compare(context, state, _a, _b) { let exit$3 = 0; switch (a.TAG) { case /* Val */ 0 : - switch (b.TAG) { - case /* Val */ 0 : - return 111; - case /* Neg */ 1 : - exit$3 = 5; - break; - case /* Sum */ 2 : - exit$2 = 4; - break; - case /* Frac */ 4 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/gpr_1698_test.ml", - 45, - 10 - ] - }); - case /* Pow */ 3 : - case /* Gcd */ 5 : - exit = 1; - break; - - } - break; + switch (b.TAG) { + case /* Val */ 0 : + return 111; + case /* Neg */ 1 : + exit$3 = 5; + break; + case /* Sum */ 2 : + exit$2 = 4; + break; + case /* Frac */ 4 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/gpr_1698_test.ml", + 45, + 10 + ] + }); + case /* Pow */ 3 : + case /* Gcd */ 5 : + exit = 1; + break; + + } + break; case /* Neg */ 1 : - _a = a._0; - continue; + _a = a._0; + continue; case /* Sum */ 2 : case /* Pow */ 3 : - exit$3 = 5; - break; + exit$3 = 5; + break; case /* Frac */ 4 : - switch (b.TAG) { - case /* Val */ 0 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/gpr_1698_test.ml", - 45, - 10 - ] - }); - case /* Neg */ 1 : - exit$3 = 5; - break; - case /* Sum */ 2 : - exit$2 = 4; - break; - case /* Frac */ 4 : - na = a._0; - da = a._1; - nb = b._0; - db = b._1; - exit = 2; - break; - case /* Pow */ 3 : - case /* Gcd */ 5 : - exit = 1; - break; - - } - break; + switch (b.TAG) { + case /* Val */ 0 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/gpr_1698_test.ml", + 45, + 10 + ] + }); + case /* Neg */ 1 : + exit$3 = 5; + break; + case /* Sum */ 2 : + exit$2 = 4; + break; + case /* Frac */ 4 : + na = a._0; + da = a._1; + nb = b._0; + db = b._1; + exit = 2; + break; + case /* Pow */ 3 : + case /* Gcd */ 5 : + exit = 1; + break; + + } + break; case /* Gcd */ 5 : - switch (b.TAG) { - case /* Neg */ 1 : - exit$3 = 5; - break; - case /* Sum */ 2 : - exit$2 = 4; - break; - case /* Gcd */ 5 : - na = a._0; - da = a._1; - nb = b._0; - db = b._1; - exit = 2; - break; - default: - exit$1 = 3; - } - break; + switch (b.TAG) { + case /* Neg */ 1 : + exit$3 = 5; + break; + case /* Sum */ 2 : + exit$2 = 4; + break; + case /* Gcd */ 5 : + na = a._0; + da = a._1; + nb = b._0; + db = b._1; + exit = 2; + break; + default: + exit$1 = 3; + } + break; } if (exit$3 === 5) { @@ -151,33 +151,33 @@ function compare(context, state, _a, _b) { if (exit$1 === 3) { switch (a.TAG) { case /* Sum */ 2 : - exit = 1; - break; + exit = 1; + break; case /* Pow */ 3 : - return -1; + return -1; case /* Val */ 0 : case /* Frac */ 4 : case /* Gcd */ 5 : - return 1; + return 1; } } switch (exit) { case 1 : - switch (b.TAG) { - case /* Pow */ 3 : - return 1; - default: - return -1; - } + switch (b.TAG) { + case /* Pow */ 3 : + return 1; + default: + return -1; + } case 2 : - const denom = compare(context, state, da, db); - if (denom !== 0) { - return denom; - } - _b = nb; - _a = na; - continue; + const denom = compare(context, state, da, db); + if (denom !== 0) { + return denom; + } + _b = nb; + _a = na; + continue; } }; diff --git a/jscomp/test/dist/jscomp/test/gpr_2413_test.js b/jscomp/test/dist/jscomp/test/gpr_2413_test.js index c7ea36f066..846e7b1956 100644 --- a/jscomp/test/dist/jscomp/test/gpr_2413_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_2413_test.js @@ -5,16 +5,16 @@ function f(param) { switch (param.TAG) { case /* A */ 0 : - const a = param._0; - if (a.TAG === /* P */ 0) { - const a$1 = a._0; - return a$1 + a$1 | 0; - } - const a$2 = a._0; - return a$2 - a$2 | 0; + const a = param._0; + if (a.TAG === /* P */ 0) { + const a$1 = a._0; + return a$1 + a$1 | 0; + } + const a$2 = a._0; + return a$2 - a$2 | 0; case /* B */ 1 : case /* C */ 2 : - break; + break; } const a$3 = param._0._0; diff --git a/jscomp/test/dist/jscomp/test/gpr_2642_test.js b/jscomp/test/dist/jscomp/test/gpr_2642_test.js index 9ec22edaf5..493a8aac65 100644 --- a/jscomp/test/dist/jscomp/test/gpr_2642_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_2642_test.js @@ -7,16 +7,16 @@ function isfree(id, _id$p) { const id$p = _id$p; switch (id$p.TAG) { case /* Pident */ 0 : - return id === id$p._0; + return id === id$p._0; case /* Pdot */ 1 : - _id$p = id$p._0; - continue; + _id$p = id$p._0; + continue; case /* Papply */ 2 : - if (isfree(id, id$p._0)) { - return true; - } - _id$p = id$p._1; - continue; + if (isfree(id, id$p._0)) { + return true; + } + _id$p = id$p._1; + continue; } }; diff --git a/jscomp/test/dist/jscomp/test/gpr_2931_test.js b/jscomp/test/dist/jscomp/test/gpr_2931_test.js index 48b6049923..576d160a71 100644 --- a/jscomp/test/dist/jscomp/test/gpr_2931_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_2931_test.js @@ -18,14 +18,14 @@ function eq(loc, x, y) { function fake_c2(a_type, b_type) { switch (a_type) { case "number" : - if (b_type === "number") { - return 33; - } - break; + if (b_type === "number") { + return 33; + } + break; case "string" : - return 1; + return 1; case "undefined" : - return -1; + return -1; } if (b_type === "undefined") { diff --git a/jscomp/test/dist/jscomp/test/gpr_3209_test.js b/jscomp/test/dist/jscomp/test/gpr_3209_test.js index 9627359b19..97a7541f6c 100644 --- a/jscomp/test/dist/jscomp/test/gpr_3209_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_3209_test.js @@ -13,10 +13,10 @@ function f9(param) { switch (param.TAG) { case /* T64 */ 0 : case /* T65 */ 1 : - return 2; + return 2; case /* T66 */ 2 : case /* T68 */ 3 : - return 3; + return 3; } } diff --git a/jscomp/test/dist/jscomp/test/gpr_4069_test.js b/jscomp/test/dist/jscomp/test/gpr_4069_test.js index 1a99440a29..5335a54071 100644 --- a/jscomp/test/dist/jscomp/test/gpr_4069_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_4069_test.js @@ -15,11 +15,11 @@ function fxx(v) { const match = Curry._1(v, undefined); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'd' */100; } diff --git a/jscomp/test/dist/jscomp/test/gpr_4639_test.js b/jscomp/test/dist/jscomp/test/gpr_4639_test.js index b23f0ce776..29badcc96b 100644 --- a/jscomp/test/dist/jscomp/test/gpr_4639_test.js +++ b/jscomp/test/dist/jscomp/test/gpr_4639_test.js @@ -8,13 +8,13 @@ function x(url) { } switch (url.hd) { case "login" : - if (url.tl) { - return "start"; - } else { - return "login"; - } - case "start" : + if (url.tl) { return "start"; + } else { + return "login"; + } + case "start" : + return "start"; default: return "start"; } diff --git a/jscomp/test/dist/jscomp/test/int_switch_test.js b/jscomp/test/dist/jscomp/test/int_switch_test.js index 8e02f00aed..cc76a4d5b6 100644 --- a/jscomp/test/dist/jscomp/test/int_switch_test.js +++ b/jscomp/test/dist/jscomp/test/int_switch_test.js @@ -24,11 +24,11 @@ function f(x) { const match = Curry._1(x, undefined); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } @@ -38,11 +38,11 @@ function f22(x) { const match = Curry._1(x, undefined); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } @@ -52,13 +52,13 @@ function f33(x) { const match = Curry._1(x, undefined); switch (match) { case /* A */ 0 : - return /* 'a' */97; + return /* 'a' */97; case /* B */ 1 : - return /* 'b' */98; + return /* 'b' */98; case /* C */ 2 : - return /* 'c' */99; + return /* 'c' */99; case /* D */ 3 : - return /* 'x' */120; + return /* 'x' */120; } } diff --git a/jscomp/test/dist/jscomp/test/js_json_test.js b/jscomp/test/dist/jscomp/test/js_json_test.js index c2ea14a23b..bf8010b2ab 100644 --- a/jscomp/test/dist/jscomp/test/js_json_test.js +++ b/jscomp/test/dist/jscomp/test/js_json_test.js @@ -235,9 +235,9 @@ function test(v) { } switch (ty) { case /* JSONFalse */ 0 : - return eq("File \"jscomp/test/js_json_test.ml\", line 96, characters 25-32", false, v); + return eq("File \"jscomp/test/js_json_test.ml\", line 96, characters 25-32", false, v); case /* JSONTrue */ 1 : - return eq("File \"jscomp/test/js_json_test.ml\", line 95, characters 24-31", true, v); + return eq("File \"jscomp/test/js_json_test.ml\", line 95, characters 24-31", true, v); default: return add_test("File \"jscomp/test/js_json_test.ml\", line 97, characters 18-25", (function (param) { return { @@ -366,116 +366,108 @@ function eq_at_i(loc, json, i, kind, expected) { const ty$1 = Js__Js_json.classify(Caml_array.get(ty._0, i)); switch (kind) { case /* String */ 0 : - if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } else if (ty$1.TAG === /* JSONString */ 0) { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } + if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } else if (ty$1.TAG === /* JSONString */ 0) { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } case /* Number */ 1 : - if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } else if (ty$1.TAG === /* JSONNumber */ 1) { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } + if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } else if (ty$1.TAG === /* JSONNumber */ 1) { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } case /* Object */ 2 : - if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } else if (ty$1.TAG === /* JSONObject */ 2) { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } + if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } else if (ty$1.TAG === /* JSONObject */ 2) { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } case /* Array */ 3 : - if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } else if (ty$1.TAG === /* JSONArray */ 3) { - return eq(loc, ty$1._0, expected); - } else { + if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } else if (ty$1.TAG === /* JSONArray */ 3) { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } + case /* Boolean */ 4 : + if (!/* tag */ (typeof ty$1 === "number" || typeof ty$1 === "string")) { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } + switch (ty$1) { + case /* JSONFalse */ 0 : + return eq(loc, false, expected); + case /* JSONTrue */ 1 : + return eq(loc, true, expected); + default: return add_test(loc, (function (param) { return { TAG: /* Ok */ 4, _0: false }; })); - } - case /* Boolean */ 4 : - if (!/* tag */ (typeof ty$1 === "number" || typeof ty$1 === "string")) { + } + case /* Null */ 5 : + if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { + if (ty$1 === /* JSONNull */ 2) { return add_test(loc, (function (param) { return { TAG: /* Ok */ 4, - _0: false + _0: true }; })); - } - switch (ty$1) { - case /* JSONFalse */ 0 : - return eq(loc, false, expected); - case /* JSONTrue */ 1 : - return eq(loc, true, expected); - default: - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } - case /* Null */ 5 : - if (/* tag */ typeof ty$1 === "number" || typeof ty$1 === "string") { - if (ty$1 === /* JSONNull */ 2) { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: true - }; - })); - } else { - return add_test(loc, (function (param) { - return { - TAG: /* Ok */ 4, - _0: false - }; - })); - } } else { return add_test(loc, (function (param) { return { @@ -484,6 +476,14 @@ function eq_at_i(loc, json, i, kind, expected) { }; })); } + } else { + return add_test(loc, (function (param) { + return { + TAG: /* Ok */ 4, + _0: false + }; + })); + } } } diff --git a/jscomp/test/dist/jscomp/test/mario_game.js b/jscomp/test/dist/jscomp/test/mario_game.js index d333999739..f7b93e2874 100644 --- a/jscomp/test/dist/jscomp/test/mario_game.js +++ b/jscomp/test/dist/jscomp/test/mario_game.js @@ -47,107 +47,107 @@ function make_enemy(param) { const dir = param[1]; switch (param[0]) { case /* Goomba */ 0 : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 14, + 14 + ], "enemies.png", 2, 10, [ + 16, + 16 + ], [ + 0, + 128 + ]); + case /* GKoopa */ 1 : + if (dir === /* Left */ 0) { return setup_sprite(undefined, [ - 1, - 1 + 4, + 10 ], [ - 14, - 14 + 11, + 16 ], "enemies.png", 2, 10, [ 16, - 16 + 27 ], [ 0, - 128 + 69 ]); - case /* GKoopa */ 1 : - if (dir === /* Left */ 0) { - return setup_sprite(undefined, [ - 4, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 0, - 69 - ]); - } else { - return setup_sprite(undefined, [ - 1, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 32, - 69 - ]); - } - case /* RKoopa */ 2 : - if (dir === /* Left */ 0) { - return setup_sprite(undefined, [ - 4, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 0, - 5 - ]); - } else { - return setup_sprite(undefined, [ - 1, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 32, - 5 - ]); - } - case /* GKoopaShell */ 3 : + } else { return setup_sprite(undefined, [ - 2, - 2 + 1, + 10 ], [ - 12, - 13 - ], "enemies.png", 4, 10, [ + 11, + 16 + ], "enemies.png", 2, 10, [ 16, + 27 + ], [ + 32, + 69 + ]); + } + case /* RKoopa */ 2 : + if (dir === /* Left */ 0) { + return setup_sprite(undefined, [ + 4, + 10 + ], [ + 11, 16 + ], "enemies.png", 2, 10, [ + 16, + 27 ], [ 0, - 96 + 5 ]); - case /* RKoopaShell */ 4 : + } else { return setup_sprite(undefined, [ - 2, - 2 + 1, + 10 ], [ - 12, - 13 - ], "enemies.png", 4, 10, [ - 16, + 11, 16 + ], "enemies.png", 2, 10, [ + 16, + 27 ], [ - 0, - 32 + 32, + 5 ]); + } + case /* GKoopaShell */ 3 : + return setup_sprite(undefined, [ + 2, + 2 + ], [ + 12, + 13 + ], "enemies.png", 4, 10, [ + 16, + 16 + ], [ + 0, + 96 + ]); + case /* RKoopaShell */ 4 : + return setup_sprite(undefined, [ + 2, + 2 + ], [ + 12, + 13 + ], "enemies.png", 4, 10, [ + 16, + 16 + ], [ + 0, + 32 + ]); } } @@ -155,93 +155,93 @@ function make_enemy(param) { function make_particle(param) { switch (param) { case /* GoombaSquish */ 0 : - return setup_sprite(undefined, undefined, undefined, "enemies.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 144 - ]); + return setup_sprite(undefined, undefined, undefined, "enemies.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 144 + ]); case /* BrickChunkL */ 1 : - return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 0, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ + 8, + 8 + ], [ + 0, + 0 + ]); case /* BrickChunkR */ 2 : - return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 8, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ + 8, + 8 + ], [ + 8, + 0 + ]); case /* Score100 */ 3 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 8 - ], [ - 0, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 8 + ], [ + 0, + 0 + ]); case /* Score200 */ 4 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 9 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 9 + ]); case /* Score400 */ 5 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 18 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 18 + ]); case /* Score800 */ 6 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 27 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 27 + ]); case /* Score1000 */ 7 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 0 + ]); case /* Score2000 */ 8 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 9 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 9 + ]); case /* Score4000 */ 9 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 18 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 18 + ]); case /* Score8000 */ 10 : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 27 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 27 + ]); } } @@ -249,401 +249,401 @@ function make_particle(param) { function make_type(typ, dir) { switch (typ.TAG) { case /* SPlayer */ 0 : - let pt = typ._0; - let spr_type = [ - typ._1, - dir - ]; - if (pt === /* BigM */ 0) { - const typ$1 = spr_type[0]; - if (spr_type[1] === /* Left */ 0) { - switch (typ$1) { - case /* Standing */ 0 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 16, - 5 - ]); - case /* Jumping */ 1 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 48, - 6 - ]); - case /* Running */ 2 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 4, 10, [ - 16, - 27 - ], [ - 0, - 37 - ]); - case /* Crouching */ 3 : - return setup_sprite(undefined, [ - 2, - 10 - ], [ - 13, - 17 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 32, - 5 - ]); - - } - } else { - switch (typ$1) { - case /* Standing */ 0 : - return setup_sprite(undefined, [ - 1, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 16, - 69 - ]); - case /* Jumping */ 1 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 48, - 70 - ]); - case /* Running */ 2 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 4, 10, [ - 16, - 27 - ], [ - 0, - 101 - ]); - case /* Crouching */ 3 : - return setup_sprite(undefined, [ - 2, - 10 - ], [ - 13, - 17 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 32, - 69 - ]); - - } + let pt = typ._0; + let spr_type = [ + typ._1, + dir + ]; + if (pt === /* BigM */ 0) { + const typ$1 = spr_type[0]; + if (spr_type[1] === /* Left */ 0) { + switch (typ$1) { + case /* Standing */ 0 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 16, + 5 + ]); + case /* Jumping */ 1 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 12, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 26 + ], [ + 48, + 6 + ]); + case /* Running */ 2 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 4, 10, [ + 16, + 27 + ], [ + 0, + 37 + ]); + case /* Crouching */ 3 : + return setup_sprite(undefined, [ + 2, + 10 + ], [ + 13, + 17 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 32, + 5 + ]); + } } else { - const typ$2 = spr_type[0]; - if (spr_type[1] === /* Left */ 0) { - switch (typ$2) { - case /* Standing */ 0 : - return setup_sprite(undefined, [ - 3, - 1 - ], [ - 11, - 15 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 0 - ]); - case /* Jumping */ 1 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 15 - ], "mario-small.png", 2, 10, [ - 16, - 16 - ], [ - 16, - 16 - ]); - case /* Running */ 2 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 15 - ], "mario-small.png", 3, 5, [ - 16, - 16 - ], [ - 16, - 0 - ]); - case /* Crouching */ 3 : - return setup_sprite(undefined, [ - 1, - 5 - ], [ - 14, - 10 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 64 - ]); - - } - } else { - switch (typ$2) { - case /* Standing */ 0 : - return setup_sprite(undefined, [ - 1, - 1 - ], [ - 11, - 15 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 32 - ]); - case /* Jumping */ 1 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 15 - ], "mario-small.png", 2, 10, [ - 16, - 16 - ], [ - 16, - 48 - ]); - case /* Running */ 2 : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 15 - ], "mario-small.png", 3, 5, [ - 16, - 16 - ], [ - 16, - 32 - ]); - case /* Crouching */ 3 : - return setup_sprite(undefined, [ - 1, - 5 - ], [ - 14, - 10 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 64 - ]); - - } - } - } - case /* SEnemy */ 1 : - return make_enemy([ - typ._0, - dir - ]); - case /* SItem */ 2 : - let param = typ._0; - switch (param) { - case /* Mushroom */ 0 : + switch (typ$1) { + case /* Standing */ 0 : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 26 + ], [ + 16, + 69 + ]); + case /* Jumping */ 1 : return setup_sprite(undefined, [ 2, - 0 + 1 ], [ 12, - 16 - ], "items.png", 1, 0, [ + 25 + ], "mario-big.png", 1, 0, [ 16, - 16 + 26 + ], [ + 48, + 70 + ]); + case /* Running */ 2 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 4, 10, [ + 16, + 27 ], [ 0, - 0 + 101 + ]); + case /* Crouching */ 3 : + return setup_sprite(undefined, [ + 2, + 10 + ], [ + 13, + 17 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 32, + 69 ]); - case /* FireFlower */ 1 : - return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + + } + } + } else { + const typ$2 = spr_type[0]; + if (spr_type[1] === /* Left */ 0) { + switch (typ$2) { + case /* Standing */ 0 : + return setup_sprite(undefined, [ + 3, + 1 + ], [ + 11, + 15 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 188 + 0 ]); - case /* Star */ 2 : - return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + case /* Jumping */ 1 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 15 + ], "mario-small.png", 2, 10, [ 16, 16 ], [ 16, - 48 + 16 ]); - case /* Coin */ 3 : + case /* Running */ 2 : return setup_sprite(undefined, [ - 3, - 0 + 2, + 1 ], [ 12, - 16 - ], "items.png", 3, 15, [ + 15 + ], "mario-small.png", 3, 5, [ 16, 16 ], [ - 0, - 80 + 16, + 0 ]); - - } - case /* SBlock */ 3 : - let param$1 = typ._0; - if (!/* tag */ (typeof param$1 === "number" || typeof param$1 === "string")) { - return setup_sprite(undefined, undefined, undefined, "blocks.png", 4, 15, [ - 16, - 16 - ], [ - 0, - 16 - ]); - } - switch (param$1) { - case /* QBlockUsed */ 0 : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case /* Crouching */ 3 : + return setup_sprite(undefined, [ + 1, + 5 + ], [ + 14, + 10 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 32 + 64 ]); - case /* Brick */ 1 : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 5, 10, [ + + } + } else { + switch (typ$2) { + case /* Standing */ 0 : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 11, + 15 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 0 + 32 ]); - case /* UnBBlock */ 2 : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case /* Jumping */ 1 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 15 + ], "mario-small.png", 2, 10, [ 16, 16 ], [ - 0, + 16, 48 ]); - case /* Cloud */ 3 : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case /* Running */ 2 : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 12, + 15 + ], "mario-small.png", 3, 5, [ 16, 16 ], [ - 0, - 64 + 16, + 32 ]); - case /* Panel */ 4 : - return setup_sprite(undefined, undefined, undefined, "panel.png", 3, 15, [ - 26, - 26 + case /* Crouching */ 3 : + return setup_sprite(undefined, [ + 1, + 5 ], [ - 0, - 0 - ]); - case /* Ground */ 5 : - return setup_sprite(undefined, undefined, undefined, "ground.png", 1, 0, [ + 14, + 10 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 32 + 64 ]); - + + } } - - } -} - -function make_from_params(params, context) { - const img = document.createElement("img"); - img.src = params.img_src; - return { - params: params, - context: context, - frame: { - contents: 0 - }, - ticks: { - contents: 0 - }, - img: img - }; -} - -function make(spawn, dir, context) { - const params = make_type(spawn, dir); - return make_from_params(params, context); -} - -function make_bgd(context) { - const params = setup_sprite(undefined, undefined, undefined, "bgd-1.png", 1, 0, [ + } + case /* SEnemy */ 1 : + return make_enemy([ + typ._0, + dir + ]); + case /* SItem */ 2 : + let param = typ._0; + switch (param) { + case /* Mushroom */ 0 : + return setup_sprite(undefined, [ + 2, + 0 + ], [ + 12, + 16 + ], "items.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 0 + ]); + case /* FireFlower */ 1 : + return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 188 + ]); + case /* Star */ 2 : + return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + 16, + 16 + ], [ + 16, + 48 + ]); + case /* Coin */ 3 : + return setup_sprite(undefined, [ + 3, + 0 + ], [ + 12, + 16 + ], "items.png", 3, 15, [ + 16, + 16 + ], [ + 0, + 80 + ]); + + } + case /* SBlock */ 3 : + let param$1 = typ._0; + if (!/* tag */ (typeof param$1 === "number" || typeof param$1 === "string")) { + return setup_sprite(undefined, undefined, undefined, "blocks.png", 4, 15, [ + 16, + 16 + ], [ + 0, + 16 + ]); + } + switch (param$1) { + case /* QBlockUsed */ 0 : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 32 + ]); + case /* Brick */ 1 : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 5, 10, [ + 16, + 16 + ], [ + 0, + 0 + ]); + case /* UnBBlock */ 2 : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 48 + ]); + case /* Cloud */ 3 : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 64 + ]); + case /* Panel */ 4 : + return setup_sprite(undefined, undefined, undefined, "panel.png", 3, 15, [ + 26, + 26 + ], [ + 0, + 0 + ]); + case /* Ground */ 5 : + return setup_sprite(undefined, undefined, undefined, "ground.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 32 + ]); + + } + + } +} + +function make_from_params(params, context) { + const img = document.createElement("img"); + img.src = params.img_src; + return { + params: params, + context: context, + frame: { + contents: 0 + }, + ticks: { + contents: 0 + }, + img: img + }; +} + +function make(spawn, dir, context) { + const params = make_type(spawn, dir); + return make_from_params(params, context); +} + +function make_bgd(context) { + const params = setup_sprite(undefined, undefined, undefined, "bgd-1.png", 1, 0, [ 512, 256 ], [ @@ -705,11 +705,11 @@ function make_type$1(typ, ctx) { switch (typ) { case /* BrickChunkL */ 1 : case /* BrickChunkR */ 2 : - return { - sprite: make_particle$1(typ, ctx), - rot: 0, - lifetime: 300 - }; + return { + sprite: make_particle$1(typ, ctx), + rot: 0, + lifetime: 300 + }; default: return { sprite: make_particle$1(typ, ctx), @@ -816,25 +816,25 @@ function set_vel_to_speed(obj) { function make_type$2(t) { switch (t.TAG) { case /* SPlayer */ 0 : - return setup_obj(undefined, 2.8, undefined); + return setup_obj(undefined, 2.8, undefined); case /* SEnemy */ 1 : - let param = t._0; - switch (param) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - return setup_obj(undefined, 3, undefined); - default: - return setup_obj(undefined, undefined, undefined); - } - case /* SItem */ 2 : - let param$1 = t._0; - if (param$1 === /* Coin */ 3) { - return setup_obj(false, undefined, undefined); - } else { + let param = t._0; + switch (param) { + case /* GKoopaShell */ 3 : + case /* RKoopaShell */ 4 : + return setup_obj(undefined, 3, undefined); + default: return setup_obj(undefined, undefined, undefined); - } - case /* SBlock */ 3 : + } + case /* SItem */ 2 : + let param$1 = t._0; + if (param$1 === /* Coin */ 3) { return setup_obj(false, undefined, undefined); + } else { + return setup_obj(undefined, undefined, undefined); + } + case /* SBlock */ 3 : + return setup_obj(false, undefined, undefined); } } @@ -885,34 +885,34 @@ function spawn(spawnable, context, param) { const spr = match[0]; switch (spawnable.TAG) { case /* SPlayer */ 0 : - return { - TAG: /* Player */ 0, - _0: spawnable._0, - _1: spr, - _2: obj - }; + return { + TAG: /* Player */ 0, + _0: spawnable._0, + _1: spr, + _2: obj + }; case /* SEnemy */ 1 : - set_vel_to_speed(obj); - return { - TAG: /* Enemy */ 1, - _0: spawnable._0, - _1: spr, - _2: obj - }; + set_vel_to_speed(obj); + return { + TAG: /* Enemy */ 1, + _0: spawnable._0, + _1: spr, + _2: obj + }; case /* SItem */ 2 : - return { - TAG: /* Item */ 2, - _0: spawnable._0, - _1: spr, - _2: obj - }; + return { + TAG: /* Item */ 2, + _0: spawnable._0, + _1: spr, + _2: obj + }; case /* SBlock */ 3 : - return { - TAG: /* Block */ 3, - _0: spawnable._0, - _1: spr, - _2: obj - }; + return { + TAG: /* Block */ 3, + _0: spawnable._0, + _1: spr, + _2: obj + }; } } @@ -962,41 +962,41 @@ function update_player(player, keys, context) { const lr_acc = player.vel.x * 0.2; switch (param) { case /* CLeft */ 0 : - if (!player.crouch) { - if (player.vel.x > - player.params.speed) { - player.vel.x = player.vel.x - (0.4 - lr_acc); - } - player.dir = /* Left */ 0; - return; - } else { - return; + if (!player.crouch) { + if (player.vel.x > - player.params.speed) { + player.vel.x = player.vel.x - (0.4 - lr_acc); } + player.dir = /* Left */ 0; + return; + } else { + return; + } case /* CRight */ 1 : - if (!player.crouch) { - if (player.vel.x < player.params.speed) { - player.vel.x = player.vel.x + (0.4 + lr_acc); - } - player.dir = /* Right */ 1; - return; - } else { - return; + if (!player.crouch) { + if (player.vel.x < player.params.speed) { + player.vel.x = player.vel.x + (0.4 + lr_acc); } + player.dir = /* Right */ 1; + return; + } else { + return; + } case /* CUp */ 2 : - if (!player.jumping && player.grounded) { - player.jumping = true; - player.grounded = false; - player.vel.y = Caml.caml_float_max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6); - return; - } else { - return; - } + if (!player.jumping && player.grounded) { + player.jumping = true; + player.grounded = false; + player.vel.y = Caml.caml_float_max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6); + return; + } else { + return; + } case /* CDown */ 3 : - if (!player.jumping && player.grounded) { - player.crouch = true; - return; - } else { - return; - } + if (!player.jumping && player.grounded) { + player.crouch = true; + return; + } else { + return; + } } }), keys); @@ -1097,16 +1097,16 @@ function collide_block(check_xOpt, dir, obj) { const check_x = check_xOpt !== undefined ? check_xOpt : true; switch (dir) { case /* North */ 0 : - obj.vel.y = -0.001; - return; + obj.vel.y = -0.001; + return; case /* South */ 1 : - obj.vel.y = 0; - obj.grounded = true; - obj.jumping = false; - return; + obj.vel.y = 0; + obj.grounded = true; + obj.jumping = false; + return; case /* East */ 2 : case /* West */ 3 : - break; + break; } if (check_x) { @@ -1132,45 +1132,45 @@ function reverse_left_right(obj) { function evolve_enemy(player_dir, typ, spr, obj, context) { switch (typ) { case /* Goomba */ 0 : - obj.kill = true; - return; + obj.kill = true; + return; case /* GKoopa */ 1 : - const match = make$2(undefined, obj.dir, { - TAG: /* SEnemy */ 1, - _0: /* GKoopaShell */ 3 - }, context, [ - obj.pos.x, - obj.pos.y - ]); - const new_obj = match[1]; - const new_spr = match[0]; - normalize_pos(new_obj.pos, spr.params, new_spr.params); - return { - TAG: /* Enemy */ 1, - _0: /* GKoopaShell */ 3, - _1: new_spr, - _2: new_obj - }; + const match = make$2(undefined, obj.dir, { + TAG: /* SEnemy */ 1, + _0: /* GKoopaShell */ 3 + }, context, [ + obj.pos.x, + obj.pos.y + ]); + const new_obj = match[1]; + const new_spr = match[0]; + normalize_pos(new_obj.pos, spr.params, new_spr.params); + return { + TAG: /* Enemy */ 1, + _0: /* GKoopaShell */ 3, + _1: new_spr, + _2: new_obj + }; case /* RKoopa */ 2 : - const match$1 = make$2(undefined, obj.dir, { - TAG: /* SEnemy */ 1, - _0: /* RKoopaShell */ 4 - }, context, [ - obj.pos.x, - obj.pos.y - ]); - const new_obj$1 = match$1[1]; - const new_spr$1 = match$1[0]; - normalize_pos(new_obj$1.pos, spr.params, new_spr$1.params); - return { - TAG: /* Enemy */ 1, - _0: /* RKoopaShell */ 4, - _1: new_spr$1, - _2: new_obj$1 - }; + const match$1 = make$2(undefined, obj.dir, { + TAG: /* SEnemy */ 1, + _0: /* RKoopaShell */ 4 + }, context, [ + obj.pos.x, + obj.pos.y + ]); + const new_obj$1 = match$1[1]; + const new_spr$1 = match$1[0]; + normalize_pos(new_obj$1.pos, spr.params, new_spr$1.params); + return { + TAG: /* Enemy */ 1, + _0: /* RKoopaShell */ 4, + _1: new_spr$1, + _2: new_obj$1 + }; case /* GKoopaShell */ 3 : case /* RKoopaShell */ 4 : - break; + break; } obj.dir = player_dir; @@ -1260,27 +1260,27 @@ function col_bypass(c1, c2) { let ctypes; switch (c1.TAG) { case /* Player */ 0 : - ctypes = c2.TAG === /* Enemy */ 1 ? c1._2.invuln > 0 : false; - break; + ctypes = c2.TAG === /* Enemy */ 1 ? c1._2.invuln > 0 : false; + break; case /* Enemy */ 1 : - ctypes = c2.TAG === /* Item */ 2 ? true : false; - break; + ctypes = c2.TAG === /* Item */ 2 ? true : false; + break; case /* Item */ 2 : - switch (c2.TAG) { - case /* Enemy */ 1 : - case /* Item */ 2 : - ctypes = true; - break; - case /* Player */ 0 : - case /* Block */ 3 : - ctypes = false; - break; - - } - break; + switch (c2.TAG) { + case /* Enemy */ 1 : + case /* Item */ 2 : + ctypes = true; + break; + case /* Player */ 0 : + case /* Block */ 3 : + ctypes = false; + break; + + } + break; case /* Block */ 3 : - ctypes = false; - break; + ctypes = false; + break; } if (o1.kill || o2.kill) { @@ -1326,94 +1326,94 @@ function check_collision(c1, c2) { function kill(collid, ctx) { switch (collid.TAG) { case /* Player */ 0 : - return /* [] */ 0; + return /* [] */ 0; case /* Enemy */ 1 : - const o = collid._2; - const pos_0 = o.pos.x; - const pos_1 = o.pos.y; - const pos = [ - pos_0, - pos_1 - ]; - const score = o.score > 0 ? ({ - hd: make_score(o.score, pos, ctx), - tl: /* [] */ 0 - }) : /* [] */ 0; - let remains; - remains = collid._0 === /* Goomba */ 0 ? ({ - hd: make$1(undefined, undefined, /* GoombaSquish */ 0, pos, ctx), - tl: /* [] */ 0 - }) : /* [] */ 0; - return Stdlib.$at(score, remains); + const o = collid._2; + const pos_0 = o.pos.x; + const pos_1 = o.pos.y; + const pos = [ + pos_0, + pos_1 + ]; + const score = o.score > 0 ? ({ + hd: make_score(o.score, pos, ctx), + tl: /* [] */ 0 + }) : /* [] */ 0; + let remains; + remains = collid._0 === /* Goomba */ 0 ? ({ + hd: make$1(undefined, undefined, /* GoombaSquish */ 0, pos, ctx), + tl: /* [] */ 0 + }) : /* [] */ 0; + return Stdlib.$at(score, remains); case /* Item */ 2 : - const o$1 = collid._2; - if (collid._0 === /* Mushroom */ 0) { - return { - hd: make_score(o$1.score, [ - o$1.pos.x, - o$1.pos.y - ], ctx), - tl: /* [] */ 0 - }; - } else { - return /* [] */ 0; - } - case /* Block */ 3 : - const o$2 = collid._2; - let tmp = collid._0; - if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { - return /* [] */ 0; - } - if (tmp !== /* Brick */ 1) { - return /* [] */ 0; - } - const pos_0$1 = o$2.pos.x; - const pos_1$1 = o$2.pos.y; - const pos$1 = [ - pos_0$1, - pos_1$1 - ]; - const p1 = make$1([ - -5, - -5 - ], [ - 0, - 0.2 - ], /* BrickChunkL */ 1, pos$1, ctx); - const p2 = make$1([ - -3, - -4 - ], [ - 0, - 0.2 - ], /* BrickChunkL */ 1, pos$1, ctx); - const p3 = make$1([ - 3, - -4 - ], [ - 0, - 0.2 - ], /* BrickChunkR */ 2, pos$1, ctx); - const p4 = make$1([ - 5, - -5 - ], [ - 0, - 0.2 - ], /* BrickChunkR */ 2, pos$1, ctx); + const o$1 = collid._2; + if (collid._0 === /* Mushroom */ 0) { return { - hd: p1, + hd: make_score(o$1.score, [ + o$1.pos.x, + o$1.pos.y + ], ctx), + tl: /* [] */ 0 + }; + } else { + return /* [] */ 0; + } + case /* Block */ 3 : + const o$2 = collid._2; + let tmp = collid._0; + if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { + return /* [] */ 0; + } + if (tmp !== /* Brick */ 1) { + return /* [] */ 0; + } + const pos_0$1 = o$2.pos.x; + const pos_1$1 = o$2.pos.y; + const pos$1 = [ + pos_0$1, + pos_1$1 + ]; + const p1 = make$1([ + -5, + -5 + ], [ + 0, + 0.2 + ], /* BrickChunkL */ 1, pos$1, ctx); + const p2 = make$1([ + -3, + -4 + ], [ + 0, + 0.2 + ], /* BrickChunkL */ 1, pos$1, ctx); + const p3 = make$1([ + 3, + -4 + ], [ + 0, + 0.2 + ], /* BrickChunkR */ 2, pos$1, ctx); + const p4 = make$1([ + 5, + -5 + ], [ + 0, + 0.2 + ], /* BrickChunkR */ 2, pos$1, ctx); + return { + hd: p1, + tl: { + hd: p2, tl: { - hd: p2, + hd: p3, tl: { - hd: p3, - tl: { - hd: p4, - tl: /* [] */ 0 - } + hd: p4, + tl: /* [] */ 0 } } - }; + } + }; } } @@ -1648,456 +1648,456 @@ function process_collision(dir, c1, c2, state) { let o2$2; switch (c1.TAG) { case /* Player */ 0 : - const o1$3 = c1._2; - const s1$2 = c1._1; - switch (c2.TAG) { - case /* Player */ 0 : - return [ - undefined, - undefined - ]; - case /* Enemy */ 1 : - const typ$1 = c2._0; - if (dir === /* South */ 1) { - s1 = s1$2; - o1 = o1$3; - typ = typ$1; - s2 = c2._1; - o2 = c2._2; - exit = 1; - } else { - s1$1 = s1$2; - o1$1 = o1$3; - t2 = typ$1; - s2$1 = c2._1; - o2$1 = c2._2; - exit = 2; - } - break; - case /* Item */ 2 : - o1$2 = o1$3; - t2$1 = c2._0; - o2$2 = c2._2; - exit = 3; - break; - case /* Block */ 3 : - const t = c2._0; - if (dir === /* North */ 0) { - const o2$3 = c2._2; - if (/* tag */ typeof t === "number" || typeof t === "string") { - switch (t) { - case /* Brick */ 1 : - if (c1._0 === /* BigM */ 0) { - collide_block(undefined, dir, o1$3); - dec_health(o2$3); - return [ - undefined, - undefined - ]; - } else { - collide_block(undefined, dir, o1$3); - return [ - undefined, - undefined - ]; - } - case /* Panel */ 4 : - game_win(state.ctx); - return [ - undefined, - undefined - ]; - default: - collide_block(undefined, dir, o1$3); - return [ - undefined, - undefined - ]; - } - } else { - const updated_block = evolve_block(o2$3, context); - const spawned_item = spawn_above(o1$3.dir, o2$3, t._0, context); - collide_block(undefined, dir, o1$3); - return [ - spawned_item, - updated_block - ]; - } - } else { - let exit$1 = 0; - if (/* tag */ typeof t === "number" || typeof t === "string") { - if (t === /* Panel */ 4) { - game_win(state.ctx); + const o1$3 = c1._2; + const s1$2 = c1._1; + switch (c2.TAG) { + case /* Player */ 0 : + return [ + undefined, + undefined + ]; + case /* Enemy */ 1 : + const typ$1 = c2._0; + if (dir === /* South */ 1) { + s1 = s1$2; + o1 = o1$3; + typ = typ$1; + s2 = c2._1; + o2 = c2._2; + exit = 1; + } else { + s1$1 = s1$2; + o1$1 = o1$3; + t2 = typ$1; + s2$1 = c2._1; + o2$1 = c2._2; + exit = 2; + } + break; + case /* Item */ 2 : + o1$2 = o1$3; + t2$1 = c2._0; + o2$2 = c2._2; + exit = 3; + break; + case /* Block */ 3 : + const t = c2._0; + if (dir === /* North */ 0) { + const o2$3 = c2._2; + if (/* tag */ typeof t === "number" || typeof t === "string") { + switch (t) { + case /* Brick */ 1 : + if (c1._0 === /* BigM */ 0) { + collide_block(undefined, dir, o1$3); + dec_health(o2$3); return [ undefined, undefined ]; - } - exit$1 = 4; - } else { - exit$1 = 4; - } - if (exit$1 === 4) { - if (dir === /* South */ 1) { - state.multiplier = 1; + } else { collide_block(undefined, dir, o1$3); return [ undefined, undefined ]; } + case /* Panel */ 4 : + game_win(state.ctx); + return [ + undefined, + undefined + ]; + default: collide_block(undefined, dir, o1$3); return [ undefined, undefined ]; - } - - } - break; - - } - break; - case /* Enemy */ 1 : - const o1$4 = c1._2; - const s1$3 = c1._1; - const t1 = c1._0; - switch (c2.TAG) { - case /* Player */ 0 : - if (dir === /* North */ 0) { - s1 = c2._1; - o1 = c2._2; - typ = t1; - s2 = s1$3; - o2 = o1$4; - exit = 1; - } else { - s1$1 = c2._1; - o1$1 = c2._2; - t2 = t1; - s2$1 = s1$3; - o2$1 = o1$4; - exit = 2; + } + } else { + const updated_block = evolve_block(o2$3, context); + const spawned_item = spawn_above(o1$3.dir, o2$3, t._0, context); + collide_block(undefined, dir, o1$3); + return [ + spawned_item, + updated_block + ]; + } + } else { + let exit$1 = 0; + if (/* tag */ typeof t === "number" || typeof t === "string") { + if (t === /* Panel */ 4) { + game_win(state.ctx); + return [ + undefined, + undefined + ]; + } + exit$1 = 4; + } else { + exit$1 = 4; + } + if (exit$1 === 4) { + if (dir === /* South */ 1) { + state.multiplier = 1; + collide_block(undefined, dir, o1$3); + return [ + undefined, + undefined + ]; + } + collide_block(undefined, dir, o1$3); + return [ + undefined, + undefined + ]; + } + + } + break; + + } + break; + case /* Enemy */ 1 : + const o1$4 = c1._2; + const s1$3 = c1._1; + const t1 = c1._0; + switch (c2.TAG) { + case /* Player */ 0 : + if (dir === /* North */ 0) { + s1 = c2._1; + o1 = c2._2; + typ = t1; + s2 = s1$3; + o2 = o1$4; + exit = 1; + } else { + s1$1 = c2._1; + o1$1 = c2._2; + t2 = t1; + s2$1 = s1$3; + o2$1 = o1$4; + exit = 2; + } + break; + case /* Enemy */ 1 : + let t2$2 = c2._0; + let s2$2 = c2._1; + let o2$4 = c2._2; + let exit$2 = 0; + switch (t1) { + case /* GKoopaShell */ 3 : + switch (t2$2) { + case /* GKoopaShell */ 3 : + case /* RKoopaShell */ 4 : + exit$2 = 1; + break; + default: + exit$2 = 2; } break; - case /* Enemy */ 1 : - let t2$2 = c2._0; - let s2$2 = c2._1; - let o2$4 = c2._2; - let exit$2 = 0; - switch (t1) { + case /* RKoopaShell */ 4 : + switch (t2$2) { case /* GKoopaShell */ 3 : - switch (t2$2) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - exit$2 = 1; - break; - default: - exit$2 = 2; - } - break; case /* RKoopaShell */ 4 : - switch (t2$2) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - exit$2 = 1; - break; - default: - exit$2 = 2; - } - break; + exit$2 = 1; + break; default: - switch (t2$2) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - exit$2 = 3; - break; - default: - let exit$3 = 0; - switch (dir) { - case /* North */ 0 : - case /* South */ 1 : - return [ - undefined, - undefined - ]; - case /* East */ 2 : - case /* West */ 3 : - exit$3 = 4; - break; - - } - if (exit$3 === 4) { - rev_dir(o1$4, t1, s1$3); - rev_dir(o2$4, t2$2, s2$2); - return [ - undefined, - undefined - ]; - } - - } + exit$2 = 2; } - switch (exit$2) { - case 1 : - dec_health(o1$4); - dec_health(o2$4); - return [ - undefined, - undefined - ]; - case 2 : - if (o1$4.vel.x === 0) { - rev_dir(o2$4, t2$2, s2$2); - return [ - undefined, - undefined - ]; - } else { - dec_health(o2$4); - return [ - undefined, - undefined - ]; - } - case 3 : - if (o2$4.vel.x === 0) { - rev_dir(o1$4, t1, s1$3); - return [ - undefined, - undefined - ]; - } else { - dec_health(o1$4); + break; + default: + switch (t2$2) { + case /* GKoopaShell */ 3 : + case /* RKoopaShell */ 4 : + exit$2 = 3; + break; + default: + let exit$3 = 0; + switch (dir) { + case /* North */ 0 : + case /* South */ 1 : return [ undefined, undefined ]; - } - + case /* East */ 2 : + case /* West */ 3 : + exit$3 = 4; + break; + + } + if (exit$3 === 4) { + rev_dir(o1$4, t1, s1$3); + rev_dir(o2$4, t2$2, s2$2); + return [ + undefined, + undefined + ]; + } + } - case /* Item */ 2 : + } + switch (exit$2) { + case 1 : + dec_health(o1$4); + dec_health(o2$4); return [ undefined, undefined ]; - case /* Block */ 3 : - const t2$3 = c2._0; - const o2$5 = c2._2; - let exit$4 = 0; - switch (dir) { - case /* North */ 0 : - case /* South */ 1 : - collide_block(undefined, dir, o1$4); - return [ - undefined, - undefined - ]; - case /* East */ 2 : - case /* West */ 3 : - exit$4 = 4; - break; - + case 2 : + if (o1$4.vel.x === 0) { + rev_dir(o2$4, t2$2, s2$2); + return [ + undefined, + undefined + ]; + } else { + dec_health(o2$4); + return [ + undefined, + undefined + ]; } - if (exit$4 === 4) { - let exit$5 = 0; - let typ$2; - switch (t1) { - case /* GKoopaShell */ 3 : - if (/* tag */ typeof t2$3 === "number" || typeof t2$3 === "string") { - if (t2$3 === /* Brick */ 1) { - dec_health(o2$5); - reverse_left_right(o1$4); - return [ - undefined, - undefined - ]; - } - exit$5 = 5; - } else { - typ$2 = t2$3._0; - exit$5 = 6; - } - break; - case /* RKoopaShell */ 4 : - if (/* tag */ typeof t2$3 === "number" || typeof t2$3 === "string") { - if (t2$3 === /* Brick */ 1) { - dec_health(o2$5); - reverse_left_right(o1$4); - return [ - undefined, - undefined - ]; - } - exit$5 = 5; - } else { - typ$2 = t2$3._0; - exit$5 = 6; - } - break; - default: - exit$5 = 5; - } - switch (exit$5) { - case 5 : - rev_dir(o1$4, t1, s1$3); - return [ - undefined, - undefined - ]; - case 6 : - const updated_block$1 = evolve_block(o2$5, context); - const spawned_item$1 = spawn_above(o1$4.dir, o2$5, typ$2, context); - rev_dir(o1$4, t1, s1$3); - return [ - updated_block$1, - spawned_item$1 - ]; - - } + case 3 : + if (o2$4.vel.x === 0) { + rev_dir(o1$4, t1, s1$3); + return [ + undefined, + undefined + ]; + } else { + dec_health(o1$4); + return [ + undefined, + undefined + ]; } - break; - - } - break; - case /* Item */ 2 : - const o2$6 = c1._2; - switch (c2.TAG) { - case /* Player */ 0 : - o1$2 = c2._2; - t2$1 = c1._0; - o2$2 = o2$6; - exit = 3; - break; - case /* Enemy */ 1 : - case /* Item */ 2 : + + } + case /* Item */ 2 : + return [ + undefined, + undefined + ]; + case /* Block */ 3 : + const t2$3 = c2._0; + const o2$5 = c2._2; + let exit$4 = 0; + switch (dir) { + case /* North */ 0 : + case /* South */ 1 : + collide_block(undefined, dir, o1$4); return [ undefined, undefined ]; - case /* Block */ 3 : - switch (dir) { - case /* North */ 0 : - case /* South */ 1 : - collide_block(undefined, dir, o2$6); + case /* East */ 2 : + case /* West */ 3 : + exit$4 = 4; + break; + + } + if (exit$4 === 4) { + let exit$5 = 0; + let typ$2; + switch (t1) { + case /* GKoopaShell */ 3 : + if (/* tag */ typeof t2$3 === "number" || typeof t2$3 === "string") { + if (t2$3 === /* Brick */ 1) { + dec_health(o2$5); + reverse_left_right(o1$4); return [ undefined, undefined ]; - case /* East */ 2 : - case /* West */ 3 : - reverse_left_right(o2$6); + } + exit$5 = 5; + } else { + typ$2 = t2$3._0; + exit$5 = 6; + } + break; + case /* RKoopaShell */ 4 : + if (/* tag */ typeof t2$3 === "number" || typeof t2$3 === "string") { + if (t2$3 === /* Brick */ 1) { + dec_health(o2$5); + reverse_left_right(o1$4); return [ undefined, undefined ]; - - } - - } - break; + } + exit$5 = 5; + } else { + typ$2 = t2$3._0; + exit$5 = 6; + } + break; + default: + exit$5 = 5; + } + switch (exit$5) { + case 5 : + rev_dir(o1$4, t1, s1$3); + return [ + undefined, + undefined + ]; + case 6 : + const updated_block$1 = evolve_block(o2$5, context); + const spawned_item$1 = spawn_above(o1$4.dir, o2$5, typ$2, context); + rev_dir(o1$4, t1, s1$3); + return [ + updated_block$1, + spawned_item$1 + ]; + + } + } + break; + + } + break; + case /* Item */ 2 : + const o2$6 = c1._2; + switch (c2.TAG) { + case /* Player */ 0 : + o1$2 = c2._2; + t2$1 = c1._0; + o2$2 = o2$6; + exit = 3; + break; + case /* Enemy */ 1 : + case /* Item */ 2 : + return [ + undefined, + undefined + ]; + case /* Block */ 3 : + switch (dir) { + case /* North */ 0 : + case /* South */ 1 : + collide_block(undefined, dir, o2$6); + return [ + undefined, + undefined + ]; + case /* East */ 2 : + case /* West */ 3 : + reverse_left_right(o2$6); + return [ + undefined, + undefined + ]; + + } + + } + break; case /* Block */ 3 : - return [ - undefined, - undefined - ]; + return [ + undefined, + undefined + ]; } switch (exit) { case 1 : - o1.invuln = 10; - o1.jumping = false; - o1.grounded = true; - switch (typ) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - break; - default: - dec_health(o2); - o1.vel.y = - 4; - if (state.multiplier === 8) { - update_score(state, 800); - o2.score = 800; - return [ - undefined, - evolve_enemy(o1.dir, typ, s2, o2, context) - ]; - } - const score = Math.imul(100, state.multiplier); - update_score(state, score); - o2.score = score; - state.multiplier = (state.multiplier << 1); + o1.invuln = 10; + o1.jumping = false; + o1.grounded = true; + switch (typ) { + case /* GKoopaShell */ 3 : + case /* RKoopaShell */ 4 : + break; + default: + dec_health(o2); + o1.vel.y = - 4; + if (state.multiplier === 8) { + update_score(state, 800); + o2.score = 800; return [ undefined, evolve_enemy(o1.dir, typ, s2, o2, context) ]; - } - const r2 = evolve_enemy(o1.dir, typ, s2, o2, context); - o1.vel.y = - 4; - o1.pos.y = o1.pos.y - 5; - return [ - undefined, - r2 - ]; + } + const score = Math.imul(100, state.multiplier); + update_score(state, score); + o2.score = score; + state.multiplier = (state.multiplier << 1); + return [ + undefined, + evolve_enemy(o1.dir, typ, s2, o2, context) + ]; + } + const r2 = evolve_enemy(o1.dir, typ, s2, o2, context); + o1.vel.y = - 4; + o1.pos.y = o1.pos.y - 5; + return [ + undefined, + r2 + ]; case 2 : - switch (t2) { - case /* GKoopaShell */ 3 : - case /* RKoopaShell */ 4 : - break; - default: - dec_health(o1$1); - o1$1.invuln = 60; - return [ - undefined, - undefined - ]; - } - const r2$1 = o2$1.vel.x === 0 ? evolve_enemy(o1$1.dir, t2, s2$1, o2$1, context) : (dec_health(o1$1), o1$1.invuln = 60, undefined); - return [ - undefined, - r2$1 - ]; + switch (t2) { + case /* GKoopaShell */ 3 : + case /* RKoopaShell */ 4 : + break; + default: + dec_health(o1$1); + o1$1.invuln = 60; + return [ + undefined, + undefined + ]; + } + const r2$1 = o2$1.vel.x === 0 ? evolve_enemy(o1$1.dir, t2, s2$1, o2$1, context) : (dec_health(o1$1), o1$1.invuln = 60, undefined); + return [ + undefined, + r2$1 + ]; case 3 : - let exit$6 = 0; - switch (t2$1) { - case /* Mushroom */ 0 : - dec_health(o2$2); - if (o1$2.health === 2) { - - } else { - o1$2.health = o1$2.health + 1 | 0; - } - o1$2.vel.x = 0; - o1$2.vel.y = 0; - update_score(state, 1000); - o2$2.score = 1000; - return [ - undefined, - undefined - ]; - case /* FireFlower */ 1 : - case /* Star */ 2 : - exit$6 = 4; - break; - case /* Coin */ 3 : - state.coins = state.coins + 1 | 0; - dec_health(o2$2); - update_score(state, 100); - return [ - undefined, - undefined - ]; - - } - if (exit$6 === 4) { + let exit$6 = 0; + switch (t2$1) { + case /* Mushroom */ 0 : dec_health(o2$2); + if (o1$2.health === 2) { + + } else { + o1$2.health = o1$2.health + 1 | 0; + } + o1$2.vel.x = 0; + o1$2.vel.y = 0; update_score(state, 1000); + o2$2.score = 1000; return [ undefined, undefined ]; - } - break; + case /* FireFlower */ 1 : + case /* Star */ 2 : + exit$6 = 4; + break; + case /* Coin */ 3 : + state.coins = state.coins + 1 | 0; + dec_health(o2$2); + update_score(state, 100); + return [ + undefined, + undefined + ]; + + } + if (exit$6 === 4) { + dec_health(o2$2); + update_score(state, 1000); + return [ + undefined, + undefined + ]; + } + break; } } @@ -2352,20 +2352,20 @@ function keydown(evt) { if (match >= 41) { switch (match) { case 65 : - pressed_keys.left = true; - break; + pressed_keys.left = true; + break; case 66 : - pressed_keys.bbox = (pressed_keys.bbox + 1 | 0) % 2; - break; + pressed_keys.bbox = (pressed_keys.bbox + 1 | 0) % 2; + break; case 68 : - pressed_keys.right = true; - break; + pressed_keys.right = true; + break; case 83 : - pressed_keys.down = true; - break; + pressed_keys.down = true; + break; case 87 : - pressed_keys.up = true; - break; + pressed_keys.up = true; + break; } } else if (match >= 32) { @@ -2374,20 +2374,20 @@ function keydown(evt) { case 34 : case 35 : case 36 : - break; + break; case 37 : - pressed_keys.left = true; - break; + pressed_keys.left = true; + break; case 32 : case 38 : - pressed_keys.up = true; - break; + pressed_keys.up = true; + break; case 39 : - pressed_keys.right = true; - break; + pressed_keys.right = true; + break; case 40 : - pressed_keys.down = true; - break; + pressed_keys.down = true; + break; } } @@ -2422,20 +2422,20 @@ function keyup(evt) { case 34 : case 35 : case 36 : - break; + break; case 37 : - pressed_keys.left = false; - break; + pressed_keys.left = false; + break; case 32 : case 38 : - pressed_keys.up = false; - break; + pressed_keys.up = false; + break; case 39 : - pressed_keys.right = false; - break; + pressed_keys.right = false; + break; case 40 : - pressed_keys.down = false; - break; + pressed_keys.down = false; + break; } } @@ -2482,11 +2482,11 @@ function convert_list(lst) { function choose_enemy_typ(typ) { switch (typ) { case 0 : - return /* RKoopa */ 2; + return /* RKoopa */ 2; case 1 : - return /* GKoopa */ 1; + return /* GKoopa */ 1; case 2 : - return /* Goomba */ 0; + return /* Goomba */ 0; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2498,18 +2498,18 @@ function choose_enemy_typ(typ) { function choose_sblock_typ(typ) { switch (typ) { case 0 : - return /* Brick */ 1; + return /* Brick */ 1; case 1 : - return /* UnBBlock */ 2; + return /* UnBBlock */ 2; case 2 : - return /* Cloud */ 3; + return /* Cloud */ 3; case 3 : - return { - TAG: /* QBlock */ 0, - _0: /* Mushroom */ 0 - }; + return { + TAG: /* QBlock */ 0, + _0: /* Mushroom */ 0 + }; case 4 : - return /* Ground */ 5; + return /* Ground */ 5; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2615,128 +2615,97 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { const middle_block = life_block_chance === 0 ? 3 : stair_typ; switch (prob) { case 0 : - if (blockw - cbx > 2) { - return { + if (blockw - cbx > 2) { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ - stair_typ, + middle_block, [ - cbx, + cbx + 1, cby ] ], tl: { hd: [ - middle_block, + stair_typ, [ - cbx + 1, + cbx + 2, cby ] ], - tl: { - hd: [ - stair_typ, - [ - cbx + 2, - cby - ] - ], - tl: /* [] */ 0 - } + tl: /* [] */ 0 } - }; - } else if (blockw - cbx > 1) { - return { + } + }; + } else if (blockw - cbx > 1) { + return { + hd: [ + block_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ block_typ, [ - cbx, - cby - ] - ], - tl: { - hd: [ - block_typ, - [ - cbx + 1, - cby - ] - ], - tl: /* [] */ 0 - } - }; - } else { - return { - hd: [ - block_typ, - [ - cbx, + cbx + 1, cby ] ], tl: /* [] */ 0 - }; - } - case 1 : - const num_clouds = Stdlib__Random.$$int(5) + 5 | 0; - if (cby < 5) { - return generate_clouds(cbx, cby, 2, num_clouds); - } else { - return /* [] */ 0; - } - case 2 : - if (blockh - cby === 1) { - const four_0 = [ - stair_typ, + } + }; + } else { + return { + hd: [ + block_typ, [ cbx, cby ] - ]; - const four_1 = { - hd: [ - stair_typ, - [ - cbx + 1, - cby - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx + 2, - cby - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx + 3, - cby - ] - ], - tl: /* [] */ 0 - } - } - }; - const four = { - hd: four_0, - tl: four_1 - }; - const three_0 = [ + ], + tl: /* [] */ 0 + }; + } + case 1 : + const num_clouds = Stdlib__Random.$$int(5) + 5 | 0; + if (cby < 5) { + return generate_clouds(cbx, cby, 2, num_clouds); + } else { + return /* [] */ 0; + } + case 2 : + if (blockh - cby === 1) { + const four_0 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + const four_1 = { + hd: [ stair_typ, [ cbx + 1, - cby - 1 + cby ] - ]; - const three_1 = { + ], + tl: { hd: [ stair_typ, [ cbx + 2, - cby - 1 + cby ] ], tl: { @@ -2744,232 +2713,291 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { stair_typ, [ cbx + 3, - cby - 1 + cby ] ], tl: /* [] */ 0 } - }; - const three = { - hd: three_0, - tl: three_1 - }; - const two_0 = [ + } + }; + const four = { + hd: four_0, + tl: four_1 + }; + const three_0 = [ + stair_typ, + [ + cbx + 1, + cby - 1 + ] + ]; + const three_1 = { + hd: [ stair_typ, [ cbx + 2, - cby - 2 + cby - 1 ] - ]; - const two_1 = { + ], + tl: { hd: [ stair_typ, [ cbx + 3, - cby - 2 + cby - 1 ] ], tl: /* [] */ 0 - }; - const two = { - hd: two_0, - tl: two_1 - }; - const one_0 = [ + } + }; + const three = { + hd: three_0, + tl: three_1 + }; + const two_0 = [ + stair_typ, + [ + cbx + 2, + cby - 2 + ] + ]; + const two_1 = { + hd: [ stair_typ, [ cbx + 3, - cby - 3 + cby - 2 ] - ]; - const one = { - hd: one_0, - tl: /* [] */ 0 - }; - return Stdlib.$at(four, Stdlib.$at(three, Stdlib.$at(two, one))); - } else { - return /* [] */ 0; - } + ], + tl: /* [] */ 0 + }; + const two = { + hd: two_0, + tl: two_1 + }; + const one_0 = [ + stair_typ, + [ + cbx + 3, + cby - 3 + ] + ]; + const one = { + hd: one_0, + tl: /* [] */ 0 + }; + return Stdlib.$at(four, Stdlib.$at(three, Stdlib.$at(two, one))); + } else { + return /* [] */ 0; + } case 3 : - if (stair_typ === 0 && blockh - cby > 3) { - const three_0$1 = [ + if (stair_typ === 0 && blockh - cby > 3) { + const three_0$1 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + const three_1$1 = { + hd: [ stair_typ, [ - cbx, + cbx + 1, cby ] - ]; - const three_1$1 = { + ], + tl: { hd: [ stair_typ, [ - cbx + 1, + cbx + 2, cby ] ], - tl: { - hd: [ - stair_typ, - [ - cbx + 2, - cby - ] - ], - tl: /* [] */ 0 - } - }; - const three$1 = { - hd: three_0$1, - tl: three_1$1 - }; - const two_0$1 = [ + tl: /* [] */ 0 + } + }; + const three$1 = { + hd: three_0$1, + tl: three_1$1 + }; + const two_0$1 = [ + stair_typ, + [ + cbx + 2, + cby + 1 + ] + ]; + const two_1$1 = { + hd: [ stair_typ, [ - cbx + 2, + cbx + 3, cby + 1 ] - ]; - const two_1$1 = { - hd: [ - stair_typ, - [ - cbx + 3, - cby + 1 - ] - ], - tl: /* [] */ 0 - }; - const two$1 = { - hd: two_0$1, - tl: two_1$1 - }; - const one_0$1 = [ + ], + tl: /* [] */ 0 + }; + const two$1 = { + hd: two_0$1, + tl: two_1$1 + }; + const one_0$1 = [ + stair_typ, + [ + cbx + 5, + cby + 2 + ] + ]; + const one_1 = { + hd: [ stair_typ, [ - cbx + 5, + cbx + 6, cby + 2 ] - ]; - const one_1 = { - hd: [ - stair_typ, - [ - cbx + 6, - cby + 2 - ] - ], - tl: /* [] */ 0 - }; - const one$1 = { - hd: one_0$1, - tl: one_1 - }; - return Stdlib.$at(three$1, Stdlib.$at(two$1, one$1)); - } else if (blockh - cby > 2) { - const one_0$2 = [ + ], + tl: /* [] */ 0 + }; + const one$1 = { + hd: one_0$1, + tl: one_1 + }; + return Stdlib.$at(three$1, Stdlib.$at(two$1, one$1)); + } else if (blockh - cby > 2) { + const one_0$2 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + const one_1$1 = { + hd: [ stair_typ, [ - cbx, + cbx + 1, cby ] - ]; - const one_1$1 = { - hd: [ - stair_typ, - [ - cbx + 1, - cby - ] - ], - tl: /* [] */ 0 - }; - const one$2 = { - hd: one_0$2, - tl: one_1$1 - }; - const two_0$2 = [ + ], + tl: /* [] */ 0 + }; + const one$2 = { + hd: one_0$2, + tl: one_1$1 + }; + const two_0$2 = [ + stair_typ, + [ + cbx + 3, + cby - 1 + ] + ]; + const two_1$2 = { + hd: [ stair_typ, [ - cbx + 3, + cbx + 4, cby - 1 ] - ]; - const two_1$2 = { - hd: [ - stair_typ, - [ - cbx + 4, - cby - 1 - ] - ], - tl: /* [] */ 0 - }; - const two$2 = { - hd: two_0$2, - tl: two_1$2 - }; - const three_0$2 = [ + ], + tl: /* [] */ 0 + }; + const two$2 = { + hd: two_0$2, + tl: two_1$2 + }; + const three_0$2 = [ + stair_typ, + [ + cbx + 4, + cby - 2 + ] + ]; + const three_1$2 = { + hd: [ stair_typ, [ - cbx + 4, + cbx + 5, cby - 2 ] - ]; - const three_1$2 = { + ], + tl: { hd: [ stair_typ, [ - cbx + 5, + cbx + 6, cby - 2 ] ], - tl: { - hd: [ - stair_typ, - [ - cbx + 6, - cby - 2 - ] - ], - tl: /* [] */ 0 - } - }; - const three$2 = { - hd: three_0$2, - tl: three_1$2 - }; - return Stdlib.$at(one$2, Stdlib.$at(two$2, three$2)); - } else { - return { - hd: [ - stair_typ, - [ - cbx, - cby - ] - ], tl: /* [] */ 0 - }; - } + } + }; + const three$2 = { + hd: three_0$2, + tl: three_1$2 + }; + return Stdlib.$at(one$2, Stdlib.$at(two$2, three$2)); + } else { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: /* [] */ 0 + }; + } case 4 : - if (cby + 3 - blockh === 2) { - return { + if (cby + 3 - blockh === 2) { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: /* [] */ 0 + }; + } else if (cby + 3 - blockh === 1) { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ stair_typ, [ cbx, - cby + cby + 1 ] ], tl: /* [] */ 0 - }; - } else if (cby + 3 - blockh === 1) { - return { + } + }; + } else { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ stair_typ, [ cbx, - cby + cby + 1 ] ], tl: { @@ -2977,53 +3005,25 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { stair_typ, [ cbx, - cby + 1 + cby + 2 ] ], tl: /* [] */ 0 } - }; - } else { - return { - hd: [ - stair_typ, - [ - cbx, - cby - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx, - cby + 1 - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx, - cby + 2 - ] - ], - tl: /* [] */ 0 - } - } - }; - } - case 5 : - return { - hd: [ - 3, - [ - cbx, - cby - ] - ], - tl: /* [] */ 0 + } }; + } + case 5 : + return { + hd: [ + 3, + [ + cbx, + cby + ] + ], + tl: /* [] */ 0 + }; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", diff --git a/jscomp/test/dist/jscomp/test/match_case_test.js b/jscomp/test/dist/jscomp/test/match_case_test.js index ef6d747509..3da7ab7acc 100644 --- a/jscomp/test/dist/jscomp/test/match_case_test.js +++ b/jscomp/test/dist/jscomp/test/match_case_test.js @@ -31,9 +31,9 @@ function eq(loc, x, y) { function f(x) { switch (x) { case "xx\"" : - return 1; + return 1; case "xx'''" : - return 0; + return 0; default: return 4; } diff --git a/jscomp/test/dist/jscomp/test/mel_ast_variants.js b/jscomp/test/dist/jscomp/test/mel_ast_variants.js index 21507eb18b..90639d6c68 100644 --- a/jscomp/test/dist/jscomp/test/mel_ast_variants.js +++ b/jscomp/test/dist/jscomp/test/mel_ast_variants.js @@ -5,15 +5,15 @@ function toEnum(x) { switch (x) { case /* A */ 0 : - return 0; + return 0; case /* B */ 1 : - return 1; + return 1; case /* C */ 2 : - return 2; + return 2; case /* D */ 3 : - return 3; + return 3; case /* E */ 4 : - return 4; + return 4; } } @@ -21,15 +21,15 @@ function toEnum(x) { function toString(x) { switch (x) { case /* A */ 0 : - return "A"; + return "A"; case /* B */ 1 : - return "B"; + return "B"; case /* C */ 2 : - return "C"; + return "C"; case /* D */ 3 : - return "D"; + return "D"; case /* E */ 4 : - return "E"; + return "E"; } } @@ -38,7 +38,7 @@ function bar(x) { switch (x) { case /* A */ 0 : case /* E */ 4 : - return 10; + return 10; default: return 0; } @@ -129,21 +129,21 @@ function foo(x) { if (/* tag */ typeof x === "number" || typeof x === "string") { switch (x) { case /* A */ "dd" : - return 1; + return 1; case /* B */ 12 : - return 2; + return 2; case /* C */ 2 : - return 3; + return 3; } } else { switch (x.TAG) { case /* D */ "qq" : - return 4; + return 4; case /* E */ 42 : - return 5; + return 5; case /* F */ 2 : - return 6; + return 6; } } diff --git a/jscomp/test/dist/jscomp/test/miss_colon_test.js b/jscomp/test/dist/jscomp/test/miss_colon_test.js index acbfb112cc..7e268fb3fb 100644 --- a/jscomp/test/dist/jscomp/test/miss_colon_test.js +++ b/jscomp/test/dist/jscomp/test/miss_colon_test.js @@ -21,26 +21,26 @@ function $plus$colon(_f, _g) { } switch (g.TAG) { case /* Int */ 0 : - if (g._0 !== 0) { - return { - TAG: /* Add */ 2, - _0: f, - _1: g - }; - } else { - return f; - } - case /* Add */ 2 : - _g = g._1; - _f = $plus$colon(f, g._0); - continue; - case /* Var */ 1 : - case /* Mul */ 3 : + if (g._0 !== 0) { return { TAG: /* Add */ 2, _0: f, _1: g }; + } else { + return f; + } + case /* Add */ 2 : + _g = g._1; + _f = $plus$colon(f, g._0); + continue; + case /* Var */ 1 : + case /* Mul */ 3 : + return { + TAG: /* Add */ 2, + _0: f, + _1: g + }; } }; @@ -88,26 +88,26 @@ function $star$colon(_f, _g) { } switch (g.TAG) { case /* Int */ 0 : - if (g._0 !== 1) { - return { - TAG: /* Mul */ 3, - _0: f, - _1: g - }; - } else { - return f; - } - case /* Var */ 1 : - case /* Add */ 2 : + if (g._0 !== 1) { return { TAG: /* Mul */ 3, _0: f, _1: g }; + } else { + return f; + } + case /* Var */ 1 : + case /* Add */ 2 : + return { + TAG: /* Mul */ 3, + _0: f, + _1: g + }; case /* Mul */ 3 : - _g = g._1; - _f = $star$colon(f, g._0); - continue; + _g = g._1; + _f = $star$colon(f, g._0); + continue; } }; @@ -117,11 +117,11 @@ function simplify(f) { switch (f.TAG) { case /* Int */ 0 : case /* Var */ 1 : - return f; + return f; case /* Add */ 2 : - return $plus$colon(simplify(f._0), simplify(f._1)); + return $plus$colon(simplify(f._0), simplify(f._1)); case /* Mul */ 3 : - return $star$colon(simplify(f._0), simplify(f._1)); + return $star$colon(simplify(f._0), simplify(f._1)); } } diff --git a/jscomp/test/dist/jscomp/test/mock_mt.js b/jscomp/test/dist/jscomp/test/mock_mt.js index 907fd3d35b..3aa34f348e 100644 --- a/jscomp/test/dist/jscomp/test/mock_mt.js +++ b/jscomp/test/dist/jscomp/test/mock_mt.js @@ -14,71 +14,71 @@ function from_pair_suites(name, suites) { const fn = Curry._1(param[1], undefined); switch (fn.TAG) { case /* Eq */ 0 : - console.log([ - name, - fn._0, - "eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "eq?", + fn._1 + ]); + return; case /* Neq */ 1 : - console.log([ - name, - fn._0, - "neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "neq?", + fn._1 + ]); + return; case /* StrictEq */ 2 : - console.log([ - name, - fn._0, - "strict_eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_eq?", + fn._1 + ]); + return; case /* StrictNeq */ 3 : - console.log([ - name, - fn._0, - "strict_neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_neq?", + fn._1 + ]); + return; case /* Ok */ 4 : - console.log([ - name, - fn._0, - "ok?" - ]); - return; + console.log([ + name, + fn._0, + "ok?" + ]); + return; case /* Approx */ 5 : - console.log([ - name, - fn._0, - "~", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "~", + fn._1 + ]); + return; case /* ApproxThreshold */ 6 : - console.log([ - name, - fn._1, - "~", - fn._2, - " (", - fn._0, - ")" - ]); - return; + console.log([ + name, + fn._1, + "~", + fn._2, + " (", + fn._0, + ")" + ]); + return; case /* ThrowAny */ 7 : - return; + return; case /* Fail */ 8 : - console.log("failed"); - return; + console.log("failed"); + return; case /* FailWith */ 9 : - console.log("failed: " + fn._0); - return; + console.log("failed: " + fn._0); + return; } }), suites); diff --git a/jscomp/test/dist/jscomp/test/mt.js b/jscomp/test/dist/jscomp/test/mt.js index 0ce9152098..7657250645 100644 --- a/jscomp/test/dist/jscomp/test/mt.js +++ b/jscomp/test/dist/jscomp/test/mt.js @@ -53,45 +53,45 @@ function close_enough(thresholdOpt, a, b) { function handleCode(spec) { switch (spec.TAG) { case /* Eq */ 0 : - Assert.deepEqual(spec._0, spec._1); - return; + Assert.deepEqual(spec._0, spec._1); + return; case /* Neq */ 1 : - Assert.notDeepEqual(spec._0, spec._1); - return; + Assert.notDeepEqual(spec._0, spec._1); + return; case /* StrictEq */ 2 : - Assert.strictEqual(spec._0, spec._1); - return; + Assert.strictEqual(spec._0, spec._1); + return; case /* StrictNeq */ 3 : - Assert.notStrictEqual(spec._0, spec._1); - return; + Assert.notStrictEqual(spec._0, spec._1); + return; case /* Ok */ 4 : - Assert.ok(spec._0); - return; + Assert.ok(spec._0); + return; case /* Approx */ 5 : - const b = spec._1; - const a = spec._0; - if (!close_enough(undefined, a, b)) { - Assert.deepEqual(a, b); - return; - } else { - return; - } + const b = spec._1; + const a = spec._0; + if (!close_enough(undefined, a, b)) { + Assert.deepEqual(a, b); + return; + } else { + return; + } case /* ApproxThreshold */ 6 : - const b$1 = spec._2; - const a$1 = spec._1; - if (!close_enough(spec._0, a$1, b$1)) { - Assert.deepEqual(a$1, b$1); - return; - } else { - return; - } - case /* ThrowAny */ 7 : - Assert.throws(spec._0); + const b$1 = spec._2; + const a$1 = spec._1; + if (!close_enough(spec._0, a$1, b$1)) { + Assert.deepEqual(a$1, b$1); + return; + } else { return; + } + case /* ThrowAny */ 7 : + Assert.throws(spec._0); + return; case /* Fail */ 8 : - return assert_fail("failed"); + return assert_fail("failed"); case /* FailWith */ 9 : - return assert_fail(spec._0); + return assert_fail(spec._0); } } @@ -119,71 +119,71 @@ function from_pair_suites(name, suites) { const _fn = Curry._1(param[1], undefined); switch (_fn.TAG) { case /* Eq */ 0 : - console.log([ - name, - _fn._0, - "eq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "eq?", + _fn._1 + ]); + return; case /* Neq */ 1 : - console.log([ - name, - _fn._0, - "neq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "neq?", + _fn._1 + ]); + return; case /* StrictEq */ 2 : - console.log([ - name, - _fn._0, - "strict_eq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "strict_eq?", + _fn._1 + ]); + return; case /* StrictNeq */ 3 : - console.log([ - name, - _fn._0, - "strict_neq?", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "strict_neq?", + _fn._1 + ]); + return; case /* Ok */ 4 : - console.log([ - name, - _fn._0, - "ok?" - ]); - return; + console.log([ + name, + _fn._0, + "ok?" + ]); + return; case /* Approx */ 5 : - console.log([ - name, - _fn._0, - "~", - _fn._1 - ]); - return; + console.log([ + name, + _fn._0, + "~", + _fn._1 + ]); + return; case /* ApproxThreshold */ 6 : - console.log([ - name, - _fn._1, - "~", - _fn._2, - " (", - _fn._0, - ")" - ]); - return; + console.log([ + name, + _fn._1, + "~", + _fn._2, + " (", + _fn._0, + ")" + ]); + return; case /* ThrowAny */ 7 : - return; + return; case /* Fail */ 8 : - console.log("failed"); - return; + console.log("failed"); + return; case /* FailWith */ 9 : - console.log("failed: " + _fn._0); - return; + console.log("failed: " + _fn._0); + return; } }), suites); diff --git a/jscomp/test/dist/jscomp/test/number_lexer.js b/jscomp/test/dist/jscomp/test/number_lexer.js index 83855ac8fc..3c3ec0ea17 100644 --- a/jscomp/test/dist/jscomp/test/number_lexer.js +++ b/jscomp/test/dist/jscomp/test/number_lexer.js @@ -28,45 +28,45 @@ function __ocaml_lex_token_rec(l, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - Curry._1(l, "new line"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "new line"); + ___ocaml_lex_state = 0; + continue; case 1 : - Curry._1(l, "number"); - Curry._1(l, Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "number"); + Curry._1(l, Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 0; + continue; case 2 : - Curry._1(l, "ident"); - Curry._1(l, Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "ident"); + Curry._1(l, Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 0; + continue; case 3 : - Curry._1(l, "+"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "+"); + ___ocaml_lex_state = 0; + continue; case 4 : - Curry._1(l, "-"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "-"); + ___ocaml_lex_state = 0; + continue; case 5 : - Curry._1(l, "*"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "*"); + ___ocaml_lex_state = 0; + continue; case 6 : - Curry._1(l, "/"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "/"); + ___ocaml_lex_state = 0; + continue; case 7 : - Curry._1(l, "("); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, "("); + ___ocaml_lex_state = 0; + continue; case 8 : - Curry._1(l, ")"); - ___ocaml_lex_state = 0; - continue; + Curry._1(l, ")"); + ___ocaml_lex_state = 0; + continue; case 9 : - return Curry._1(l, "eof"); + return Curry._1(l, "eof"); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; diff --git a/jscomp/test/dist/jscomp/test/ocaml_parsetree_test.js b/jscomp/test/dist/jscomp/test/ocaml_parsetree_test.js index d06bdc6531..99c0f28d4a 100644 --- a/jscomp/test/dist/jscomp/test/ocaml_parsetree_test.js +++ b/jscomp/test/dist/jscomp/test/ocaml_parsetree_test.js @@ -89,21 +89,21 @@ function create_hashtable(size, init) { function ansi_of_color(param) { switch (param) { case /* Black */ 0 : - return "0"; + return "0"; case /* Red */ 1 : - return "1"; + return "1"; case /* Green */ 2 : - return "2"; + return "2"; case /* Yellow */ 3 : - return "3"; + return "3"; case /* Blue */ 4 : - return "4"; + return "4"; case /* Magenta */ 5 : - return "5"; + return "5"; case /* Cyan */ 6 : - return "6"; + return "6"; case /* White */ 7 : - return "7"; + return "7"; } } @@ -118,11 +118,11 @@ function code_of_style(c) { } switch (c) { case /* Bold */ 0 : - return "1"; + return "1"; case /* Reset */ 1 : - return "0"; + return "0"; case /* Dim */ 2 : - return "2"; + return "2"; } } @@ -177,35 +177,35 @@ function style_of_tag(s) { if (s.MEL_EXN_ID === Stdlib__Format.String_tag) { switch (s._1) { case "dim" : - return { - hd: /* Dim */ 2, - tl: /* [] */ 0 - }; + return { + hd: /* Dim */ 2, + tl: /* [] */ 0 + }; case "error" : - return cur_styles.contents.error; + return cur_styles.contents.error; case "filename" : - return { + return { + hd: { + TAG: /* FG */ 0, + _0: /* Cyan */ 6 + }, + tl: /* [] */ 0 + }; + case "info" : + return { + hd: /* Bold */ 0, + tl: { hd: { TAG: /* FG */ 0, - _0: /* Cyan */ 6 + _0: /* Yellow */ 3 }, tl: /* [] */ 0 - }; - case "info" : - return { - hd: /* Bold */ 0, - tl: { - hd: { - TAG: /* FG */ 0, - _0: /* Yellow */ 3 - }, - tl: /* [] */ 0 - } - }; + } + }; case "loc" : - return cur_styles.contents.loc; + return cur_styles.contents.loc; case "warning" : - return cur_styles.contents.warning; + return cur_styles.contents.warning; default: throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found @@ -306,12 +306,12 @@ function setup(o) { if (o !== undefined) { switch (o) { case /* Always */ 1 : - tmp = true; - break; + tmp = true; + break; case /* Auto */ 0 : case /* Never */ 2 : - tmp = false; - break; + tmp = false; + break; } } else { @@ -335,117 +335,117 @@ function number(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* Comment_start */ 0 : - return 1; + return 1; case /* Comment_not_end */ 1 : - return 2; + return 2; case /* Partial_application */ 2 : - return 5; + return 5; case /* Labels_omitted */ 3 : - return 6; + return 6; case /* Statement_type */ 4 : - return 10; + return 10; case /* Unused_match */ 5 : - return 11; + return 11; case /* Unused_pat */ 6 : - return 12; + return 12; case /* Illegal_backslash */ 7 : - return 14; + return 14; case /* Unerasable_optional_argument */ 8 : - return 16; + return 16; case /* Unused_argument */ 9 : - return 20; + return 20; case /* Nonreturning_statement */ 10 : - return 21; + return 21; case /* Useless_record_with */ 11 : - return 23; + return 23; case /* All_clauses_guarded */ 12 : - return 25; + return 25; case /* Wildcard_arg_to_constant_constr */ 13 : - return 28; + return 28; case /* Eol_in_string */ 14 : - return 29; + return 29; case /* Unused_rec_flag */ 15 : - return 39; + return 39; case /* Bs_polymorphic_comparison */ 16 : - return 102; + return 102; } } else { switch (param.TAG) { case /* Deprecated */ 0 : - return 3; + return 3; case /* Fragile_match */ 1 : - return 4; + return 4; case /* Method_override */ 2 : - return 7; + return 7; case /* Partial_match */ 3 : - return 8; + return 8; case /* Non_closed_record_pattern */ 4 : - return 9; + return 9; case /* Instance_variable_override */ 5 : - return 13; + return 13; case /* Implicit_public_methods */ 6 : - return 15; + return 15; case /* Undeclared_virtual_method */ 7 : - return 17; + return 17; case /* Not_principal */ 8 : - return 18; + return 18; case /* Without_principality */ 9 : - return 19; + return 19; case /* Preprocessor */ 10 : - return 22; + return 22; case /* Bad_module_name */ 11 : - return 24; + return 24; case /* Unused_var */ 12 : - return 26; + return 26; case /* Unused_var_strict */ 13 : - return 27; + return 27; case /* Duplicate_definitions */ 14 : - return 30; + return 30; case /* Multiple_definition */ 15 : - return 31; + return 31; case /* Unused_value_declaration */ 16 : - return 32; + return 32; case /* Unused_open */ 17 : - return 33; + return 33; case /* Unused_type_declaration */ 18 : - return 34; + return 34; case /* Unused_for_index */ 19 : - return 35; + return 35; case /* Unused_ancestor */ 20 : - return 36; + return 36; case /* Unused_constructor */ 21 : - return 37; + return 37; case /* Unused_extension */ 22 : - return 38; + return 38; case /* Name_out_of_scope */ 23 : - return 40; + return 40; case /* Ambiguous_name */ 24 : - return 41; + return 41; case /* Disambiguated_name */ 25 : - return 42; + return 42; case /* Nonoptional_label */ 26 : - return 43; + return 43; case /* Open_shadow_identifier */ 27 : - return 44; + return 44; case /* Open_shadow_label_constructor */ 28 : - return 45; + return 45; case /* Bad_env_variable */ 29 : - return 46; + return 46; case /* Attribute_payload */ 30 : - return 47; + return 47; case /* Eliminated_optional_arguments */ 31 : - return 48; + return 48; case /* No_cmi_file */ 32 : - return 49; + return 49; case /* Bad_docstring */ 33 : - return 50; + return 50; case /* Bs_unused_attribute */ 34 : - return 101; + return 101; case /* Bs_ffi_warning */ 35 : - return 103; + return 103; case /* Bs_derive_warning */ 36 : - return 104; + return 104; } } @@ -467,94 +467,94 @@ const letter_all = loop(104); function letter(param) { switch (param) { case 97 : - return letter_all; + return letter_all; case 99 : - return { - hd: 1, - tl: { - hd: 2, - tl: /* [] */ 0 - } - }; - case 100 : - return { - hd: 3, + return { + hd: 1, + tl: { + hd: 2, tl: /* [] */ 0 - }; + } + }; + case 100 : + return { + hd: 3, + tl: /* [] */ 0 + }; case 101 : - return { - hd: 4, - tl: /* [] */ 0 - }; + return { + hd: 4, + tl: /* [] */ 0 + }; case 102 : - return { - hd: 5, - tl: /* [] */ 0 - }; + return { + hd: 5, + tl: /* [] */ 0 + }; case 107 : - return { - hd: 32, + return { + hd: 32, + tl: { + hd: 33, tl: { - hd: 33, + hd: 34, tl: { - hd: 34, + hd: 35, tl: { - hd: 35, + hd: 36, tl: { - hd: 36, + hd: 37, tl: { - hd: 37, + hd: 38, tl: { - hd: 38, - tl: { - hd: 39, - tl: /* [] */ 0 - } + hd: 39, + tl: /* [] */ 0 } } } } } } - }; + } + }; case 108 : - return { - hd: 6, - tl: /* [] */ 0 - }; + return { + hd: 6, + tl: /* [] */ 0 + }; case 109 : - return { - hd: 7, - tl: /* [] */ 0 - }; + return { + hd: 7, + tl: /* [] */ 0 + }; case 112 : - return { - hd: 8, - tl: /* [] */ 0 - }; + return { + hd: 8, + tl: /* [] */ 0 + }; case 114 : - return { - hd: 9, - tl: /* [] */ 0 - }; + return { + hd: 9, + tl: /* [] */ 0 + }; case 115 : - return { - hd: 10, - tl: /* [] */ 0 - }; + return { + hd: 10, + tl: /* [] */ 0 + }; case 117 : - return { - hd: 11, - tl: { - hd: 12, - tl: /* [] */ 0 - } - }; - case 118 : - return { - hd: 13, + return { + hd: 11, + tl: { + hd: 12, tl: /* [] */ 0 - }; + } + }; + case 118 : + return { + hd: 13, + tl: /* [] */ 0 + }; case 98 : case 103 : case 104 : @@ -565,36 +565,35 @@ function letter(param) { case 113 : case 116 : case 119 : - return /* [] */ 0; + return /* [] */ 0; case 120 : - return { - hd: 14, + return { + hd: 14, + tl: { + hd: 15, tl: { - hd: 15, + hd: 16, tl: { - hd: 16, + hd: 17, tl: { - hd: 17, + hd: 18, tl: { - hd: 18, + hd: 19, tl: { - hd: 19, + hd: 20, tl: { - hd: 20, + hd: 21, tl: { - hd: 21, + hd: 22, tl: { - hd: 22, + hd: 23, tl: { - hd: 23, + hd: 24, tl: { - hd: 24, + hd: 25, tl: { - hd: 25, - tl: { - hd: 30, - tl: /* [] */ 0 - } + hd: 30, + tl: /* [] */ 0 } } } @@ -606,17 +605,18 @@ function letter(param) { } } } - }; + } + }; case 121 : - return { - hd: 26, - tl: /* [] */ 0 - }; + return { + hd: 26, + tl: /* [] */ 0 + }; case 122 : - return { - hd: 27, - tl: /* [] */ 0 - }; + return { + hd: 27, + tl: /* [] */ 0 + }; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -739,14 +739,14 @@ function parse_opt(error, active, flags, s) { if (c >= 43) { switch (c) { case 43 : - return loop_letter_num(set, i + 1 | 0); + return loop_letter_num(set, i + 1 | 0); case 44 : - throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { - MEL_EXN_ID: Stdlib__Arg.Bad, - _1: "Ill-formed list of warnings" - }); + throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { + MEL_EXN_ID: Stdlib__Arg.Bad, + _1: "Ill-formed list of warnings" + }); case 45 : - return loop_letter_num(clear, i + 1 | 0); + return loop_letter_num(clear, i + 1 | 0); } } else { @@ -818,162 +818,161 @@ function message(s) { if (/* tag */ typeof s === "number" || typeof s === "string") { switch (s) { case /* Comment_start */ 0 : - return "this is the start of a comment."; + return "this is the start of a comment."; case /* Comment_not_end */ 1 : - return "this is not the end of a comment."; + return "this is not the end of a comment."; case /* Partial_application */ 2 : - return "this function application is partial,\nmaybe some arguments are missing."; + return "this function application is partial,\nmaybe some arguments are missing."; case /* Labels_omitted */ 3 : - return "labels were omitted in the application of this function."; + return "labels were omitted in the application of this function."; case /* Statement_type */ 4 : - return "this expression should have type unit."; + return "this expression should have type unit."; case /* Unused_match */ 5 : - return "this match case is unused."; + return "this match case is unused."; case /* Unused_pat */ 6 : - return "this sub-pattern is unused."; + return "this sub-pattern is unused."; case /* Illegal_backslash */ 7 : - return "illegal backslash escape in string."; + return "illegal backslash escape in string."; case /* Unerasable_optional_argument */ 8 : - return "this optional argument cannot be erased."; + return "this optional argument cannot be erased."; case /* Unused_argument */ 9 : - return "this argument will not be used by the function."; + return "this argument will not be used by the function."; case /* Nonreturning_statement */ 10 : - return "this statement never returns (or has an unsound type.)"; + return "this statement never returns (or has an unsound type.)"; case /* Useless_record_with */ 11 : - return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; + return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; case /* All_clauses_guarded */ 12 : - return "bad style, all clauses in this pattern-matching are guarded."; + return "bad style, all clauses in this pattern-matching are guarded."; case /* Wildcard_arg_to_constant_constr */ 13 : - return "wildcard pattern given as argument to a constant constructor"; + return "wildcard pattern given as argument to a constant constructor"; case /* Eol_in_string */ 14 : - return "unescaped end-of-line in a string constant (non-portable code)"; + return "unescaped end-of-line in a string constant (non-portable code)"; case /* Unused_rec_flag */ 15 : - return "unused rec flag."; + return "unused rec flag."; case /* Bs_polymorphic_comparison */ 16 : - return "polymorphic comparison introduced (maybe unsafe)"; + return "polymorphic comparison introduced (maybe unsafe)"; } } else { switch (s.TAG) { case /* Deprecated */ 0 : - return "deprecated: " + s._0; + return "deprecated: " + s._0; case /* Fragile_match */ 1 : - const s$1 = s._0; - if (s$1 === "") { - return "this pattern-matching is fragile."; - } else { - return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); - } + const s$1 = s._0; + if (s$1 === "") { + return "this pattern-matching is fragile."; + } else { + return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); + } case /* Method_override */ 2 : - const match = s._0; - if (match) { - const lab = match.hd; - if (match.tl) { - return Stdlib__String.concat(" ", { - hd: "the following methods are overridden by the class", + const match = s._0; + if (match) { + const lab = match.hd; + if (match.tl) { + return Stdlib__String.concat(" ", { + hd: "the following methods are overridden by the class", + tl: { + hd: lab, tl: { - hd: lab, - tl: { - hd: ":\n ", - tl: match.tl - } + hd: ":\n ", + tl: match.tl } - }); - } else { - return "the method " + (lab + " is overridden."); - } - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 283, - 26 - ] - }); - case /* Partial_match */ 3 : - const s$2 = s._0; - if (s$2 === "") { - return "this pattern-matching is not exhaustive."; + } + }); } else { - return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + return "the method " + (lab + " is overridden."); } + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 283, + 26 + ] + }); + case /* Partial_match */ 3 : + const s$2 = s._0; + if (s$2 === "") { + return "this pattern-matching is not exhaustive."; + } else { + return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + } case /* Non_closed_record_pattern */ 4 : - return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); + return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); case /* Instance_variable_override */ 5 : - const match$1 = s._0; - if (match$1) { - const lab$1 = match$1.hd; - if (match$1.tl) { - return Stdlib__String.concat(" ", { - hd: "the following instance variables are overridden by the class", + const match$1 = s._0; + if (match$1) { + const lab$1 = match$1.hd; + if (match$1.tl) { + return Stdlib__String.concat(" ", { + hd: "the following instance variables are overridden by the class", + tl: { + hd: lab$1, tl: { - hd: lab$1, - tl: { - hd: ":\n ", - tl: match$1.tl - } + hd: ":\n ", + tl: match$1.tl } - }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; - } else { - return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); - } + } + }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; + } else { + return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 303, - 37 - ] - }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 303, + 37 + ] + }); case /* Implicit_public_methods */ 6 : - return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); + return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); case /* Undeclared_virtual_method */ 7 : - return "the virtual method " + (s._0 + " is not declared."); + return "the virtual method " + (s._0 + " is not declared."); case /* Not_principal */ 8 : - return s._0 + " is not principal."; + return s._0 + " is not principal."; case /* Without_principality */ 9 : - return s._0 + " without principality."; + return s._0 + " without principality."; case /* Preprocessor */ 10 : - return s._0; + return s._0; case /* Bad_module_name */ 11 : - return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); + return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); case /* Unused_var */ 12 : case /* Unused_var_strict */ 13 : - return "unused variable " + (s._0 + "."); + return "unused variable " + (s._0 + "."); case /* Duplicate_definitions */ 14 : - return Curry._4(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "the ", + return Curry._4(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is defined in both types ", _1: { - TAG: /* String_literal */ 11, - _0: " is defined in both types ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } @@ -981,239 +980,240 @@ function message(s) { } } } - }, - _1: "the %s %s is defined in both types %s and %s." - }), s._0, s._1, s._2, s._3); + } + }, + _1: "the %s %s is defined in both types %s and %s." + }), s._0, s._1, s._2, s._3); case /* Multiple_definition */ 15 : - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "files ", + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "files ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " both define a module named ", _1: { - TAG: /* String_literal */ 11, - _0: " both define a module named ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "files %s and %s both define a module named %s" - }), s._1, s._2, s._0); + } + }, + _1: "files %s and %s both define a module named %s" + }), s._1, s._2, s._0); case /* Unused_value_declaration */ 16 : - return "unused value " + (s._0 + "."); + return "unused value " + (s._0 + "."); case /* Unused_open */ 17 : - return "unused open " + (s._0 + "."); + return "unused open " + (s._0 + "."); case /* Unused_type_declaration */ 18 : - return "unused type " + (s._0 + "."); + return "unused type " + (s._0 + "."); case /* Unused_for_index */ 19 : - return "unused for-loop index " + (s._0 + "."); + return "unused for-loop index " + (s._0 + "."); case /* Unused_ancestor */ 20 : - return "unused ancestor variable " + (s._0 + "."); + return "unused ancestor variable " + (s._0 + "."); case /* Unused_constructor */ 21 : - const s$3 = s._0; - if (s._1) { - return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); - } else { - return "unused constructor " + (s$3 + "."); - } + const s$3 = s._0; + if (s._1) { + return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); + } else { + return "unused constructor " + (s$3 + "."); + } case /* Unused_extension */ 22 : - const s$4 = s._0; - if (s._1) { - return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); - } else { - return "unused extension constructor " + (s$4 + "."); - } + const s$4 = s._0; + if (s._1) { + return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); + } else { + return "unused extension constructor " + (s$4 + "."); + } case /* Name_out_of_scope */ 23 : - const slist = s._1; - const ty = s._0; - if (slist && !slist.tl && !s._2) { - return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); - } - if (s._2) { - return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 365, - 39 - ] - }); - break; - case /* Ambiguous_name */ 24 : - const slist$1 = s._0; - if (slist$1 && !slist$1.tl && !s._2) { - return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); - } - if (s._2) { - return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 374, - 36 - ] - }); - break; + const slist = s._1; + const ty = s._0; + if (slist && !slist.tl && !s._2) { + return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); + } + if (s._2) { + return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 365, + 39 + ] + }); + break; + case /* Ambiguous_name */ 24 : + const slist$1 = s._0; + if (slist$1 && !slist$1.tl && !s._2) { + return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); + } + if (s._2) { + return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 374, + 36 + ] + }); + break; case /* Disambiguated_name */ 25 : - return "this use of " + (s._0 + " required disambiguation."); + return "this use of " + (s._0 + " required disambiguation."); case /* Nonoptional_label */ 26 : - return "the label " + (s._0 + " is not optional."); + return "the label " + (s._0 + " is not optional."); case /* Open_shadow_identifier */ 27 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " identifier ", _1: { - TAG: /* String_literal */ 11, - _0: " identifier ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s identifier %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s identifier %s (which is later used)" + }), s._0, s._1); case /* Open_shadow_label_constructor */ 28 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s %s (which is later used)" + }), s._0, s._1); case /* Bad_env_variable */ 29 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal environment variable ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal environment variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " : ", _1: { - TAG: /* String_literal */ 11, - _0: " : ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal environment variable %s : %s" - }), s._0, s._1); + } + }, + _1: "illegal environment variable %s : %s" + }), s._0, s._1); case /* Attribute_payload */ 30 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal payload for attribute '", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal payload for attribute '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "'.\n", _1: { - TAG: /* String_literal */ 11, - _0: "'.\n", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal payload for attribute '%s'.\n%s" - }), s._0, s._1); + } + }, + _1: "illegal payload for attribute '%s'.\n%s" + }), s._0, s._1); case /* Eliminated_optional_arguments */ 31 : - const sl = s._0; - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "implicit elimination of optional argument", + const sl = s._0; + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "implicit elimination of optional argument", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "implicit elimination of optional argument%s %s" - }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); + } + }, + _1: "implicit elimination of optional argument%s %s" + }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); case /* No_cmi_file */ 32 : - return "no cmi file was found in path for module " + s._0; + return "no cmi file was found in path for module " + s._0; case /* Bad_docstring */ 33 : - if (s._0) { - return "unattached documentation comment (ignored)"; - } else { - return "ambiguous documentation comment"; - } + if (s._0) { + return "unattached documentation comment (ignored)"; + } else { + return "ambiguous documentation comment"; + } case /* Bs_unused_attribute */ 34 : - return "Unused BuckleScript attribute: " + s._0; + return "Unused BuckleScript attribute: " + s._0; case /* Bs_ffi_warning */ 35 : - return "BuckleScript FFI warning: " + s._0; + return "BuckleScript FFI warning: " + s._0; case /* Bs_derive_warning */ 36 : - return "BuckleScript bs.deriving warning: " + s._0; + return "BuckleScript bs.deriving warning: " + s._0; } } @@ -2003,11 +2003,11 @@ register_error_of_exn(function (e) { function last(s) { switch (s.TAG) { case /* Lident */ 0 : - return s._0; + return s._0; case /* Ldot */ 1 : - return s._1; + return s._1; case /* Lapply */ 2 : - return fatal_error("Longident.last"); + return fatal_error("Longident.last"); } } @@ -2049,45 +2049,45 @@ function from_pair_suites(name, suites) { let spec = Curry._1(code, undefined); switch (spec.TAG) { case /* Eq */ 0 : - Assert.deepEqual(spec._0, spec._1); - return; + Assert.deepEqual(spec._0, spec._1); + return; case /* Neq */ 1 : - Assert.notDeepEqual(spec._0, spec._1); - return; + Assert.notDeepEqual(spec._0, spec._1); + return; case /* StrictEq */ 2 : - Assert.strictEqual(spec._0, spec._1); - return; + Assert.strictEqual(spec._0, spec._1); + return; case /* StrictNeq */ 3 : - Assert.notStrictEqual(spec._0, spec._1); - return; + Assert.notStrictEqual(spec._0, spec._1); + return; case /* Ok */ 4 : - Assert.ok(spec._0); - return; + Assert.ok(spec._0); + return; case /* Approx */ 5 : - const b = spec._1; - const a = spec._0; - if (!close_enough(undefined, a, b)) { - Assert.deepEqual(a, b); - return; - } else { - return; - } + const b = spec._1; + const a = spec._0; + if (!close_enough(undefined, a, b)) { + Assert.deepEqual(a, b); + return; + } else { + return; + } case /* ApproxThreshold */ 6 : - const b$1 = spec._2; - const a$1 = spec._1; - if (!close_enough(spec._0, a$1, b$1)) { - Assert.deepEqual(a$1, b$1); - return; - } else { - return; - } - case /* ThrowAny */ 7 : - Assert.throws(spec._0); + const b$1 = spec._2; + const a$1 = spec._1; + if (!close_enough(spec._0, a$1, b$1)) { + Assert.deepEqual(a$1, b$1); + return; + } else { return; + } + case /* ThrowAny */ 7 : + Assert.throws(spec._0); + return; case /* Fail */ 8 : - return assert_fail("failed"); + return assert_fail("failed"); case /* FailWith */ 9 : - return assert_fail(spec._0); + return assert_fail(spec._0); } })); @@ -2104,71 +2104,71 @@ function from_pair_suites(name, suites) { const fn = Curry._1(param[1], undefined); switch (fn.TAG) { case /* Eq */ 0 : - console.log([ - name, - fn._0, - "eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "eq?", + fn._1 + ]); + return; case /* Neq */ 1 : - console.log([ - name, - fn._0, - "neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "neq?", + fn._1 + ]); + return; case /* StrictEq */ 2 : - console.log([ - name, - fn._0, - "strict_eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_eq?", + fn._1 + ]); + return; case /* StrictNeq */ 3 : - console.log([ - name, - fn._0, - "strict_neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_neq?", + fn._1 + ]); + return; case /* Ok */ 4 : - console.log([ - name, - fn._0, - "ok?" - ]); - return; + console.log([ + name, + fn._0, + "ok?" + ]); + return; case /* Approx */ 5 : - console.log([ - name, - fn._0, - "~", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "~", + fn._1 + ]); + return; case /* ApproxThreshold */ 6 : - console.log([ - name, - fn._1, - "~", - fn._2, - " (", - fn._0, - ")" - ]); - return; + console.log([ + name, + fn._1, + "~", + fn._2, + " (", + fn._0, + ")" + ]); + return; case /* ThrowAny */ 7 : - return; + return; case /* Fail */ 8 : - console.log("failed"); - return; + console.log("failed"); + return; case /* FailWith */ 9 : - console.log("failed: " + fn._0); - return; + console.log("failed: " + fn._0); + return; } }), suites); @@ -2192,25 +2192,25 @@ function warn_bad_docstrings(param) { const match = ds.ds_attached; switch (match) { case /* Unattached */ 0 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: true - }); + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: true + }); case /* Info */ 1 : - return; + return; case /* Docs */ 2 : - const match$1 = ds.ds_associated; - switch (match$1) { - case /* Zero */ 0 : - case /* One */ 1 : - return; - case /* Many */ 2 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: false - }); - - } + const match$1 = ds.ds_associated; + switch (match$1) { + case /* Zero */ 0 : + case /* One */ 1 : + return; + case /* Many */ 2 : + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: false + }); + + } } }), Stdlib__List.rev(docstrings.contents)); @@ -2364,11 +2364,11 @@ function get_docstring(info, dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = info ? /* Info */ 1 : /* Docs */ 2; @@ -2389,11 +2389,11 @@ function get_docstrings(dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = /* Docs */ 2; @@ -2411,12 +2411,12 @@ function associate_docstrings(dsl) { const match = ds.ds_associated; switch (match) { case /* Zero */ 0 : - ds.ds_associated = /* One */ 1; - return; + ds.ds_associated = /* One */ 1; + return; case /* One */ 1 : case /* Many */ 2 : - ds.ds_associated = /* Many */ 2; - return; + ds.ds_associated = /* Many */ 2; + return; } }), dsl); @@ -3567,165 +3567,165 @@ const Escape_error = /* @__PURE__ */ Caml_exceptions.create("Ocaml_parsetree_tes function prepare_error(loc) { switch (loc.TAG) { case /* Unclosed */ 0 : - const closing = loc._3; - const opening = loc._1; - return Curry._1(errorf(loc._2, { - hd: Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This '", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } - } - }, - _1: "This '%s' might be unmatched" - }), opening), - tl: /* [] */ 0 - }, Curry._2(Stdlib__Printf.sprintf({ + const closing = loc._3; + const opening = loc._1; + return Curry._1(errorf(loc._2, { + hd: Curry._1(errorf(loc._0, undefined, undefined, { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Syntax error: '", + _0: "This '", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "' expected, the highlighted '", + _0: "' might be unmatched", + _1: /* End_of_format */ 0 + } + } + }, + _1: "This '%s' might be unmatched" + }), opening), + tl: /* [] */ 0 + }, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "' expected, the highlighted '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' might be unmatched", + _1: /* End_of_format */ 0 } } } - }, - _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" - }), closing, opening), { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: '", + } + }, + _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" + }), closing, opening), { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' expected", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' expected", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: '%s' expected" - }), closing); - case /* Expecting */ 1 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", + } + }, + _1: "Syntax error: '%s' expected" + }), closing); + case /* Expecting */ 1 : + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " expected.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s expected." - }), loc._1); + } + }, + _1: "Syntax error: %s expected." + }), loc._1); case /* Not_expecting */ 2 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " not expected.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " not expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s not expected." - }), loc._1); + } + }, + _1: "Syntax error: %s not expected." + }), loc._1); case /* Applicative_path */ 3 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." + }); case /* Variable_in_scope */ 4 : - const $$var = loc._1; - return Curry._2(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "In this scoped type, variable '", + const $$var = loc._1; + return Curry._2(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "In this scoped type, variable '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is reserved for the local type ", _1: { - TAG: /* String_literal */ 11, - _0: " is reserved for the local type ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } - }, - _1: "In this scoped type, variable '%s is reserved for the local type %s." - }), $$var, $$var); + } + }, + _1: "In this scoped type, variable '%s is reserved for the local type %s." + }), $$var, $$var); case /* Other */ 5 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error" - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error" + }); case /* Ill_formed_ast */ 6 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "broken invariant in parsetree: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "broken invariant in parsetree: %s" - }), loc._1); + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "broken invariant in parsetree: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "broken invariant in parsetree: %s" + }), loc._1); } } @@ -4191,135 +4191,135 @@ function varify_constructors(var_names, t) { } else { switch (x.TAG) { case /* Ptyp_var */ 0 : - const x$1 = x._0; - check_variable(var_names, t.ptyp_loc, x$1); - desc = { - TAG: /* Ptyp_var */ 0, - _0: x$1 - }; - break; + const x$1 = x._0; + check_variable(var_names, t.ptyp_loc, x$1); + desc = { + TAG: /* Ptyp_var */ 0, + _0: x$1 + }; + break; case /* Ptyp_arrow */ 1 : - desc = { - TAG: /* Ptyp_arrow */ 1, - _0: x._0, - _1: loop(x._1), - _2: loop(x._2) - }; - break; + desc = { + TAG: /* Ptyp_arrow */ 1, + _0: x._0, + _1: loop(x._1), + _2: loop(x._2) + }; + break; case /* Ptyp_tuple */ 2 : - desc = { - TAG: /* Ptyp_tuple */ 2, - _0: Stdlib__List.map(loop, x._0) - }; - break; + desc = { + TAG: /* Ptyp_tuple */ 2, + _0: Stdlib__List.map(loop, x._0) + }; + break; case /* Ptyp_constr */ 3 : - const longident = x._0; - let exit = 0; - const s = longident.txt; - switch (s.TAG) { - case /* Lident */ 0 : - if (x._1) { - exit = 1; - } else { - const s$1 = s._0; - if (Stdlib__List.mem(s$1, var_names)) { - desc = { - TAG: /* Ptyp_var */ 0, - _0: s$1 - }; - } else { - exit = 1; - } - } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + const longident = x._0; + let exit = 0; + const s = longident.txt; + switch (s.TAG) { + case /* Lident */ 0 : + if (x._1) { + exit = 1; + } else { + const s$1 = s._0; + if (Stdlib__List.mem(s$1, var_names)) { + desc = { + TAG: /* Ptyp_var */ 0, + _0: s$1 + }; + } else { exit = 1; - break; - - } - if (exit === 1) { - desc = { - TAG: /* Ptyp_constr */ 3, - _0: longident, - _1: Stdlib__List.map(loop, x._1) - }; - } - break; - case /* Ptyp_object */ 4 : - desc = { - TAG: /* Ptyp_object */ 4, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - loop(param[2]) - ]; - }), x._0), - _1: x._1 - }; - break; - case /* Ptyp_class */ 5 : + } + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + exit = 1; + break; + + } + if (exit === 1) { desc = { - TAG: /* Ptyp_class */ 5, - _0: x._0, + TAG: /* Ptyp_constr */ 3, + _0: longident, _1: Stdlib__List.map(loop, x._1) }; - break; + } + break; + case /* Ptyp_object */ 4 : + desc = { + TAG: /* Ptyp_object */ 4, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + loop(param[2]) + ]; + }), x._0), + _1: x._1 + }; + break; + case /* Ptyp_class */ 5 : + desc = { + TAG: /* Ptyp_class */ 5, + _0: x._0, + _1: Stdlib__List.map(loop, x._1) + }; + break; case /* Ptyp_alias */ 6 : - const string = x._1; - check_variable(var_names, t.ptyp_loc, string); - desc = { - TAG: /* Ptyp_alias */ 6, - _0: loop(x._0), - _1: string - }; - break; + const string = x._1; + check_variable(var_names, t.ptyp_loc, string); + desc = { + TAG: /* Ptyp_alias */ 6, + _0: loop(x._0), + _1: string + }; + break; case /* Ptyp_variant */ 7 : - desc = { - TAG: /* Ptyp_variant */ 7, - _0: Stdlib__List.map(loop_row_field, x._0), - _1: x._1, - _2: x._2 - }; - break; + desc = { + TAG: /* Ptyp_variant */ 7, + _0: Stdlib__List.map(loop_row_field, x._0), + _1: x._1, + _2: x._2 + }; + break; case /* Ptyp_poly */ 8 : - const string_lst = x._0; - const partial_arg = t.ptyp_loc; - Stdlib__List.iter((function (param) { - return check_variable(var_names, partial_arg, param); - }), string_lst); - desc = { - TAG: /* Ptyp_poly */ 8, - _0: string_lst, - _1: loop(x._1) - }; - break; + const string_lst = x._0; + const partial_arg = t.ptyp_loc; + Stdlib__List.iter((function (param) { + return check_variable(var_names, partial_arg, param); + }), string_lst); + desc = { + TAG: /* Ptyp_poly */ 8, + _0: string_lst, + _1: loop(x._1) + }; + break; case /* Ptyp_package */ 9 : - const match = x._0; - desc = { - TAG: /* Ptyp_package */ 9, - _0: [ - match[0], - Stdlib__List.map((function (param) { - return [ - param[0], - loop(param[1]) - ]; - }), match[1]) - ] - }; - break; + const match = x._0; + desc = { + TAG: /* Ptyp_package */ 9, + _0: [ + match[0], + Stdlib__List.map((function (param) { + return [ + param[0], + loop(param[1]) + ]; + }), match[1]) + ] + }; + break; case /* Ptyp_extension */ 10 : - const match$1 = x._0; - desc = { - TAG: /* Ptyp_extension */ 10, - _0: [ - match$1[0], - match$1[1] - ] - }; - break; + const match$1 = x._0; + desc = { + TAG: /* Ptyp_extension */ 10, + _0: [ + match$1[0], + match$1[1] + ] + }; + break; } } @@ -6802,51 +6802,51 @@ const yyact = [ let exit = 0; switch (_1) { case "-" : - if (match.TAG === /* Pexp_constant */ 1) { - const n = match._0; - switch (n.TAG) { - case /* Const_int */ 0 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int */ 0, - _0: -n._0 | 0 - } - }); - case /* Const_int32 */ 4 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int32 */ 4, - _0: -n._0 | 0 - } - }); - case /* Const_int64 */ 5 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int64 */ 5, - _0: Caml_int64.neg(n._0) - } - }); - case /* Const_nativeint */ 6 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_nativeint */ 6, - _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) - } - }); - default: - exit = 2; - } - } else { - exit = 2; + if (match.TAG === /* Pexp_constant */ 1) { + const n = match._0; + switch (n.TAG) { + case /* Const_int */ 0 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int */ 0, + _0: -n._0 | 0 + } + }); + case /* Const_int32 */ 4 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int32 */ 4, + _0: -n._0 | 0 + } + }); + case /* Const_int64 */ 5 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int64 */ 5, + _0: Caml_int64.neg(n._0) + } + }); + case /* Const_nativeint */ 6 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_nativeint */ 6, + _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) + } + }); + default: + exit = 2; } - break; - case "-." : + } else { exit = 2; - break; + } + break; + case "-." : + exit = 2; + break; } if (exit === 2 && match.TAG === /* Pexp_constant */ 1) { @@ -6881,23 +6881,23 @@ const yyact = [ let exit = 0; switch (_1) { case "+" : - if (desc.TAG === /* Pexp_constant */ 1) { - switch (desc._0.TAG) { - case /* Const_char */ 1 : - case /* Const_string */ 2 : - case /* Const_float */ 3 : - exit = 2; - break; - default: - return mkexp(desc); - } - } else { - exit = 2; + if (desc.TAG === /* Pexp_constant */ 1) { + switch (desc._0.TAG) { + case /* Const_char */ 1 : + case /* Const_string */ 2 : + case /* Const_float */ 3 : + exit = 2; + break; + default: + return mkexp(desc); } - break; - case "+." : + } else { exit = 2; - break; + } + break; + case "+." : + exit = 2; + break; } if (exit === 2 && desc.TAG === /* Pexp_constant */ 1 && desc._0.TAG === /* Const_float */ 3) { @@ -10683,13 +10683,13 @@ function type_of_directive(x) { } switch (x.TAG) { case /* Dir_bool */ 0 : - return /* Dir_type_bool */ 0; + return /* Dir_type_bool */ 0; case /* Dir_float */ 1 : - return /* Dir_type_float */ 1; + return /* Dir_type_float */ 1; case /* Dir_int */ 2 : - return /* Dir_type_int */ 2; + return /* Dir_type_int */ 2; case /* Dir_string */ 3 : - return /* Dir_type_string */ 3; + return /* Dir_type_string */ 3; } } @@ -10697,15 +10697,15 @@ function type_of_directive(x) { function string_of_type_directive(x) { switch (x) { case /* Dir_type_bool */ 0 : - return "bool"; + return "bool"; case /* Dir_type_float */ 1 : - return "float"; + return "float"; case /* Dir_type_int */ 2 : - return "int"; + return "int"; case /* Dir_type_string */ 3 : - return "string"; + return "string"; case /* Dir_type_null */ 4 : - return "null"; + return "null"; } } @@ -10918,15 +10918,15 @@ function value_of_token(loc, t) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* FALSE */ 29 : - return { - TAG: /* Dir_bool */ 0, - _0: false - }; + return { + TAG: /* Dir_bool */ 0, + _0: false + }; case /* TRUE */ 91 : - return { - TAG: /* Dir_bool */ 0, - _0: true - }; + return { + TAG: /* Dir_bool */ 0, + _0: true + }; default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -10937,22 +10937,22 @@ function value_of_token(loc, t) { } else { switch (t.TAG) { case /* FLOAT */ 1 : - return { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(t._0) - }; + return { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(t._0) + }; case /* INT */ 7 : - return { - TAG: /* Dir_int */ 2, - _0: t._0 - }; + return { + TAG: /* Dir_int */ 2, + _0: t._0 + }; case /* STRING */ 16 : - return { - TAG: /* Dir_string */ 3, - _0: t._0[0] - }; + return { + TAG: /* Dir_string */ 3, + _0: t._0[0] + }; case /* UIDENT */ 17 : - return query(loc, t._0); + return query(loc, t._0); default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -10979,14 +10979,14 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* EOF */ 25 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_if */ 2, + _2: curr(lexbuf) + }); case /* EOL */ 100 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -10994,8 +10994,8 @@ function directive_parse(token_with_comments, lexbuf) { switch (t.TAG) { case /* COMMENT */ 18 : case /* DOCSTRING */ 19 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -11023,8 +11023,8 @@ function directive_parse(token_with_comments, lexbuf) { case /* EQUAL */ 26 : case /* GREATER */ 34 : case /* LESS */ 51 : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -11034,151 +11034,138 @@ function directive_parse(token_with_comments, lexbuf) { } switch (op._0) { case "=~" : - if (!calc) { - return true; - } - let exit$1 = 0; - if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { - exit$1 = 2; + if (!calc) { + return true; + } + let exit$1 = 0; + if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { + exit$1 = 2; + } else { + const curr_loc = curr(lexbuf); + const rhs = value_of_token(curr_loc, token(undefined)); + let exit$2 = 0; + if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { + exit$2 = 3; } else { - const curr_loc = curr(lexbuf); - const rhs = value_of_token(curr_loc, token(undefined)); - let exit$2 = 0; - if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { - exit$2 = 3; - } else { - if (rhs.TAG === /* Dir_string */ 3) { - let lhs$1 = lhs._0; - let str = rhs._0; - const last_index = str.length - 1 | 0; - if (last_index < 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - const v = str.charCodeAt(0); - let match; - let exit$3 = 0; - if (v !== 94) { - if (v >= 63) { - if (v !== 126) { - exit$3 = 1; - } else { - match = [ - "Approximate", - semantic_version_parse(str, 1, last_index) - ]; - } - } else if (v >= 60) { - switch (v) { - case 60 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - match = str[1] === "=" ? [ - "Le", - semantic_version_parse(str, 2, last_index) - ] : [ - "Lt", - semantic_version_parse(str, 1, last_index) - ]; - break; - case 61 : - exit$3 = 1; - break; - case 62 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - match = str[1] === "=" ? [ - "Ge", - semantic_version_parse(str, 2, last_index) - ] : [ - "Gt", - semantic_version_parse(str, 1, last_index) - ]; - break; - - } - } else { + if (rhs.TAG === /* Dir_string */ 3) { + let lhs$1 = lhs._0; + let str = rhs._0; + const last_index = str.length - 1 | 0; + if (last_index < 0) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + const v = str.charCodeAt(0); + let match; + let exit$3 = 0; + if (v !== 94) { + if (v >= 63) { + if (v !== 126) { exit$3 = 1; + } else { + match = [ + "Approximate", + semantic_version_parse(str, 1, last_index) + ]; + } + } else if (v >= 60) { + switch (v) { + case 60 : + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + match = str[1] === "=" ? [ + "Le", + semantic_version_parse(str, 2, last_index) + ] : [ + "Lt", + semantic_version_parse(str, 1, last_index) + ]; + break; + case 61 : + exit$3 = 1; + break; + case 62 : + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + match = str[1] === "=" ? [ + "Ge", + semantic_version_parse(str, 2, last_index) + ] : [ + "Gt", + semantic_version_parse(str, 1, last_index) + ]; + break; + } } else { - match = [ - "Compatible", - semantic_version_parse(str, 1, last_index) - ]; - } - if (exit$3 === 1) { - match = [ - "Exact", - semantic_version_parse(str, 0, last_index) - ]; - } - const version = match[1][0]; - const major = version[0]; - const pred = match[0]; - const match$1 = semantic_version_parse(lhs$1, 0, lhs$1.length - 1 | 0); - const lversion = match$1[0]; - if (pred === "Ge") { - return Caml_obj.caml_greaterequal(lversion, version); - } - if (pred === "Gt") { - return Caml_obj.caml_greaterthan(lversion, version); - } - if (pred === "Le") { - return Caml_obj.caml_lessequal(lversion, version); - } - if (pred === "Lt") { - return Caml_obj.caml_lessthan(lversion, version); - } - if (pred === "Exact") { - return Caml_obj.caml_equal(lversion, version); - } - const l_major = lversion[0]; - if (pred === "Compatible") { - return major === l_major; - } else if (major === l_major) { - return version[1] === lversion[1]; - } else { - return false; + exit$3 = 1; } + } else { + match = [ + "Compatible", + semantic_version_parse(str, 1, last_index) + ]; + } + if (exit$3 === 1) { + match = [ + "Exact", + semantic_version_parse(str, 0, last_index) + ]; + } + const version = match[1][0]; + const major = version[0]; + const pred = match[0]; + const match$1 = semantic_version_parse(lhs$1, 0, lhs$1.length - 1 | 0); + const lversion = match$1[0]; + if (pred === "Ge") { + return Caml_obj.caml_greaterequal(lversion, version); + } + if (pred === "Gt") { + return Caml_obj.caml_greaterthan(lversion, version); + } + if (pred === "Le") { + return Caml_obj.caml_lessequal(lversion, version); + } + if (pred === "Lt") { + return Caml_obj.caml_lessthan(lversion, version); + } + if (pred === "Exact") { + return Caml_obj.caml_equal(lversion, version); + } + const l_major = lversion[0]; + if (pred === "Compatible") { + return major === l_major; + } else if (major === l_major) { + return version[1] === lversion[1]; + } else { + return false; } - exit$2 = 3; - } - if (exit$2 === 3) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_string */ 3, - _1: type_of_directive(lhs) - }, - _2: curr(lexbuf) - }); } - + exit$2 = 3; } - if (exit$1 === 2) { + if (exit$2 === 3) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: { @@ -11189,12 +11176,25 @@ function directive_parse(token_with_comments, lexbuf) { _2: curr(lexbuf) }); } - break; + + } + if (exit$1 === 2) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_string */ 3, + _1: type_of_directive(lhs) + }, + _2: curr(lexbuf) + }); + } + break; case "<=" : case "<>" : case ">=" : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -11205,25 +11205,25 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof op === "number" || typeof op === "string") { switch (op) { case /* EQUAL */ 26 : - f = Caml_obj.caml_equal; - break; + f = Caml_obj.caml_equal; + break; case /* GREATER */ 34 : - f = Caml_obj.caml_greaterthan; - break; + f = Caml_obj.caml_greaterthan; + break; case /* LESS */ 51 : - f = Caml_obj.caml_lessthan; - break; + f = Caml_obj.caml_lessthan; + break; default: exit$4 = 2; } } else if (op.TAG === /* INFIXOP0 */ 2) { switch (op._0) { case "<=" : - f = Caml_obj.caml_lessequal; - break; + f = Caml_obj.caml_lessequal; + break; case "<>" : - f = Caml_obj.caml_notequal; - break; + f = Caml_obj.caml_notequal; + break; default: exit$4 = 2; } @@ -11294,28 +11294,28 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof curr_token === "number" || typeof curr_token === "string") { switch (curr_token) { case /* FALSE */ 29 : - return false; + return false; case /* LPAREN */ 54 : - const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); - const match = token(undefined); - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (match === /* RPAREN */ 81) { - return v; - } - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); - } else { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); + const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); + const match = token(undefined); + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (match === /* RPAREN */ 81) { + return v; } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } else { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } case /* TRUE */ 91 : - return true; + return true; default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -11326,102 +11326,102 @@ function directive_parse(token_with_comments, lexbuf) { } else { switch (curr_token.TAG) { case /* FLOAT */ 1 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_float */ 1 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(curr_token._0) - }); - case /* INT */ 7 : - const v$1 = curr_token._0; - return token_op(calc, (function (e) { - push(e); - return v$1 !== 0; - }), { - TAG: /* Dir_int */ 2, - _0: v$1 - }); - case /* LIDENT */ 11 : - const r = curr_token._0; - switch (r) { - case "defined" : - case "undefined" : - break; - default: + return token_op(calc, (function (e) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_token_in_conditional */ 4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_float */ 1 + }, _2: curr_loc }); - } - const t = token(undefined); - const loc = curr(lexbuf); - if (/* tag */ typeof t === "number" || typeof t === "string") { + }), { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(curr_token._0) + }); + case /* INT */ 7 : + const v$1 = curr_token._0; + return token_op(calc, (function (e) { + push(e); + return v$1 !== 0; + }), { + TAG: /* Dir_int */ 2, + _0: v$1 + }); + case /* LIDENT */ 11 : + const r = curr_token._0; + switch (r) { + case "defined" : + case "undefined" : + break; + default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: /* Unexpected_token_in_conditional */ 4, - _2: loc + _2: curr_loc }); - } - if (t.TAG === /* UIDENT */ 17) { - const s = t._0; - if (calc) { - if (Caml_string.get(r, 0) === /* 'u' */117) { - return !defined(s); - } else { - return defined(s); - } - } else { - return true; - } - } + } + const t = token(undefined); + const loc = curr(lexbuf); + if (/* tag */ typeof t === "number" || typeof t === "string") { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: /* Unexpected_token_in_conditional */ 4, _2: loc }); - break; + } + if (t.TAG === /* UIDENT */ 17) { + const s = t._0; + if (calc) { + if (Caml_string.get(r, 0) === /* 'u' */117) { + return !defined(s); + } else { + return defined(s); + } + } else { + return true; + } + } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_token_in_conditional */ 4, + _2: loc + }); + break; case /* STRING */ 16 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_string */ 3 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_string */ 3, - _0: curr_token._0[0] - }); + return token_op(calc, (function (e) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_string */ 3 + }, + _2: curr_loc + }); + }), { + TAG: /* Dir_string */ 3, + _0: curr_token._0[0] + }); case /* UIDENT */ 17 : - const value_v = query(curr_loc, curr_token._0); - return token_op(calc, (function (e) { - push(e); - if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { - return value_v._0; - } - const ty = type_of_directive(value_v); - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: ty - }, - _2: curr_loc - }); - }), value_v); + const value_v = query(curr_loc, curr_token._0); + return token_op(calc, (function (e) { + push(e); + if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { + return value_v._0; + } + const ty = type_of_directive(value_v); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: ty + }, + _2: curr_loc + }); + }), value_v); default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -11916,16 +11916,16 @@ function char_for_backslash(c) { } switch (c) { case 110 : - return /* '\n' */10; + return /* '\n' */10; case 114 : - return /* '\r' */13; + return /* '\r' */13; case 111 : case 112 : case 113 : case 115 : - return c; + return c; case 116 : - return /* '\t' */9; + return /* '\t' */9; } } @@ -12067,218 +12067,218 @@ function report_error(ppf, c) { if (/* tag */ typeof c === "number" || typeof c === "string") { switch (c) { case /* Unterminated_string */ 0 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal not terminated", - _1: /* End_of_format */ 0 - }, - _1: "String literal not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "String literal not terminated", + _1: /* End_of_format */ 0 + }, + _1: "String literal not terminated" + }); case /* Unterminated_paren_in_conditional */ 1 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unterminated parens in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unterminated parens in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unterminated parens in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unterminated parens in conditional predicate" + }); case /* Unterminated_if */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#if not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#if not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#if not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#if not terminated" + }); case /* Unterminated_else */ 3 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#else not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#else not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#else not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#else not terminated" + }); case /* Unexpected_token_in_conditional */ 4 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected token in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected token in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected token in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected token in conditional predicate" + }); case /* Expect_hash_then_in_conditional */ 5 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Expect `then` after conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Expect `then` after conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Expect `then` after conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Expect `then` after conditional predicate" + }); case /* Unexpected_directive */ 6 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected directive", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected directive" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected directive", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected directive" + }); } } else { switch (c.TAG) { case /* Illegal_character */ 0 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal character (%s)" - }), Stdlib__Char.escaped(c._0)); + } + }, + _1: "Illegal character (%s)" + }), Stdlib__Char.escaped(c._0)); case /* Illegal_escape */ 1 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal backslash escape in string or character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal backslash escape in string or character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal backslash escape in string or character (%s)" - }), c._0); + } + }, + _1: "Illegal backslash escape in string or character (%s)" + }), c._0); case /* Unterminated_comment */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Comment not terminated", - _1: /* End_of_format */ 0 - }, - _1: "Comment not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Comment not terminated", + _1: /* End_of_format */ 0 + }, + _1: "Comment not terminated" + }); case /* Unterminated_string_in_comment */ 3 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This comment contains an unterminated string literal", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal begins here", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "This comment contains an unterminated string literal@.%aString literal begins here" - }), print_error, c._1); - case /* Keyword_as_label */ 4 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '`' */96, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This comment contains an unterminated string literal", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* String_literal */ 11, - _0: "' is a keyword, it cannot be used as label name", + _0: "String literal begins here", _1: /* End_of_format */ 0 } } - }, - _1: "`%s' is a keyword, it cannot be used as label name" - }), c._0); - case /* Literal_overflow */ 5 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Integer literal exceeds the range of representable integers of type ", + } + }, + _1: "This comment contains an unterminated string literal@.%aString literal begins here" + }), print_error, c._1); + case /* Keyword_as_label */ 4 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '`' */96, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "' is a keyword, it cannot be used as label name", _1: /* End_of_format */ 0 } - }, - _1: "Integer literal exceeds the range of representable integers of type %s" - }), c._0); + } + }, + _1: "`%s' is a keyword, it cannot be used as label name" + }), c._0); + case /* Literal_overflow */ 5 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Integer literal exceeds the range of representable integers of type ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Integer literal exceeds the range of representable integers of type %s" + }), c._0); case /* Illegal_semver */ 6 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal semantic version string ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "Illegal semantic version string %s" - }), c._0); + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal semantic version string ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Illegal semantic version string %s" + }), c._0); case /* Conditional_expr_expected_type */ 7 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Conditional expression type mismatch (", + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Conditional expression type mismatch (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } - }, - _1: "Conditional expression type mismatch (%s,%s)" - }), string_of_type_directive(c._0), string_of_type_directive(c._1)); + } + }, + _1: "Conditional expression type mismatch (%s,%s)" + }), string_of_type_directive(c._0), string_of_type_directive(c._1)); } } @@ -12313,479 +12313,479 @@ function token(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - if (!escaped_newlines.contents) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); - } - update_loc(lexbuf, undefined, 1, false, 0); - return token(lexbuf); + if (!escaped_newlines.contents) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); + } + update_loc(lexbuf, undefined, 1, false, 0); + return token(lexbuf); case 1 : - update_loc(lexbuf, undefined, 1, false, 0); - return /* EOL */ 100; + update_loc(lexbuf, undefined, 1, false, 0); + return /* EOL */ 100; case 2 : - return token(lexbuf); + return token(lexbuf); case 3 : - return /* UNDERSCORE */ 94; + return /* UNDERSCORE */ 94; case 4 : - return /* TILDE */ 89; + return /* TILDE */ 89; case 5 : - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 6 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 7 : - return /* QUESTION */ 76; + return /* QUESTION */ 76; case 8 : - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 9 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 10 : - const s = Stdlib__Lexing.lexeme(lexbuf); - try { - return Stdlib__Hashtbl.find(keyword_table, s); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return { - TAG: /* LIDENT */ 11, - _0: s - }; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const s = Stdlib__Lexing.lexeme(lexbuf); + try { + return Stdlib__Hashtbl.find(keyword_table, s); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return { + TAG: /* LIDENT */ 11, + _0: s + }; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case 11 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LIDENT */ 11, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LIDENT */ 11, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 12 : - return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 13 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 14 : - try { - return { - TAG: /* INT */ 7, - _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - case 15 : + try { return { - TAG: /* FLOAT */ 1, - _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) + TAG: /* INT */ 7, + _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 16 : - try { - return { - TAG: /* INT32 */ 8, - _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int32" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - case 17 : - try { - return { - TAG: /* INT64 */ 9, - _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int64" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); - } - case 18 : - try { - return { - TAG: /* NATIVEINT */ 12, - _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "nativeint" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int" + }, + _2: curr(lexbuf) + }); } - case 19 : - reset_string_buffer(undefined); - is_in_string.contents = true; - const string_start = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - string(lexbuf); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start; + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + case 15 : + return { + TAG: /* FLOAT */ 1, + _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) + }; + case 16 : + try { return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - undefined - ] + TAG: /* INT32 */ 8, + _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 20 : - reset_string_buffer(undefined); - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - is_in_string.contents = true; - const string_start$1 = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start$1; + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int32" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + case 17 : + try { return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - delim$1 - ] + TAG: /* INT64 */ 9, + _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 21 : - update_loc(lexbuf, undefined, 1, false, 1); + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int64" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } + case 18 : + try { return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + TAG: /* NATIVEINT */ 12, + _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) }; + } + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "nativeint" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + case 19 : + reset_string_buffer(undefined); + is_in_string.contents = true; + const string_start = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + string(lexbuf); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + undefined + ] + }; + case 20 : + reset_string_buffer(undefined); + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + is_in_string.contents = true; + const string_start$1 = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start$1; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + delim$1 + ] + }; + case 21 : + update_loc(lexbuf, undefined, 1, false, 1); + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 22 : - return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) - }; + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 23 : - return { - TAG: /* CHAR */ 0, - _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) + }; case 24 : - return { - TAG: /* CHAR */ 0, - _0: char_for_decimal_code(lexbuf, 2) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_decimal_code(lexbuf, 2) + }; case 25 : - return { - TAG: /* CHAR */ 0, - _0: char_for_hexadecimal_code(lexbuf, 3) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_hexadecimal_code(lexbuf, 3) + }; case 26 : - const l = Stdlib__Lexing.lexeme(lexbuf); - const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_escape */ 1, - _0: esc - }, - _2: curr(lexbuf) - }); + const l = Stdlib__Lexing.lexeme(lexbuf); + const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_escape */ 1, + _0: esc + }, + _2: curr(lexbuf) + }); case 27 : - const match = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match[0], - match[1] - ] - }; + const match = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match[0], + match[1] + ] + }; case 28 : - const match$1 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* DOCSTRING */ 19, - _0: docstring(match$1[0], match$1[1]) - }; + const match$1 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* DOCSTRING */ 19, + _0: docstring(match$1[0], match$1[1]) + }; case 29 : - const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - const match$2 = with_comment_buffer((function (lexbuf) { - store_string("*" + stars); - return __ocaml_lex_comment_rec(lexbuf, 132); - }), lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$2[0], - match$2[1] - ] - }; + const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + const match$2 = with_comment_buffer((function (lexbuf) { + store_string("*" + stars); + return __ocaml_lex_comment_rec(lexbuf, 132); + }), lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$2[0], + match$2[1] + ] + }; case 30 : - if (print_warnings.contents) { - prerr_warning(curr(lexbuf), /* Comment_start */ 0); - } - const match$3 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$3[0], - match$3[1] - ] - }; + if (print_warnings.contents) { + prerr_warning(curr(lexbuf), /* Comment_start */ 0); + } + const match$3 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$3[0], + match$3[1] + ] + }; case 31 : - const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); - return { - TAG: /* COMMENT */ 18, - _0: [ - stars$1, - curr(lexbuf) - ] - }; + const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); + return { + TAG: /* COMMENT */ 18, + _0: [ + stars$1, + curr(lexbuf) + ] + }; case 32 : - const loc = curr(lexbuf); - prerr_warning(loc, /* Comment_not_end */ 1); - lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; - const curpos = lexbuf.lex_curr_p; - lexbuf.lex_curr_p = { - pos_fname: curpos.pos_fname, - pos_lnum: curpos.pos_lnum, - pos_bol: curpos.pos_bol, - pos_cnum: curpos.pos_cnum - 1 | 0 - }; - return /* STAR */ 86; + const loc = curr(lexbuf); + prerr_warning(loc, /* Comment_not_end */ 1); + lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; + const curpos = lexbuf.lex_curr_p; + lexbuf.lex_curr_p = { + pos_fname: curpos.pos_fname, + pos_lnum: curpos.pos_lnum, + pos_bol: curpos.pos_bol, + pos_cnum: curpos.pos_cnum - 1 | 0 + }; + return /* STAR */ 86; case 33 : - const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); - update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); - return token(lexbuf); + const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); + update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); + return token(lexbuf); case 34 : - return /* SHARP */ 84; + return /* SHARP */ 84; case 35 : - return /* AMPERSAND */ 1; + return /* AMPERSAND */ 1; case 36 : - return /* AMPERAMPER */ 0; + return /* AMPERAMPER */ 0; case 37 : - return /* BACKQUOTE */ 5; + return /* BACKQUOTE */ 5; case 38 : - return /* QUOTE */ 77; + return /* QUOTE */ 77; case 39 : - return /* LPAREN */ 54; + return /* LPAREN */ 54; case 40 : - return /* RPAREN */ 81; + return /* RPAREN */ 81; case 41 : - return /* STAR */ 86; + return /* STAR */ 86; case 42 : - return /* COMMA */ 16; + return /* COMMA */ 16; case 43 : - return /* MINUSGREATER */ 62; + return /* MINUSGREATER */ 62; case 44 : - return /* DOT */ 20; + return /* DOT */ 20; case 45 : - return /* DOTDOT */ 21; + return /* DOTDOT */ 21; case 46 : - return /* COLON */ 12; + return /* COLON */ 12; case 47 : - return /* COLONCOLON */ 13; + return /* COLONCOLON */ 13; case 48 : - return /* COLONEQUAL */ 14; + return /* COLONEQUAL */ 14; case 49 : - return /* COLONGREATER */ 15; + return /* COLONGREATER */ 15; case 50 : - return /* SEMI */ 82; + return /* SEMI */ 82; case 51 : - return /* SEMISEMI */ 83; + return /* SEMISEMI */ 83; case 52 : - return /* LESS */ 51; + return /* LESS */ 51; case 53 : - return /* LESSMINUS */ 52; + return /* LESSMINUS */ 52; case 54 : - return /* EQUAL */ 26; + return /* EQUAL */ 26; case 55 : - return /* LBRACKET */ 45; + return /* LBRACKET */ 45; case 56 : - return /* LBRACKETBAR */ 46; + return /* LBRACKETBAR */ 46; case 57 : - return /* LBRACKETLESS */ 47; + return /* LBRACKETLESS */ 47; case 58 : - return /* LBRACKETGREATER */ 48; + return /* LBRACKETGREATER */ 48; case 59 : - return /* RBRACKET */ 79; + return /* RBRACKET */ 79; case 60 : - return /* LBRACE */ 43; + return /* LBRACE */ 43; case 61 : - return /* LBRACELESS */ 44; + return /* LBRACELESS */ 44; case 62 : - return /* BAR */ 7; + return /* BAR */ 7; case 63 : - return /* BARBAR */ 8; + return /* BARBAR */ 8; case 64 : - return /* BARRBRACKET */ 9; + return /* BARRBRACKET */ 9; case 65 : - return /* GREATER */ 34; + return /* GREATER */ 34; case 66 : - return /* GREATERRBRACKET */ 36; + return /* GREATERRBRACKET */ 36; case 67 : - return /* RBRACE */ 78; + return /* RBRACE */ 78; case 68 : - return /* GREATERRBRACE */ 35; + return /* GREATERRBRACE */ 35; case 69 : - return /* LBRACKETAT */ 55; + return /* LBRACKETAT */ 55; case 70 : - return /* LBRACKETPERCENT */ 49; + return /* LBRACKETPERCENT */ 49; case 71 : - return /* LBRACKETPERCENTPERCENT */ 50; + return /* LBRACKETPERCENTPERCENT */ 50; case 72 : - return /* LBRACKETATAT */ 56; + return /* LBRACKETATAT */ 56; case 73 : - return /* LBRACKETATATAT */ 57; + return /* LBRACKETATATAT */ 57; case 74 : - return /* BANG */ 6; + return /* BANG */ 6; case 75 : - return { - TAG: /* INFIXOP0 */ 2, - _0: "!=" - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: "!=" + }; case 76 : - return /* PLUS */ 72; + return /* PLUS */ 72; case 77 : - return /* PLUSDOT */ 73; + return /* PLUSDOT */ 73; case 78 : - return /* PLUSEQ */ 74; + return /* PLUSEQ */ 74; case 79 : - return /* MINUS */ 60; + return /* MINUS */ 60; case 80 : - return /* MINUSDOT */ 61; + return /* MINUSDOT */ 61; case 81 : case 82 : - return { - TAG: /* PREFIXOP */ 14, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* PREFIXOP */ 14, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 83 : - return { - TAG: /* INFIXOP0 */ 2, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 84 : - return { - TAG: /* INFIXOP1 */ 3, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP1 */ 3, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 85 : - return { - TAG: /* INFIXOP2 */ 4, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP2 */ 4, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 86 : - return { - TAG: /* INFIXOP4 */ 6, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP4 */ 6, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 87 : - return /* PERCENT */ 71; + return /* PERCENT */ 71; case 88 : - return { - TAG: /* INFIXOP3 */ 5, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP3 */ 5, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 89 : - return { - TAG: /* SHARPOP */ 15, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* SHARPOP */ 15, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 90 : - if (if_then_else.contents === /* Dir_out */ 2) { - return /* EOF */ 25; - } - if (if_then_else.contents === /* Dir_if_true */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); - } + if (if_then_else.contents === /* Dir_out */ 2) { + return /* EOF */ 25; + } + if (if_then_else.contents === /* Dir_if_true */ 0) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_else */ 3, + _1: /* Unterminated_if */ 2, _2: curr(lexbuf) }); + } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); case 91 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -12800,174 +12800,174 @@ function __ocaml_lex_comment_rec(lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - comment_start_loc.contents = { - hd: curr(lexbuf), - tl: comment_start_loc.contents - }; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + comment_start_loc.contents = { + hd: curr(lexbuf), + tl: comment_start_loc.contents + }; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 1 : - const match = comment_start_loc.contents; - if (match) { - if (match.tl) { - comment_start_loc.contents = match.tl; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; - } - comment_start_loc.contents = /* [] */ 0; - return curr(lexbuf); + const match = comment_start_loc.contents; + if (match) { + if (match.tl) { + comment_start_loc.contents = match.tl; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 992, - 16 - ] - }); + comment_start_loc.contents = /* [] */ 0; + return curr(lexbuf); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 992, + 16 + ] + }); case 2 : - string_start_loc.contents = curr(lexbuf); - store_string_char(/* '"' */34); - is_in_string.contents = true; - try { - string(lexbuf); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === $$Error$2) { - let tmp = exn._1; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - if (tmp === /* Unterminated_string */ 0) { - const match$1 = comment_start_loc.contents; - if (match$1) { - const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start, - _1: exn._2 - }, - _2: match$1.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1006, - 18 - ] + string_start_loc.contents = curr(lexbuf); + store_string_char(/* '"' */34); + is_in_string.contents = true; + try { + string(lexbuf); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === $$Error$2) { + let tmp = exn._1; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + if (tmp === /* Unterminated_string */ 0) { + const match$1 = comment_start_loc.contents; + if (match$1) { + const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start, + _1: exn._2 + }, + _2: match$1.hd }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1006, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } else { throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - is_in_string.contents = false; - store_string_char(/* '"' */34); - ___ocaml_lex_state = 132; - continue; + } + is_in_string.contents = false; + store_string_char(/* '"' */34); + ___ocaml_lex_state = 132; + continue; case 3 : - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - string_start_loc.contents = curr(lexbuf); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - is_in_string.contents = true; - try { - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === $$Error$2) { - let tmp$1 = exn$1._1; - if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { - if (tmp$1 === /* Unterminated_string */ 0) { - const match$2 = comment_start_loc.contents; - if (match$2) { - const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start$1, - _1: exn$1._2 - }, - _2: match$2.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1026, - 18 - ] + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + string_start_loc.contents = curr(lexbuf); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + is_in_string.contents = true; + try { + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === $$Error$2) { + let tmp$1 = exn$1._1; + if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { + if (tmp$1 === /* Unterminated_string */ 0) { + const match$2 = comment_start_loc.contents; + if (match$2) { + const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start$1, + _1: exn$1._2 + }, + _2: match$2.hd }); } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1026, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } else { throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - is_in_string.contents = false; - store_string_char(/* '|' */124); - store_string(delim$1); - store_string_char(/* '}' */125); - ___ocaml_lex_state = 132; - continue; - case 5 : - update_loc(lexbuf, undefined, 1, false, 1); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; - case 10 : - const match$3 = comment_start_loc.contents; - if (match$3) { - const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_comment */ 2, - _0: start$2 - }, - _2: match$3.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1056, - 16 - ] + } + is_in_string.contents = false; + store_string_char(/* '|' */124); + store_string(delim$1); + store_string_char(/* '}' */125); + ___ocaml_lex_state = 132; + continue; + case 5 : + update_loc(lexbuf, undefined, 1, false, 1); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; + case 10 : + const match$3 = comment_start_loc.contents; + if (match$3) { + const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_comment */ 2, + _0: start$2 + }, + _2: match$3.hd }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1056, + 16 + ] + }); case 11 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 4 : case 6 : case 7 : case 8 : case 9 : case 12 : - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -12982,30 +12982,30 @@ function __ocaml_lex_quoted_string_rec(delim, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 1 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 2 : - const edelim = Stdlib__Lexing.lexeme(lexbuf); - const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); - if (delim === edelim$1) { - return; - } - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + const edelim = Stdlib__Lexing.lexeme(lexbuf); + const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); + if (delim === edelim$1) { + return; + } + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 3 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - ___ocaml_lex_state = 183; - continue; + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + ___ocaml_lex_state = 183; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -13026,46 +13026,46 @@ function string(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return; + return; case 1 : - const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - update_loc(lexbuf, undefined, 1, false, space.length); - return string(lexbuf); + const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + update_loc(lexbuf, undefined, 1, false, space.length); + return string(lexbuf); case 2 : - store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); - return string(lexbuf); + store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); + return string(lexbuf); case 3 : - store_string_char(char_for_decimal_code(lexbuf, 1)); - return string(lexbuf); + store_string_char(char_for_decimal_code(lexbuf, 1)); + return string(lexbuf); case 4 : - store_string_char(char_for_hexadecimal_code(lexbuf, 2)); - return string(lexbuf); + store_string_char(char_for_hexadecimal_code(lexbuf, 2)); + return string(lexbuf); case 5 : - if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - return string(lexbuf); - } - const loc = curr(lexbuf); - prerr_warning(loc, /* Illegal_backslash */ 7); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { return string(lexbuf); + } + const loc = curr(lexbuf); + prerr_warning(loc, /* Illegal_backslash */ 7); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + return string(lexbuf); case 6 : - if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); - } - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - return string(lexbuf); + if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { + prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); + } + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + return string(lexbuf); case 7 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 8 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - return string(lexbuf); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + return string(lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -13099,10 +13099,10 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a)); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); + set_post_docstrings(post_pos, Stdlib__List.rev(a)); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); } set_post_docstrings(post_pos, Stdlib__List.rev(a)); @@ -13114,12 +13114,12 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); - set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); + set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); + set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); } set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); @@ -13136,308 +13136,308 @@ function token$1(lexbuf) { if (/* tag */ typeof doc === "number" || typeof doc === "string") { switch (doc) { case /* SHARP */ 84 : - if (at_bol(lexbuf)) { - const cont = function (lexbuf) { - return loop(lines, docs, lexbuf); - }; - const look_ahead = function (token) { - sharp_look_ahead.contents = token; - return /* SHARP */ 84; - }; - const if_then_else$1 = if_then_else.contents; - const match = token_with_comments(lexbuf); - if (/* tag */ typeof match === "number" || typeof match === "string") { - switch (match) { - case /* ELSE */ 23 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - break; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } + if (at_bol(lexbuf)) { + const cont = function (lexbuf) { + return loop(lines, docs, lexbuf); + }; + const look_ahead = function (token) { + sharp_look_ahead.contents = token; + return /* SHARP */ 84; + }; + const if_then_else$1 = if_then_else.contents; + const match = token_with_comments(lexbuf); + if (/* tag */ typeof match === "number" || typeof match === "string") { + switch (match) { + case /* ELSE */ 23 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : break; - case /* END */ 24 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - case /* IF */ 37 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + break; + case /* END */ 24 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + case /* IF */ 37 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + case /* Dir_out */ 2 : + if (directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } else { + let _param; + while (true) { + const token = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token, /* EOF */ 25)) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, + _1: /* Unterminated_if */ 2, _2: curr(lexbuf) }); - case /* Dir_out */ 2 : - if (directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; - return Curry._1(cont, lexbuf); - } else { - let _param; - while (true) { - const token = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token, /* EOF */ 25)) { + } + if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$1 = token_with_comments(lexbuf); + if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { + switch (token$1) { + case /* ELSE */ 23 : + if_then_else.contents = /* Dir_if_false */ 1; + return Curry._1(cont, lexbuf); + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, + _1: /* Unexpected_directive */ 6, _2: curr(lexbuf) }); - } - if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$1 = token_with_comments(lexbuf); - if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { - switch (token$1) { - case /* ELSE */ 23 : - if_then_else.contents = /* Dir_if_false */ 1; - return Curry._1(cont, lexbuf); - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - } - if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; - return Curry._1(cont, lexbuf); - } - _param = undefined; - continue; - } - _param = undefined; - continue; - }; + + } } - + if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } + _param = undefined; + continue; + } + _param = undefined; + continue; + }; } - default: - return Curry._1(look_ahead, match); - } - } else { - if (match.TAG !== /* LIDENT */ 11) { - return Curry._1(look_ahead, match); - } - if (match._0 !== "elif") { + + } + default: return Curry._1(look_ahead, match); - } - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - break; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } + } + } else { + if (match.TAG !== /* LIDENT */ 11) { + return Curry._1(look_ahead, match); + } + if (match._0 !== "elif") { + return Curry._1(look_ahead, match); } switch (if_then_else$1) { case /* Dir_if_true */ 0 : - let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); - while (true) { - const else_seen = _else_seen; - const token$2 = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_else */ 3, - _2: curr(lexbuf) - }); - } - if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$3 = token_with_comments(lexbuf); - if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { - switch (token$3) { - case /* ELSE */ 23 : - if (else_seen) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - } - _else_seen = true; - continue; - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - + break; + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + } + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); + while (true) { + const else_seen = _else_seen; + const token$2 = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); + } + if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$3 = token_with_comments(lexbuf); + if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { + switch (token$3) { + case /* ELSE */ 23 : + if (else_seen) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); } - } - if (else_seen && is_elif(token$3)) { + _else_seen = true; + continue; + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: /* Unexpected_directive */ 6, _2: curr(lexbuf) }); - } - continue; + } - continue; - }; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - return Curry._1(look_ahead, match); - - } + } + if (else_seen && is_elif(token$3)) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + } + continue; + } + continue; + }; + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + return Curry._1(look_ahead, match); + } - break; + } + break; case /* EOL */ 100 : - let lines$p; + let lines$p; + switch (lines) { + case /* NoLine */ 0 : + lines$p = /* NewLine */ 1; + break; + case /* NewLine */ 1 : + case /* BlankLine */ 2 : + lines$p = /* BlankLine */ 2; + break; + + } + _lines = lines$p; + continue; + + } + } else { + switch (doc.TAG) { + case /* COMMENT */ 18 : + const match$1 = doc._0; + add_comment([ + match$1[0], + match$1[1] + ]); + let lines$p$1; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + lines$p$1 = /* NoLine */ 0; + break; + case /* BlankLine */ 2 : + lines$p$1 = /* BlankLine */ 2; + break; + + } + _lines = lines$p$1; + continue; + case /* DOCSTRING */ 19 : + const doc$1 = doc._0; + add_docstring_comment(doc$1); + let docs$p; + if (/* tag */ typeof docs === "number" || typeof docs === "string") { switch (lines) { case /* NoLine */ 0 : - lines$p = /* NewLine */ 1; - break; case /* NewLine */ 1 : + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; case /* BlankLine */ 2 : - lines$p = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: /* [] */ 0, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p; - continue; - - } - } else { - switch (doc.TAG) { - case /* COMMENT */ 18 : - const match$1 = doc._0; - add_comment([ - match$1[0], - match$1[1] - ]); - let lines$p$1; + } else if (docs.TAG === /* After */ 0) { + const a = docs._0; switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - lines$p$1 = /* NoLine */ 0; - break; + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: a + } + }; + break; case /* BlankLine */ 2 : - lines$p$1 = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: a, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p$1; - continue; - case /* DOCSTRING */ 19 : - const doc$1 = doc._0; - add_docstring_comment(doc$1); - let docs$p; - if (/* tag */ typeof docs === "number" || typeof docs === "string") { - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: /* [] */ 0, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else if (docs.TAG === /* After */ 0) { - const a = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: a - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else { - const b = docs._2; - const f = docs._1; - const a$1 = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: f, - _2: { - hd: doc$1, - tl: b - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: Stdlib.$at(b, f), - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } + } else { + const b = docs._2; + const f = docs._1; + const a$1 = docs._0; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: f, + _2: { + hd: doc$1, + tl: b + } + }; + break; + case /* BlankLine */ 2 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: Stdlib.$at(b, f), + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; + } - _docs = docs$p; - _lines = /* NoLine */ 0; - continue; + } + _docs = docs$p; + _lines = /* NoLine */ 0; + continue; } } @@ -13477,7 +13477,7 @@ function skip_phrase(lexbuf) { switch (match) { case /* EOF */ 25 : case /* SEMISEMI */ 83 : - return; + return; default: return skip_phrase(lexbuf); } @@ -13496,7 +13496,7 @@ function skip_phrase(lexbuf) { case /* Illegal_character */ 0 : case /* Unterminated_comment */ 2 : case /* Unterminated_string_in_comment */ 3 : - continue; + continue; default: throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } @@ -13647,156 +13647,135 @@ if (match) { const match$29 = match$28.txt; switch (match$29.TAG) { case /* Lident */ 0 : - if (match$29._0 === "|>") { - const match$30 = match$28.loc; - const match$31 = match$30.loc_start; - if (match$31.pos_fname === "" && !(match$31.pos_lnum !== 4 || match$31.pos_bol !== 46 || match$31.pos_cnum !== 48)) { - const match$32 = match$30.loc_end; - if (match$32.pos_fname === "" && !(match$32.pos_lnum !== 4 || match$32.pos_bol !== 46 || match$32.pos_cnum !== 50 || match$30.loc_ghost)) { - const match$33 = match$26.pexp_loc; - const match$34 = match$33.loc_start; - if (match$34.pos_fname === "" && !(match$34.pos_lnum !== 4 || match$34.pos_bol !== 46 || match$34.pos_cnum !== 48)) { - const match$35 = match$33.loc_end; - if (match$35.pos_fname === "" && !(match$35.pos_lnum !== 4 || match$35.pos_bol !== 46 || match$35.pos_cnum !== 50 || match$33.loc_ghost || match$26.pexp_attributes)) { - const match$36 = match$25._1; - if (match$36) { - const match$37 = match$36.hd; - if (match$37[0] === "") { - const match$38 = match$37[1]; - const match$39 = match$38.pexp_desc; - if (match$39.TAG === /* Pexp_apply */ 5) { - const match$40 = match$39._0; - const match$41 = match$40.pexp_desc; - if (match$41.TAG === /* Pexp_ident */ 0) { - const match$42 = match$41._0; - const match$43 = match$42.txt; - switch (match$43.TAG) { - case /* Lident */ 0 : - if (match$43._0 === "|>") { - const match$44 = match$42.loc; - const match$45 = match$44.loc_start; - if (match$45.pos_fname === "" && !(match$45.pos_lnum !== 3 || match$45.pos_bol !== 21 || match$45.pos_cnum !== 23)) { - const match$46 = match$44.loc_end; - if (match$46.pos_fname === "" && !(match$46.pos_lnum !== 3 || match$46.pos_bol !== 21 || match$46.pos_cnum !== 25 || match$44.loc_ghost)) { - const match$47 = match$40.pexp_loc; - const match$48 = match$47.loc_start; - if (match$48.pos_fname === "" && !(match$48.pos_lnum !== 3 || match$48.pos_bol !== 21 || match$48.pos_cnum !== 23)) { - const match$49 = match$47.loc_end; - if (match$49.pos_fname === "" && !(match$49.pos_lnum !== 3 || match$49.pos_bol !== 21 || match$49.pos_cnum !== 25 || match$47.loc_ghost || match$40.pexp_attributes)) { - const match$50 = match$39._1; - if (match$50) { - const match$51 = match$50.hd; - if (match$51[0] === "") { - const match$52 = match$51[1]; - const match$53 = match$52.pexp_desc; - if (match$53.TAG === /* Pexp_ident */ 0) { - const match$54 = match$53._0; - const match$55 = match$54.txt; - switch (match$55.TAG) { - case /* Lident */ 0 : - if (match$55._0 === "str") { - const match$56 = match$54.loc; - const match$57 = match$56.loc_start; - if (match$57.pos_fname === "" && !(match$57.pos_lnum !== 2 || match$57.pos_bol !== 13 || match$57.pos_cnum !== 15)) { - const match$58 = match$56.loc_end; - if (match$58.pos_fname === "" && !(match$58.pos_lnum !== 2 || match$58.pos_bol !== 13 || match$58.pos_cnum !== 18 || match$56.loc_ghost)) { - const match$59 = match$52.pexp_loc; - const match$60 = match$59.loc_start; - if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 2 || match$60.pos_bol !== 13 || match$60.pos_cnum !== 15)) { - const match$61 = match$59.loc_end; - if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 2 || match$61.pos_bol !== 13 || match$61.pos_cnum !== 18 || match$59.loc_ghost || match$52.pexp_attributes)) { - const match$62 = match$50.tl; - if (match$62) { - const match$63 = match$62.hd; - if (match$63[0] === "") { - const match$64 = match$63[1]; - const match$65 = match$64.pexp_desc; - if (match$65.TAG === /* Pexp_ident */ 0) { - const match$66 = match$65._0; - const match$67 = match$66.txt; - switch (match$67.TAG) { - case /* Ldot */ 1 : - const match$68 = match$67._0; - switch (match$68.TAG) { - case /* Lident */ 0 : - if (match$68._0 === "Lexing" && match$67._1 === "from_string") { - const match$69 = match$66.loc; - const match$70 = match$69.loc_start; - if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 21 || match$70.pos_cnum !== 26)) { - const match$71 = match$69.loc_end; - if (match$71.pos_fname === "" && !(match$71.pos_lnum !== 3 || match$71.pos_bol !== 21 || match$71.pos_cnum !== 44 || match$69.loc_ghost)) { - const match$72 = match$64.pexp_loc; - const match$73 = match$72.loc_start; - if (match$73.pos_fname === "" && !(match$73.pos_lnum !== 3 || match$73.pos_bol !== 21 || match$73.pos_cnum !== 26)) { - const match$74 = match$72.loc_end; - if (match$74.pos_fname === "" && !(match$74.pos_lnum !== 3 || match$74.pos_bol !== 21 || match$74.pos_cnum !== 44 || match$72.loc_ghost || match$64.pexp_attributes || match$62.tl)) { - const match$75 = match$38.pexp_loc; - const match$76 = match$75.loc_start; - if (match$76.pos_fname === "" && !(match$76.pos_lnum !== 2 || match$76.pos_bol !== 13 || match$76.pos_cnum !== 15)) { - const match$77 = match$75.loc_end; - if (match$77.pos_fname === "" && !(match$77.pos_lnum !== 3 || match$77.pos_bol !== 21 || match$77.pos_cnum !== 44 || match$75.loc_ghost || match$38.pexp_attributes)) { - const match$78 = match$36.tl; - if (match$78) { - const match$79 = match$78.hd; - if (match$79[0] === "") { - const match$80 = match$79[1]; - const match$81 = match$80.pexp_desc; - if (match$81.TAG === /* Pexp_ident */ 0) { - const match$82 = match$81._0; - const match$83 = match$82.txt; - switch (match$83.TAG) { - case /* Ldot */ 1 : - const match$84 = match$83._0; - switch (match$84.TAG) { - case /* Lident */ 0 : - if (match$84._0 === "Parse" && match$83._1 === "implementation") { - const match$85 = match$82.loc; - const match$86 = match$85.loc_start; - if (match$86.pos_fname === "" && !(match$86.pos_lnum !== 4 || match$86.pos_bol !== 46 || match$86.pos_cnum !== 51)) { - const match$87 = match$85.loc_end; - if (match$87.pos_fname === "" && !(match$87.pos_lnum !== 4 || match$87.pos_bol !== 46 || match$87.pos_cnum !== 71 || match$85.loc_ghost)) { - const match$88 = match$80.pexp_loc; - const match$89 = match$88.loc_start; - if (match$89.pos_fname === "" && !(match$89.pos_lnum !== 4 || match$89.pos_bol !== 46 || match$89.pos_cnum !== 51)) { - const match$90 = match$88.loc_end; - if (match$90.pos_fname === "" && !(match$90.pos_lnum !== 4 || match$90.pos_bol !== 46 || match$90.pos_cnum !== 71 || match$88.loc_ghost || match$80.pexp_attributes || match$78.tl)) { - const match$91 = match$24.pexp_loc; - const match$92 = match$91.loc_start; - if (match$92.pos_fname === "" && !(match$92.pos_lnum !== 2 || match$92.pos_bol !== 13 || match$92.pos_cnum !== 15)) { - const match$93 = match$91.loc_end; - if (match$93.pos_fname === "" && !(match$93.pos_lnum !== 4 || match$93.pos_bol !== 46 || match$93.pos_cnum !== 71 || match$91.loc_ghost || match$24.pexp_attributes)) { - const match$94 = match$13.pexp_loc; - const match$95 = match$94.loc_start; - if (match$95.pos_fname === "" && !(match$95.pos_lnum !== 1 || match$95.pos_bol !== 0 || match$95.pos_cnum !== 6)) { - const match$96 = match$94.loc_end; - if (match$96.pos_fname === "" && !(match$96.pos_lnum !== 4 || match$96.pos_bol !== 46 || match$96.pos_cnum !== 71 || !(match$94.loc_ghost && !(match$13.pexp_attributes || match$3.pvb_attributes)))) { - const match$97 = match$3.pvb_loc; - const match$98 = match$97.loc_start; - if (match$98.pos_fname === "" && !(match$98.pos_lnum !== 1 || match$98.pos_bol !== 0 || match$98.pos_cnum !== 0)) { - const match$99 = match$97.loc_end; - if (match$99.pos_fname === "" && !(match$99.pos_lnum !== 4 || match$99.pos_bol !== 46 || match$99.pos_cnum !== 71 || match$97.loc_ghost || match$2.tl)) { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 215, characters 10-17", true, true); - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } + if (match$29._0 === "|>") { + const match$30 = match$28.loc; + const match$31 = match$30.loc_start; + if (match$31.pos_fname === "" && !(match$31.pos_lnum !== 4 || match$31.pos_bol !== 46 || match$31.pos_cnum !== 48)) { + const match$32 = match$30.loc_end; + if (match$32.pos_fname === "" && !(match$32.pos_lnum !== 4 || match$32.pos_bol !== 46 || match$32.pos_cnum !== 50 || match$30.loc_ghost)) { + const match$33 = match$26.pexp_loc; + const match$34 = match$33.loc_start; + if (match$34.pos_fname === "" && !(match$34.pos_lnum !== 4 || match$34.pos_bol !== 46 || match$34.pos_cnum !== 48)) { + const match$35 = match$33.loc_end; + if (match$35.pos_fname === "" && !(match$35.pos_lnum !== 4 || match$35.pos_bol !== 46 || match$35.pos_cnum !== 50 || match$33.loc_ghost || match$26.pexp_attributes)) { + const match$36 = match$25._1; + if (match$36) { + const match$37 = match$36.hd; + if (match$37[0] === "") { + const match$38 = match$37[1]; + const match$39 = match$38.pexp_desc; + if (match$39.TAG === /* Pexp_apply */ 5) { + const match$40 = match$39._0; + const match$41 = match$40.pexp_desc; + if (match$41.TAG === /* Pexp_ident */ 0) { + const match$42 = match$41._0; + const match$43 = match$42.txt; + switch (match$43.TAG) { + case /* Lident */ 0 : + if (match$43._0 === "|>") { + const match$44 = match$42.loc; + const match$45 = match$44.loc_start; + if (match$45.pos_fname === "" && !(match$45.pos_lnum !== 3 || match$45.pos_bol !== 21 || match$45.pos_cnum !== 23)) { + const match$46 = match$44.loc_end; + if (match$46.pos_fname === "" && !(match$46.pos_lnum !== 3 || match$46.pos_bol !== 21 || match$46.pos_cnum !== 25 || match$44.loc_ghost)) { + const match$47 = match$40.pexp_loc; + const match$48 = match$47.loc_start; + if (match$48.pos_fname === "" && !(match$48.pos_lnum !== 3 || match$48.pos_bol !== 21 || match$48.pos_cnum !== 23)) { + const match$49 = match$47.loc_end; + if (match$49.pos_fname === "" && !(match$49.pos_lnum !== 3 || match$49.pos_bol !== 21 || match$49.pos_cnum !== 25 || match$47.loc_ghost || match$40.pexp_attributes)) { + const match$50 = match$39._1; + if (match$50) { + const match$51 = match$50.hd; + if (match$51[0] === "") { + const match$52 = match$51[1]; + const match$53 = match$52.pexp_desc; + if (match$53.TAG === /* Pexp_ident */ 0) { + const match$54 = match$53._0; + const match$55 = match$54.txt; + switch (match$55.TAG) { + case /* Lident */ 0 : + if (match$55._0 === "str") { + const match$56 = match$54.loc; + const match$57 = match$56.loc_start; + if (match$57.pos_fname === "" && !(match$57.pos_lnum !== 2 || match$57.pos_bol !== 13 || match$57.pos_cnum !== 15)) { + const match$58 = match$56.loc_end; + if (match$58.pos_fname === "" && !(match$58.pos_lnum !== 2 || match$58.pos_bol !== 13 || match$58.pos_cnum !== 18 || match$56.loc_ghost)) { + const match$59 = match$52.pexp_loc; + const match$60 = match$59.loc_start; + if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 2 || match$60.pos_bol !== 13 || match$60.pos_cnum !== 15)) { + const match$61 = match$59.loc_end; + if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 2 || match$61.pos_bol !== 13 || match$61.pos_cnum !== 18 || match$59.loc_ghost || match$52.pexp_attributes)) { + const match$62 = match$50.tl; + if (match$62) { + const match$63 = match$62.hd; + if (match$63[0] === "") { + const match$64 = match$63[1]; + const match$65 = match$64.pexp_desc; + if (match$65.TAG === /* Pexp_ident */ 0) { + const match$66 = match$65._0; + const match$67 = match$66.txt; + switch (match$67.TAG) { + case /* Ldot */ 1 : + const match$68 = match$67._0; + switch (match$68.TAG) { + case /* Lident */ 0 : + if (match$68._0 === "Lexing" && match$67._1 === "from_string") { + const match$69 = match$66.loc; + const match$70 = match$69.loc_start; + if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 21 || match$70.pos_cnum !== 26)) { + const match$71 = match$69.loc_end; + if (match$71.pos_fname === "" && !(match$71.pos_lnum !== 3 || match$71.pos_bol !== 21 || match$71.pos_cnum !== 44 || match$69.loc_ghost)) { + const match$72 = match$64.pexp_loc; + const match$73 = match$72.loc_start; + if (match$73.pos_fname === "" && !(match$73.pos_lnum !== 3 || match$73.pos_bol !== 21 || match$73.pos_cnum !== 26)) { + const match$74 = match$72.loc_end; + if (match$74.pos_fname === "" && !(match$74.pos_lnum !== 3 || match$74.pos_bol !== 21 || match$74.pos_cnum !== 44 || match$72.loc_ghost || match$64.pexp_attributes || match$62.tl)) { + const match$75 = match$38.pexp_loc; + const match$76 = match$75.loc_start; + if (match$76.pos_fname === "" && !(match$76.pos_lnum !== 2 || match$76.pos_bol !== 13 || match$76.pos_cnum !== 15)) { + const match$77 = match$75.loc_end; + if (match$77.pos_fname === "" && !(match$77.pos_lnum !== 3 || match$77.pos_bol !== 21 || match$77.pos_cnum !== 44 || match$75.loc_ghost || match$38.pexp_attributes)) { + const match$78 = match$36.tl; + if (match$78) { + const match$79 = match$78.hd; + if (match$79[0] === "") { + const match$80 = match$79[1]; + const match$81 = match$80.pexp_desc; + if (match$81.TAG === /* Pexp_ident */ 0) { + const match$82 = match$81._0; + const match$83 = match$82.txt; + switch (match$83.TAG) { + case /* Ldot */ 1 : + const match$84 = match$83._0; + switch (match$84.TAG) { + case /* Lident */ 0 : + if (match$84._0 === "Parse" && match$83._1 === "implementation") { + const match$85 = match$82.loc; + const match$86 = match$85.loc_start; + if (match$86.pos_fname === "" && !(match$86.pos_lnum !== 4 || match$86.pos_bol !== 46 || match$86.pos_cnum !== 51)) { + const match$87 = match$85.loc_end; + if (match$87.pos_fname === "" && !(match$87.pos_lnum !== 4 || match$87.pos_bol !== 46 || match$87.pos_cnum !== 71 || match$85.loc_ghost)) { + const match$88 = match$80.pexp_loc; + const match$89 = match$88.loc_start; + if (match$89.pos_fname === "" && !(match$89.pos_lnum !== 4 || match$89.pos_bol !== 46 || match$89.pos_cnum !== 51)) { + const match$90 = match$88.loc_end; + if (match$90.pos_fname === "" && !(match$90.pos_lnum !== 4 || match$90.pos_bol !== 46 || match$90.pos_cnum !== 71 || match$88.loc_ghost || match$80.pexp_attributes || match$78.tl)) { + const match$91 = match$24.pexp_loc; + const match$92 = match$91.loc_start; + if (match$92.pos_fname === "" && !(match$92.pos_lnum !== 2 || match$92.pos_bol !== 13 || match$92.pos_cnum !== 15)) { + const match$93 = match$91.loc_end; + if (match$93.pos_fname === "" && !(match$93.pos_lnum !== 4 || match$93.pos_bol !== 46 || match$93.pos_cnum !== 71 || match$91.loc_ghost || match$24.pexp_attributes)) { + const match$94 = match$13.pexp_loc; + const match$95 = match$94.loc_start; + if (match$95.pos_fname === "" && !(match$95.pos_lnum !== 1 || match$95.pos_bol !== 0 || match$95.pos_cnum !== 6)) { + const match$96 = match$94.loc_end; + if (match$96.pos_fname === "" && !(match$96.pos_lnum !== 4 || match$96.pos_bol !== 46 || match$96.pos_cnum !== 71 || !(match$94.loc_ghost && !(match$13.pexp_attributes || match$3.pvb_attributes)))) { + const match$97 = match$3.pvb_loc; + const match$98 = match$97.loc_start; + if (match$98.pos_fname === "" && !(match$98.pos_lnum !== 1 || match$98.pos_bol !== 0 || match$98.pos_cnum !== 0)) { + const match$99 = match$97.loc_end; + if (match$99.pos_fname === "" && !(match$99.pos_lnum !== 4 || match$99.pos_bol !== 46 || match$99.pos_cnum !== 71 || match$97.loc_ghost || match$2.tl)) { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 215, characters 10-17", true, true); } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } @@ -13809,34 +13788,40 @@ if (match) { } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Lident */ 0 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - } else { + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } - } else { + break; + case /* Lident */ 0 : + case /* Lapply */ 2 : eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); @@ -13853,28 +13838,34 @@ if (match) { } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Lident */ 0 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } - } else { + break; + case /* Lident */ 0 : + case /* Lapply */ 2 : eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); @@ -13891,18 +13882,21 @@ if (match) { } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - } else { + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); @@ -13922,15 +13916,18 @@ if (match) { } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; - - } - } else { - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; + } } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); @@ -13956,11 +13953,14 @@ if (match) { } else { eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); } - break; + } else { + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + } + break; case /* Ldot */ 1 : case /* Lapply */ 2 : - eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); - break; + eq("File \"ocaml_parsetree_main_bspack.ml\", line 216, characters 12-19", true, false); + break; } } else { diff --git a/jscomp/test/dist/jscomp/test/ocaml_proto_test.js b/jscomp/test/dist/jscomp/test/ocaml_proto_test.js index 946e4f6bf3..51e26eb543 100644 --- a/jscomp/test/dist/jscomp/test/ocaml_proto_test.js +++ b/jscomp/test/dist/jscomp/test/ocaml_proto_test.js @@ -357,17 +357,17 @@ function string_of_programmatic_error(e) { let tmp; switch (e) { case /* Invalid_string_split */ 0 : - tmp = "string split error"; - break; + tmp = "string split error"; + break; case /* Unexpected_field_type */ 1 : - tmp = "unexpected field type"; - break; + tmp = "unexpected field type"; + break; case /* No_type_found_for_id */ 2 : - tmp = "no type was found for type id"; - break; + tmp = "no type was found for type id"; + break; case /* One_of_should_be_inlined_in_message */ 3 : - tmp = "one of variant encoding must be inlined in message"; - break; + tmp = "one of variant encoding must be inlined in message"; + break; } return "Programatic_error" + tmp; @@ -389,335 +389,335 @@ function prepare_error(e) { } switch (e.TAG) { case /* Unresolved_type */ 0 : - const match = e._0; - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unresolved type for field name : ", + const match = e._0; + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unresolved type for field name : ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " (type:", _1: { - TAG: /* String_literal */ 11, - _0: " (type:", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ", in message: ", _1: { - TAG: /* String_literal */ 11, - _0: ", in message: ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "unresolved type for field name : %s (type:%s, in message: %s)" - }), match.field_name, match.type_, match.message_name); + } + }, + _1: "unresolved type for field name : %s (type:%s, in message: %s)" + }), match.field_name, match.type_, match.message_name); case /* Duplicated_field_number */ 1 : - const match$1 = e._0; - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "duplicated field number for field name: ", + const match$1 = e._0; + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "duplicated field number for field name: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " (previous field name:", _1: { - TAG: /* String_literal */ 11, - _0: " (previous field name:", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ", message: ", _1: { - TAG: /* String_literal */ 11, - _0: ", message: ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "duplicated field number for field name: %s (previous field name:%s, message: %s)" - }), match$1.field_name, match$1.previous_field_name, match$1.message_name); + } + }, + _1: "duplicated field number for field name: %s (previous field name:%s, message: %s)" + }), match$1.field_name, match$1.previous_field_name, match$1.message_name); case /* Invalid_default_value */ 2 : - const match$2 = e._0; - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "invalid default value for field name:", + const match$2 = e._0; + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "invalid default value for field name:", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " (info: ", _1: { - TAG: /* String_literal */ 11, - _0: " (info: ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } - }, - _1: "invalid default value for field name:%s (info: %s)" - }), option_default("", match$2.field_name), match$2.info); + } + }, + _1: "invalid default value for field name:%s (info: %s)" + }), option_default("", match$2.field_name), match$2.info); case /* Unsupported_field_type */ 3 : - const match$3 = e._0; - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unsupported field type for field name:", + const match$3 = e._0; + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unsupported field type for field name:", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " with type:", _1: { - TAG: /* String_literal */ 11, - _0: " with type:", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " in bakend: ", _1: { - TAG: /* String_literal */ 11, - _0: " in bakend: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "unsupported field type for field name:%s with type:%s in bakend: %s" - }), option_default("", match$3.field_name), match$3.field_type, match$3.backend_name); + } + }, + _1: "unsupported field type for field name:%s with type:%s in bakend: %s" + }), option_default("", match$3.field_name), match$3.field_type, match$3.backend_name); case /* Programatic_error */ 4 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "programmatic error: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "programmatic error: %s" - }), string_of_programmatic_error(e._0)); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "programmatic error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "programmatic error: %s" + }), string_of_programmatic_error(e._0)); case /* Invalid_import_qualifier */ 5 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "Invalid import qualified, only 'public' supported", + _1: /* End_of_format */ 0 + } + }, + _1: "%sInvalid import qualified, only 'public' supported" + }), to_string(e._0)); + case /* Invalid_file_name */ 6 : + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Invalid file name: ", + _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "Invalid import qualified, only 'public' supported", + _0: ", format must .proto", _1: /* End_of_format */ 0 } - }, - _1: "%sInvalid import qualified, only 'public' supported" - }), to_string(e._0)); - case /* Invalid_file_name */ 6 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Invalid file name: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ", format must .proto", - _1: /* End_of_format */ 0 - } - } - }, - _1: "Invalid file name: %s, format must .proto" - }), e._0); + } + }, + _1: "Invalid file name: %s, format must .proto" + }), e._0); case /* Import_file_not_found */ 7 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "File: ", + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "File: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ", could not be found.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: ", could not be found.", + _1: /* End_of_format */ 0 } - }, - _1: "File: %s, could not be found." - }), e._0); + } + }, + _1: "File: %s, could not be found." + }), e._0); case /* Invalid_packed_option */ 8 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Invalid packed option for field: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Invalid packed option for field: %s" + }), e._0); + case /* Missing_semicolon_for_enum_value */ 9 : + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* String_literal */ 11, - _0: "Invalid packed option for field: ", + _0: "Missing semicolon for enum value: ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: /* End_of_format */ 0 } - }, - _1: "Invalid packed option for field: %s" - }), e._0); - case /* Missing_semicolon_for_enum_value */ 9 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "Missing semicolon for enum value: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - } - }, - _1: "%sMissing semicolon for enum value: %s" - }), to_string(e._1), e._0); + } + }, + _1: "%sMissing semicolon for enum value: %s" + }), to_string(e._1), e._0); case /* Invalid_enum_specification */ 10 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "Missing enum specification ( = ;) for enum value: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - } - }, - _1: "%sMissing enum specification ( = ;) for enum value: %s" - }), to_string(e._1), e._0); - case /* Invalid_mutable_option */ 11 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* String_literal */ 11, - _0: "Invalid mutable option for field ", + _0: "Missing enum specification ( = ;) for enum value: ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: /* End_of_format */ 0 } - }, - _1: "Invalid mutable option for field %s" - }), option_default("", e._0)); - case /* Missing_one_of_name */ 12 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + } + }, + _1: "%sMissing enum specification ( = ;) for enum value: %s" + }), to_string(e._1), e._0); + case /* Invalid_mutable_option */ 11 : + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Invalid mutable option for field ", + _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "Missing oneof name", - _1: /* End_of_format */ 0 - } - }, - _1: "%sMissing oneof name" - }), to_string(e._0)); + _1: /* End_of_format */ 0 + } + }, + _1: "Invalid mutable option for field %s" + }), option_default("", e._0)); + case /* Missing_one_of_name */ 12 : + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "Missing oneof name", + _1: /* End_of_format */ 0 + } + }, + _1: "%sMissing oneof name" + }), to_string(e._0)); case /* Invalid_field_label */ 13 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "Invalid field label. [required|repeated|optional] expected", - _1: /* End_of_format */ 0 - } - }, - _1: "%sInvalid field label. [required|repeated|optional] expected" - }), to_string(e._0)); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "Invalid field label. [required|repeated|optional] expected", + _1: /* End_of_format */ 0 + } + }, + _1: "%sInvalid field label. [required|repeated|optional] expected" + }), to_string(e._0)); case /* Missing_field_label */ 14 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "Missing field label. [required|repeated|optional] expected", + _1: /* End_of_format */ 0 + } + }, + _1: "%sMissing field label. [required|repeated|optional] expected" + }), to_string(e._0)); + case /* Parsing_error */ 15 : + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "File ", + _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "Missing field label. [required|repeated|optional] expected", - _1: /* End_of_format */ 0 - } - }, - _1: "%sMissing field label. [required|repeated|optional] expected" - }), to_string(e._0)); - case /* Parsing_error */ 15 : - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "File ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + _0: ", line ", _1: { - TAG: /* String_literal */ 11, - _0: ", line ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: ":\n", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: ":\n", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "File %s, line %i:\n%s" - }), e._0, e._1, e._2); + } + }, + _1: "File %s, line %i:\n%s" + }), e._0, e._1, e._2); } } @@ -733,7 +733,7 @@ function add_loc(loc, exn) { case /* Missing_one_of_name */ 12 : case /* Invalid_field_label */ 13 : case /* Missing_field_label */ 14 : - return exn; + return exn; } } @@ -1370,15 +1370,15 @@ const yyact = [ const litteral = _1[1]; switch (litteral) { case "false" : - return { - TAG: /* Constant_bool */ 1, - _0: false - }; + return { + TAG: /* Constant_bool */ 1, + _0: false + }; case "true" : - return { - TAG: /* Constant_bool */ 1, - _0: true - }; + return { + TAG: /* Constant_bool */ 1, + _0: true + }; default: return { TAG: /* Constant_litteral */ 4, @@ -1598,24 +1598,24 @@ function __ocaml_lex_multi_line_comment_rec(_l, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - update_loc(lexbuf); - ___ocaml_lex_state = 47; - continue; + update_loc(lexbuf); + ___ocaml_lex_state = 47; + continue; case 1 : - Stdlib__Lexing.lexeme(lexbuf); - return { - TAG: /* Comment_value */ 0, - _0: Stdlib__String.concat("", Stdlib__List.rev(l)) - }; + Stdlib__Lexing.lexeme(lexbuf); + return { + TAG: /* Comment_value */ 0, + _0: Stdlib__String.concat("", Stdlib__List.rev(l)) + }; case 2 : - ___ocaml_lex_state = 47; - _l = { - hd: Stdlib__Lexing.lexeme(lexbuf), - tl: l - }; - continue; + ___ocaml_lex_state = 47; + _l = { + hd: Stdlib__Lexing.lexeme(lexbuf), + tl: l + }; + continue; case 3 : - return /* Comment_eof */ 0; + return /* Comment_eof */ 0; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -1631,27 +1631,27 @@ function __ocaml_lex_string_rec(_l, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - const c = Stdlib__Lexing.lexeme_char(lexbuf, 1); - ___ocaml_lex_state = 55; - _l = { - hd: Stdlib__Char.escaped(c), - tl: l - }; - continue; + const c = Stdlib__Lexing.lexeme_char(lexbuf, 1); + ___ocaml_lex_state = 55; + _l = { + hd: Stdlib__Char.escaped(c), + tl: l + }; + continue; case 1 : - return { - TAG: /* String_value */ 0, - _0: Stdlib__String.concat("", Stdlib__List.rev(l)) - }; + return { + TAG: /* String_value */ 0, + _0: Stdlib__String.concat("", Stdlib__List.rev(l)) + }; case 2 : - ___ocaml_lex_state = 55; - _l = { - hd: Stdlib__Lexing.lexeme(lexbuf), - tl: l - }; - continue; + ___ocaml_lex_state = 55; + _l = { + hd: Stdlib__Lexing.lexeme(lexbuf), + tl: l + }; + continue; case 3 : - return /* String_eof */ 0; + return /* String_eof */ 0; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -1667,20 +1667,20 @@ function __ocaml_lex_comment_rec(_l, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - update_loc(lexbuf); - return { - TAG: /* Comment_value */ 0, - _0: Stdlib__String.concat("", Stdlib__List.rev(l)) - }; + update_loc(lexbuf); + return { + TAG: /* Comment_value */ 0, + _0: Stdlib__String.concat("", Stdlib__List.rev(l)) + }; case 1 : - ___ocaml_lex_state = 41; - _l = { - hd: Stdlib__Lexing.lexeme(lexbuf), - tl: l - }; - continue; + ___ocaml_lex_state = 41; + _l = { + hd: Stdlib__Lexing.lexeme(lexbuf), + tl: l + }; + continue; case 2 : - return /* Comment_eof */ 0; + return /* Comment_eof */ 0; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -1696,144 +1696,144 @@ function lexer(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return /* LBRACE */ 15; + return /* LBRACE */ 15; case 1 : - return /* RBRACE */ 14; + return /* RBRACE */ 14; case 2 : - return /* LBRACKET */ 17; + return /* LBRACKET */ 17; case 3 : - return /* RBRACKET */ 16; + return /* RBRACKET */ 16; case 4 : - return /* RPAREN */ 18; + return /* RPAREN */ 18; case 5 : - return /* LPAREN */ 19; + return /* LPAREN */ 19; case 6 : - return /* LANGLEB */ 21; + return /* LANGLEB */ 21; case 7 : - return /* RANGLEB */ 20; + return /* RANGLEB */ 20; case 8 : - return /* EQUAL */ 22; + return /* EQUAL */ 22; case 9 : - return /* SEMICOLON */ 23; + return /* SEMICOLON */ 23; case 10 : - return /* COMMA */ 24; + return /* COMMA */ 24; case 11 : - const match = __ocaml_lex_comment_rec(/* [] */ 0, lexbuf, 41); - if (/* tag */ typeof match === "number" || typeof match === "string") { - return /* EOF */ 25; - } - ___ocaml_lex_state = 0; - continue; + const match = __ocaml_lex_comment_rec(/* [] */ 0, lexbuf, 41); + if (/* tag */ typeof match === "number" || typeof match === "string") { + return /* EOF */ 25; + } + ___ocaml_lex_state = 0; + continue; case 12 : - const match$1 = __ocaml_lex_multi_line_comment_rec(/* [] */ 0, lexbuf, 47); - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return /* EOF */ 25; - } - ___ocaml_lex_state = 0; - continue; + const match$1 = __ocaml_lex_multi_line_comment_rec(/* [] */ 0, lexbuf, 47); + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return /* EOF */ 25; + } + ___ocaml_lex_state = 0; + continue; case 13 : - const s = __ocaml_lex_string_rec(/* [] */ 0, lexbuf, 55); - if (/* tag */ typeof s === "number" || typeof s === "string") { - return /* EOF */ 25; - } else { - return { - TAG: /* STRING */ 2, - _0: s._0 - }; - } - case 14 : + const s = __ocaml_lex_string_rec(/* [] */ 0, lexbuf, 55); + if (/* tag */ typeof s === "number" || typeof s === "string") { + return /* EOF */ 25; + } else { return { - TAG: /* INT */ 3, - _0: Caml_format.caml_int_of_string(Stdlib__Lexing.lexeme(lexbuf)) + TAG: /* STRING */ 2, + _0: s._0 }; + } + case 14 : + return { + TAG: /* INT */ 3, + _0: Caml_format.caml_int_of_string(Stdlib__Lexing.lexeme(lexbuf)) + }; case 15 : - return { - TAG: /* FLOAT */ 4, - _0: Caml_format.caml_float_of_string(Stdlib__Lexing.lexeme(lexbuf)) - }; + return { + TAG: /* FLOAT */ 4, + _0: Caml_format.caml_float_of_string(Stdlib__Lexing.lexeme(lexbuf)) + }; case 16 : - return { - TAG: /* FLOAT */ 4, - _0: Number.NaN - }; + return { + TAG: /* FLOAT */ 4, + _0: Number.NaN + }; case 17 : - update_loc(lexbuf); - ___ocaml_lex_state = 0; - continue; + update_loc(lexbuf); + ___ocaml_lex_state = 0; + continue; case 18 : - ___ocaml_lex_state = 0; - continue; + ___ocaml_lex_state = 0; + continue; case 19 : - let loc = from_lexbuf(lexbuf); - let ident = Stdlib__Lexing.lexeme(lexbuf); - switch (ident) { - case "enum" : - return /* ENUM */ 4; - case "extend" : - return /* EXTEND */ 9; - case "extensions" : - return /* EXTENSIONS */ 8; - case "import" : - return { - TAG: /* IMPORT */ 1, - _0: loc - }; - case "map" : - return /* MAP */ 13; - case "max" : - return /* MAX */ 12; - case "message" : - return /* MESSAGE */ 3; - case "oneof" : - return { - TAG: /* ONE_OF */ 0, - _0: loc - }; - case "option" : - return /* OPTION */ 7; - case "optional" : - return /* OPTIONAL */ 1; - case "package" : - return /* PACKAGE */ 5; - case "public" : - return /* PUBLIC */ 6; - case "repeated" : - return /* REPEATED */ 2; - case "required" : - return /* REQUIRED */ 0; - case "syntax" : - return /* SYNTAX */ 10; - case "to" : - return /* TO */ 11; - default: - return { - TAG: /* IDENT */ 5, - _0: [ - loc, - ident - ] - }; - } + let loc = from_lexbuf(lexbuf); + let ident = Stdlib__Lexing.lexeme(lexbuf); + switch (ident) { + case "enum" : + return /* ENUM */ 4; + case "extend" : + return /* EXTEND */ 9; + case "extensions" : + return /* EXTENSIONS */ 8; + case "import" : + return { + TAG: /* IMPORT */ 1, + _0: loc + }; + case "map" : + return /* MAP */ 13; + case "max" : + return /* MAX */ 12; + case "message" : + return /* MESSAGE */ 3; + case "oneof" : + return { + TAG: /* ONE_OF */ 0, + _0: loc + }; + case "option" : + return /* OPTION */ 7; + case "optional" : + return /* OPTIONAL */ 1; + case "package" : + return /* PACKAGE */ 5; + case "public" : + return /* PUBLIC */ 6; + case "repeated" : + return /* REPEATED */ 2; + case "required" : + return /* REQUIRED */ 0; + case "syntax" : + return /* SYNTAX */ 10; + case "to" : + return /* TO */ 11; + default: + return { + TAG: /* IDENT */ 5, + _0: [ + loc, + ident + ] + }; + } case 20 : - return /* EOF */ 25; + return /* EOF */ 25; case 21 : - const s$1 = Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unknown character found ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "Unknown character found %s" - }), Stdlib__Lexing.lexeme(lexbuf)); - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: s$1 - }); + const s$1 = Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unknown character found ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Unknown character found %s" + }), Stdlib__Lexing.lexeme(lexbuf)); + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: s$1 + }); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -1853,19 +1853,19 @@ function let_decl_of_and(param) { function string_of_basic_type(param) { switch (param) { case /* Bt_string */ 0 : - return "string"; + return "string"; case /* Bt_float */ 1 : - return "float"; + return "float"; case /* Bt_int */ 2 : - return "int"; + return "int"; case /* Bt_int32 */ 3 : - return "int32"; + return "int32"; case /* Bt_int64 */ 4 : - return "int64"; + return "int64"; case /* Bt_bytes */ 5 : - return "bytes"; + return "bytes"; case /* Bt_bool */ 6 : - return "bool"; + return "bool"; } } @@ -1897,77 +1897,77 @@ function string_of_repeated_type(param) { function string_of_record_field_type(param) { switch (param.TAG) { case /* Rft_required */ 0 : - return string_of_field_type(param._0[0]); + return string_of_field_type(param._0[0]); case /* Rft_optional */ 1 : - return string_of_field_type(param._0[0]) + " option"; + return string_of_field_type(param._0[0]) + " option"; case /* Rft_repeated_field */ 2 : - const match = param._0; - return string_of_field_type(match[1]) + (" " + string_of_repeated_type(match[0])); + const match = param._0; + return string_of_field_type(match[1]) + (" " + string_of_repeated_type(match[0])); case /* Rft_associative_field */ 3 : - const match$1 = param._0; - if (match$1[0] === /* At_list */ 0) { - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, + const match$1 = param._0; + if (match$1[0] === /* At_list */ 0) { + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " * ", _1: { - TAG: /* String_literal */ 11, - _0: " * ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ") ", _1: { - TAG: /* String_literal */ 11, - _0: ") ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "(%s * %s) %s" - }), string_of_basic_type(match$1[2][0]), string_of_field_type(match$1[3][0]), "list"); - } else { - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, + } + }, + _1: "(%s * %s) %s" + }), string_of_basic_type(match$1[2][0]), string_of_field_type(match$1[3][0]), "list"); + } else { + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ", ", _1: { - TAG: /* String_literal */ 11, - _0: ", ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ") ", _1: { - TAG: /* String_literal */ 11, - _0: ") ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "(%s, %s) %s" - }), string_of_basic_type(match$1[2][0]), string_of_field_type(match$1[3][0]), "Hashtbl.t"); - } + } + }, + _1: "(%s, %s) %s" + }), string_of_basic_type(match$1[2][0]), string_of_field_type(match$1[3][0]), "Hashtbl.t"); + } case /* Rft_variant_field */ 4 : - return param._0.v_name; + return param._0.v_name; } } @@ -2026,14 +2026,14 @@ function string_of_payload_kind(capitalize, payload_kind, packed) { if (/* tag */ typeof payload_kind === "number" || typeof payload_kind === "string") { switch (payload_kind) { case /* Pk_bits32 */ 0 : - s = packed ? "bytes" : "bits32"; - break; + s = packed ? "bytes" : "bits32"; + break; case /* Pk_bits64 */ 1 : - s = packed ? "bytes" : "bits64"; - break; + s = packed ? "bytes" : "bits64"; + break; case /* Pk_bytes */ 2 : - s = "bytes"; - break; + s = "bytes"; + break; } } else { @@ -2073,23 +2073,23 @@ function scope(scope$1, f) { function indentation_prefix(n) { switch (n) { case 0 : - return ""; + return ""; case 1 : - return " "; + return " "; case 2 : - return " "; + return " "; case 3 : - return " "; + return " "; case 4 : - return " "; + return " "; case 5 : - return " "; + return " "; case 6 : - return " "; + return " "; case 7 : - return " "; + return " "; case 8 : - return " "; + return " "; default: return Caml_bytes.bytes_to_string(Stdlib__Bytes.make(n, /* ' ' */32)); } @@ -2129,55 +2129,55 @@ function runtime_function(param) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { switch (match$1) { case /* Pk_bits32 */ 0 : - switch (param[2]) { - case /* Bt_float */ 1 : - return "Pbrt.Decoder.float_as_bits32"; - case /* Bt_int */ 2 : - return "Pbrt.Decoder.int_as_bits32"; - case /* Bt_int32 */ 3 : - return "Pbrt.Decoder.int32_as_bits32"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_float */ 1 : + return "Pbrt.Decoder.float_as_bits32"; + case /* Bt_int */ 2 : + return "Pbrt.Decoder.int_as_bits32"; + case /* Bt_int32 */ 3 : + return "Pbrt.Decoder.int32_as_bits32"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } case /* Pk_bits64 */ 1 : - switch (param[2]) { - case /* Bt_float */ 1 : - return "Pbrt.Decoder.float_as_bits64"; - case /* Bt_int */ 2 : - return "Pbrt.Decoder.int_as_bits64"; - case /* Bt_int64 */ 4 : - return "Pbrt.Decoder.int64_as_bits64"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_float */ 1 : + return "Pbrt.Decoder.float_as_bits64"; + case /* Bt_int */ 2 : + return "Pbrt.Decoder.int_as_bits64"; + case /* Bt_int64 */ 4 : + return "Pbrt.Decoder.int64_as_bits64"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } case /* Pk_bytes */ 2 : - switch (param[2]) { - case /* Bt_string */ 0 : - return "Pbrt.Decoder.string"; - case /* Bt_bytes */ 5 : - return "Pbrt.Decoder.bytes"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_string */ 0 : + return "Pbrt.Decoder.string"; + case /* Bt_bytes */ 5 : + return "Pbrt.Decoder.bytes"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } } } else if (match$1._0) { switch (param[2]) { case /* Bt_int */ 2 : - return "Pbrt.Decoder.int_as_zigzag"; + return "Pbrt.Decoder.int_as_zigzag"; case /* Bt_int32 */ 3 : - return "Pbrt.Decoder.int32_as_zigzag"; + return "Pbrt.Decoder.int32_as_zigzag"; case /* Bt_int64 */ 4 : - return "Pbrt.Decoder.int64_as_zigzag"; + return "Pbrt.Decoder.int64_as_zigzag"; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2187,13 +2187,13 @@ function runtime_function(param) { } else { switch (param[2]) { case /* Bt_int */ 2 : - return "Pbrt.Decoder.int_as_varint"; + return "Pbrt.Decoder.int_as_varint"; case /* Bt_int32 */ 3 : - return "Pbrt.Decoder.int32_as_varint"; + return "Pbrt.Decoder.int32_as_varint"; case /* Bt_int64 */ 4 : - return "Pbrt.Decoder.int64_as_varint"; + return "Pbrt.Decoder.int64_as_varint"; case /* Bt_bool */ 6 : - return "Pbrt.Decoder.bool"; + return "Pbrt.Decoder.bool"; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2206,55 +2206,55 @@ function runtime_function(param) { if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { switch (match$2) { case /* Pk_bits32 */ 0 : - switch (param[2]) { - case /* Bt_float */ 1 : - return "Pbrt.Encoder.float_as_bits32"; - case /* Bt_int */ 2 : - return "Pbrt.Encoder.int_as_bits32"; - case /* Bt_int32 */ 3 : - return "Pbrt.Encoder.int32_as_bits32"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_float */ 1 : + return "Pbrt.Encoder.float_as_bits32"; + case /* Bt_int */ 2 : + return "Pbrt.Encoder.int_as_bits32"; + case /* Bt_int32 */ 3 : + return "Pbrt.Encoder.int32_as_bits32"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } case /* Pk_bits64 */ 1 : - switch (param[2]) { - case /* Bt_float */ 1 : - return "Pbrt.Encoder.float_as_bits64"; - case /* Bt_int */ 2 : - return "Pbrt.Encoder.int_as_bits64"; - case /* Bt_int64 */ 4 : - return "Pbrt.Encoder.int64_as_bits64"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_float */ 1 : + return "Pbrt.Encoder.float_as_bits64"; + case /* Bt_int */ 2 : + return "Pbrt.Encoder.int_as_bits64"; + case /* Bt_int64 */ 4 : + return "Pbrt.Encoder.int64_as_bits64"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } case /* Pk_bytes */ 2 : - switch (param[2]) { - case /* Bt_string */ 0 : - return "Pbrt.Encoder.string"; - case /* Bt_bytes */ 5 : - return "Pbrt.Encoder.bytes"; - default: - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid encoding/OCaml type combination" - }); - } + switch (param[2]) { + case /* Bt_string */ 0 : + return "Pbrt.Encoder.string"; + case /* Bt_bytes */ 5 : + return "Pbrt.Encoder.bytes"; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid encoding/OCaml type combination" + }); + } } } else if (match$2._0) { switch (param[2]) { case /* Bt_int */ 2 : - return "Pbrt.Encoder.int_as_zigzag"; + return "Pbrt.Encoder.int_as_zigzag"; case /* Bt_int32 */ 3 : - return "Pbrt.Encoder.int32_as_zigzag"; + return "Pbrt.Encoder.int32_as_zigzag"; case /* Bt_int64 */ 4 : - return "Pbrt.Encoder.int64_as_zigzag"; + return "Pbrt.Encoder.int64_as_zigzag"; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2264,13 +2264,13 @@ function runtime_function(param) { } else { switch (param[2]) { case /* Bt_int */ 2 : - return "Pbrt.Encoder.int_as_varint"; + return "Pbrt.Encoder.int_as_varint"; case /* Bt_int32 */ 3 : - return "Pbrt.Encoder.int32_as_varint"; + return "Pbrt.Encoder.int32_as_varint"; case /* Bt_int64 */ 4 : - return "Pbrt.Encoder.int64_as_varint"; + return "Pbrt.Encoder.int64_as_varint"; case /* Bt_bool */ 6 : - return "Pbrt.Encoder.bool"; + return "Pbrt.Encoder.bool"; default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", @@ -2318,23 +2318,23 @@ function gen_decode_record(and_, param, sc) { const rf_label = param.rf_label; switch (rf_field_type.TAG) { case /* Rft_repeated_field */ 2 : - if (rf_field_type._0[0] === /* Rt_list */ 0) { - return { - hd: rf_label, - tl: acc - }; - } else { - return acc; - } + if (rf_field_type._0[0] === /* Rt_list */ 0) { + return { + hd: rf_label, + tl: acc + }; + } else { + return acc; + } case /* Rft_associative_field */ 3 : - if (rf_field_type._0[0] === /* At_list */ 0) { - return { - hd: rf_label, - tl: acc - }; - } else { - return acc; - } + if (rf_field_type._0[0] === /* At_list */ 0) { + return { + hd: rf_label, + tl: acc + }; + } else { + return acc; + } default: return acc; } @@ -2517,233 +2517,105 @@ function gen_decode_record(and_, param, sc) { const rf_label = param.rf_label; switch (rf_field_type.TAG) { case /* Rft_required */ 0 : - let param$1 = rf_field_type._0; - const pk = param$1[2]; - const field_type = param$1[0]; - return process_field_common(sc, param$1[1], string_of_payload_kind(Caml_option.some(undefined), pk, false), (function (sc) { - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "v.", + let param$1 = rf_field_type._0; + const pk = param$1[2]; + const field_type = param$1[0]; + return process_field_common(sc, param$1[1], string_of_payload_kind(Caml_option.some(undefined), pk, false), (function (sc) { + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " <- ", _1: { - TAG: /* String_literal */ 11, - _0: " <- ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 } } } - }, - _1: "v.%s <- %s;" - }), rf_label, decode_field_f(field_type, pk))); - })); + } + }, + _1: "v.%s <- %s;" + }), rf_label, decode_field_f(field_type, pk))); + })); case /* Rft_optional */ 1 : - let param$2 = rf_field_type._0; - const pk$1 = param$2[2]; - const field_type$1 = param$2[0]; - return process_field_common(sc, param$2[1], string_of_payload_kind(Caml_option.some(undefined), pk$1, false), (function (sc) { - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "v.", + let param$2 = rf_field_type._0; + const pk$1 = param$2[2]; + const field_type$1 = param$2[0]; + return process_field_common(sc, param$2[1], string_of_payload_kind(Caml_option.some(undefined), pk$1, false), (function (sc) { + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " <- Some (", _1: { - TAG: /* String_literal */ 11, - _0: " <- Some (", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ");", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: ");", + _1: /* End_of_format */ 0 } } } - }, - _1: "v.%s <- Some (%s);" - }), rf_label, decode_field_f(field_type$1, pk$1))); - })); + } + }, + _1: "v.%s <- Some (%s);" + }), rf_label, decode_field_f(field_type$1, pk$1))); + })); case /* Rft_repeated_field */ 2 : - let param$3 = rf_field_type._0; - const is_packed = param$3[4]; - const pk$2 = param$3[3]; - const encoding_number = param$3[2]; - const field_type$2 = param$3[1]; - if (param$3[0] === /* Rt_list */ 0) { - if (is_packed) { - return process_field_common(sc, encoding_number, "Bytes", (function (sc) { - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " <- Pbrt.Decoder.packed_fold (fun l d -> (", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ")::l) [] d;", - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "v.%s <- Pbrt.Decoder.packed_fold (fun l d -> (%s)::l) [] d;" - }), rf_label, decode_field_f(field_type$2, pk$2))); - })); - } else { - return process_field_common(sc, encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk$2, false), (function (sc) { - line$1(sc, Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " <- (", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") :: v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "v.%s <- (%s) :: v.%s;" - }), rf_label, decode_field_f(field_type$2, pk$2), rf_label)); - })); - } - } else if (is_packed) { + let param$3 = rf_field_type._0; + const is_packed = param$3[4]; + const pk$2 = param$3[3]; + const encoding_number = param$3[2]; + const field_type$2 = param$3[1]; + if (param$3[0] === /* Rt_list */ 0) { + if (is_packed) { return process_field_common(sc, encoding_number, "Bytes", (function (sc) { - line$1(sc, "Pbrt.Decoder.packed_fold (fun () d -> "); - scope(sc, (function (sc) { - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Pbrt.Repeated_field.add (", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "Pbrt.Repeated_field.add (%s) v.%s;" - }), decode_field_f(field_type$2, pk$2), rf_label)); - })); - line$1(sc, ") () d;"); - })); - } else { - return process_field_common(sc, encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk$2, false), (function (sc) { line$1(sc, Curry._2(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Pbrt.Repeated_field.add (", + _0: "v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: ") v.", + _0: " <- Pbrt.Decoder.packed_fold (fun l d -> (", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "; ", + _0: ")::l) [] d;", _1: /* End_of_format */ 0 } } } } }, - _1: "Pbrt.Repeated_field.add (%s) v.%s; " - }), decode_field_f(field_type$2, pk$2), rf_label)); + _1: "v.%s <- Pbrt.Decoder.packed_fold (fun l d -> (%s)::l) [] d;" + }), rf_label, decode_field_f(field_type$2, pk$2))); })); - } - case /* Rft_associative_field */ 3 : - let param$4 = rf_field_type._0; - const match = param$4[3]; - const value_pk = match[1]; - const value_type = match[0]; - const match$1 = param$4[2]; - const at = param$4[0]; - const decode_key_f = decode_basic_type(match$1[0], match$1[1]); - return process_field_common(sc, param$4[1], "Bytes", (function (sc) { - line$1(sc, "let decode_value = (fun d ->"); - scope(sc, (function (sc) { - line$1(sc, decode_field_f(value_type, value_pk)); - })); - line$1(sc, ") in"); - const decode_expression = Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "(Pbrt.Decoder.map_entry d ~decode_key:", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " ~decode_value)", - _1: /* End_of_format */ 0 - } - } - }, - _1: "(Pbrt.Decoder.map_entry d ~decode_key:%s ~decode_value)" - }), decode_key_f); - if (at === /* At_list */ 0) { - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + } else { + return process_field_common(sc, encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk$2, false), (function (sc) { + line$1(sc, Curry._3(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, @@ -2754,21 +2626,45 @@ function gen_decode_record(and_, param, sc) { _1: { TAG: /* String_literal */ 11, _0: " <- (", - _1: /* End_of_format */ 0 + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: ") :: v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 + } + } + } + } } } }, - _1: "v.%s <- (" - }), rf_label)); - scope(sc, (function (sc) { - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + _1: "v.%s <- (%s) :: v.%s;" + }), rf_label, decode_field_f(field_type$2, pk$2), rf_label)); + })); + } + } else if (is_packed) { + return process_field_common(sc, encoding_number, "Bytes", (function (sc) { + line$1(sc, "Pbrt.Decoder.packed_fold (fun () d -> "); + scope(sc, (function (sc) { + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Repeated_field.add (", + _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "::v.", + _0: ") v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, @@ -2779,91 +2675,160 @@ function gen_decode_record(and_, param, sc) { } } } - }, - _1: "%s::v.%s;" - }), decode_expression, rf_label)); - })); - return line$1(sc, ");"); - } - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + } + }, + _1: "Pbrt.Repeated_field.add (%s) v.%s;" + }), decode_field_f(field_type$2, pk$2), rf_label)); + })); + line$1(sc, ") () d;"); + })); + } else { + return process_field_common(sc, encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk$2, false), (function (sc) { + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "let a, b = ", + _0: "Pbrt.Repeated_field.add (", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " in", - _1: /* End_of_format */ 0 + _0: ") v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "; ", + _1: /* End_of_format */ 0 + } + } } } }, - _1: "let a, b = %s in" - }), decode_expression)); + _1: "Pbrt.Repeated_field.add (%s) v.%s; " + }), decode_field_f(field_type$2, pk$2), rf_label)); + })); + } + case /* Rft_associative_field */ 3 : + let param$4 = rf_field_type._0; + const match = param$4[3]; + const value_pk = match[1]; + const value_type = match[0]; + const match$1 = param$4[2]; + const at = param$4[0]; + const decode_key_f = decode_basic_type(match$1[0], match$1[1]); + return process_field_common(sc, param$4[1], "Bytes", (function (sc) { + line$1(sc, "let decode_value = (fun d ->"); + scope(sc, (function (sc) { + line$1(sc, decode_field_f(value_type, value_pk)); + })); + line$1(sc, ") in"); + const decode_expression = Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "(Pbrt.Decoder.map_entry d ~decode_key:", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " ~decode_value)", + _1: /* End_of_format */ 0 + } + } + }, + _1: "(Pbrt.Decoder.map_entry d ~decode_key:%s ~decode_value)" + }), decode_key_f); + if (at === /* At_list */ 0) { line$1(sc, Curry._1(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Hashtbl.add v.", + _0: "v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " a b;", + _0: " <- (", _1: /* End_of_format */ 0 } } }, - _1: "Hashtbl.add v.%s a b;" + _1: "v.%s <- (" }), rf_label)); - })); - case /* Rft_variant_field */ 4 : - let param$5 = rf_field_type._0; - return Stdlib__List.iter((function (param) { - const pk = param.vc_payload_kind; - const vc_field_type = param.vc_field_type; - const vc_constructor = param.vc_constructor; - process_field_common(sc, param.vc_encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk, false), (function (sc) { - if (!/* tag */ (typeof vc_field_type === "number" || typeof vc_field_type === "string")) { - return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + scope(sc, (function (sc) { + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* String_literal */ 11, - _0: "v.", + _0: "::v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: " <- ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ");", - _1: /* End_of_format */ 0 - } - } - } - } + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 } } - }, - _1: "v.%s <- %s (%s);" - }), rf_label, vc_constructor, decode_field_f(vc_field_type._0, pk))); - } - line$1(sc, "Pbrt.Decoder.empty_nested d;"); - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + } + }, + _1: "%s::v.%s;" + }), decode_expression, rf_label)); + })); + return line$1(sc, ");"); + } + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "let a, b = ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " in", + _1: /* End_of_format */ 0 + } + } + }, + _1: "let a, b = %s in" + }), decode_expression)); + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Hashtbl.add v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " a b;", + _1: /* End_of_format */ 0 + } + } + }, + _1: "Hashtbl.add v.%s a b;" + }), rf_label)); + })); + case /* Rft_variant_field */ 4 : + let param$5 = rf_field_type._0; + return Stdlib__List.iter((function (param) { + const pk = param.vc_payload_kind; + const vc_field_type = param.vc_field_type; + const vc_constructor = param.vc_constructor; + process_field_common(sc, param.vc_encoding_number, string_of_payload_kind(Caml_option.some(undefined), pk, false), (function (sc) { + if (!/* tag */ (typeof vc_field_type === "number" || typeof vc_field_type === "string")) { + return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, @@ -2878,18 +2843,53 @@ function gen_decode_record(and_, param, sc) { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 + TAG: /* String_literal */ 11, + _0: " (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: ");", + _1: /* End_of_format */ 0 + } + } } } } } }, - _1: "v.%s <- %s;" - }), rf_label, vc_constructor)); - })); - }), param$5.v_constructors); + _1: "v.%s <- %s (%s);" + }), rf_label, vc_constructor, decode_field_f(vc_field_type._0, pk))); + } + line$1(sc, "Pbrt.Decoder.empty_nested d;"); + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " <- ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "v.%s <- %s;" + }), rf_label, vc_constructor)); + })); + }), param$5.v_constructors); } }), r_fields); @@ -3143,23 +3143,23 @@ function gen_struct(and_, t, sc) { let tmp; switch (r.TAG) { case /* Record */ 0 : - tmp = [ - gen_decode_record(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_decode_record(and_, r._0, sc), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - gen_decode_variant(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_decode_variant(and_, r._0, sc), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - gen_decode_const_variant(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_decode_const_variant(and_, r._0, sc), + true + ]; + break; } return tmp[1]; @@ -3218,23 +3218,23 @@ function gen_sig(and_, t, sc) { let tmp; switch (match.TAG) { case /* Record */ 0 : - tmp = [ - f(match._0.r_name), - true - ]; - break; + tmp = [ + f(match._0.r_name), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - f(match._0.v_name), - true - ]; - break; + tmp = [ + f(match._0.v_name), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - f(match._0.cv_name), - true - ]; - break; + tmp = [ + f(match._0.cv_name), + true + ]; + break; } return tmp[1]; @@ -3365,7 +3365,79 @@ function gen_pp_record(and_, param, sc) { }), rf_label); switch (rf_field_type.TAG) { case /* Rft_required */ 0 : - const field_string_of = gen_pp_field(rf_field_type._0[0]); + const field_string_of = gen_pp_field(rf_field_type._0[0]); + return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Pp.pp_record_field \"", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "\" ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " fmt ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + }, + _1: "Pbrt.Pp.pp_record_field \"%s\" %s fmt %s;" + }), rf_label, field_string_of, var_name)); + case /* Rft_optional */ 1 : + const field_string_of$1 = gen_pp_field(rf_field_type._0[0]); + return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Pp.pp_record_field \"", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "\" (Pbrt.Pp.pp_option ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: ") fmt ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + }, + _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_option %s) fmt %s;" + }), rf_label, field_string_of$1, var_name)); + case /* Rft_repeated_field */ 2 : + const match = rf_field_type._0; + const field_string_of$2 = gen_pp_field(match[1]); + if (match[0] === /* Rt_list */ 0) { return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { @@ -3376,13 +3448,13 @@ function gen_pp_record(and_, param, sc) { _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "\" ", + _0: "\" (Pbrt.Pp.pp_list ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " fmt ", + _0: ") fmt ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, @@ -3397,10 +3469,9 @@ function gen_pp_record(and_, param, sc) { } } }, - _1: "Pbrt.Pp.pp_record_field \"%s\" %s fmt %s;" - }), rf_label, field_string_of, var_name)); - case /* Rft_optional */ 1 : - const field_string_of$1 = gen_pp_field(rf_field_type._0[0]); + _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_list %s) fmt %s;" + }), rf_label, field_string_of$2, var_name)); + } else { return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { @@ -3411,19 +3482,19 @@ function gen_pp_record(and_, param, sc) { _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "\" (Pbrt.Pp.pp_option ", + _0: "\" (Pbrt.Pp.pp_list ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: ") fmt ", + _0: ") fmt (Pbrt.Repeated_field.to_list ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* String_literal */ 11, + _0: ");", _1: /* End_of_format */ 0 } } @@ -3432,126 +3503,54 @@ function gen_pp_record(and_, param, sc) { } } }, - _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_option %s) fmt %s;" - }), rf_label, field_string_of$1, var_name)); - case /* Rft_repeated_field */ 2 : - const match = rf_field_type._0; - const field_string_of$2 = gen_pp_field(match[1]); - if (match[0] === /* Rt_list */ 0) { - return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Pbrt.Pp.pp_record_field \"", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "\" (Pbrt.Pp.pp_list ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") fmt ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_list %s) fmt %s;" - }), rf_label, field_string_of$2, var_name)); - } else { - return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { + _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_list %s) fmt (Pbrt.Repeated_field.to_list %s);" + }), rf_label, field_string_of$2, var_name)); + } + case /* Rft_associative_field */ 3 : + const match$1 = rf_field_type._0; + let pp_runtime_function; + pp_runtime_function = match$1[0] === /* At_list */ 0 ? "pp_associative_list" : "pp_hastable"; + const pp_key = gen_pp_field({ + TAG: /* Ft_basic_type */ 0, + _0: match$1[2][0] + }); + const pp_value = gen_pp_field(match$1[3][0]); + return line$1(sc, Curry._5(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Pp.pp_record_field \"", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* String_literal */ 11, - _0: "Pbrt.Pp.pp_record_field \"", + _0: "\" (Pbrt.Pp.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "\" (Pbrt.Pp.pp_list ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") fmt (Pbrt.Repeated_field.to_list ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ");", - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.pp_list %s) fmt (Pbrt.Repeated_field.to_list %s);" - }), rf_label, field_string_of$2, var_name)); - } - case /* Rft_associative_field */ 3 : - const match$1 = rf_field_type._0; - let pp_runtime_function; - pp_runtime_function = match$1[0] === /* At_list */ 0 ? "pp_associative_list" : "pp_hastable"; - const pp_key = gen_pp_field({ - TAG: /* Ft_basic_type */ 0, - _0: match$1[2][0] - }); - const pp_value = gen_pp_field(match$1[3][0]); - return line$1(sc, Curry._5(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Pbrt.Pp.pp_record_field \"", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "\" (Pbrt.Pp.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ") fmt ", _1: { - TAG: /* String_literal */ 11, - _0: ") fmt ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 } } } @@ -3561,43 +3560,44 @@ function gen_pp_record(and_, param, sc) { } } } - }, - _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.%s %s %s) fmt %s;" - }), rf_label, pp_runtime_function, pp_key, pp_value, var_name)); + } + }, + _1: "Pbrt.Pp.pp_record_field \"%s\" (Pbrt.Pp.%s %s %s) fmt %s;" + }), rf_label, pp_runtime_function, pp_key, pp_value, var_name)); case /* Rft_variant_field */ 4 : - return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Pbrt.Pp.pp_record_field \"", + return line$1(sc, Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Pp.pp_record_field \"", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "\" ", _1: { - TAG: /* String_literal */ 11, - _0: "\" ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " fmt ", _1: { - TAG: /* String_literal */ 11, - _0: " fmt ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "Pbrt.Pp.pp_record_field \"%s\" %s fmt %s;" - }), rf_label, "pp_" + rf_field_type._0.v_name, var_name)); + } + }, + _1: "Pbrt.Pp.pp_record_field \"%s\" %s fmt %s;" + }), rf_label, "pp_" + rf_field_type._0.v_name, var_name)); } }), r_fields); @@ -3806,14 +3806,14 @@ function gen_struct$1(and_, t, sc) { const r = t.spec; switch (r.TAG) { case /* Record */ 0 : - gen_pp_record(and_, r._0, sc); - break; + gen_pp_record(and_, r._0, sc); + break; case /* Variant */ 1 : - gen_pp_variant(and_, r._0, sc); - break; + gen_pp_variant(and_, r._0, sc); + break; case /* Const_variant */ 2 : - gen_pp_const_variant(and_, r._0, sc); - break; + gen_pp_const_variant(and_, r._0, sc); + break; } return true; @@ -3867,14 +3867,14 @@ function gen_sig$1(and_, t, sc) { const v = t.spec; switch (v.TAG) { case /* Record */ 0 : - f(v._0.r_name); - break; + f(v._0.r_name); + break; case /* Variant */ 1 : - f(v._0.v_name); - break; + f(v._0.v_name); + break; case /* Const_variant */ 2 : - f(v._0.cv_name); - break; + f(v._0.cv_name); + break; } return true; @@ -4506,35 +4506,35 @@ function unresolved_of_string(s) { function field_type_of_string(s) { switch (s) { case "bool" : - return /* Field_type_bool */ 12; + return /* Field_type_bool */ 12; case "bytes" : - return /* Field_type_bytes */ 14; + return /* Field_type_bytes */ 14; case "double" : - return /* Field_type_double */ 0; + return /* Field_type_double */ 0; case "fixed32" : - return /* Field_type_fixed32 */ 8; + return /* Field_type_fixed32 */ 8; case "fixed64" : - return /* Field_type_fixed64 */ 9; + return /* Field_type_fixed64 */ 9; case "float" : - return /* Field_type_float */ 1; + return /* Field_type_float */ 1; case "int32" : - return /* Field_type_int32 */ 2; + return /* Field_type_int32 */ 2; case "int64" : - return /* Field_type_int64 */ 3; + return /* Field_type_int64 */ 3; case "sfixed32" : - return /* Field_type_sfixed32 */ 10; + return /* Field_type_sfixed32 */ 10; case "sfixed64" : - return /* Field_type_sfixed64 */ 11; + return /* Field_type_sfixed64 */ 11; case "sint32" : - return /* Field_type_sint32 */ 6; + return /* Field_type_sint32 */ 6; case "sint64" : - return /* Field_type_sint64 */ 7; + return /* Field_type_sint64 */ 7; case "string" : - return /* Field_type_string */ 13; + return /* Field_type_string */ 13; case "uint32" : - return /* Field_type_uint32 */ 4; + return /* Field_type_uint32 */ 4; case "uint64" : - return /* Field_type_uint64 */ 5; + return /* Field_type_uint64 */ 5; default: return { TAG: /* Field_type_type */ 0, @@ -4555,26 +4555,26 @@ function compile_default_p2(all_types, field) { switch (field_type$1) { case /* Field_type_double */ 0 : case /* Field_type_float */ 1 : - exit = 1; - break; + exit = 1; + break; case /* Field_type_uint32 */ 4 : case /* Field_type_uint64 */ 5 : - exit = 2; - break; + exit = 2; + break; case /* Field_type_bool */ 12 : - if (field_default$1.TAG === /* Constant_bool */ 1) { - return field_default$1; - } else { - return invalid_default_value(field_name$1, "invalid default type (bool expected)", undefined); - } + if (field_default$1.TAG === /* Constant_bool */ 1) { + return field_default$1; + } else { + return invalid_default_value(field_name$1, "invalid default type (bool expected)", undefined); + } case /* Field_type_string */ 13 : - if (field_default$1.TAG === /* Constant_string */ 0) { - return field_default$1; - } else { - return invalid_default_value(field_name$1, "invalid default type (string expected)", undefined); - } + if (field_default$1.TAG === /* Constant_string */ 0) { + return field_default$1; + } else { + return invalid_default_value(field_name$1, "invalid default type (string expected)", undefined); + } case /* Field_type_bytes */ 14 : - return invalid_default_value(field_name$1, "default value not supported for bytes", undefined); + return invalid_default_value(field_name$1, "default value not supported for bytes", undefined); default: if (field_default$1.TAG === /* Constant_int */ 2) { return field_default$1; @@ -4607,27 +4607,27 @@ function compile_default_p2(all_types, field) { } switch (exit) { case 1 : - switch (field_default$1.TAG) { - case /* Constant_int */ 2 : - return { - TAG: /* Constant_float */ 3, - _0: field_default$1._0 - }; - case /* Constant_float */ 3 : - return field_default$1; - default: - return invalid_default_value(field_name$1, "invalid default type (float/int expected)", undefined); - } + switch (field_default$1.TAG) { + case /* Constant_int */ 2 : + return { + TAG: /* Constant_float */ 3, + _0: field_default$1._0 + }; + case /* Constant_float */ 3 : + return field_default$1; + default: + return invalid_default_value(field_name$1, "invalid default type (float/int expected)", undefined); + } case 2 : - if (field_default$1.TAG === /* Constant_int */ 2) { - if (field_default$1._0 >= 0) { - return field_default$1; - } else { - return invalid_default_value(field_name$1, "negative default value for unsigned int", undefined); - } + if (field_default$1.TAG === /* Constant_int */ 2) { + if (field_default$1._0 >= 0) { + return field_default$1; } else { - return invalid_default_value(field_name$1, "invalid default type (int expected)", undefined); + return invalid_default_value(field_name$1, "negative default value for unsigned int", undefined); } + } else { + return invalid_default_value(field_name$1, "invalid default type (int expected)", undefined); + } } } @@ -4750,66 +4750,66 @@ function compile_message_p1(file_name, file_options, message_scope, param) { const message_body = param[0]; switch (f.TAG) { case /* Message_field */ 0 : - const field = { - TAG: /* Message_field */ 0, - _0: compile_field_p1(f._0) - }; - return [ - { - hd: field, - tl: message_body - }, - extensions, - all_types - ]; + const field = { + TAG: /* Message_field */ 0, + _0: compile_field_p1(f._0) + }; + return [ + { + hd: field, + tl: message_body + }, + extensions, + all_types + ]; case /* Message_map_field */ 1 : - const field$1 = { - TAG: /* Message_map_field */ 2, - _0: compile_map_p1(f._0) - }; - return [ - { - hd: field$1, - tl: message_body - }, - extensions, - all_types - ]; + const field$1 = { + TAG: /* Message_map_field */ 2, + _0: compile_map_p1(f._0) + }; + return [ + { + hd: field$1, + tl: message_body + }, + extensions, + all_types + ]; case /* Message_oneof_field */ 2 : - const field$2 = { - TAG: /* Message_oneof_field */ 1, - _0: compile_oneof_p1(f._0) - }; - return [ - { - hd: field$2, - tl: message_body - }, - extensions, - all_types - ]; + const field$2 = { + TAG: /* Message_oneof_field */ 1, + _0: compile_oneof_p1(f._0) + }; + return [ + { + hd: field$2, + tl: message_body + }, + extensions, + all_types + ]; case /* Message_sub */ 3 : - const all_sub_types = compile_message_p1(file_name, file_options, sub_scope, f._0); - return [ - message_body, - extensions, - Stdlib.$at(all_types, all_sub_types) - ]; + const all_sub_types = compile_message_p1(file_name, file_options, sub_scope, f._0); + return [ + message_body, + extensions, + Stdlib.$at(all_types, all_sub_types) + ]; case /* Message_enum */ 4 : - return [ - message_body, - extensions, - Stdlib.$at(all_types, { - hd: compile_enum_p1(file_name, file_options, sub_scope, f._0), - tl: /* [] */ 0 - }) - ]; + return [ + message_body, + extensions, + Stdlib.$at(all_types, { + hd: compile_enum_p1(file_name, file_options, sub_scope, f._0), + tl: /* [] */ 0 + }) + ]; case /* Message_extension */ 5 : - return [ - message_body, - Stdlib.$at(extensions, f._0), - all_types - ]; + return [ + message_body, + Stdlib.$at(extensions, f._0), + all_types + ]; } }), [ @@ -4851,11 +4851,11 @@ function compile_message_p1(file_name, file_options, message_scope, param) { Stdlib__List.fold_left((function (number_index, f) { switch (f.TAG) { case /* Message_field */ 0 : - return validate_duplicate(number_index, f._0); + return validate_duplicate(number_index, f._0); case /* Message_oneof_field */ 1 : - return Stdlib__List.fold_left(validate_duplicate, number_index, f._0.oneof_fields); + return Stdlib__List.fold_left(validate_duplicate, number_index, f._0.oneof_fields); case /* Message_map_field */ 2 : - return number_index; + return number_index; } }), /* [] */ 0, message_body); @@ -4971,35 +4971,35 @@ function compile_message_p2(types, param, message) { if (/* tag */ typeof field_type === "number" || typeof field_type === "string") { switch (field_type) { case /* Field_type_double */ 0 : - return /* Field_type_double */ 0; + return /* Field_type_double */ 0; case /* Field_type_float */ 1 : - return /* Field_type_float */ 1; + return /* Field_type_float */ 1; case /* Field_type_int32 */ 2 : - return /* Field_type_int32 */ 2; + return /* Field_type_int32 */ 2; case /* Field_type_int64 */ 3 : - return /* Field_type_int64 */ 3; + return /* Field_type_int64 */ 3; case /* Field_type_uint32 */ 4 : - return /* Field_type_uint32 */ 4; + return /* Field_type_uint32 */ 4; case /* Field_type_uint64 */ 5 : - return /* Field_type_uint64 */ 5; + return /* Field_type_uint64 */ 5; case /* Field_type_sint32 */ 6 : - return /* Field_type_sint32 */ 6; + return /* Field_type_sint32 */ 6; case /* Field_type_sint64 */ 7 : - return /* Field_type_sint64 */ 7; + return /* Field_type_sint64 */ 7; case /* Field_type_fixed32 */ 8 : - return /* Field_type_fixed32 */ 8; + return /* Field_type_fixed32 */ 8; case /* Field_type_fixed64 */ 9 : - return /* Field_type_fixed64 */ 9; + return /* Field_type_fixed64 */ 9; case /* Field_type_sfixed32 */ 10 : - return /* Field_type_sfixed32 */ 10; + return /* Field_type_sfixed32 */ 10; case /* Field_type_sfixed64 */ 11 : - return /* Field_type_sfixed64 */ 11; + return /* Field_type_sfixed64 */ 11; case /* Field_type_bool */ 12 : - return /* Field_type_bool */ 12; + return /* Field_type_bool */ 12; case /* Field_type_string */ 13 : - return /* Field_type_string */ 13; + return /* Field_type_string */ 13; case /* Field_type_bytes */ 14 : - return /* Field_type_bytes */ 14; + return /* Field_type_bytes */ 14; } } else { @@ -5104,82 +5104,82 @@ function compile_message_p2(types, param, message) { const message_body = Stdlib__List.fold_left((function (message_body, field) { switch (field.TAG) { case /* Message_field */ 0 : - const field$1 = field._0; - const field_name$1 = field_name(field$1); - const field_type$1 = field_type(field$1); - const field_field_parsed = field$1.field_parsed; - const field_field_type = compile_field_p2(field_name$1, field_type$1); - const field_field_default = field$1.field_default; - const field_field_options = field$1.field_options; - const field$2 = { - field_parsed: field_field_parsed, - field_type: field_field_type, - field_default: field_field_default, - field_options: field_field_options - }; - const field_field_parsed$1 = field_field_parsed; - const field_field_type$1 = field_field_type; - const field_field_default$1 = compile_default_p2(types, field$2); - const field_field_options$1 = field_field_options; - const field$3 = { - field_parsed: field_field_parsed$1, - field_type: field_field_type$1, - field_default: field_field_default$1, - field_options: field_field_options$1 - }; - return { - hd: { - TAG: /* Message_field */ 0, - _0: field$3 - }, - tl: message_body - }; + const field$1 = field._0; + const field_name$1 = field_name(field$1); + const field_type$1 = field_type(field$1); + const field_field_parsed = field$1.field_parsed; + const field_field_type = compile_field_p2(field_name$1, field_type$1); + const field_field_default = field$1.field_default; + const field_field_options = field$1.field_options; + const field$2 = { + field_parsed: field_field_parsed, + field_type: field_field_type, + field_default: field_field_default, + field_options: field_field_options + }; + const field_field_parsed$1 = field_field_parsed; + const field_field_type$1 = field_field_type; + const field_field_default$1 = compile_default_p2(types, field$2); + const field_field_options$1 = field_field_options; + const field$3 = { + field_parsed: field_field_parsed$1, + field_type: field_field_type$1, + field_default: field_field_default$1, + field_options: field_field_options$1 + }; + return { + hd: { + TAG: /* Message_field */ 0, + _0: field$3 + }, + tl: message_body + }; case /* Message_oneof_field */ 1 : - const oneof = field._0; - const oneof_fields = Stdlib__List.fold_left((function (oneof_fields, field) { - const field_name$2 = field_name(field); - const field_type$2 = field_type(field); - const field_type$3 = compile_field_p2(field_name$2, field_type$2); - return { - hd: { - field_parsed: field.field_parsed, - field_type: field_type$3, - field_default: field.field_default, - field_options: field.field_options - }, - tl: oneof_fields - }; - }), /* [] */ 0, oneof.oneof_fields); - const oneof_fields$1 = Stdlib__List.rev(oneof_fields); - return { - hd: { - TAG: /* Message_oneof_field */ 1, - _0: { - oneof_name: oneof.oneof_name, - oneof_fields: oneof_fields$1 - } - }, - tl: message_body - }; - case /* Message_map_field */ 2 : - const map = field._0; - const map_name = map.map_name; - const map_key_type = compile_field_p2(map_name, map.map_key_type); - const map_value_type = compile_field_p2(map_name, map.map_value_type); - const resolved_map = { - TAG: /* Message_map_field */ 2, + const oneof = field._0; + const oneof_fields = Stdlib__List.fold_left((function (oneof_fields, field) { + const field_name$2 = field_name(field); + const field_type$2 = field_type(field); + const field_type$3 = compile_field_p2(field_name$2, field_type$2); + return { + hd: { + field_parsed: field.field_parsed, + field_type: field_type$3, + field_default: field.field_default, + field_options: field.field_options + }, + tl: oneof_fields + }; + }), /* [] */ 0, oneof.oneof_fields); + const oneof_fields$1 = Stdlib__List.rev(oneof_fields); + return { + hd: { + TAG: /* Message_oneof_field */ 1, _0: { - map_name: map_name, - map_number: map.map_number, - map_key_type: map_key_type, - map_value_type: map_value_type, - map_options: map.map_options + oneof_name: oneof.oneof_name, + oneof_fields: oneof_fields$1 } - }; - return { - hd: resolved_map, - tl: message_body - }; + }, + tl: message_body + }; + case /* Message_map_field */ 2 : + const map = field._0; + const map_name = map.map_name; + const map_key_type = compile_field_p2(map_name, map.map_key_type); + const map_value_type = compile_field_p2(map_name, map.map_value_type); + const resolved_map = { + TAG: /* Message_map_field */ 2, + _0: { + map_name: map_name, + map_number: map.map_number, + map_key_type: map_key_type, + map_value_type: map_value_type, + map_options: map.map_options + } + }; + return { + hd: resolved_map, + tl: message_body + }; } }), /* [] */ 0, message.message_body); @@ -5203,37 +5203,37 @@ function node_of_proto_type(param) { const sub = Stdlib__List.flatten(Stdlib__List.map((function (param) { switch (param.TAG) { case /* Message_field */ 0 : - const field_type = param._0.field_type; - if (/* tag */ typeof field_type === "number" || typeof field_type === "string") { - return /* [] */ 0; - } else { - return { - hd: field_type._0, - tl: /* [] */ 0 - }; - } + const field_type = param._0.field_type; + if (/* tag */ typeof field_type === "number" || typeof field_type === "string") { + return /* [] */ 0; + } else { + return { + hd: field_type._0, + tl: /* [] */ 0 + }; + } case /* Message_oneof_field */ 1 : - return Stdlib__List.flatten(Stdlib__List.map((function (param) { - const field_type = param.field_type; - if (/* tag */ typeof field_type === "number" || typeof field_type === "string") { - return /* [] */ 0; - } else { - return { - hd: field_type._0, - tl: /* [] */ 0 - }; - } - }), param._0.oneof_fields)); + return Stdlib__List.flatten(Stdlib__List.map((function (param) { + const field_type = param.field_type; + if (/* tag */ typeof field_type === "number" || typeof field_type === "string") { + return /* [] */ 0; + } else { + return { + hd: field_type._0, + tl: /* [] */ 0 + }; + } + }), param._0.oneof_fields)); case /* Message_map_field */ 2 : - const map_value_type = param._0.map_value_type; - if (/* tag */ typeof map_value_type === "number" || typeof map_value_type === "string") { - return /* [] */ 0; - } else { - return { - hd: map_value_type._0, - tl: /* [] */ 0 - }; - } + const map_value_type = param._0.map_value_type; + if (/* tag */ typeof map_value_type === "number" || typeof map_value_type === "string") { + return /* [] */ 0; + } else { + return { + hd: map_value_type._0, + tl: /* [] */ 0 + }; + } } }), match._0.message_body)); @@ -5273,17 +5273,17 @@ function gen_type_record(mutable_, and_, param, sc) { const is_imperative_type = function (param) { switch (param.TAG) { case /* Rft_repeated_field */ 2 : - if (param._0[0] === /* Rt_list */ 0) { - return false; - } else { - return true; - } + if (param._0[0] === /* Rt_list */ 0) { + return false; + } else { + return true; + } case /* Rft_associative_field */ 3 : - if (param._0[0] === /* At_list */ 0) { - return false; - } else { - return true; - } + if (param._0[0] === /* At_list */ 0) { + return false; + } else { + return true; + } default: return false; } @@ -5470,17 +5470,17 @@ function gen_struct$2(and_, t, scope) { const r = t.spec; switch (r.TAG) { case /* Record */ 0 : - const r$1 = r._0; - gen_type_record(undefined, and_, r$1, scope); - line$1(scope, ""); - gen_type_record(Caml_option.some(undefined), Caml_option.some(undefined), r$1, scope); - break; + const r$1 = r._0; + gen_type_record(undefined, and_, r$1, scope); + line$1(scope, ""); + gen_type_record(Caml_option.some(undefined), Caml_option.some(undefined), r$1, scope); + break; case /* Variant */ 1 : - gen_type_variant(and_, r._0, scope); - break; + gen_type_variant(and_, r._0, scope); + break; case /* Const_variant */ 2 : - gen_type_const_variant(and_, r._0, scope); - break; + gen_type_const_variant(and_, r._0, scope); + break; } return true; @@ -5490,14 +5490,14 @@ function gen_sig$2(and_, t, scope) { const r = t.spec; switch (r.TAG) { case /* Record */ 0 : - gen_type_record(undefined, and_, r._0, scope); - break; + gen_type_record(undefined, and_, r._0, scope); + break; case /* Variant */ 1 : - gen_type_variant(and_, r._0, scope); - break; + gen_type_variant(and_, r._0, scope); + break; case /* Const_variant */ 2 : - gen_type_const_variant(and_, r._0, scope); - break; + gen_type_const_variant(and_, r._0, scope); + break; } return true; @@ -5694,123 +5694,73 @@ function gen_encode_record(and_, param, sc) { const rf_label = record_field.rf_label; switch (rf_field_type.TAG) { case /* Rft_required */ 0 : - const match = rf_field_type._0; - const var_name = Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "v.%s" - }), rf_label); - return gen_encode_field_type(Caml_option.some(undefined), sc, var_name, match[1], match[2], false, match[0]); - case /* Rft_optional */ 1 : - const match$1 = rf_field_type._0; - const pk = match$1[2]; - const encoding_number = match$1[1]; - const field_type = match$1[0]; - line$1(sc, "("); - scope(sc, (function (sc) { - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "match v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " with ", - _1: /* End_of_format */ 0 - } - } - }, - _1: "match v.%s with " - }), rf_label)); - line$1(sc, Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "| Some x -> (", - _1: /* End_of_format */ 0 - }, - _1: "| Some x -> (" - })); - scope(sc, (function (sc) { - gen_encode_field_type(Caml_option.some(undefined), sc, "x", encoding_number, pk, false, field_type); - })); - line$1(sc, ")"); - line$1(sc, "| None -> ();"); - })); - return line$1(sc, ");"); - case /* Rft_repeated_field */ 2 : - const match$2 = rf_field_type._0; - const is_packed = match$2[4]; - const pk$1 = match$2[3]; - const encoding_number$1 = match$2[2]; - const field_type$1 = match$2[1]; - if (match$2[0] === /* Rt_list */ 0) { - if (is_packed) { - gen_encode_field_key(sc, encoding_number$1, pk$1, is_packed); - line$1(sc, "Pbrt.Encoder.nested (fun encoder ->"); - scope(sc, (function (sc) { - line$1(sc, "List.iter (fun x -> "); - scope(sc, (function (sc) { - gen_encode_field_type(undefined, sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); - })); - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: ") v.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: /* End_of_format */ 0 - } - } - }, - _1: ") v.%s;" - }), rf_label)); - })); - return line$1(sc, ") encoder;"); - } else { - line$1(sc, "List.iter (fun x -> "); - scope(sc, (function (sc) { - gen_encode_field_type(Caml_option.some(undefined), sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); - })); - return line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + const match = rf_field_type._0; + const var_name = Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "v.%s" + }), rf_label); + return gen_encode_field_type(Caml_option.some(undefined), sc, var_name, match[1], match[2], false, match[0]); + case /* Rft_optional */ 1 : + const match$1 = rf_field_type._0; + const pk = match$1[2]; + const encoding_number = match$1[1]; + const field_type = match$1[0]; + line$1(sc, "("); + scope(sc, (function (sc) { + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: ") v.", + _0: "match v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* String_literal */ 11, + _0: " with ", _1: /* End_of_format */ 0 } } }, - _1: ") v.%s;" + _1: "match v.%s with " }), rf_label)); - } - } else if (is_packed) { + line$1(sc, Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "| Some x -> (", + _1: /* End_of_format */ 0 + }, + _1: "| Some x -> (" + })); + scope(sc, (function (sc) { + gen_encode_field_type(Caml_option.some(undefined), sc, "x", encoding_number, pk, false, field_type); + })); + line$1(sc, ")"); + line$1(sc, "| None -> ();"); + })); + return line$1(sc, ");"); + case /* Rft_repeated_field */ 2 : + const match$2 = rf_field_type._0; + const is_packed = match$2[4]; + const pk$1 = match$2[3]; + const encoding_number$1 = match$2[2]; + const field_type$1 = match$2[1]; + if (match$2[0] === /* Rt_list */ 0) { + if (is_packed) { gen_encode_field_key(sc, encoding_number$1, pk$1, is_packed); line$1(sc, "Pbrt.Encoder.nested (fun encoder ->"); scope(sc, (function (sc) { - line$1(sc, "Pbrt.Repeated_field.iter (fun x -> "); + line$1(sc, "List.iter (fun x -> "); scope(sc, (function (sc) { gen_encode_field_type(undefined, sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); })); @@ -5834,7 +5784,7 @@ function gen_encode_record(and_, param, sc) { })); return line$1(sc, ") encoder;"); } else { - line$1(sc, "Pbrt.Repeated_field.iter (fun x -> "); + line$1(sc, "List.iter (fun x -> "); scope(sc, (function (sc) { gen_encode_field_type(Caml_option.some(undefined), sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); })); @@ -5856,69 +5806,37 @@ function gen_encode_record(and_, param, sc) { _1: ") v.%s;" }), rf_label)); } - case /* Rft_associative_field */ 3 : - const match$3 = rf_field_type._0; - const match$4 = match$3[3]; - const value_pk = match$4[1]; - const value_type = match$4[0]; - const match$5 = match$3[2]; - const key_pk = match$5[1]; - const encoding_number$2 = match$3[1]; - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "let encode_key = ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " in", - _1: /* End_of_format */ 0 - } - } - }, - _1: "let encode_key = %s in" - }), encode_basic_type(match$5[0], key_pk))); - line$1(sc, "let encode_value = (fun x encoder ->"); - scope(sc, (function (sc) { - gen_encode_field_type(undefined, sc, "x", -1, value_pk, false, value_type); - })); - line$1(sc, ") in"); - if (match$3[0] === /* At_list */ 0) { - line$1(sc, "List.iter (fun (k, v) ->"); - } else { - line$1(sc, "Hashtbl.iter (fun k v ->"); - } + } else if (is_packed) { + gen_encode_field_key(sc, encoding_number$1, pk$1, is_packed); + line$1(sc, "Pbrt.Encoder.nested (fun encoder ->"); scope(sc, (function (sc) { - gen_encode_field_key(sc, encoding_number$2, /* Pk_bytes */ 2, false); - line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + line$1(sc, "Pbrt.Repeated_field.iter (fun x -> "); + scope(sc, (function (sc) { + gen_encode_field_type(undefined, sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); + })); + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "let map_entry = (k, Pbrt.", + _0: ") v.", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "), (v, Pbrt.", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") in", - _1: /* End_of_format */ 0 - } - } + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 } } }, - _1: "let map_entry = (k, Pbrt.%s), (v, Pbrt.%s) in" - }), string_of_payload_kind(Caml_option.some(undefined), key_pk, false), string_of_payload_kind(Caml_option.some(undefined), value_pk, false))); - line$1(sc, "Pbrt.Encoder.map_entry ~encode_key ~encode_value map_entry encoder"); + _1: ") v.%s;" + }), rf_label)); + })); + return line$1(sc, ") encoder;"); + } else { + line$1(sc, "Pbrt.Repeated_field.iter (fun x -> "); + scope(sc, (function (sc) { + gen_encode_field_type(Caml_option.some(undefined), sc, "x", encoding_number$1, pk$1, is_packed, field_type$1); })); return line$1(sc, Curry._1(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, @@ -5937,57 +5855,115 @@ function gen_encode_record(and_, param, sc) { }, _1: ") v.%s;" }), rf_label)); - case /* Rft_variant_field */ 4 : - const v_constructors = rf_field_type._0.v_constructors; - line$1(sc, "("); - scope(sc, (function (sc) { - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "match v.", + } + case /* Rft_associative_field */ 3 : + const match$3 = rf_field_type._0; + const match$4 = match$3[3]; + const value_pk = match$4[1]; + const value_type = match$4[0]; + const match$5 = match$3[2]; + const key_pk = match$5[1]; + const encoding_number$2 = match$3[1]; + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "let encode_key = ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " in", + _1: /* End_of_format */ 0 + } + } + }, + _1: "let encode_key = %s in" + }), encode_basic_type(match$5[0], key_pk))); + line$1(sc, "let encode_value = (fun x encoder ->"); + scope(sc, (function (sc) { + gen_encode_field_type(undefined, sc, "x", -1, value_pk, false, value_type); + })); + line$1(sc, ") in"); + if (match$3[0] === /* At_list */ 0) { + line$1(sc, "List.iter (fun (k, v) ->"); + } else { + line$1(sc, "Hashtbl.iter (fun k v ->"); + } + scope(sc, (function (sc) { + gen_encode_field_key(sc, encoding_number$2, /* Pk_bytes */ 2, false); + line$1(sc, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "let map_entry = (k, Pbrt.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "), (v, Pbrt.", _1: { - TAG: /* String_literal */ 11, - _0: " with", - _1: /* End_of_format */ 0 + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: ") in", + _1: /* End_of_format */ 0 + } } } - }, - _1: "match v.%s with" - }), rf_label)); - Stdlib__List.iter((function (param) { - const vc_payload_kind = param.vc_payload_kind; - const vc_encoding_number = param.vc_encoding_number; - const vc_field_type = param.vc_field_type; - const vc_constructor = param.vc_constructor; - if (/* tag */ typeof vc_field_type === "number" || typeof vc_field_type === "string") { - line$1(sc, Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "| ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " -> (", - _1: /* End_of_format */ 0 - } - } - }, - _1: "| %s -> (" - }), vc_constructor)); - scope(sc, (function (sc) { - gen_encode_field_key(sc, vc_encoding_number, vc_payload_kind, false); - line$1(sc, "Pbrt.Encoder.empty_nested encoder"); - })); - return line$1(sc, ")"); - } - const field_type = vc_field_type._0; + } + }, + _1: "let map_entry = (k, Pbrt.%s), (v, Pbrt.%s) in" + }), string_of_payload_kind(Caml_option.some(undefined), key_pk, false), string_of_payload_kind(Caml_option.some(undefined), value_pk, false))); + line$1(sc, "Pbrt.Encoder.map_entry ~encode_key ~encode_value map_entry encoder"); + })); + return line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: ") v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: /* End_of_format */ 0 + } + } + }, + _1: ") v.%s;" + }), rf_label)); + case /* Rft_variant_field */ 4 : + const v_constructors = rf_field_type._0.v_constructors; + line$1(sc, "("); + scope(sc, (function (sc) { + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "match v.", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " with", + _1: /* End_of_format */ 0 + } + } + }, + _1: "match v.%s with" + }), rf_label)); + Stdlib__List.iter((function (param) { + const vc_payload_kind = param.vc_payload_kind; + const vc_encoding_number = param.vc_encoding_number; + const vc_field_type = param.vc_field_type; + const vc_constructor = param.vc_constructor; + if (/* tag */ typeof vc_field_type === "number" || typeof vc_field_type === "string") { line$1(sc, Curry._1(Stdlib__Printf.sprintf({ TAG: /* Format */ 0, _0: { @@ -5998,20 +5974,44 @@ function gen_encode_record(and_, param, sc) { _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " x -> (", + _0: " -> (", _1: /* End_of_format */ 0 } } }, - _1: "| %s x -> (" + _1: "| %s -> (" }), vc_constructor)); scope(sc, (function (sc) { - gen_encode_field_type(Caml_option.some(undefined), sc, "x", vc_encoding_number, vc_payload_kind, false, field_type); + gen_encode_field_key(sc, vc_encoding_number, vc_payload_kind, false); + line$1(sc, "Pbrt.Encoder.empty_nested encoder"); })); - line$1(sc, ")"); - }), v_constructors); - })); - return line$1(sc, ");"); + return line$1(sc, ")"); + } + const field_type = vc_field_type._0; + line$1(sc, Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "| ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " x -> (", + _1: /* End_of_format */ 0 + } + } + }, + _1: "| %s x -> (" + }), vc_constructor)); + scope(sc, (function (sc) { + gen_encode_field_type(Caml_option.some(undefined), sc, "x", vc_encoding_number, vc_payload_kind, false, field_type); + })); + line$1(sc, ")"); + }), v_constructors); + })); + return line$1(sc, ");"); } }), r_fields); @@ -6207,23 +6207,23 @@ function gen_struct$3(and_, t, sc) { let tmp; switch (r.TAG) { case /* Record */ 0 : - tmp = [ - gen_encode_record(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_encode_record(and_, r._0, sc), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - gen_encode_variant(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_encode_variant(and_, r._0, sc), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - gen_encode_const_variant(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_encode_const_variant(and_, r._0, sc), + true + ]; + break; } return tmp[1]; @@ -6278,23 +6278,23 @@ function gen_sig$3(and_, t, sc) { let tmp; switch (v.TAG) { case /* Record */ 0 : - tmp = [ - f(v._0.r_name), - true - ]; - break; + tmp = [ + f(v._0.r_name), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - f(v._0.v_name), - true - ]; - break; + tmp = [ + f(v._0.v_name), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - f(v._0.cv_name), - true - ]; - break; + tmp = [ + f(v._0.cv_name), + true + ]; + break; } return tmp[1]; @@ -6313,138 +6313,138 @@ function default_value_of_field_type(field_name, field_type, field_default) { let basic_type = field_type._0; switch (basic_type) { case /* Bt_string */ 0 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_string */ 0) { - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_string */ 0) { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '"' */34, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '"' */34, + _1: /* End_of_format */ 0 } - }, - _1: "\"%s\"" - }), field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + } + }, + _1: "\"%s\"" + }), field_default._0); } else { - return "\"\""; + return invalid_default_value(field_name, "invalid default type", undefined); } + } else { + return "\"\""; + } case /* Bt_float */ 1 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_float */ 3) { - return Stdlib.string_of_float(field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_float */ 3) { + return Stdlib.string_of_float(field_default._0); } else { - return "0."; + return invalid_default_value(field_name, "invalid default type", undefined); } + } else { + return "0."; + } case /* Bt_int */ 2 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_int */ 2) { - return String(field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_int */ 2) { + return String(field_default._0); } else { - return "0"; + return invalid_default_value(field_name, "invalid default type", undefined); } + } else { + return "0"; + } case /* Bt_int32 */ 3 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_int */ 2) { - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* 'l' */108, - _1: /* End_of_format */ 0 - } - }, - _1: "%il" - }), field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_int */ 2) { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* 'l' */108, + _1: /* End_of_format */ 0 + } + }, + _1: "%il" + }), field_default._0); } else { - return "0l"; + return invalid_default_value(field_name, "invalid default type", undefined); } + } else { + return "0l"; + } case /* Bt_int64 */ 4 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_int */ 2) { - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* 'L' */76, - _1: /* End_of_format */ 0 - } - }, - _1: "%iL" - }), field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_int */ 2) { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* 'L' */76, + _1: /* End_of_format */ 0 + } + }, + _1: "%iL" + }), field_default._0); } else { - return "0L"; + return invalid_default_value(field_name, "invalid default type", undefined); } + } else { + return "0L"; + } case /* Bt_bytes */ 5 : - if (field_default !== undefined) { - if (field_default.TAG === /* Constant_string */ 0) { - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Bytes.of_string \"", + if (field_default !== undefined) { + if (field_default.TAG === /* Constant_string */ 0) { + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Bytes.of_string \"", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '"' */34, + _1: /* End_of_format */ 0 } - }, - _1: "Bytes.of_string \"%s\"" - }), field_default._0); - } else { - return invalid_default_value(field_name, "invalid default type", undefined); - } + } + }, + _1: "Bytes.of_string \"%s\"" + }), field_default._0); } else { - return "Bytes.create 64"; - } - case /* Bt_bool */ 6 : - if (field_default === undefined) { - return "false"; - } - if (field_default.TAG !== /* Constant_bool */ 1) { return invalid_default_value(field_name, "invalid default type", undefined); } - const b = field_default._0; - if (b) { - return "true"; - } else { - return "false"; - } + } else { + return "Bytes.create 64"; + } + case /* Bt_bool */ 6 : + if (field_default === undefined) { + return "false"; + } + if (field_default.TAG !== /* Constant_bool */ 1) { + return invalid_default_value(field_name, "invalid default type", undefined); + } + const b = field_default._0; + if (b) { + return "true"; + } else { + return "false"; + } } } else { @@ -6462,91 +6462,91 @@ function record_field_default_info(record_field) { let default_value; switch (rf_field_type.TAG) { case /* Rft_required */ 0 : - const match = rf_field_type._0; - default_value = dfvft(match[0], match[3]); - break; + const match = rf_field_type._0; + default_value = dfvft(match[0], match[3]); + break; case /* Rft_optional */ 1 : - const match$1 = rf_field_type._0; - const default_value$1 = match$1[3]; - default_value = default_value$1 !== undefined ? Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Some (", + const match$1 = rf_field_type._0; + const default_value$1 = match$1[3]; + default_value = default_value$1 !== undefined ? Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Some (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Some (%s)" - }), dfvft(match$1[0], default_value$1)) : "None"; - break; + } + }, + _1: "Some (%s)" + }), dfvft(match$1[0], default_value$1)) : "None"; + break; case /* Rft_repeated_field */ 2 : - const match$2 = rf_field_type._0; - default_value = match$2[0] === /* Rt_list */ 0 ? "[]" : Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Pbrt.Repeated_field.make (", + const match$2 = rf_field_type._0; + default_value = match$2[0] === /* Rt_list */ 0 ? "[]" : Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Pbrt.Repeated_field.make (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Pbrt.Repeated_field.make (%s)" - }), dfvft(match$2[1], undefined)); - break; + } + }, + _1: "Pbrt.Repeated_field.make (%s)" + }), dfvft(match$2[1], undefined)); + break; case /* Rft_associative_field */ 3 : - default_value = rf_field_type._0[0] === /* At_list */ 0 ? "[]" : "Hashtbl.create 128"; - break; + default_value = rf_field_type._0[0] === /* At_list */ 0 ? "[]" : "Hashtbl.create 128"; + break; case /* Rft_variant_field */ 4 : - const v_constructors = rf_field_type._0.v_constructors; - if (v_constructors) { - const match$3 = v_constructors.hd; - const vc_field_type = match$3.vc_field_type; - const vc_constructor = match$3.vc_constructor; - default_value = /* tag */ typeof vc_field_type === "number" || typeof vc_field_type === "string" ? vc_constructor : Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + const v_constructors = rf_field_type._0.v_constructors; + if (v_constructors) { + const match$3 = v_constructors.hd; + const vc_field_type = match$3.vc_field_type; + const vc_constructor = match$3.vc_constructor; + default_value = /* tag */ typeof vc_field_type === "number" || typeof vc_field_type === "string" ? vc_constructor : Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " (", _1: { - TAG: /* String_literal */ 11, - _0: " (", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } - }, - _1: "%s (%s)" - }), vc_constructor, dfvft(vc_field_type._0, undefined)); - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "codegen_default.ml", - 74, - 15 - ] - }); - } - break; + } + }, + _1: "%s (%s)" + }), vc_constructor, dfvft(vc_field_type._0, undefined)); + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "codegen_default.ml", + 74, + 15 + ] + }); + } + break; } return [ @@ -6873,24 +6873,24 @@ function gen_struct$4(and_, t, sc) { let tmp; switch (r.TAG) { case /* Record */ 0 : - const r$1 = r._0; - tmp = [ - (gen_default_record(undefined, and_, r$1, sc), line$1(sc, ""), gen_default_record(Caml_option.some(undefined), Caml_option.some(undefined), r$1, sc)), - true - ]; - break; + const r$1 = r._0; + tmp = [ + (gen_default_record(undefined, and_, r$1, sc), line$1(sc, ""), gen_default_record(Caml_option.some(undefined), Caml_option.some(undefined), r$1, sc)), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - gen_default_variant(and_, r._0, sc), - true - ]; - break; + tmp = [ + gen_default_variant(and_, r._0, sc), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - gen_default_const_variant(undefined, r._0, sc), - true - ]; - break; + tmp = [ + gen_default_const_variant(undefined, r._0, sc), + true + ]; + break; } return tmp[1]; @@ -7027,23 +7027,23 @@ function gen_sig$4(and_, t, sc) { let tmp; switch (r.TAG) { case /* Record */ 0 : - tmp = [ - gen_sig_record(sc, r._0), - true - ]; - break; + tmp = [ + gen_sig_record(sc, r._0), + true + ]; + break; case /* Variant */ 1 : - tmp = [ - f(r._0.v_name), - true - ]; - break; + tmp = [ + f(r._0.v_name), + true + ]; + break; case /* Const_variant */ 2 : - tmp = [ - f(r._0.cv_name), - true - ]; - break; + tmp = [ + f(r._0.cv_name), + true + ]; + break; } return tmp[1]; @@ -7164,7 +7164,7 @@ function fix_ocaml_keyword_conflict(s) { case "when" : case "while" : case "with" : - return s + "_"; + return s + "_"; default: return s; } @@ -7230,21 +7230,21 @@ function encoding_info_of_field_type(all_types, field_type) { switch (field_type) { case /* Field_type_sint32 */ 6 : case /* Field_type_sint64 */ 7 : - return { - TAG: /* Pk_varint */ 0, - _0: true - }; + return { + TAG: /* Pk_varint */ 0, + _0: true + }; case /* Field_type_float */ 1 : case /* Field_type_fixed32 */ 8 : case /* Field_type_sfixed32 */ 10 : - return /* Pk_bits32 */ 0; + return /* Pk_bits32 */ 0; case /* Field_type_double */ 0 : case /* Field_type_fixed64 */ 9 : case /* Field_type_sfixed64 */ 11 : - return /* Pk_bits64 */ 1; + return /* Pk_bits64 */ 1; case /* Field_type_string */ 13 : case /* Field_type_bytes */ 14 : - return /* Pk_bytes */ 2; + return /* Pk_bytes */ 2; default: return { TAG: /* Pk_varint */ 0, @@ -7362,53 +7362,53 @@ function compile_field_type(field_name, all_types, file_options, field_options, switch (field_type) { case /* Field_type_double */ 0 : case /* Field_type_float */ 1 : - return { - TAG: /* Ft_basic_type */ 0, - _0: /* Bt_float */ 1 - }; + return { + TAG: /* Ft_basic_type */ 0, + _0: /* Bt_float */ 1 + }; case /* Field_type_int32 */ 2 : case /* Field_type_uint32 */ 4 : case /* Field_type_sint32 */ 6 : case /* Field_type_fixed32 */ 8 : - if (ocaml_type === "Int_t") { - return { - TAG: /* Ft_basic_type */ 0, - _0: /* Bt_int */ 2 - }; - } else { - return int32_type; - } + if (ocaml_type === "Int_t") { + return { + TAG: /* Ft_basic_type */ 0, + _0: /* Bt_int */ 2 + }; + } else { + return int32_type; + } case /* Field_type_int64 */ 3 : case /* Field_type_uint64 */ 5 : case /* Field_type_sint64 */ 7 : case /* Field_type_fixed64 */ 9 : - if (ocaml_type === "Int_t") { - return { - TAG: /* Ft_basic_type */ 0, - _0: /* Bt_int */ 2 - }; - } else { - return int64_type; - } - case /* Field_type_sfixed32 */ 10 : - return unsupported_field_type(field_name, "sfixed32", "OCaml", undefined); - case /* Field_type_sfixed64 */ 11 : - return unsupported_field_type(field_name, "sfixed64", "OCaml", undefined); - case /* Field_type_bool */ 12 : + if (ocaml_type === "Int_t") { return { TAG: /* Ft_basic_type */ 0, - _0: /* Bt_bool */ 6 + _0: /* Bt_int */ 2 }; + } else { + return int64_type; + } + case /* Field_type_sfixed32 */ 10 : + return unsupported_field_type(field_name, "sfixed32", "OCaml", undefined); + case /* Field_type_sfixed64 */ 11 : + return unsupported_field_type(field_name, "sfixed64", "OCaml", undefined); + case /* Field_type_bool */ 12 : + return { + TAG: /* Ft_basic_type */ 0, + _0: /* Bt_bool */ 6 + }; case /* Field_type_string */ 13 : - return { - TAG: /* Ft_basic_type */ 0, - _0: /* Bt_string */ 0 - }; + return { + TAG: /* Ft_basic_type */ 0, + _0: /* Bt_string */ 0 + }; case /* Field_type_bytes */ 14 : - return { - TAG: /* Ft_basic_type */ 0, - _0: /* Bt_bytes */ 5 - }; + return { + TAG: /* Ft_basic_type */ 0, + _0: /* Bt_bytes */ 5 + }; } } @@ -7564,27 +7564,27 @@ function compile(proto_definition) { const f = message_body.hd; switch (f.TAG) { case /* Message_oneof_field */ 1 : - if (!message_body.tl) { - const outer_message_names = Stdlib.$at(message_names, { - hd: message_name, - tl: /* [] */ 0 - }); - const variant = variant_of_oneof(undefined, outer_message_names, all_pbtt_msgs$1, file_options, file_name, f._0); - return { - hd: { - module_: module_, - spec: { - TAG: /* Variant */ 1, - _0: variant - } - }, - tl: /* [] */ 0 - }; - } - break; + if (!message_body.tl) { + const outer_message_names = Stdlib.$at(message_names, { + hd: message_name, + tl: /* [] */ 0 + }); + const variant = variant_of_oneof(undefined, outer_message_names, all_pbtt_msgs$1, file_options, file_name, f._0); + return { + hd: { + module_: module_, + spec: { + TAG: /* Variant */ 1, + _0: variant + } + }, + tl: /* [] */ 0 + }; + } + break; case /* Message_field */ 0 : case /* Message_map_field */ 2 : - break; + break; } const match = Stdlib__List.fold_left((function (param, field) { @@ -7592,204 +7592,204 @@ function compile(proto_definition) { const variants = param[0]; switch (field.TAG) { case /* Message_field */ 0 : - const field$1 = field._0; - const match = encoding_of_field(all_pbtt_msgs$1, field$1); - const encoding_number = match[1]; - const pk = match[0]; - const field_name$1 = field_name(field$1); - const field_options$1 = field_options(field$1); - const field_type$1 = compile_field_type(field_name$1, all_pbtt_msgs$1, file_options, field_options$1, file_name, field_type(field$1)); - const field_default$1 = field_default(field$1); - const mutable_ = is_mutable(field_name$1, field_options$1); - const match$1 = field_label(field$1); - let record_field_type; - if (match$1 === "Optional") { - record_field_type = { - TAG: /* Rft_optional */ 1, - _0: [ - field_type$1, - encoding_number, - pk, - field_default$1 - ] - }; - } else if (match$1 === "Required") { - record_field_type = { - TAG: /* Rft_required */ 0, - _0: [ - field_type$1, - encoding_number, - pk, - field_default$1 - ] - }; - } else { - const match$2 = ocaml_container(field_options$1); - let repeated_type; - if (match$2 !== undefined) { - if (match$2 === "repeated_field") { - repeated_type = /* Rt_repeated_field */ 1; - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid ocaml_container attribute value" - }); - } + const field$1 = field._0; + const match = encoding_of_field(all_pbtt_msgs$1, field$1); + const encoding_number = match[1]; + const pk = match[0]; + const field_name$1 = field_name(field$1); + const field_options$1 = field_options(field$1); + const field_type$1 = compile_field_type(field_name$1, all_pbtt_msgs$1, file_options, field_options$1, file_name, field_type(field$1)); + const field_default$1 = field_default(field$1); + const mutable_ = is_mutable(field_name$1, field_options$1); + const match$1 = field_label(field$1); + let record_field_type; + if (match$1 === "Optional") { + record_field_type = { + TAG: /* Rft_optional */ 1, + _0: [ + field_type$1, + encoding_number, + pk, + field_default$1 + ] + }; + } else if (match$1 === "Required") { + record_field_type = { + TAG: /* Rft_required */ 0, + _0: [ + field_type$1, + encoding_number, + pk, + field_default$1 + ] + }; + } else { + const match$2 = ocaml_container(field_options$1); + let repeated_type; + if (match$2 !== undefined) { + if (match$2 === "repeated_field") { + repeated_type = /* Rt_repeated_field */ 1; } else { - repeated_type = /* Rt_list */ 0; + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid ocaml_container attribute value" + }); } - record_field_type = { - TAG: /* Rft_repeated_field */ 2, - _0: [ - repeated_type, - field_type$1, - encoding_number, - pk, - match[2] - ] - }; + } else { + repeated_type = /* Rt_list */ 0; } - const record_field_rf_label = label_name_of_field_name(field_name$1); - const record_field = { - rf_label: record_field_rf_label, - rf_field_type: record_field_type, - rf_mutable: mutable_ + record_field_type = { + TAG: /* Rft_repeated_field */ 2, + _0: [ + repeated_type, + field_type$1, + encoding_number, + pk, + match[2] + ] }; - return [ - variants, - { - hd: record_field, - tl: fields - } - ]; + } + const record_field_rf_label = label_name_of_field_name(field_name$1); + const record_field = { + rf_label: record_field_rf_label, + rf_field_type: record_field_type, + rf_mutable: mutable_ + }; + return [ + variants, + { + hd: record_field, + tl: fields + } + ]; case /* Message_oneof_field */ 1 : - const field$2 = field._0; - const outer_message_names = Stdlib.$at(message_names, { - hd: message_name, - tl: /* [] */ 0 - }); - const variant = variant_of_oneof(Caml_option.some(undefined), outer_message_names, all_pbtt_msgs$1, file_options, file_name, field$2); - const record_field_rf_label$1 = label_name_of_field_name(field$2.oneof_name); - const record_field_rf_field_type = { - TAG: /* Rft_variant_field */ 4, + const field$2 = field._0; + const outer_message_names = Stdlib.$at(message_names, { + hd: message_name, + tl: /* [] */ 0 + }); + const variant = variant_of_oneof(Caml_option.some(undefined), outer_message_names, all_pbtt_msgs$1, file_options, file_name, field$2); + const record_field_rf_label$1 = label_name_of_field_name(field$2.oneof_name); + const record_field_rf_field_type = { + TAG: /* Rft_variant_field */ 4, + _0: variant + }; + const record_field$1 = { + rf_label: record_field_rf_label$1, + rf_field_type: record_field_rf_field_type, + rf_mutable: false + }; + const variants_0 = { + module_: module_, + spec: { + TAG: /* Variant */ 1, _0: variant - }; - const record_field$1 = { - rf_label: record_field_rf_label$1, - rf_field_type: record_field_rf_field_type, - rf_mutable: false - }; - const variants_0 = { - module_: module_, - spec: { - TAG: /* Variant */ 1, - _0: variant - } - }; - const variants$1 = { - hd: variants_0, - tl: variants - }; - const fields$1 = { - hd: record_field$1, - tl: fields - }; - return [ - variants$1, - fields$1 - ]; - case /* Message_map_field */ 2 : - const mf = field._0; - const map_options = mf.map_options; - const map_value_type = mf.map_value_type; - const map_key_type = mf.map_key_type; - const map_name = mf.map_name; - const key_type = compile_field_type(Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "key of ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "key of %s" - }), map_name), all_pbtt_msgs$1, file_options, map_options, file_name, map_key_type); - const key_pk = encoding_info_of_field_type(all_pbtt_msgs$1, map_key_type); - let key_type$1; - if (/* tag */ typeof key_type === "number" || typeof key_type === "string") { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Only Basic Types are supported for map keys" - }); } - if (key_type.TAG === /* Ft_basic_type */ 0) { - key_type$1 = key_type._0; + }; + const variants$1 = { + hd: variants_0, + tl: variants + }; + const fields$1 = { + hd: record_field$1, + tl: fields + }; + return [ + variants$1, + fields$1 + ]; + case /* Message_map_field */ 2 : + const mf = field._0; + const map_options = mf.map_options; + const map_value_type = mf.map_value_type; + const map_key_type = mf.map_key_type; + const map_name = mf.map_name; + const key_type = compile_field_type(Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "key of ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "key of %s" + }), map_name), all_pbtt_msgs$1, file_options, map_options, file_name, map_key_type); + const key_pk = encoding_info_of_field_type(all_pbtt_msgs$1, map_key_type); + let key_type$1; + if (/* tag */ typeof key_type === "number" || typeof key_type === "string") { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Only Basic Types are supported for map keys" + }); + } + if (key_type.TAG === /* Ft_basic_type */ 0) { + key_type$1 = key_type._0; + } else { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Only Basic Types are supported for map keys" + }); + } + const value_type = compile_field_type(Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "value of ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "value of %s" + }), map_name), all_pbtt_msgs$1, file_options, map_options, file_name, map_value_type); + const value_pk = encoding_info_of_field_type(all_pbtt_msgs$1, map_value_type); + const match$3 = ocaml_container(map_options); + let associative_type; + if (match$3 !== undefined) { + if (match$3 === "hashtbl") { + associative_type = /* At_hashtable */ 1; } else { throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", - _1: "Only Basic Types are supported for map keys" + _1: "Invalid ocaml_container attribute value for map" }); } - const value_type = compile_field_type(Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "value of ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "value of %s" - }), map_name), all_pbtt_msgs$1, file_options, map_options, file_name, map_value_type); - const value_pk = encoding_info_of_field_type(all_pbtt_msgs$1, map_value_type); - const match$3 = ocaml_container(map_options); - let associative_type; - if (match$3 !== undefined) { - if (match$3 === "hashtbl") { - associative_type = /* At_hashtable */ 1; - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid ocaml_container attribute value for map" - }); - } - } else { - associative_type = /* At_list */ 0; - } - const record_field_type$1 = { - TAG: /* Rft_associative_field */ 3, - _0: [ - associative_type, - mf.map_number, - [ - key_type$1, - key_pk - ], - [ - value_type, - value_pk - ] + } else { + associative_type = /* At_list */ 0; + } + const record_field_type$1 = { + TAG: /* Rft_associative_field */ 3, + _0: [ + associative_type, + mf.map_number, + [ + key_type$1, + key_pk + ], + [ + value_type, + value_pk ] - }; - const record_field_rf_label$2 = label_name_of_field_name(map_name); - const record_field_rf_mutable = is_mutable(map_name, map_options); - const record_field$2 = { - rf_label: record_field_rf_label$2, - rf_field_type: record_field_type$1, - rf_mutable: record_field_rf_mutable - }; - return [ - variants, - { - hd: record_field$2, - tl: fields - } - ]; + ] + }; + const record_field_rf_label$2 = label_name_of_field_name(map_name); + const record_field_rf_mutable = is_mutable(map_name, map_options); + const record_field$2 = { + rf_label: record_field_rf_label$2, + rf_field_type: record_field_type$1, + rf_mutable: record_field_rf_mutable + }; + return [ + variants, + { + hd: record_field$2, + tl: fields + } + ]; } }), [ diff --git a/jscomp/test/dist/jscomp/test/ocaml_re_test.js b/jscomp/test/dist/jscomp/test/ocaml_re_test.js index bd02cc2e96..df52ffdd64 100644 --- a/jscomp/test/dist/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/dist/jscomp/test/ocaml_re_test.js @@ -797,26 +797,26 @@ function rename(ids, x) { } switch (l.TAG) { case /* Alt */ 1 : - return mk_expr(ids, { - TAG: /* Alt */ 1, - _0: Stdlib__List.map((function (param) { - return rename(ids, param); - }), l._0) - }); + return mk_expr(ids, { + TAG: /* Alt */ 1, + _0: Stdlib__List.map((function (param) { + return rename(ids, param); + }), l._0) + }); case /* Seq */ 2 : - return mk_expr(ids, { - TAG: /* Seq */ 2, - _0: l._0, - _1: rename(ids, l._1), - _2: rename(ids, l._2) - }); + return mk_expr(ids, { + TAG: /* Seq */ 2, + _0: l._0, + _1: rename(ids, l._1), + _2: rename(ids, l._2) + }); case /* Rep */ 3 : - return mk_expr(ids, { - TAG: /* Rep */ 3, - _0: l._0, - _1: l._1, - _2: rename(ids, l._2) - }); + return mk_expr(ids, { + TAG: /* Rep */ 3, + _0: l._0, + _1: l._1, + _2: rename(ids, l._2) + }); default: return mk_expr(ids, x.def); } @@ -836,65 +836,65 @@ function equal(_l1, _l2) { const marks1 = l1.hd; switch (marks1.TAG) { case /* TSeq */ 0 : - if (!l2) { + if (!l2) { + return false; + } + const match = l2.hd; + switch (match.TAG) { + case /* TSeq */ 0 : + if (marks1._1.id !== match._1.id) { + return false; + } + if (!equal(marks1._0, match._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + case /* TExp */ 1 : + case /* TMatch */ 2 : return false; - } - const match = l2.hd; - switch (match.TAG) { - case /* TSeq */ 0 : - if (marks1._1.id !== match._1.id) { - return false; - } - if (!equal(marks1._0, match._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - case /* TExp */ 1 : - case /* TMatch */ 2 : - return false; - - } + + } case /* TExp */ 1 : - if (!l2) { + if (!l2) { + return false; + } + const match$1 = l2.hd; + switch (match$1.TAG) { + case /* TExp */ 1 : + if (marks1._1.id !== match$1._1.id) { + return false; + } + if (!Caml_obj.caml_equal(marks1._0, match$1._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + case /* TSeq */ 0 : + case /* TMatch */ 2 : return false; - } - const match$1 = l2.hd; - switch (match$1.TAG) { - case /* TExp */ 1 : - if (marks1._1.id !== match$1._1.id) { - return false; - } - if (!Caml_obj.caml_equal(marks1._0, match$1._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - case /* TSeq */ 0 : - case /* TMatch */ 2 : - return false; - - } + + } case /* TMatch */ 2 : - if (!l2) { + if (!l2) { + return false; + } + const marks2 = l2.hd; + switch (marks2.TAG) { + case /* TSeq */ 0 : + case /* TExp */ 1 : return false; - } - const marks2 = l2.hd; - switch (marks2.TAG) { - case /* TSeq */ 0 : - case /* TExp */ 1 : - return false; - case /* TMatch */ 2 : - if (!Caml_obj.caml_equal(marks1._0, marks2._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - - } + case /* TMatch */ 2 : + if (!Caml_obj.caml_equal(marks1._0, marks2._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + + } } }; @@ -910,17 +910,17 @@ function hash$1(_l, _accu) { const marks = l.hd; switch (marks.TAG) { case /* TSeq */ 0 : - _accu = hash_combine(388635598, hash_combine(marks._1.id, hash$1(marks._0, accu))); - _l = l.tl; - continue; + _accu = hash_combine(388635598, hash_combine(marks._1.id, hash$1(marks._0, accu))); + _l = l.tl; + continue; case /* TExp */ 1 : - _accu = hash_combine(726404471, hash_combine(marks._1.id, hash(marks._0, accu))); - _l = l.tl; - continue; + _accu = hash_combine(726404471, hash_combine(marks._1.id, hash(marks._0, accu))); + _l = l.tl; + continue; case /* TMatch */ 2 : - _accu = hash_combine(471882453, hash(marks._0, accu)); - _l = l.tl; - continue; + _accu = hash_combine(471882453, hash(marks._0, accu)); + _l = l.tl; + continue; } }; @@ -933,21 +933,21 @@ function tseq(kind, x, y, rem) { const match = x.hd; switch (match.TAG) { case /* TExp */ 1 : - let tmp = match._1.def; - if (/* tag */ (typeof tmp === "number" || typeof tmp === "string") && !x.tl) { - return { - hd: { - TAG: /* TExp */ 1, - _0: match._0, - _1: y - }, - tl: rem - }; - } - break; + let tmp = match._1.def; + if (/* tag */ (typeof tmp === "number" || typeof tmp === "string") && !x.tl) { + return { + hd: { + TAG: /* TExp */ 1, + _0: match._0, + _1: y + }, + tl: rem + }; + } + break; case /* TSeq */ 0 : case /* TMatch */ 2 : - break; + break; } return { @@ -1020,10 +1020,10 @@ function mark_used_indices(tbl) { return Stdlib__List.iter((function (param) { switch (param.TAG) { case /* TSeq */ 0 : - return mark_used_indices(tbl)(param._0); + return mark_used_indices(tbl)(param._0); case /* TExp */ 1 : case /* TMatch */ 2 : - break; + break; } Stdlib__List.iter((function (param) { @@ -1065,9 +1065,9 @@ function remove_matches(param) { switch (param.TAG) { case /* TSeq */ 0 : case /* TExp */ 1 : - return true; + return true; case /* TMatch */ 2 : - return false; + return false; } }), param); @@ -1082,17 +1082,17 @@ function split_at_match_rec(_l$p, _param) { switch (x.TAG) { case /* TSeq */ 0 : case /* TExp */ 1 : - _param = param.tl; - _l$p = { - hd: x, - tl: l$p - }; - continue; + _param = param.tl; + _l$p = { + hd: x, + tl: l$p + }; + continue; case /* TMatch */ 2 : - return [ - Stdlib__List.rev(l$p), - remove_matches(param.tl) - ]; + return [ + Stdlib__List.rev(l$p), + remove_matches(param.tl) + ]; } } else { @@ -1120,58 +1120,58 @@ function remove_duplicates(prev, _l, y) { const x = l.hd; switch (x.TAG) { case /* TSeq */ 0 : - const x$1 = x._1; - const match = remove_duplicates(prev, x._0, x$1); - const match$1 = remove_duplicates(match[1], l.tl, y); - return [ - tseq(x._2, match[0], x$1, match$1[0]), - match$1[1] - ]; + const x$1 = x._1; + const match = remove_duplicates(prev, x._0, x$1); + const match$1 = remove_duplicates(match[1], l.tl, y); + return [ + tseq(x._2, match[0], x$1, match$1[0]), + match$1[1] + ]; case /* TExp */ 1 : - let tmp = x._1.def; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - const r = l.tl; - if (Stdlib__List.memq(y.id, prev)) { - _l = r; - continue; - } - const match$2 = remove_duplicates({ - hd: y.id, - tl: prev - }, r, y); - return [ - { - hd: x, - tl: match$2[0] - }, - match$2[1] - ]; - } - const r$1 = l.tl; - const x$2 = x._1; - if (Stdlib__List.memq(x$2.id, prev)) { - _l = r$1; + let tmp = x._1.def; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + const r = l.tl; + if (Stdlib__List.memq(y.id, prev)) { + _l = r; continue; } - const match$3 = remove_duplicates({ - hd: x$2.id, + const match$2 = remove_duplicates({ + hd: y.id, tl: prev - }, r$1, y); + }, r, y); return [ { hd: x, - tl: match$3[0] + tl: match$2[0] }, - match$3[1] + match$2[1] ]; + } + const r$1 = l.tl; + const x$2 = x._1; + if (Stdlib__List.memq(x$2.id, prev)) { + _l = r$1; + continue; + } + const match$3 = remove_duplicates({ + hd: x$2.id, + tl: prev + }, r$1, y); + return [ + { + hd: x, + tl: match$3[0] + }, + match$3[1] + ]; case /* TMatch */ 2 : - return [ - { - hd: x, - tl: /* [] */ 0 - }, - prev - ]; + return [ + { + hd: x, + tl: /* [] */ 0 + }, + prev + ]; } }; @@ -1184,32 +1184,32 @@ function set_idx(idx, param) { const marks = param.hd; switch (marks.TAG) { case /* TSeq */ 0 : - return { - hd: { - TAG: /* TSeq */ 0, - _0: set_idx(idx, marks._0), - _1: marks._1, - _2: marks._2 - }, - tl: set_idx(idx, param.tl) - }; + return { + hd: { + TAG: /* TSeq */ 0, + _0: set_idx(idx, marks._0), + _1: marks._1, + _2: marks._2 + }, + tl: set_idx(idx, param.tl) + }; case /* TExp */ 1 : - return { - hd: { - TAG: /* TExp */ 1, - _0: marks_set_idx$1(marks._0, idx), - _1: marks._1 - }, - tl: set_idx(idx, param.tl) - }; + return { + hd: { + TAG: /* TExp */ 1, + _0: marks_set_idx$1(marks._0, idx), + _1: marks._1 + }, + tl: set_idx(idx, param.tl) + }; case /* TMatch */ 2 : - return { - hd: { - TAG: /* TMatch */ 2, - _0: marks_set_idx$1(marks._0, idx) - }, - tl: set_idx(idx, param.tl) - }; + return { + hd: { + TAG: /* TMatch */ 2, + _0: marks_set_idx$1(marks._0, idx) + }, + tl: set_idx(idx, param.tl) + }; } } @@ -1241,128 +1241,128 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { } switch (s.TAG) { case /* Cst */ 0 : - if (mem(c, s._0)) { - return { - hd: { - TAG: /* TExp */ 1, - _0: marks, - _1: eps_expr - }, - tl: rem - }; - } else { - return rem; - } + if (mem(c, s._0)) { + return { + hd: { + TAG: /* TExp */ 1, + _0: marks, + _1: eps_expr + }, + tl: rem + }; + } else { + return rem; + } case /* Alt */ 1 : - return delta_2(marks, c, next_cat, prev_cat, s._0, rem); + return delta_2(marks, c, next_cat, prev_cat, s._0, rem); case /* Seq */ 2 : - const y$p = delta_1(marks, c, next_cat, prev_cat, s._1, /* [] */ 0); - return delta_seq(c, next_cat, prev_cat, s._0, y$p, s._2, rem); + const y$p = delta_1(marks, c, next_cat, prev_cat, s._1, /* [] */ 0); + return delta_seq(c, next_cat, prev_cat, s._0, y$p, s._2, rem); case /* Rep */ 3 : - const kind = s._1; - const y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */ 0); - const marks$p = first((function (marks) { - switch (marks.TAG) { - case /* TSeq */ 0 : - case /* TExp */ 1 : - return; - case /* TMatch */ 2 : - return marks._0; - - } - }), y$p$1); - const match = marks$p !== undefined ? [ - remove_matches(y$p$1), - marks$p - ] : [ - y$p$1, - marks - ]; - const y$p$p = match[0]; - if (s._0 === "Non_greedy") { - return { - hd: { - TAG: /* TMatch */ 2, - _0: marks - }, - tl: tseq(kind, y$p$p, x, rem) - }; - } else { - return tseq(kind, y$p$p, x, { - hd: { - TAG: /* TMatch */ 2, - _0: match[1] - }, - tl: rem - }); - } - case /* Mark */ 4 : - const i = s._0; - const marks_marks = { - hd: [ - i, - -1 - ], - tl: Stdlib__List.remove_assq(i, marks.marks) - }; - const marks_pmarks = marks.pmarks; - const marks$1 = { - marks: marks_marks, - pmarks: marks_pmarks - }; + const kind = s._1; + const y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */ 0); + const marks$p = first((function (marks) { + switch (marks.TAG) { + case /* TSeq */ 0 : + case /* TExp */ 1 : + return; + case /* TMatch */ 2 : + return marks._0; + + } + }), y$p$1); + const match = marks$p !== undefined ? [ + remove_matches(y$p$1), + marks$p + ] : [ + y$p$1, + marks + ]; + const y$p$p = match[0]; + if (s._0 === "Non_greedy") { return { hd: { TAG: /* TMatch */ 2, - _0: marks$1 + _0: marks }, - tl: rem + tl: tseq(kind, y$p$p, x, rem) }; + } else { + return tseq(kind, y$p$p, x, { + hd: { + TAG: /* TMatch */ 2, + _0: match[1] + }, + tl: rem + }); + } + case /* Mark */ 4 : + const i = s._0; + const marks_marks = { + hd: [ + i, + -1 + ], + tl: Stdlib__List.remove_assq(i, marks.marks) + }; + const marks_pmarks = marks.pmarks; + const marks$1 = { + marks: marks_marks, + pmarks: marks_pmarks + }; + return { + hd: { + TAG: /* TMatch */ 2, + _0: marks$1 + }, + tl: rem + }; case /* Erase */ 5 : + return { + hd: { + TAG: /* TMatch */ 2, + _0: filter_marks(s._0, s._1, marks) + }, + tl: rem + }; + case /* Before */ 6 : + if (intersect(next_cat, s._0)) { return { hd: { TAG: /* TMatch */ 2, - _0: filter_marks(s._0, s._1, marks) + _0: marks }, tl: rem }; - case /* Before */ 6 : - if (intersect(next_cat, s._0)) { - return { - hd: { - TAG: /* TMatch */ 2, - _0: marks - }, - tl: rem - }; - } else { - return rem; - } + } else { + return rem; + } case /* After */ 7 : - if (intersect(prev_cat, s._0)) { - return { - hd: { - TAG: /* TMatch */ 2, - _0: marks - }, - tl: rem - }; - } else { - return rem; - } - case /* Pmark */ 8 : - const marks_marks$1 = marks.marks; - const marks_pmarks$1 = Curry._2(add$1, s._0, marks.pmarks); - const marks$2 = { - marks: marks_marks$1, - pmarks: marks_pmarks$1 - }; + if (intersect(prev_cat, s._0)) { return { hd: { TAG: /* TMatch */ 2, - _0: marks$2 + _0: marks }, tl: rem }; + } else { + return rem; + } + case /* Pmark */ 8 : + const marks_marks$1 = marks.marks; + const marks_pmarks$1 = Curry._2(add$1, s._0, marks.pmarks); + const marks$2 = { + marks: marks_marks$1, + pmarks: marks_pmarks$1 + }; + return { + hd: { + TAG: /* TMatch */ 2, + _0: marks$2 + }, + tl: rem + }; } } @@ -1380,9 +1380,9 @@ function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { switch (marks.TAG) { case /* TSeq */ 0 : case /* TExp */ 1 : - return; + return; case /* TMatch */ 2 : - return marks._0; + return marks._0; } }), y); @@ -1405,15 +1405,15 @@ function delta_4(c, next_cat, prev_cat, l, rem) { let rem$1 = delta_4(c, next_cat, prev_cat, l.tl, rem); switch (x.TAG) { case /* TSeq */ 0 : - const y$p = delta_4(c, next_cat, prev_cat, x._0, /* [] */ 0); - return delta_seq(c, next_cat, prev_cat, x._2, y$p, x._1, rem$1); + const y$p = delta_4(c, next_cat, prev_cat, x._0, /* [] */ 0); + return delta_seq(c, next_cat, prev_cat, x._2, y$p, x._1, rem$1); case /* TExp */ 1 : - return delta_1(x._0, c, next_cat, prev_cat, x._1, rem$1); + return delta_1(x._0, c, next_cat, prev_cat, x._1, rem$1); case /* TMatch */ 2 : - return { - hd: x, - tl: rem$1 - }; + return { + hd: x, + tl: rem$1 + }; } } else { @@ -1453,16 +1453,16 @@ function status(s) { switch (m.TAG) { case /* TSeq */ 0 : case /* TExp */ 1 : - st$1 = /* Running */ 1; - break; + st$1 = /* Running */ 1; + break; case /* TMatch */ 2 : - const m$1 = m._0; - st$1 = { - TAG: /* Match */ 0, - _0: flatten_match(m$1.marks), - _1: m$1.pmarks - }; - break; + const m$1 = m._0; + st$1 = { + TAG: /* Match */ 0, + _0: flatten_match(m$1.marks), + _1: m$1.pmarks + }; + break; } } else { @@ -1770,26 +1770,26 @@ function is_charset(_param) { } switch (param.TAG) { case /* Set */ 0 : - return true; + return true; case /* Sem */ 4 : case /* Sem_greedy */ 5 : - _param = param._1; - continue; + _param = param._1; + continue; case /* No_group */ 7 : case /* Case */ 9 : case /* No_case */ 10 : - _param = param._0; - continue; + _param = param._0; + continue; case /* Alternative */ 2 : case /* Intersection */ 11 : case /* Complement */ 12 : - return Stdlib__List.for_all(is_charset, param._0); + return Stdlib__List.for_all(is_charset, param._0); case /* Difference */ 13 : - if (!is_charset(param._0)) { - return false; - } - _param = param._1; - continue; + if (!is_charset(param._0)) { + return false; + } + _param = param._1; + continue; default: return false; } @@ -1858,45 +1858,45 @@ function colorize(c, regexp) { switch (regexp) { case /* Beg_of_line */ 0 : case /* End_of_line */ 1 : - return split({ - hd: [ - /* '\n' */10, - /* '\n' */10 - ], - tl: /* [] */ 0 - }, c); + return split({ + hd: [ + /* '\n' */10, + /* '\n' */10 + ], + tl: /* [] */ 0 + }, c); case /* Beg_of_word */ 2 : case /* End_of_word */ 3 : case /* Not_bound */ 4 : - return split(cword, c); + return split(cword, c); case /* Last_end_of_line */ 7 : - lnl.contents = true; - return; + lnl.contents = true; + return; case /* Beg_of_str */ 5 : case /* End_of_str */ 6 : case /* Start */ 8 : case /* Stop */ 9 : - return; + return; } } else { switch (regexp.TAG) { case /* Set */ 0 : - return split(regexp._0, c); + return split(regexp._0, c); case /* Sequence */ 1 : case /* Alternative */ 2 : - return Stdlib__List.iter(colorize$1, regexp._0); + return Stdlib__List.iter(colorize$1, regexp._0); case /* Repeat */ 3 : case /* Group */ 6 : case /* No_group */ 7 : case /* Nest */ 8 : - _regexp = regexp._0; - continue; + _regexp = regexp._0; + continue; case /* Sem */ 4 : case /* Sem_greedy */ 5 : case /* Pmark */ 14 : - _regexp = regexp._1; - continue; + _regexp = regexp._1; + continue; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -1941,209 +1941,209 @@ function equal$2(_x1, _x2) { if (/* tag */ typeof x1 === "number" || typeof x1 === "string") { switch (x1) { case /* Beg_of_line */ 0 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_line */ 0) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_line */ 0) { + return true; + } else { + return false; + } case /* End_of_line */ 1 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_line */ 1) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_line */ 1) { + return true; + } else { + return false; + } case /* Beg_of_word */ 2 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_word */ 2) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_word */ 2) { + return true; + } else { + return false; + } case /* End_of_word */ 3 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_word */ 3) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_word */ 3) { + return true; + } else { + return false; + } case /* Not_bound */ 4 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Not_bound */ 4) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Not_bound */ 4) { + return true; + } else { + return false; + } case /* Beg_of_str */ 5 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_str */ 5) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Beg_of_str */ 5) { + return true; + } else { + return false; + } case /* End_of_str */ 6 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_str */ 6) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* End_of_str */ 6) { + return true; + } else { + return false; + } case /* Last_end_of_line */ 7 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Last_end_of_line */ 7) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Last_end_of_line */ 7) { + return true; + } else { + return false; + } case /* Start */ 8 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Start */ 8) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Start */ 8) { + return true; + } else { + return false; + } case /* Stop */ 9 : - if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Stop */ 9) { - return true; - } else { - return false; - } + if (/* tag */ (typeof x2 === "number" || typeof x2 === "string") && x2 === /* Stop */ 9) { + return true; + } else { + return false; + } } } else { switch (x1.TAG) { case /* Set */ 0 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Set */ 0) { - return false; - } else { - return Caml_obj.caml_equal(x1._0, x2._0); - } + if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Set */ 0) { + return false; + } else { + return Caml_obj.caml_equal(x1._0, x2._0); + } case /* Sequence */ 1 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Sequence */ 1) { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Sequence */ 1) { + return false; + } else { + return eq_list(x1._0, x2._0); + } case /* Alternative */ 2 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Alternative */ 2) { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Alternative */ 2) { + return false; + } else { + return eq_list(x1._0, x2._0); + } case /* Repeat */ 3 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Repeat */ 3) { - return false; - } - if (x1._1 !== x2._1) { - return false; - } - if (!Caml_obj.caml_equal(x1._2, x2._2)) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Repeat */ 3) { + return false; + } + if (x1._1 !== x2._1) { + return false; + } + if (!Caml_obj.caml_equal(x1._2, x2._2)) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case /* Sem */ 4 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Sem */ 4) { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Sem */ 4) { + return false; + } + if (x1._0 !== x2._0) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; case /* Sem_greedy */ 5 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Sem_greedy */ 5) { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; - case /* Group */ 6 : + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Sem_greedy */ 5) { + return false; + } + if (x1._0 !== x2._0) { return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; + case /* Group */ 6 : + return false; case /* No_group */ 7 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* No_group */ 7) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* No_group */ 7) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case /* Nest */ 8 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Nest */ 8) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Nest */ 8) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case /* Case */ 9 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Case */ 9) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Case */ 9) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case /* No_case */ 10 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* No_case */ 10) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* No_case */ 10) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case /* Intersection */ 11 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Intersection */ 11) { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Intersection */ 11) { + return false; + } else { + return eq_list(x1._0, x2._0); + } case /* Complement */ 12 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Complement */ 12) { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (/* tag */ typeof x2 === "number" || typeof x2 === "string" || x2.TAG !== /* Complement */ 12) { + return false; + } else { + return eq_list(x1._0, x2._0); + } case /* Difference */ 13 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Difference */ 13) { - return false; - } - if (!equal$2(x1._0, x2._0)) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Difference */ 13) { + return false; + } + if (!equal$2(x1._0, x2._0)) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; case /* Pmark */ 14 : - if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { - return false; - } - if (x2.TAG !== /* Pmark */ 14) { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; + if (/* tag */ typeof x2 === "number" || typeof x2 === "string") { + return false; + } + if (x2.TAG !== /* Pmark */ 14) { + return false; + } + if (x1._0 !== x2._0) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; } } @@ -2194,69 +2194,69 @@ function merge_sequences(_param) { if (!/* tag */ (typeof l$p === "number" || typeof l$p === "string")) { switch (l$p.TAG) { case /* Sequence */ 1 : - const match = l$p._0; - if (match) { - const y = match.tl; - const x = match.hd; - const r$p = merge_sequences(param.tl); - let exit = 0; - if (r$p) { - const match$1 = r$p.hd; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Sequence */ 1) { - exit = 2; - } else { - const match$2 = match$1._0; - if (match$2) { - if (equal$2(x, match$2.hd)) { - return { - hd: { - TAG: /* Sequence */ 1, - _0: { - hd: x, - tl: { - hd: { - TAG: /* Alternative */ 2, - _0: { - hd: sequence(y), - tl: { - hd: sequence(match$2.tl), - tl: /* [] */ 0 - } + const match = l$p._0; + if (match) { + const y = match.tl; + const x = match.hd; + const r$p = merge_sequences(param.tl); + let exit = 0; + if (r$p) { + const match$1 = r$p.hd; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Sequence */ 1) { + exit = 2; + } else { + const match$2 = match$1._0; + if (match$2) { + if (equal$2(x, match$2.hd)) { + return { + hd: { + TAG: /* Sequence */ 1, + _0: { + hd: x, + tl: { + hd: { + TAG: /* Alternative */ 2, + _0: { + hd: sequence(y), + tl: { + hd: sequence(match$2.tl), + tl: /* [] */ 0 } - }, - tl: /* [] */ 0 - } + } + }, + tl: /* [] */ 0 } - }, - tl: r$p.tl - }; - } - exit = 2; - } else { - exit = 2; + } + }, + tl: r$p.tl + }; } + exit = 2; + } else { + exit = 2; } - } else { - exit = 2; - } - if (exit === 2) { - return { - hd: { - TAG: /* Sequence */ 1, - _0: { - hd: x, - tl: y - } - }, - tl: r$p - }; } - + } else { + exit = 2; } - break; + if (exit === 2) { + return { + hd: { + TAG: /* Sequence */ 1, + _0: { + hd: x, + tl: y + } + }, + tl: r$p + }; + } + + } + break; case /* Alternative */ 2 : - _param = Stdlib.$at(l$p._0, param.tl); - continue; + _param = Stdlib.$at(l$p._0, param.tl); + continue; } } @@ -2283,52 +2283,60 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _s) if (/* tag */ typeof s === "number" || typeof s === "string") { switch (s) { case /* Beg_of_line */ 0 : - const c$1 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); - return [ - mk_expr(ids, { - TAG: /* After */ 7, - _0: c$1 - }), - kind - ]; + const c$1 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); + return [ + mk_expr(ids, { + TAG: /* After */ 7, + _0: c$1 + }), + kind + ]; case /* End_of_line */ 1 : - const c$2 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); - return [ - mk_expr(ids, { - TAG: /* Before */ 6, - _0: c$2 - }), - kind - ]; + const c$2 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); + return [ + mk_expr(ids, { + TAG: /* Before */ 6, + _0: c$2 + }), + kind + ]; case /* Beg_of_word */ 2 : - const c$3 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.not_letter); - const 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 */ 7, - _0: c$3 - }), mk_expr(ids, { - TAG: /* Before */ 6, - _0: c$4 - })), - kind - ]; + const c$3 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.not_letter); + const 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 */ 7, + _0: c$3 + }), mk_expr(ids, { + TAG: /* Before */ 6, + _0: c$4 + })), + kind + ]; case /* End_of_word */ 3 : - const c$5 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.letter); - const 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 */ 7, - _0: c$5 - }), mk_expr(ids, { - TAG: /* Before */ 6, - _0: c$6 - })), - kind - ]; + const c$5 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.letter); + const 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 */ 7, + _0: c$5 + }), mk_expr(ids, { + TAG: /* Before */ 6, + _0: c$6 + })), + kind + ]; case /* Not_bound */ 4 : - return [ - alt(ids, { + return [ + alt(ids, { + hd: seq$1(ids, "First", mk_expr(ids, { + TAG: /* After */ 7, + _0: Re_automata_Category.letter + }), mk_expr(ids, { + TAG: /* Before */ 6, + _0: Re_automata_Category.letter + })), + tl: { hd: seq$1(ids, "First", mk_expr(ids, { TAG: /* After */ 7, _0: Re_automata_Category.letter @@ -2336,185 +2344,177 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _s) TAG: /* Before */ 6, _0: Re_automata_Category.letter })), - tl: { - hd: seq$1(ids, "First", mk_expr(ids, { - TAG: /* After */ 7, - _0: Re_automata_Category.letter - }), mk_expr(ids, { - TAG: /* Before */ 6, - _0: Re_automata_Category.letter - })), - tl: /* [] */ 0 - } - }), - kind - ]; + tl: /* [] */ 0 + } + }), + kind + ]; case /* Beg_of_str */ 5 : - return [ - mk_expr(ids, { - TAG: /* After */ 7, - _0: Re_automata_Category.inexistant - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: /* After */ 7, + _0: Re_automata_Category.inexistant + }), + kind + ]; case /* End_of_str */ 6 : - return [ - mk_expr(ids, { - TAG: /* Before */ 6, - _0: Re_automata_Category.inexistant - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: /* Before */ 6, + _0: Re_automata_Category.inexistant + }), + kind + ]; case /* Last_end_of_line */ 7 : - const c$7 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.lastnewline); - return [ - mk_expr(ids, { - TAG: /* Before */ 6, - _0: c$7 - }), - kind - ]; + const c$7 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.lastnewline); + return [ + mk_expr(ids, { + TAG: /* Before */ 6, + _0: c$7 + }), + kind + ]; case /* Start */ 8 : - return [ - mk_expr(ids, { - TAG: /* After */ 7, - _0: Re_automata_Category.search_boundary - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: /* After */ 7, + _0: Re_automata_Category.search_boundary + }), + kind + ]; case /* Stop */ 9 : - return [ - mk_expr(ids, { - TAG: /* Before */ 6, - _0: Re_automata_Category.search_boundary - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: /* Before */ 6, + _0: Re_automata_Category.search_boundary + }), + kind + ]; } } else { switch (s.TAG) { case /* Set */ 0 : - return [ - cst(ids, trans_set(cache, c, s._0)), - kind - ]; + return [ + cst(ids, trans_set(cache, c, s._0)), + kind + ]; case /* Sequence */ 1 : - return [ - trans_seq(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0), - kind - ]; + return [ + trans_seq(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0), + kind + ]; case /* Alternative */ 2 : - const merged_sequences = merge_sequences(s._0); - if (merged_sequences && !merged_sequences.tl) { - const match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, merged_sequences.hd); - return [ - enforce_kind(ids, kind, match[1], match[0]), - kind - ]; - } + const merged_sequences = merge_sequences(s._0); + if (merged_sequences && !merged_sequences.tl) { + const match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, merged_sequences.hd); return [ - alt(ids, Stdlib__List.map((function (r$p) { - const match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); - return enforce_kind(ids, kind, match[1], match[0]); - }), merged_sequences)), + enforce_kind(ids, kind, match[1], match[0]), kind ]; + } + return [ + alt(ids, Stdlib__List.map((function (r$p) { + const match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); + return enforce_kind(ids, kind, match[1], match[0]); + }), merged_sequences)), + kind + ]; case /* Repeat */ 3 : - const j = s._2; - const i = s._1; - const match$1 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0); - const kind$p = match$1[1]; - const cr = match$1[0]; - let rem; - if (j !== undefined) { - const f = greedy === "Non_greedy" ? (function (rem) { - return alt(ids, { - hd: mk_expr(ids, /* Eps */ 0), - tl: { - hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: /* [] */ 0 - } - }); - }) : (function (rem) { - return alt(ids, { + const j = s._2; + const i = s._1; + const match$1 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0); + const kind$p = match$1[1]; + const cr = match$1[0]; + let rem; + if (j !== undefined) { + const f = greedy === "Non_greedy" ? (function (rem) { + return alt(ids, { + hd: mk_expr(ids, /* Eps */ 0), + tl: { hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: { - hd: mk_expr(ids, /* Eps */ 0), - tl: /* [] */ 0 - } - }); - }); - rem = iter(j - i | 0, f, mk_expr(ids, /* Eps */ 0)); - } else { - rem = rep(ids, greedy, kind$p, cr); - } - return [ - iter(i, (function (rem) { - return seq$1(ids, kind$p, rename(ids, cr), rem); - }), rem), - kind - ]; + tl: /* [] */ 0 + } + }); + }) : (function (rem) { + return alt(ids, { + hd: seq$1(ids, kind$p, rename(ids, cr), rem), + tl: { + hd: mk_expr(ids, /* Eps */ 0), + tl: /* [] */ 0 + } + }); + }); + rem = iter(j - i | 0, f, mk_expr(ids, /* Eps */ 0)); + } else { + rem = rep(ids, greedy, kind$p, cr); + } + return [ + iter(i, (function (rem) { + return seq$1(ids, kind$p, rename(ids, cr), rem); + }), rem), + kind + ]; case /* Sem */ 4 : - const kind$p$1 = s._0; - const match$2 = translate(ids, kind$p$1, ign_group, ign_case, greedy, pos, cache, c, s._1); - return [ - enforce_kind(ids, kind$p$1, match$2[1], match$2[0]), - kind$p$1 - ]; + const kind$p$1 = s._0; + const match$2 = translate(ids, kind$p$1, ign_group, ign_case, greedy, pos, cache, c, s._1); + return [ + enforce_kind(ids, kind$p$1, match$2[1], match$2[0]), + kind$p$1 + ]; case /* Sem_greedy */ 5 : - _s = s._1; - _greedy = s._0; - continue; + _s = s._1; + _greedy = s._0; + continue; case /* Group */ 6 : - const r$p = s._0; - if (ign_group) { - _s = r$p; - continue; - } - const p = pos.contents; - pos.contents = pos.contents + 2 | 0; - const 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 */ 4, - _0: p - }), seq$1(ids, "First", match$3[0], mk_expr(ids, { - TAG: /* Mark */ 4, - _0: p + 1 | 0 - }))), - match$3[1] - ]; - case /* No_group */ 7 : - _s = s._0; - _ign_group = true; + const r$p = s._0; + if (ign_group) { + _s = r$p; continue; + } + const p = pos.contents; + pos.contents = pos.contents + 2 | 0; + const 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 */ 4, + _0: p + }), seq$1(ids, "First", match$3[0], mk_expr(ids, { + TAG: /* Mark */ 4, + _0: p + 1 | 0 + }))), + match$3[1] + ]; + case /* No_group */ 7 : + _s = s._0; + _ign_group = true; + continue; case /* Nest */ 8 : - const b = pos.contents; - const match$4 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0); - const kind$p$2 = match$4[1]; - const cr$1 = match$4[0]; - const e = pos.contents - 1 | 0; - if (e < b) { - return [ - cr$1, - kind$p$2 - ]; - } else { - return [ - seq$1(ids, "First", erase(ids, b, e), cr$1), - kind$p$2 - ]; - } - case /* Pmark */ 14 : - const match$5 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._1); + const b = pos.contents; + const match$4 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._0); + const kind$p$2 = match$4[1]; + const cr$1 = match$4[0]; + const e = pos.contents - 1 | 0; + if (e < b) { + return [ + cr$1, + kind$p$2 + ]; + } else { return [ - seq$1(ids, "First", mk_expr(ids, { - TAG: /* Pmark */ 8, - _0: s._0 - }), match$5[0]), - match$5[1] + seq$1(ids, "First", erase(ids, b, e), cr$1), + kind$p$2 ]; + } + case /* Pmark */ 14 : + const match$5 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, s._1); + return [ + seq$1(ids, "First", mk_expr(ids, { + TAG: /* Pmark */ 8, + _0: s._0 + }), match$5[0]), + match$5[1] + ]; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -2587,131 +2587,131 @@ function handle_case(_ign_case, _s) { } switch (s.TAG) { case /* Set */ 0 : - const s$1 = s._0; + const s$1 = s._0; + return { + TAG: /* Set */ 0, + _0: ign_case ? case_insens(s$1) : s$1 + }; + case /* Sequence */ 1 : + return { + TAG: /* Sequence */ 1, + _0: Stdlib__List.map((function (param) { + return handle_case(ign_case, param); + }), s._0) + }; + case /* Alternative */ 2 : + const l$p = Stdlib__List.map((function (param) { + return handle_case(ign_case, param); + }), s._0); + if (is_charset({ + TAG: /* Alternative */ 2, + _0: l$p + })) { return { TAG: /* Set */ 0, - _0: ign_case ? case_insens(s$1) : s$1 + _0: Stdlib__List.fold_left((function (s, r) { + return union(s, as_set(r)); + }), /* [] */ 0, l$p) }; - case /* Sequence */ 1 : + } else { return { - TAG: /* Sequence */ 1, - _0: Stdlib__List.map((function (param) { - return handle_case(ign_case, param); - }), s._0) + TAG: /* Alternative */ 2, + _0: l$p }; - case /* Alternative */ 2 : - const l$p = Stdlib__List.map((function (param) { - return handle_case(ign_case, param); - }), s._0); - if (is_charset({ - TAG: /* Alternative */ 2, - _0: l$p - })) { - return { - TAG: /* Set */ 0, - _0: Stdlib__List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */ 0, l$p) - }; - } else { - return { - TAG: /* Alternative */ 2, - _0: l$p - }; - } + } case /* Repeat */ 3 : + return { + TAG: /* Repeat */ 3, + _0: handle_case(ign_case, s._0), + _1: s._1, + _2: s._2 + }; + case /* Sem */ 4 : + const r$p = handle_case(ign_case, s._1); + if (is_charset(r$p)) { + return r$p; + } else { + return { + TAG: /* Sem */ 4, + _0: s._0, + _1: r$p + }; + } + case /* Sem_greedy */ 5 : + const r$p$1 = handle_case(ign_case, s._1); + if (is_charset(r$p$1)) { + return r$p$1; + } else { return { - TAG: /* Repeat */ 3, - _0: handle_case(ign_case, s._0), - _1: s._1, - _2: s._2 + TAG: /* Sem_greedy */ 5, + _0: s._0, + _1: r$p$1 }; - case /* Sem */ 4 : - const r$p = handle_case(ign_case, s._1); - if (is_charset(r$p)) { - return r$p; - } else { - return { - TAG: /* Sem */ 4, - _0: s._0, - _1: r$p - }; - } - case /* Sem_greedy */ 5 : - const r$p$1 = handle_case(ign_case, s._1); - if (is_charset(r$p$1)) { - return r$p$1; - } else { - return { - TAG: /* Sem_greedy */ 5, - _0: s._0, - _1: r$p$1 - }; - } + } case /* Group */ 6 : + return { + TAG: /* Group */ 6, + _0: handle_case(ign_case, s._0) + }; + case /* No_group */ 7 : + const r$p$2 = handle_case(ign_case, s._0); + if (is_charset(r$p$2)) { + return r$p$2; + } else { return { - TAG: /* Group */ 6, - _0: handle_case(ign_case, s._0) + TAG: /* No_group */ 7, + _0: r$p$2 }; - case /* No_group */ 7 : - const r$p$2 = handle_case(ign_case, s._0); - if (is_charset(r$p$2)) { - return r$p$2; - } else { - return { - TAG: /* No_group */ 7, - _0: r$p$2 - }; - } + } case /* Nest */ 8 : - const r$p$3 = handle_case(ign_case, s._0); - if (is_charset(r$p$3)) { - return r$p$3; - } else { - return { - TAG: /* Nest */ 8, - _0: r$p$3 - }; - } + const r$p$3 = handle_case(ign_case, s._0); + if (is_charset(r$p$3)) { + return r$p$3; + } else { + return { + TAG: /* Nest */ 8, + _0: r$p$3 + }; + } case /* Case */ 9 : - _s = s._0; - _ign_case = false; - continue; + _s = s._0; + _ign_case = false; + continue; case /* No_case */ 10 : - _s = s._0; - _ign_case = true; - continue; + _s = s._0; + _ign_case = true; + continue; case /* Intersection */ 11 : - const l$p$1 = Stdlib__List.map((function (r) { - return handle_case(ign_case, r); - }), s._0); - return { - TAG: /* Set */ 0, - _0: Stdlib__List.fold_left((function (s, r) { - return inter(s, as_set(r)); - }), cany, l$p$1) - }; + const l$p$1 = Stdlib__List.map((function (r) { + return handle_case(ign_case, r); + }), s._0); + return { + TAG: /* Set */ 0, + _0: Stdlib__List.fold_left((function (s, r) { + return inter(s, as_set(r)); + }), cany, l$p$1) + }; case /* Complement */ 12 : - const l$p$2 = Stdlib__List.map((function (r) { - return handle_case(ign_case, r); - }), s._0); - return { - TAG: /* Set */ 0, - _0: diff(cany, Stdlib__List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */ 0, l$p$2)) - }; + const l$p$2 = Stdlib__List.map((function (r) { + return handle_case(ign_case, r); + }), s._0); + return { + TAG: /* Set */ 0, + _0: diff(cany, Stdlib__List.fold_left((function (s, r) { + return union(s, as_set(r)); + }), /* [] */ 0, l$p$2)) + }; case /* Difference */ 13 : - return { - TAG: /* Set */ 0, - _0: inter(as_set(handle_case(ign_case, s._0)), diff(cany, as_set(handle_case(ign_case, s._1)))) - }; + return { + TAG: /* Set */ 0, + _0: inter(as_set(handle_case(ign_case, s._0)), diff(cany, as_set(handle_case(ign_case, s._1)))) + }; case /* Pmark */ 14 : - return { - TAG: /* Pmark */ 14, - _0: s._0, - _1: handle_case(ign_case, s._1) - }; + return { + TAG: /* Pmark */ 14, + _0: s._0, + _1: handle_case(ign_case, s._1) + }; } }; @@ -2724,34 +2724,34 @@ function anchored(_l) { switch (l) { case /* Beg_of_str */ 5 : case /* Start */ 8 : - return true; + return true; default: return false; } } else { switch (l.TAG) { case /* Sequence */ 1 : - return Stdlib__List.exists(anchored, l._0); + return Stdlib__List.exists(anchored, l._0); case /* Alternative */ 2 : - return Stdlib__List.for_all(anchored, l._0); + return Stdlib__List.for_all(anchored, l._0); case /* Repeat */ 3 : - if (l._1 <= 0) { - return false; - } - _l = l._0; - continue; + if (l._1 <= 0) { + return false; + } + _l = l._0; + continue; case /* Group */ 6 : case /* No_group */ 7 : case /* Nest */ 8 : case /* Case */ 9 : case /* No_case */ 10 : - _l = l._0; - continue; + _l = l._0; + continue; case /* Sem */ 4 : case /* Sem_greedy */ 5 : case /* Pmark */ 14 : - _l = l._1; - continue; + _l = l._1; + continue; default: return false; } @@ -3279,31 +3279,31 @@ const Not_supported = /* @__PURE__ */ Caml_exceptions.create("Not_supported"); function posix_class_of_string(class_) { switch (class_) { case "alnum" : - return alnum; + return alnum; case "ascii" : - return ascii; + return ascii; case "blank" : - return blank; + return blank; case "cntrl" : - return cntrl; + return cntrl; case "digit" : - return digit; + return digit; case "graph" : - return graph; + return graph; case "lower" : - return lower; + return lower; case "print" : - return print; + return print; case "punct" : - return punct; + return punct; case "space" : - return space; + return space; case "upper" : - return upper; + return upper; case "word" : - return wordc; + return wordc; case "xdigit" : - return xdigit; + return xdigit; default: const s = "Invalid pcre class: " + class_; throw new Caml_js_exceptions.MelangeError("Invalid_argument", { @@ -3469,73 +3469,73 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 55 : case 56 : case 57 : - throw new Caml_js_exceptions.MelangeError(Not_supported, { - MEL_EXN_ID: Not_supported - }); + throw new Caml_js_exceptions.MelangeError(Not_supported, { + MEL_EXN_ID: Not_supported + }); case 65 : - return /* Beg_of_str */ 5; + return /* Beg_of_str */ 5; case 66 : - return /* Not_bound */ 4; + return /* Not_bound */ 4; case 68 : - return compl({ - hd: digit, - tl: /* [] */ 0 - }); + return compl({ + hd: digit, + tl: /* [] */ 0 + }); case 71 : - return /* Start */ 8; + return /* Start */ 8; case 83 : - return compl({ - hd: space, - tl: /* [] */ 0 - }); + return compl({ + hd: space, + tl: /* [] */ 0 + }); case 87 : - return compl({ - hd: alnum, - tl: { - hd: { - TAG: /* Set */ 0, - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */ 0 - } - }, - tl: /* [] */ 0 - } - }); + return compl({ + hd: alnum, + tl: { + hd: { + TAG: /* Set */ 0, + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */ 0 + } + }, + tl: /* [] */ 0 + } + }); case 90 : - return /* Last_end_of_line */ 7; + return /* Last_end_of_line */ 7; case 98 : - return alt$1({ - hd: /* Beg_of_word */ 2, - tl: { - hd: /* End_of_word */ 3, - tl: /* [] */ 0 - } - }); + return alt$1({ + hd: /* Beg_of_word */ 2, + tl: { + hd: /* End_of_word */ 3, + tl: /* [] */ 0 + } + }); case 100 : - return digit; + return digit; case 115 : - return space; + return space; case 119 : - return alt$1({ - hd: alnum, - tl: { - hd: { - TAG: /* Set */ 0, - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */ 0 - } - }, - tl: /* [] */ 0 - } - }); + return alt$1({ + hd: alnum, + tl: { + hd: { + TAG: /* Set */ 0, + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */ 0 + } + }, + tl: /* [] */ 0 + } + }); case 67 : case 69 : case 70 : @@ -3576,11 +3576,11 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 118 : case 120 : case 121 : - throw new Caml_js_exceptions.MelangeError(Parse_error, { - MEL_EXN_ID: Parse_error - }); + throw new Caml_js_exceptions.MelangeError(Parse_error, { + MEL_EXN_ID: Parse_error + }); case 122 : - return /* End_of_str */ 6; + return /* End_of_str */ 6; default: return { TAG: /* Set */ 0, @@ -3930,41 +3930,41 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } switch (c$2) { case 68 : - return { - NAME: "Set", - VAL: compl({ - hd: digit, - tl: /* [] */ 0 - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: digit, + tl: /* [] */ 0 + }) + }; case 83 : - return { - NAME: "Set", - VAL: compl({ - hd: space, - tl: /* [] */ 0 - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: space, + tl: /* [] */ 0 + }) + }; case 87 : - return { - NAME: "Set", - VAL: compl({ - hd: alnum, - tl: { - hd: { - TAG: /* Set */ 0, - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */ 0 - } - }, - tl: /* [] */ 0 - } - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: alnum, + tl: { + hd: { + TAG: /* Set */ 0, + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */ 0 + } + }, + tl: /* [] */ 0 + } + }) + }; case 58 : case 59 : case 60 : @@ -3978,60 +3978,60 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 94 : case 95 : case 96 : - return { - NAME: "Char", - VAL: c$2 - }; + return { + NAME: "Char", + VAL: c$2 + }; case 98 : - return { - NAME: "Char", - VAL: /* '\b' */8 - }; + return { + NAME: "Char", + VAL: /* '\b' */8 + }; case 100 : - return { - NAME: "Set", - VAL: digit - }; + return { + NAME: "Set", + VAL: digit + }; case 110 : - return { - NAME: "Char", - VAL: /* '\n' */10 - }; + return { + NAME: "Char", + VAL: /* '\n' */10 + }; case 114 : - return { - NAME: "Char", - VAL: /* '\r' */13 - }; + return { + NAME: "Char", + VAL: /* '\r' */13 + }; case 115 : - return { - NAME: "Set", - VAL: space - }; + return { + NAME: "Set", + VAL: space + }; case 116 : - return { - NAME: "Char", - VAL: /* '\t' */9 - }; + return { + NAME: "Char", + VAL: /* '\t' */9 + }; case 119 : - return { - NAME: "Set", - VAL: alt$1({ - hd: alnum, - tl: { - hd: { - TAG: /* Set */ 0, - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */ 0 - } - }, - tl: /* [] */ 0 - } - }) - }; + return { + NAME: "Set", + VAL: alt$1({ + hd: alnum, + tl: { + hd: { + TAG: /* Set */ 0, + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */ 0 + } + }, + tl: /* [] */ 0 + } + }) + }; case 65 : case 66 : case 67 : @@ -4074,9 +4074,9 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 120 : case 121 : case 122 : - throw new Caml_js_exceptions.MelangeError(Parse_error, { - MEL_EXN_ID: Parse_error - }); + throw new Caml_js_exceptions.MelangeError(Parse_error, { + MEL_EXN_ID: Parse_error + }); } } else { diff --git a/jscomp/test/dist/jscomp/test/ocaml_typedtree_test.js b/jscomp/test/dist/jscomp/test/ocaml_typedtree_test.js index 14609cee2f..8e40c677b4 100644 --- a/jscomp/test/dist/jscomp/test/ocaml_typedtree_test.js +++ b/jscomp/test/dist/jscomp/test/ocaml_typedtree_test.js @@ -368,21 +368,21 @@ function edit_distance(a, b, cutoff) { function ansi_of_color(param) { switch (param) { case /* Black */ 0 : - return "0"; + return "0"; case /* Red */ 1 : - return "1"; + return "1"; case /* Green */ 2 : - return "2"; + return "2"; case /* Yellow */ 3 : - return "3"; + return "3"; case /* Blue */ 4 : - return "4"; + return "4"; case /* Magenta */ 5 : - return "5"; + return "5"; case /* Cyan */ 6 : - return "6"; + return "6"; case /* White */ 7 : - return "7"; + return "7"; } } @@ -397,11 +397,11 @@ function code_of_style(c) { } switch (c) { case /* Bold */ 0 : - return "1"; + return "1"; case /* Reset */ 1 : - return "0"; + return "0"; case /* Dim */ 2 : - return "2"; + return "2"; } } @@ -456,35 +456,35 @@ function style_of_tag(s) { if (s.MEL_EXN_ID === Stdlib__Format.String_tag) { switch (s._1) { case "dim" : - return { - hd: /* Dim */ 2, - tl: /* [] */ 0 - }; + return { + hd: /* Dim */ 2, + tl: /* [] */ 0 + }; case "error" : - return cur_styles.contents.error; + return cur_styles.contents.error; case "filename" : - return { + return { + hd: { + TAG: /* FG */ 0, + _0: /* Cyan */ 6 + }, + tl: /* [] */ 0 + }; + case "info" : + return { + hd: /* Bold */ 0, + tl: { hd: { TAG: /* FG */ 0, - _0: /* Cyan */ 6 + _0: /* Yellow */ 3 }, tl: /* [] */ 0 - }; - case "info" : - return { - hd: /* Bold */ 0, - tl: { - hd: { - TAG: /* FG */ 0, - _0: /* Yellow */ 3 - }, - tl: /* [] */ 0 - } - }; + } + }; case "loc" : - return cur_styles.contents.loc; + return cur_styles.contents.loc; case "warning" : - return cur_styles.contents.warning; + return cur_styles.contents.warning; default: throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found @@ -585,12 +585,12 @@ function setup(o) { if (o !== undefined) { switch (o) { case /* Always */ 1 : - tmp = true; - break; + tmp = true; + break; case /* Auto */ 0 : case /* Never */ 2 : - tmp = false; - break; + tmp = false; + break; } } else { @@ -614,117 +614,117 @@ function number(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* Comment_start */ 0 : - return 1; + return 1; case /* Comment_not_end */ 1 : - return 2; + return 2; case /* Partial_application */ 2 : - return 5; + return 5; case /* Labels_omitted */ 3 : - return 6; + return 6; case /* Statement_type */ 4 : - return 10; + return 10; case /* Unused_match */ 5 : - return 11; + return 11; case /* Unused_pat */ 6 : - return 12; + return 12; case /* Illegal_backslash */ 7 : - return 14; + return 14; case /* Unerasable_optional_argument */ 8 : - return 16; + return 16; case /* Unused_argument */ 9 : - return 20; + return 20; case /* Nonreturning_statement */ 10 : - return 21; + return 21; case /* Useless_record_with */ 11 : - return 23; + return 23; case /* All_clauses_guarded */ 12 : - return 25; + return 25; case /* Wildcard_arg_to_constant_constr */ 13 : - return 28; + return 28; case /* Eol_in_string */ 14 : - return 29; + return 29; case /* Unused_rec_flag */ 15 : - return 39; + return 39; case /* Bs_polymorphic_comparison */ 16 : - return 102; + return 102; } } else { switch (param.TAG) { case /* Deprecated */ 0 : - return 3; + return 3; case /* Fragile_match */ 1 : - return 4; + return 4; case /* Method_override */ 2 : - return 7; + return 7; case /* Partial_match */ 3 : - return 8; + return 8; case /* Non_closed_record_pattern */ 4 : - return 9; + return 9; case /* Instance_variable_override */ 5 : - return 13; + return 13; case /* Implicit_public_methods */ 6 : - return 15; + return 15; case /* Undeclared_virtual_method */ 7 : - return 17; + return 17; case /* Not_principal */ 8 : - return 18; + return 18; case /* Without_principality */ 9 : - return 19; + return 19; case /* Preprocessor */ 10 : - return 22; + return 22; case /* Bad_module_name */ 11 : - return 24; + return 24; case /* Unused_var */ 12 : - return 26; + return 26; case /* Unused_var_strict */ 13 : - return 27; + return 27; case /* Duplicate_definitions */ 14 : - return 30; + return 30; case /* Multiple_definition */ 15 : - return 31; + return 31; case /* Unused_value_declaration */ 16 : - return 32; + return 32; case /* Unused_open */ 17 : - return 33; + return 33; case /* Unused_type_declaration */ 18 : - return 34; + return 34; case /* Unused_for_index */ 19 : - return 35; + return 35; case /* Unused_ancestor */ 20 : - return 36; + return 36; case /* Unused_constructor */ 21 : - return 37; + return 37; case /* Unused_extension */ 22 : - return 38; + return 38; case /* Name_out_of_scope */ 23 : - return 40; + return 40; case /* Ambiguous_name */ 24 : - return 41; + return 41; case /* Disambiguated_name */ 25 : - return 42; + return 42; case /* Nonoptional_label */ 26 : - return 43; + return 43; case /* Open_shadow_identifier */ 27 : - return 44; + return 44; case /* Open_shadow_label_constructor */ 28 : - return 45; + return 45; case /* Bad_env_variable */ 29 : - return 46; + return 46; case /* Attribute_payload */ 30 : - return 47; + return 47; case /* Eliminated_optional_arguments */ 31 : - return 48; + return 48; case /* No_cmi_file */ 32 : - return 49; + return 49; case /* Bad_docstring */ 33 : - return 50; + return 50; case /* Bs_unused_attribute */ 34 : - return 101; + return 101; case /* Bs_ffi_warning */ 35 : - return 103; + return 103; case /* Bs_derive_warning */ 36 : - return 104; + return 104; } } @@ -746,94 +746,94 @@ const letter_all = loop(104); function letter(param) { switch (param) { case 97 : - return letter_all; + return letter_all; case 99 : - return { - hd: 1, - tl: { - hd: 2, - tl: /* [] */ 0 - } - }; - case 100 : - return { - hd: 3, + return { + hd: 1, + tl: { + hd: 2, tl: /* [] */ 0 - }; + } + }; + case 100 : + return { + hd: 3, + tl: /* [] */ 0 + }; case 101 : - return { - hd: 4, - tl: /* [] */ 0 - }; + return { + hd: 4, + tl: /* [] */ 0 + }; case 102 : - return { - hd: 5, - tl: /* [] */ 0 - }; + return { + hd: 5, + tl: /* [] */ 0 + }; case 107 : - return { - hd: 32, + return { + hd: 32, + tl: { + hd: 33, tl: { - hd: 33, + hd: 34, tl: { - hd: 34, + hd: 35, tl: { - hd: 35, + hd: 36, tl: { - hd: 36, + hd: 37, tl: { - hd: 37, + hd: 38, tl: { - hd: 38, - tl: { - hd: 39, - tl: /* [] */ 0 - } + hd: 39, + tl: /* [] */ 0 } } } } } } - }; + } + }; case 108 : - return { - hd: 6, - tl: /* [] */ 0 - }; + return { + hd: 6, + tl: /* [] */ 0 + }; case 109 : - return { - hd: 7, - tl: /* [] */ 0 - }; + return { + hd: 7, + tl: /* [] */ 0 + }; case 112 : - return { - hd: 8, - tl: /* [] */ 0 - }; + return { + hd: 8, + tl: /* [] */ 0 + }; case 114 : - return { - hd: 9, - tl: /* [] */ 0 - }; + return { + hd: 9, + tl: /* [] */ 0 + }; case 115 : - return { - hd: 10, - tl: /* [] */ 0 - }; + return { + hd: 10, + tl: /* [] */ 0 + }; case 117 : - return { - hd: 11, - tl: { - hd: 12, - tl: /* [] */ 0 - } - }; - case 118 : - return { - hd: 13, + return { + hd: 11, + tl: { + hd: 12, tl: /* [] */ 0 - }; + } + }; + case 118 : + return { + hd: 13, + tl: /* [] */ 0 + }; case 98 : case 103 : case 104 : @@ -844,36 +844,35 @@ function letter(param) { case 113 : case 116 : case 119 : - return /* [] */ 0; + return /* [] */ 0; case 120 : - return { - hd: 14, + return { + hd: 14, + tl: { + hd: 15, tl: { - hd: 15, + hd: 16, tl: { - hd: 16, + hd: 17, tl: { - hd: 17, + hd: 18, tl: { - hd: 18, + hd: 19, tl: { - hd: 19, + hd: 20, tl: { - hd: 20, + hd: 21, tl: { - hd: 21, + hd: 22, tl: { - hd: 22, + hd: 23, tl: { - hd: 23, + hd: 24, tl: { - hd: 24, + hd: 25, tl: { - hd: 25, - tl: { - hd: 30, - tl: /* [] */ 0 - } + hd: 30, + tl: /* [] */ 0 } } } @@ -885,17 +884,18 @@ function letter(param) { } } } - }; + } + }; case 121 : - return { - hd: 26, - tl: /* [] */ 0 - }; + return { + hd: 26, + tl: /* [] */ 0 + }; case 122 : - return { - hd: 27, - tl: /* [] */ 0 - }; + return { + hd: 27, + tl: /* [] */ 0 + }; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -1018,14 +1018,14 @@ function parse_opt(error, active, flags, s) { if (c >= 43) { switch (c) { case 43 : - return loop_letter_num(set, i + 1 | 0); + return loop_letter_num(set, i + 1 | 0); case 44 : - throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { - MEL_EXN_ID: Stdlib__Arg.Bad, - _1: "Ill-formed list of warnings" - }); + throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { + MEL_EXN_ID: Stdlib__Arg.Bad, + _1: "Ill-formed list of warnings" + }); case 45 : - return loop_letter_num(clear, i + 1 | 0); + return loop_letter_num(clear, i + 1 | 0); } } else { @@ -1097,162 +1097,161 @@ function message(s) { if (/* tag */ typeof s === "number" || typeof s === "string") { switch (s) { case /* Comment_start */ 0 : - return "this is the start of a comment."; + return "this is the start of a comment."; case /* Comment_not_end */ 1 : - return "this is not the end of a comment."; + return "this is not the end of a comment."; case /* Partial_application */ 2 : - return "this function application is partial,\nmaybe some arguments are missing."; + return "this function application is partial,\nmaybe some arguments are missing."; case /* Labels_omitted */ 3 : - return "labels were omitted in the application of this function."; + return "labels were omitted in the application of this function."; case /* Statement_type */ 4 : - return "this expression should have type unit."; + return "this expression should have type unit."; case /* Unused_match */ 5 : - return "this match case is unused."; + return "this match case is unused."; case /* Unused_pat */ 6 : - return "this sub-pattern is unused."; + return "this sub-pattern is unused."; case /* Illegal_backslash */ 7 : - return "illegal backslash escape in string."; + return "illegal backslash escape in string."; case /* Unerasable_optional_argument */ 8 : - return "this optional argument cannot be erased."; + return "this optional argument cannot be erased."; case /* Unused_argument */ 9 : - return "this argument will not be used by the function."; + return "this argument will not be used by the function."; case /* Nonreturning_statement */ 10 : - return "this statement never returns (or has an unsound type.)"; + return "this statement never returns (or has an unsound type.)"; case /* Useless_record_with */ 11 : - return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; + return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; case /* All_clauses_guarded */ 12 : - return "bad style, all clauses in this pattern-matching are guarded."; + return "bad style, all clauses in this pattern-matching are guarded."; case /* Wildcard_arg_to_constant_constr */ 13 : - return "wildcard pattern given as argument to a constant constructor"; + return "wildcard pattern given as argument to a constant constructor"; case /* Eol_in_string */ 14 : - return "unescaped end-of-line in a string constant (non-portable code)"; + return "unescaped end-of-line in a string constant (non-portable code)"; case /* Unused_rec_flag */ 15 : - return "unused rec flag."; + return "unused rec flag."; case /* Bs_polymorphic_comparison */ 16 : - return "polymorphic comparison introduced (maybe unsafe)"; + return "polymorphic comparison introduced (maybe unsafe)"; } } else { switch (s.TAG) { case /* Deprecated */ 0 : - return "deprecated: " + s._0; + return "deprecated: " + s._0; case /* Fragile_match */ 1 : - const s$1 = s._0; - if (s$1 === "") { - return "this pattern-matching is fragile."; - } else { - return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); - } + const s$1 = s._0; + if (s$1 === "") { + return "this pattern-matching is fragile."; + } else { + return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); + } case /* Method_override */ 2 : - const match = s._0; - if (match) { - const lab = match.hd; - if (match.tl) { - return Stdlib__String.concat(" ", { - hd: "the following methods are overridden by the class", + const match = s._0; + if (match) { + const lab = match.hd; + if (match.tl) { + return Stdlib__String.concat(" ", { + hd: "the following methods are overridden by the class", + tl: { + hd: lab, tl: { - hd: lab, - tl: { - hd: ":\n ", - tl: match.tl - } + hd: ":\n ", + tl: match.tl } - }); - } else { - return "the method " + (lab + " is overridden."); - } - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 1694, - 26 - ] - }); - case /* Partial_match */ 3 : - const s$2 = s._0; - if (s$2 === "") { - return "this pattern-matching is not exhaustive."; + } + }); } else { - return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + return "the method " + (lab + " is overridden."); } + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 1694, + 26 + ] + }); + case /* Partial_match */ 3 : + const s$2 = s._0; + if (s$2 === "") { + return "this pattern-matching is not exhaustive."; + } else { + return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + } case /* Non_closed_record_pattern */ 4 : - return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); + return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); case /* Instance_variable_override */ 5 : - const match$1 = s._0; - if (match$1) { - const lab$1 = match$1.hd; - if (match$1.tl) { - return Stdlib__String.concat(" ", { - hd: "the following instance variables are overridden by the class", + const match$1 = s._0; + if (match$1) { + const lab$1 = match$1.hd; + if (match$1.tl) { + return Stdlib__String.concat(" ", { + hd: "the following instance variables are overridden by the class", + tl: { + hd: lab$1, tl: { - hd: lab$1, - tl: { - hd: ":\n ", - tl: match$1.tl - } + hd: ":\n ", + tl: match$1.tl } - }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; - } else { - return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); - } + } + }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; + } else { + return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 1714, - 37 - ] - }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 1714, + 37 + ] + }); case /* Implicit_public_methods */ 6 : - return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); + return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); case /* Undeclared_virtual_method */ 7 : - return "the virtual method " + (s._0 + " is not declared."); + return "the virtual method " + (s._0 + " is not declared."); case /* Not_principal */ 8 : - return s._0 + " is not principal."; + return s._0 + " is not principal."; case /* Without_principality */ 9 : - return s._0 + " without principality."; + return s._0 + " without principality."; case /* Preprocessor */ 10 : - return s._0; + return s._0; case /* Bad_module_name */ 11 : - return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); + return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); case /* Unused_var */ 12 : case /* Unused_var_strict */ 13 : - return "unused variable " + (s._0 + "."); + return "unused variable " + (s._0 + "."); case /* Duplicate_definitions */ 14 : - return Curry._4(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "the ", + return Curry._4(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is defined in both types ", _1: { - TAG: /* String_literal */ 11, - _0: " is defined in both types ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } @@ -1260,239 +1259,240 @@ function message(s) { } } } - }, - _1: "the %s %s is defined in both types %s and %s." - }), s._0, s._1, s._2, s._3); + } + }, + _1: "the %s %s is defined in both types %s and %s." + }), s._0, s._1, s._2, s._3); case /* Multiple_definition */ 15 : - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "files ", + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "files ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " both define a module named ", _1: { - TAG: /* String_literal */ 11, - _0: " both define a module named ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "files %s and %s both define a module named %s" - }), s._1, s._2, s._0); + } + }, + _1: "files %s and %s both define a module named %s" + }), s._1, s._2, s._0); case /* Unused_value_declaration */ 16 : - return "unused value " + (s._0 + "."); + return "unused value " + (s._0 + "."); case /* Unused_open */ 17 : - return "unused open " + (s._0 + "."); + return "unused open " + (s._0 + "."); case /* Unused_type_declaration */ 18 : - return "unused type " + (s._0 + "."); + return "unused type " + (s._0 + "."); case /* Unused_for_index */ 19 : - return "unused for-loop index " + (s._0 + "."); + return "unused for-loop index " + (s._0 + "."); case /* Unused_ancestor */ 20 : - return "unused ancestor variable " + (s._0 + "."); + return "unused ancestor variable " + (s._0 + "."); case /* Unused_constructor */ 21 : - const s$3 = s._0; - if (s._1) { - return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); - } else { - return "unused constructor " + (s$3 + "."); - } + const s$3 = s._0; + if (s._1) { + return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); + } else { + return "unused constructor " + (s$3 + "."); + } case /* Unused_extension */ 22 : - const s$4 = s._0; - if (s._1) { - return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); - } else { - return "unused extension constructor " + (s$4 + "."); - } + const s$4 = s._0; + if (s._1) { + return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); + } else { + return "unused extension constructor " + (s$4 + "."); + } case /* Name_out_of_scope */ 23 : - const slist = s._1; - const ty = s._0; - if (slist && !slist.tl && !s._2) { - return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); - } - if (s._2) { - return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 1776, - 39 - ] - }); - break; + const slist = s._1; + const ty = s._0; + if (slist && !slist.tl && !s._2) { + return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); + } + if (s._2) { + return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 1776, + 39 + ] + }); + break; case /* Ambiguous_name */ 24 : - const slist$1 = s._0; - if (slist$1 && !slist$1.tl && !s._2) { - return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); - } - if (s._2) { - return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 1785, - 36 - ] - }); - break; + const slist$1 = s._0; + if (slist$1 && !slist$1.tl && !s._2) { + return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); + } + if (s._2) { + return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 1785, + 36 + ] + }); + break; case /* Disambiguated_name */ 25 : - return "this use of " + (s._0 + " required disambiguation."); + return "this use of " + (s._0 + " required disambiguation."); case /* Nonoptional_label */ 26 : - return "the label " + (s._0 + " is not optional."); + return "the label " + (s._0 + " is not optional."); case /* Open_shadow_identifier */ 27 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " identifier ", _1: { - TAG: /* String_literal */ 11, - _0: " identifier ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s identifier %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s identifier %s (which is later used)" + }), s._0, s._1); case /* Open_shadow_label_constructor */ 28 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s %s (which is later used)" + }), s._0, s._1); case /* Bad_env_variable */ 29 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal environment variable ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal environment variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " : ", _1: { - TAG: /* String_literal */ 11, - _0: " : ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal environment variable %s : %s" - }), s._0, s._1); + } + }, + _1: "illegal environment variable %s : %s" + }), s._0, s._1); case /* Attribute_payload */ 30 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal payload for attribute '", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal payload for attribute '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "'.\n", _1: { - TAG: /* String_literal */ 11, - _0: "'.\n", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal payload for attribute '%s'.\n%s" - }), s._0, s._1); + } + }, + _1: "illegal payload for attribute '%s'.\n%s" + }), s._0, s._1); case /* Eliminated_optional_arguments */ 31 : - const sl = s._0; - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "implicit elimination of optional argument", + const sl = s._0; + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "implicit elimination of optional argument", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "implicit elimination of optional argument%s %s" - }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); + } + }, + _1: "implicit elimination of optional argument%s %s" + }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); case /* No_cmi_file */ 32 : - return "no cmi file was found in path for module " + s._0; + return "no cmi file was found in path for module " + s._0; case /* Bad_docstring */ 33 : - if (s._0) { - return "unattached documentation comment (ignored)"; - } else { - return "ambiguous documentation comment"; - } + if (s._0) { + return "unattached documentation comment (ignored)"; + } else { + return "ambiguous documentation comment"; + } case /* Bs_unused_attribute */ 34 : - return "Unused BuckleScript attribute: " + s._0; + return "Unused BuckleScript attribute: " + s._0; case /* Bs_ffi_warning */ 35 : - return "BuckleScript FFI warning: " + s._0; + return "BuckleScript FFI warning: " + s._0; case /* Bs_derive_warning */ 36 : - return "BuckleScript bs.deriving warning: " + s._0; + return "BuckleScript bs.deriving warning: " + s._0; } } @@ -2642,42 +2642,42 @@ function same(_p1, _p2) { const p1 = _p1; switch (p1.TAG) { case /* Pident */ 0 : - switch (p2.TAG) { - case /* Pident */ 0 : - return Caml_obj.caml_equal(p1._0, p2._0); - case /* Pdot */ 1 : - case /* Papply */ 2 : - return false; - - } + switch (p2.TAG) { + case /* Pident */ 0 : + return Caml_obj.caml_equal(p1._0, p2._0); + case /* Pdot */ 1 : + case /* Papply */ 2 : + return false; + + } case /* Pdot */ 1 : - switch (p2.TAG) { - case /* Pdot */ 1 : - if (p1._1 !== p2._1) { - return false; - } - _p2 = p2._0; - _p1 = p1._0; - continue; - case /* Pident */ 0 : - case /* Papply */ 2 : - return false; - - } + switch (p2.TAG) { + case /* Pdot */ 1 : + if (p1._1 !== p2._1) { + return false; + } + _p2 = p2._0; + _p1 = p1._0; + continue; + case /* Pident */ 0 : + case /* Papply */ 2 : + return false; + + } case /* Papply */ 2 : - switch (p2.TAG) { - case /* Pident */ 0 : - case /* Pdot */ 1 : - return false; - case /* Papply */ 2 : - if (!same(p1._0, p2._0)) { - return false; - } - _p2 = p2._1; - _p1 = p1._1; - continue; - - } + switch (p2.TAG) { + case /* Pident */ 0 : + case /* Pdot */ 1 : + return false; + case /* Papply */ 2 : + if (!same(p1._0, p2._0)) { + return false; + } + _p2 = p2._1; + _p1 = p1._1; + continue; + + } } }; @@ -2688,16 +2688,16 @@ function isfree(id, _id$p) { const id$p = _id$p; switch (id$p.TAG) { case /* Pident */ 0 : - return Caml_obj.caml_equal(id, id$p._0); + return Caml_obj.caml_equal(id, id$p._0); case /* Pdot */ 1 : - _id$p = id$p._0; - continue; + _id$p = id$p._0; + continue; case /* Papply */ 2 : - if (isfree(id, id$p._0)) { - return true; - } - _id$p = id$p._1; - continue; + if (isfree(id, id$p._0)) { + return true; + } + _id$p = id$p._1; + continue; } }; @@ -2708,12 +2708,12 @@ function binding_time(_id) { const id = _id; switch (id.TAG) { case /* Pident */ 0 : - return id._0.stamp; + return id._0.stamp; case /* Pdot */ 1 : - _id = id._0; - continue; + _id = id._0; + continue; case /* Papply */ 2 : - return Caml.caml_int_max(binding_time(id._0), binding_time(id._1)); + return Caml.caml_int_max(binding_time(id._0), binding_time(id._1)); } }; @@ -2727,14 +2727,14 @@ function name(parenOpt, id) { const paren = parenOpt !== undefined ? parenOpt : kfalse; switch (id.TAG) { case /* Pident */ 0 : - return id._0.name; + return id._0.name; case /* Pdot */ 1 : - const s = id._1; - return name(paren, id._0) + ( - Curry._1(paren, s) ? ".( " + (s + " )") : "." + s - ); + const s = id._1; + return name(paren, id._0) + ( + Curry._1(paren, s) ? ".( " + (s + " )") : "." + s + ); case /* Papply */ 2 : - return name(paren, id._0) + ("(" + (name(paren, id._1) + ")")); + return name(paren, id._0) + ("(" + (name(paren, id._1) + ")")); } } @@ -2744,19 +2744,19 @@ function head(_id) { const id = _id; switch (id.TAG) { case /* Pident */ 0 : - return id._0; + return id._0; case /* Pdot */ 1 : - _id = id._0; - continue; + _id = id._0; + continue; case /* Papply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 2970, - 22 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 2970, + 22 + ] + }); } }; @@ -2767,12 +2767,12 @@ function last(_id) { const id = _id; switch (id.TAG) { case /* Pident */ 0 : - return id._0.name; + return id._0.name; case /* Pdot */ 1 : - return id._1; + return id._1; case /* Papply */ 2 : - _id = id._1; - continue; + _id = id._1; + continue; } }; @@ -2784,19 +2784,19 @@ function flat(_accu, _s) { const accu = _accu; switch (s.TAG) { case /* Lident */ 0 : - return { - hd: s._0, - tl: accu - }; + return { + hd: s._0, + tl: accu + }; case /* Ldot */ 1 : - _s = s._0; - _accu = { - hd: s._1, - tl: accu - }; - continue; + _s = s._0; + _accu = { + hd: s._1, + tl: accu + }; + continue; case /* Lapply */ 2 : - return fatal_error("Longident.flat"); + return fatal_error("Longident.flat"); } }; @@ -2809,11 +2809,11 @@ function flatten(lid) { function last$1(s) { switch (s.TAG) { case /* Lident */ 0 : - return s._0; + return s._0; case /* Ldot */ 1 : - return s._1; + return s._1; case /* Lapply */ 2 : - return fatal_error("Longident.last"); + return fatal_error("Longident.last"); } } @@ -4069,19 +4069,19 @@ const Meths = { function single(param) { switch (param) { case /* May_pos */ 0 : - return 1; + return 1; case /* May_neg */ 1 : - return 2; + return 2; case /* May_weak */ 2 : - return 4; + return 4; case /* Inj */ 3 : - return 8; + return 8; case /* Pos */ 4 : - return 16; + return 16; case /* Neg */ 5 : - return 32; + return 32; case /* Inv */ 6 : - return 64; + return 64; } } @@ -4540,36 +4540,36 @@ function elements(s) { function equal_tag(t1, t2) { switch (t1.TAG) { case /* Cstr_constant */ 0 : - switch (t2.TAG) { - case /* Cstr_constant */ 0 : - return t2._0 === t1._0; - case /* Cstr_block */ 1 : - case /* Cstr_extension */ 2 : - return false; - - } + switch (t2.TAG) { + case /* Cstr_constant */ 0 : + return t2._0 === t1._0; + case /* Cstr_block */ 1 : + case /* Cstr_extension */ 2 : + return false; + + } case /* Cstr_block */ 1 : - switch (t2.TAG) { - case /* Cstr_block */ 1 : - return t2._0 === t1._0; - case /* Cstr_constant */ 0 : - case /* Cstr_extension */ 2 : - return false; - - } + switch (t2.TAG) { + case /* Cstr_block */ 1 : + return t2._0 === t1._0; + case /* Cstr_constant */ 0 : + case /* Cstr_extension */ 2 : + return false; + + } case /* Cstr_extension */ 2 : - switch (t2.TAG) { - case /* Cstr_constant */ 0 : - case /* Cstr_block */ 1 : - return false; - case /* Cstr_extension */ 2 : - if (same(t1._0, t2._0)) { - return t1._1 === t2._1; - } else { - return false; - } - - } + switch (t2.TAG) { + case /* Cstr_constant */ 0 : + case /* Cstr_block */ 1 : + return false; + case /* Cstr_extension */ 2 : + if (same(t1._0, t2._0)) { + return t1._1 === t2._1; + } else { + return false; + } + + } } } @@ -5251,14 +5251,14 @@ function repr(_t) { } switch (t$p.TAG) { case /* Tfield */ 5 : - if (!Caml_obj.caml_equal(field_kind_repr(t$p._1), /* Fabsent */ 1)) { - return t; - } - _t = t$p._3; - continue; + if (!Caml_obj.caml_equal(field_kind_repr(t$p._1), /* Fabsent */ 1)) { + return t; + } + _t = t$p._3; + continue; case /* Tlink */ 6 : - _t = t$p._0; - continue; + _t = t$p._0; + continue; default: return t; } @@ -5404,10 +5404,10 @@ function row_fixed(row) { } switch (match.TAG) { case /* Tvar */ 0 : - return false; + return false; case /* Tconstr */ 3 : case /* Tunivar */ 9 : - return true; + return true; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -5457,42 +5457,42 @@ function proxy(ty) { } switch (row.TAG) { case /* Tobject */ 4 : - let _ty = row._0; - while (true) { - const ty$1 = _ty; - const match = ty$1.desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { - return ty0; - } - switch (match.TAG) { - case /* Tfield */ 5 : - _ty = match._3; - continue; - case /* Tlink */ 6 : - _ty = match._0; - continue; - case /* Tvar */ 0 : - case /* Tconstr */ 3 : - case /* Tunivar */ 9 : - return ty$1; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 4976, - 15 - ] - }); - } - }; - case /* Tvariant */ 8 : - const row$1 = row._0; - if (static_row(row$1)) { + let _ty = row._0; + while (true) { + const ty$1 = _ty; + const match = ty$1.desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { return ty0; - } else { - return row_more(row$1); } + switch (match.TAG) { + case /* Tfield */ 5 : + _ty = match._3; + continue; + case /* Tlink */ 6 : + _ty = match._0; + continue; + case /* Tvar */ 0 : + case /* Tconstr */ 3 : + case /* Tunivar */ 9 : + return ty$1; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 4976, + 15 + ] + }); + } + }; + case /* Tvariant */ 8 : + const row$1 = row._0; + if (static_row(row$1)) { + return ty0; + } else { + return row_more(row$1); + } default: return ty0; } @@ -5505,31 +5505,31 @@ function has_constr_row(t) { } switch (row.TAG) { case /* Tobject */ 4 : - let _t = row._0; - while (true) { - const t$1 = _t; - const match = repr(t$1).desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { - return false; - } - switch (match.TAG) { - case /* Tconstr */ 3 : - return true; - case /* Tfield */ 5 : - _t = match._3; - continue; - default: - return false; - } - }; - case /* Tvariant */ 8 : - const match$1 = row_more(row._0); - const match$2 = match$1.desc; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Tconstr */ 3) { + let _t = row._0; + while (true) { + const t$1 = _t; + const match = repr(t$1).desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { return false; - } else { - return true; } + switch (match.TAG) { + case /* Tconstr */ 3 : + return true; + case /* Tfield */ 5 : + _t = match._3; + continue; + default: + return false; + } + }; + case /* Tvariant */ 8 : + const match$1 = row_more(row._0); + const match$2 = match$1.desc; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Tconstr */ 3) { + return false; + } else { + return true; + } default: return false; } @@ -5555,11 +5555,11 @@ function is_constr_row(t) { const id = match._0; switch (id.TAG) { case /* Pident */ 0 : - return is_row_name(id._0.name); + return is_row_name(id._0.name); case /* Pdot */ 1 : - return is_row_name(id._1); + return is_row_name(id._1); case /* Papply */ 2 : - return false; + return false; } } @@ -5585,13 +5585,13 @@ function iter_row(f, _row) { if (!/* tag */ (typeof row$1 === "number" || typeof row$1 === "string")) { switch (row$1.TAG) { case /* Tvariant */ 8 : - _row = row$1._0; - continue; + _row = row$1._0; + continue; case /* Tvar */ 0 : case /* Tconstr */ 3 : case /* Tsubst */ 7 : case /* Tunivar */ 9 : - break; + break; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -5616,36 +5616,36 @@ function iter_type_expr(f, ty) { } switch (l.TAG) { case /* Tarrow */ 1 : - Curry._1(f, l._1); - return Curry._1(f, l._2); + Curry._1(f, l._1); + return Curry._1(f, l._2); case /* Ttuple */ 2 : - return Stdlib__List.iter(f, l._0); + return Stdlib__List.iter(f, l._0); case /* Tconstr */ 3 : - return Stdlib__List.iter(f, l._1); + return Stdlib__List.iter(f, l._1); case /* Tobject */ 4 : - const ty$1 = l._0; - const match = l._1.contents; - if (match !== undefined) { - Curry._1(f, ty$1); - return Stdlib__List.iter(f, match[1]); - } else { - return Curry._1(f, ty$1); - } + const ty$1 = l._0; + const match = l._1.contents; + if (match !== undefined) { + Curry._1(f, ty$1); + return Stdlib__List.iter(f, match[1]); + } else { + return Curry._1(f, ty$1); + } case /* Tfield */ 5 : - Curry._1(f, l._2); - return Curry._1(f, l._3); + Curry._1(f, l._2); + return Curry._1(f, l._3); case /* Tlink */ 6 : case /* Tsubst */ 7 : - return Curry._1(f, l._0); + return Curry._1(f, l._0); case /* Tvariant */ 8 : - const row = l._0; - iter_row(f, row); - return Curry._1(f, row_more(row)); + const row = l._0; + iter_row(f, row); + return Curry._1(f, row_more(row)); case /* Tpoly */ 10 : - Curry._1(f, l._0); - return Stdlib__List.iter(f, l._1); + Curry._1(f, l._0); + return Stdlib__List.iter(f, l._1); case /* Tpackage */ 11 : - return Stdlib__List.iter(f, l._2); + return Stdlib__List.iter(f, l._2); default: return; } @@ -5678,19 +5678,19 @@ function it_signature(it) { function it_signature_item(it, param) { switch (param.TAG) { case /* Sig_value */ 0 : - return Curry._2(it.it_value_description, it, param._1); + return Curry._2(it.it_value_description, it, param._1); case /* Sig_type */ 1 : - return Curry._2(it.it_type_declaration, it, param._1); + return Curry._2(it.it_type_declaration, it, param._1); case /* Sig_typext */ 2 : - return Curry._2(it.it_extension_constructor, it, param._1); + return Curry._2(it.it_extension_constructor, it, param._1); case /* Sig_module */ 3 : - return Curry._2(it.it_module_declaration, it, param._1); + return Curry._2(it.it_module_declaration, it, param._1); case /* Sig_modtype */ 4 : - return Curry._2(it.it_modtype_declaration, it, param._1); + return Curry._2(it.it_modtype_declaration, it, param._1); case /* Sig_class */ 5 : - return Curry._2(it.it_class_declaration, it, param._1); + return Curry._2(it.it_class_declaration, it, param._1); case /* Sig_class_type */ 6 : - return Curry._2(it.it_class_type_declaration, it, param._1); + return Curry._2(it.it_class_type_declaration, it, param._1); } } @@ -5736,13 +5736,13 @@ function it_class_type_declaration(it, ctd) { function it_module_type(it, sg) { switch (sg.TAG) { case /* Mty_signature */ 1 : - return Curry._2(it.it_signature, it, sg._0); + return Curry._2(it.it_signature, it, sg._0); case /* Mty_functor */ 2 : - may(Curry._1(it.it_module_type, it), sg._1); - return Curry._2(it.it_module_type, it, sg._2); + may(Curry._1(it.it_module_type, it), sg._1); + return Curry._2(it.it_module_type, it, sg._2); case /* Mty_ident */ 0 : case /* Mty_alias */ 3 : - return Curry._1(it.it_path, sg._0); + return Curry._1(it.it_path, sg._0); } } @@ -5750,22 +5750,22 @@ function it_module_type(it, sg) { function it_class_type(it, cs) { switch (cs.TAG) { case /* Cty_constr */ 0 : - Curry._1(it.it_path, cs._0); - Stdlib__List.iter(Curry._1(it.it_type_expr, it), cs._1); - return Curry._2(it.it_class_type, it, cs._2); + Curry._1(it.it_path, cs._0); + Stdlib__List.iter(Curry._1(it.it_type_expr, it), cs._1); + return Curry._2(it.it_class_type, it, cs._2); case /* Cty_signature */ 1 : - const cs$1 = cs._0; - Curry._2(it.it_type_expr, it, cs$1.csig_self); - Curry._2(Meths.iter, (function (param, param$1) { - Curry._2(it.it_type_expr, it, param$1[2]); - }), cs$1.csig_vars); - return Stdlib__List.iter((function (param) { - Curry._1(it.it_path, param[0]); - Stdlib__List.iter(Curry._1(it.it_type_expr, it), param[1]); - }), cs$1.csig_inher); + const cs$1 = cs._0; + Curry._2(it.it_type_expr, it, cs$1.csig_self); + Curry._2(Meths.iter, (function (param, param$1) { + Curry._2(it.it_type_expr, it, param$1[2]); + }), cs$1.csig_vars); + return Stdlib__List.iter((function (param) { + Curry._1(it.it_path, param[0]); + Stdlib__List.iter(Curry._1(it.it_type_expr, it), param[1]); + }), cs$1.csig_inher); case /* Cty_arrow */ 2 : - Curry._2(it.it_type_expr, it, cs._1); - return Curry._2(it.it_class_type, it, cs._2); + Curry._2(it.it_type_expr, it, cs._1); + return Curry._2(it.it_class_type, it, cs._2); } } @@ -5793,19 +5793,19 @@ function it_do_type_expr(it, ty) { } switch (row.TAG) { case /* Tobject */ 4 : - const match = row._1.contents; - if (match !== undefined) { - return Curry._1(it.it_path, match[0]); - } else { - return; - } + const match = row._1.contents; + if (match !== undefined) { + return Curry._1(it.it_path, match[0]); + } else { + return; + } case /* Tvariant */ 8 : - return may((function (param) { - Curry._1(it.it_path, param[0]); - }), row_repr_aux(/* [] */ 0, row._0).row_name); + return may((function (param) { + Curry._1(it.it_path, param[0]); + }), row_repr_aux(/* [] */ 0, row._0).row_name); case /* Tconstr */ 3 : case /* Tpackage */ 11 : - return Curry._1(it.it_path, row._0); + return Curry._1(it.it_path, row._0); default: return; } @@ -5916,137 +5916,137 @@ function copy_type_desc(_keep_namesOpt, f, _ty) { } switch (ty.TAG) { case /* Tvar */ 0 : - if (keep_names) { - return ty; - } else { - return { - TAG: /* Tvar */ 0, - _0: undefined - }; - } - case /* Tarrow */ 1 : + if (keep_names) { + return ty; + } else { return { - TAG: /* Tarrow */ 1, - _0: ty._0, - _1: Curry._1(f, ty._1), - _2: Curry._1(f, ty._2), - _3: copy_commu(ty._3) + TAG: /* Tvar */ 0, + _0: undefined }; + } + case /* Tarrow */ 1 : + return { + TAG: /* Tarrow */ 1, + _0: ty._0, + _1: Curry._1(f, ty._1), + _2: Curry._1(f, ty._2), + _3: copy_commu(ty._3) + }; case /* Ttuple */ 2 : - return { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map(f, ty._0) - }; + return { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map(f, ty._0) + }; case /* Tconstr */ 3 : + return { + TAG: /* Tconstr */ 3, + _0: ty._0, + _1: Stdlib__List.map(f, ty._1), + _2: { + contents: /* Mnil */ 0 + } + }; + case /* Tobject */ 4 : + const ty$1 = ty._0; + const match = ty._1.contents; + if (match !== undefined) { return { - TAG: /* Tconstr */ 3, - _0: ty._0, - _1: Stdlib__List.map(f, ty._1), - _2: { - contents: /* Mnil */ 0 + TAG: /* Tobject */ 4, + _0: Curry._1(f, ty$1), + _1: { + contents: [ + match[0], + Stdlib__List.map(f, match[1]) + ] } }; - case /* Tobject */ 4 : - const ty$1 = ty._0; - const match = ty._1.contents; - if (match !== undefined) { - return { - TAG: /* Tobject */ 4, - _0: Curry._1(f, ty$1), - _1: { - contents: [ - match[0], - Stdlib__List.map(f, match[1]) - ] - } - }; - } else { - return { - TAG: /* Tobject */ 4, - _0: Curry._1(f, ty$1), - _1: { - contents: undefined - } - }; - } - case /* Tfield */ 5 : + } else { return { - TAG: /* Tfield */ 5, - _0: ty._0, - _1: field_kind_repr(ty._1), - _2: Curry._1(f, ty._2), - _3: Curry._1(f, ty._3) + TAG: /* Tobject */ 4, + _0: Curry._1(f, ty$1), + _1: { + contents: undefined + } }; + } + case /* Tfield */ 5 : + return { + TAG: /* Tfield */ 5, + _0: ty._0, + _1: field_kind_repr(ty._1), + _2: Curry._1(f, ty._2), + _3: Curry._1(f, ty._3) + }; case /* Tlink */ 6 : - _ty = ty._0.desc; - _keep_namesOpt = undefined; - continue; + _ty = ty._0.desc; + _keep_namesOpt = undefined; + continue; case /* Tsubst */ 7 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 5199, - 27 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 5199, + 27 + ] + }); case /* Tvariant */ 8 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 5194, - 27 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 5194, + 27 + ] + }); case /* Tunivar */ 9 : - return ty; + return ty; case /* Tpoly */ 10 : - const tyl = Stdlib__List.map((function (x) { - let _ty = Curry._1(f, x); - while (true) { - const ty = _ty; - const ty$1 = ty.desc; - if (!/* tag */ (typeof ty$1 === "number" || typeof ty$1 === "string")) { - switch (ty$1.TAG) { - case /* Ttuple */ 2 : - const match = ty$1._0; - if (match) { - _ty = match.hd; - continue; - } - break; - case /* Tlink */ 6 : - _ty = ty$1._0; - continue; - case /* Tsubst */ 7 : - case /* Tunivar */ 9 : - return ty; - - } + const tyl = Stdlib__List.map((function (x) { + let _ty = Curry._1(f, x); + while (true) { + const ty = _ty; + const ty$1 = ty.desc; + if (!/* tag */ (typeof ty$1 === "number" || typeof ty$1 === "string")) { + switch (ty$1.TAG) { + case /* Ttuple */ 2 : + const match = ty$1._0; + if (match) { + _ty = match.hd; + continue; + } + break; + case /* Tlink */ 6 : + _ty = ty$1._0; + continue; + case /* Tsubst */ 7 : + case /* Tunivar */ 9 : + return ty; + } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 5184, - 26 - ] - }); - }; - }), ty._1); - return { - TAG: /* Tpoly */ 10, - _0: Curry._1(f, ty._0), - _1: tyl - }; + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 5184, + 26 + ] + }); + }; + }), ty._1); + return { + TAG: /* Tpoly */ 10, + _0: Curry._1(f, ty._0), + _1: tyl + }; case /* Tpackage */ 11 : - return { - TAG: /* Tpackage */ 11, - _0: ty._0, - _1: ty._1, - _2: Stdlib__List.map(f, ty._2) - }; + return { + TAG: /* Tpackage */ 11, + _0: ty._0, + _1: ty._1, + _2: Stdlib__List.map(f, ty._2) + }; } }; @@ -6336,11 +6336,11 @@ function extract_label_aux(_hd, l, _param) { function undo_change(param) { switch (param.TAG) { case /* Ctype */ 0 : - param._0.desc = param._1; - return; + param._0.desc = param._1; + return; case /* Clevel */ 1 : - param._0.level = param._1; - return; + param._0.level = param._1; + return; default: param._0.contents = param._1; return; @@ -6652,87 +6652,87 @@ function output_cmi(filename, oc, cmi) { function report_error(ppf, filename) { switch (filename.TAG) { case /* Not_an_interface */ 0 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is not a compiled interface", - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not a compiled interface", + _1: /* End_of_format */ 0 } - }, - _1: "%a@ is not a compiled interface" - }), print_filename, filename._0); + } + }, + _1: "%a@ is not a compiled interface" + }), print_filename, filename._0); case /* Wrong_version_interface */ 1 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not a compiled interface for this version of OCaml.", _1: { - TAG: /* String_literal */ 11, - _0: "is not a compiled interface for this version of OCaml.", + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, + TAG: /* String_literal */ 11, + _0: "It seems to be for ", _1: { - TAG: /* String_literal */ 11, - _0: "It seems to be for ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " version of OCaml.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " version of OCaml.", + _1: /* End_of_format */ 0 } } } } } - }, - _1: "%a@ is not a compiled interface for this version of OCaml.@.It seems to be for %s version of OCaml." - }), print_filename, filename._0, filename._1); + } + }, + _1: "%a@ is not a compiled interface for this version of OCaml.@.It seems to be for %s version of OCaml." + }), print_filename, filename._0, filename._1); case /* Corrupted_interface */ 2 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Corrupted compiled interface", + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Corrupted compiled interface", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, - _1: "Corrupted compiled interface@ %a" - }), print_filename, filename._0); + } + }, + _1: "Corrupted compiled interface@ %a" + }), print_filename, filename._0); } } @@ -6800,16 +6800,16 @@ function free_vars(ty) { } switch (row.TAG) { case /* Tvar */ 0 : - ret.contents = Curry._2(add$3, ty$1, ret.contents); - return; + ret.contents = Curry._2(add$3, ty$1, ret.contents); + return; case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - iter_row(loop, row$1); - if (static_row(row$1)) { - return; - } - _ty = row$1.row_more; - continue; + const row$1 = row_repr_aux(/* [] */ 0, row._0); + iter_row(loop, row$1); + if (static_row(row$1)) { + return; + } + _ty = row$1.row_more; + continue; default: return iter_type_expr(loop, ty$1); } @@ -7563,25 +7563,25 @@ function warn_bad_docstrings(param) { const match = ds.ds_attached; switch (match) { case /* Unattached */ 0 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: true - }); + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: true + }); case /* Info */ 1 : - return; + return; case /* Docs */ 2 : - const match$1 = ds.ds_associated; - switch (match$1) { - case /* Zero */ 0 : - case /* One */ 1 : - return; - case /* Many */ 2 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: false - }); - - } + const match$1 = ds.ds_associated; + switch (match$1) { + case /* Zero */ 0 : + case /* One */ 1 : + return; + case /* Many */ 2 : + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: false + }); + + } } }), Stdlib__List.rev(docstrings.contents)); @@ -7735,11 +7735,11 @@ function get_docstring(info, dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = info ? /* Info */ 1 : /* Docs */ 2; @@ -7760,11 +7760,11 @@ function get_docstrings(dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = /* Docs */ 2; @@ -7782,12 +7782,12 @@ function associate_docstrings(dsl) { const match = ds.ds_associated; switch (match) { case /* Zero */ 0 : - ds.ds_associated = /* One */ 1; - return; + ds.ds_associated = /* One */ 1; + return; case /* One */ 1 : case /* Many */ 2 : - ds.ds_associated = /* Many */ 2; - return; + ds.ds_associated = /* Many */ 2; + return; } }), dsl); @@ -9425,55 +9425,55 @@ function map$1(sub, param) { } switch (desc.TAG) { case /* Ptyp_var */ 0 : - return $$var(loc, attrs, desc._0); + return $$var(loc, attrs, desc._0); case /* Ptyp_arrow */ 1 : - return arrow(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1), Curry._2(sub.typ, sub, desc._2)); + return arrow(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1), Curry._2(sub.typ, sub, desc._2)); case /* Ptyp_tuple */ 2 : - return tuple(loc, attrs, Stdlib__List.map(Curry._1(sub.typ, sub), desc._0)); + return tuple(loc, attrs, Stdlib__List.map(Curry._1(sub.typ, sub), desc._0)); case /* Ptyp_constr */ 3 : - return constr(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); + return constr(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); case /* Ptyp_object */ 4 : - const f = function (param) { - return [ - param[0], - Curry._2(sub.attributes, sub, param[1]), - Curry._2(sub.typ, sub, param[2]) - ]; - }; - return object_(loc, attrs, Stdlib__List.map(f, desc._0), desc._1); + const f = function (param) { + return [ + param[0], + Curry._2(sub.attributes, sub, param[1]), + Curry._2(sub.typ, sub, param[2]) + ]; + }; + return object_(loc, attrs, Stdlib__List.map(f, desc._0), desc._1); case /* Ptyp_class */ 5 : - return class_(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); + return class_(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); case /* Ptyp_alias */ 6 : - return alias(loc, attrs, Curry._2(sub.typ, sub, desc._0), desc._1); + return alias(loc, attrs, Curry._2(sub.typ, sub, desc._0), desc._1); case /* Ptyp_variant */ 7 : - return variant(loc, attrs, Stdlib__List.map((function (param) { - if (param.TAG === /* Rtag */ 0) { - return { - TAG: /* Rtag */ 0, - _0: param._0, - _1: Curry._2(sub.attributes, sub, param._1), - _2: param._2, - _3: Stdlib__List.map(Curry._1(sub.typ, sub), param._3) - }; - } else { - return { - TAG: /* Rinherit */ 1, - _0: Curry._2(sub.typ, sub, param._0) - }; - } - }), desc._0), desc._1, desc._2); + return variant(loc, attrs, Stdlib__List.map((function (param) { + if (param.TAG === /* Rtag */ 0) { + return { + TAG: /* Rtag */ 0, + _0: param._0, + _1: Curry._2(sub.attributes, sub, param._1), + _2: param._2, + _3: Stdlib__List.map(Curry._1(sub.typ, sub), param._3) + }; + } else { + return { + TAG: /* Rinherit */ 1, + _0: Curry._2(sub.typ, sub, param._0) + }; + } + }), desc._0), desc._1, desc._2); case /* Ptyp_poly */ 8 : - return poly(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1)); + return poly(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1)); case /* Ptyp_package */ 9 : - const match = desc._0; - const partial_arg = Curry._1(sub.typ, sub); - return $$package(loc, attrs, map_loc(sub, match[0]), Stdlib__List.map((function (param) { - return map_tuple((function (param) { - return map_loc(sub, param); - }), partial_arg, param); - }), match[1])); + const match = desc._0; + const partial_arg = Curry._1(sub.typ, sub); + return $$package(loc, attrs, map_loc(sub, match[0]), Stdlib__List.map((function (param) { + return map_tuple((function (param) { + return map_loc(sub, param); + }), partial_arg, param); + }), match[1])); case /* Ptyp_extension */ 10 : - return extension(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension(loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9546,13 +9546,13 @@ function map$2(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pcty_attributes); switch (desc.TAG) { case /* Pcty_constr */ 0 : - return constr$2(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); + return constr$2(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); case /* Pcty_signature */ 1 : - return signature$1(loc, attrs, Curry._2(sub.class_signature, sub, desc._0)); + return signature$1(loc, attrs, Curry._2(sub.class_signature, sub, desc._0)); case /* Pcty_arrow */ 2 : - return arrow$1(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1), Curry._2(sub.class_type, sub, desc._2)); + return arrow$1(loc, attrs, desc._0, Curry._2(sub.typ, sub, desc._1), Curry._2(sub.class_type, sub, desc._2)); case /* Pcty_extension */ 3 : - return extension$8(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension$8(loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9563,20 +9563,20 @@ function map_field(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pctf_attributes); switch (desc.TAG) { case /* Pctf_inherit */ 0 : - return Curry._3(Ast_helper_Ctf.inherit_, loc, attrs, Curry._2(sub.class_type, sub, desc._0)); + return Curry._3(Ast_helper_Ctf.inherit_, loc, attrs, Curry._2(sub.class_type, sub, desc._0)); case /* Pctf_val */ 1 : - const match = desc._0; - return Curry._6(Ast_helper_Ctf.val_, loc, attrs, match[0], match[1], match[2], Curry._2(sub.typ, sub, match[3])); + const match = desc._0; + return Curry._6(Ast_helper_Ctf.val_, loc, attrs, match[0], match[1], match[2], Curry._2(sub.typ, sub, match[3])); case /* Pctf_method */ 2 : - const match$1 = desc._0; - return Curry._6(Ast_helper_Ctf.method_, loc, attrs, match$1[0], match$1[1], match$1[2], Curry._2(sub.typ, sub, match$1[3])); + const match$1 = desc._0; + return Curry._6(Ast_helper_Ctf.method_, loc, attrs, match$1[0], match$1[1], match$1[2], Curry._2(sub.typ, sub, match$1[3])); case /* Pctf_constraint */ 3 : - const match$2 = desc._0; - return Curry._4(Ast_helper_Ctf.constraint_, loc, attrs, Curry._2(sub.typ, sub, match$2[0]), Curry._2(sub.typ, sub, match$2[1])); + const match$2 = desc._0; + return Curry._4(Ast_helper_Ctf.constraint_, loc, attrs, Curry._2(sub.typ, sub, match$2[0]), Curry._2(sub.typ, sub, match$2[1])); case /* Pctf_attribute */ 4 : - return Curry._2(Ast_helper_Ctf.attribute, loc, Curry._2(sub.attribute, sub, desc._0)); + return Curry._2(Ast_helper_Ctf.attribute, loc, Curry._2(sub.attribute, sub, desc._0)); case /* Pctf_extension */ 5 : - return Curry._3(Ast_helper_Ctf.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return Curry._3(Ast_helper_Ctf.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9594,19 +9594,19 @@ function map$3(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pmty_attributes); switch (desc.TAG) { case /* Pmty_ident */ 0 : - return ident$1(loc, attrs, map_loc(sub, desc._0)); + return ident$1(loc, attrs, map_loc(sub, desc._0)); case /* Pmty_signature */ 1 : - return signature(loc, attrs, Curry._2(sub.signature, sub, desc._0)); + return signature(loc, attrs, Curry._2(sub.signature, sub, desc._0)); case /* Pmty_functor */ 2 : - return functor_(loc, attrs, map_loc(sub, desc._0), may_map(Curry._1(sub.module_type, sub), desc._1), Curry._2(sub.module_type, sub, desc._2)); + return functor_(loc, attrs, map_loc(sub, desc._0), may_map(Curry._1(sub.module_type, sub), desc._1), Curry._2(sub.module_type, sub, desc._2)); case /* Pmty_with */ 3 : - return with_(loc, attrs, Curry._2(sub.module_type, sub, desc._0), Stdlib__List.map(Curry._1(sub.with_constraint, sub), desc._1)); + return with_(loc, attrs, Curry._2(sub.module_type, sub, desc._0), Stdlib__List.map(Curry._1(sub.with_constraint, sub), desc._1)); case /* Pmty_typeof */ 4 : - return typeof_(loc, attrs, Curry._2(sub.module_expr, sub, desc._0)); + return typeof_(loc, attrs, Curry._2(sub.module_expr, sub, desc._0)); case /* Pmty_extension */ 5 : - return extension$3(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension$3(loc, attrs, Curry._2(sub.extension, sub, desc._0)); case /* Pmty_alias */ 6 : - return alias$2(loc, attrs, map_loc(sub, desc._0)); + return alias$2(loc, attrs, map_loc(sub, desc._0)); } } @@ -9614,28 +9614,28 @@ function map$3(sub, param) { function map_with_constraint(sub, d) { switch (d.TAG) { case /* Pwith_type */ 0 : - return { - TAG: /* Pwith_type */ 0, - _0: map_loc(sub, d._0), - _1: Curry._2(sub.type_declaration, sub, d._1) - }; + return { + TAG: /* Pwith_type */ 0, + _0: map_loc(sub, d._0), + _1: Curry._2(sub.type_declaration, sub, d._1) + }; case /* Pwith_module */ 1 : - return { - TAG: /* Pwith_module */ 1, - _0: map_loc(sub, d._0), - _1: map_loc(sub, d._1) - }; + return { + TAG: /* Pwith_module */ 1, + _0: map_loc(sub, d._0), + _1: map_loc(sub, d._1) + }; case /* Pwith_typesubst */ 2 : - return { - TAG: /* Pwith_typesubst */ 2, - _0: Curry._2(sub.type_declaration, sub, d._0) - }; + return { + TAG: /* Pwith_typesubst */ 2, + _0: Curry._2(sub.type_declaration, sub, d._0) + }; case /* Pwith_modsubst */ 3 : - return { - TAG: /* Pwith_modsubst */ 3, - _0: map_loc(sub, d._0), - _1: map_loc(sub, d._1) - }; + return { + TAG: /* Pwith_modsubst */ 3, + _0: map_loc(sub, d._0), + _1: map_loc(sub, d._1) + }; } } @@ -9645,79 +9645,79 @@ function map_signature_item(sub, param) { const loc = Curry._2(sub.location, sub, param.psig_loc); switch (desc.TAG) { case /* Psig_value */ 0 : - const a = Curry._2(sub.value_description, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_value */ 0, - _0: a - }); + const a = Curry._2(sub.value_description, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_value */ 0, + _0: a + }); case /* Psig_type */ 1 : - const a$1 = Stdlib__List.map(Curry._1(sub.type_declaration, sub), desc._0); - return mk$5(loc, { - TAG: /* Psig_type */ 1, - _0: a$1 - }); + const a$1 = Stdlib__List.map(Curry._1(sub.type_declaration, sub), desc._0); + return mk$5(loc, { + TAG: /* Psig_type */ 1, + _0: a$1 + }); case /* Psig_typext */ 2 : - const a$2 = Curry._2(sub.type_extension, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_typext */ 2, - _0: a$2 - }); + const a$2 = Curry._2(sub.type_extension, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_typext */ 2, + _0: a$2 + }); case /* Psig_exception */ 3 : - const a$3 = Curry._2(sub.extension_constructor, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_exception */ 3, - _0: a$3 - }); + const a$3 = Curry._2(sub.extension_constructor, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_exception */ 3, + _0: a$3 + }); case /* Psig_module */ 4 : - const a$4 = Curry._2(sub.module_declaration, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_module */ 4, - _0: a$4 - }); + const a$4 = Curry._2(sub.module_declaration, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_module */ 4, + _0: a$4 + }); case /* Psig_recmodule */ 5 : - const a$5 = Stdlib__List.map(Curry._1(sub.module_declaration, sub), desc._0); - return mk$5(loc, { - TAG: /* Psig_recmodule */ 5, - _0: a$5 - }); + const a$5 = Stdlib__List.map(Curry._1(sub.module_declaration, sub), desc._0); + return mk$5(loc, { + TAG: /* Psig_recmodule */ 5, + _0: a$5 + }); case /* Psig_modtype */ 6 : - const a$6 = Curry._2(sub.module_type_declaration, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_modtype */ 6, - _0: a$6 - }); + const a$6 = Curry._2(sub.module_type_declaration, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_modtype */ 6, + _0: a$6 + }); case /* Psig_open */ 7 : - const a$7 = Curry._2(sub.open_description, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_open */ 7, - _0: a$7 - }); + const a$7 = Curry._2(sub.open_description, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_open */ 7, + _0: a$7 + }); case /* Psig_include */ 8 : - const a$8 = Curry._2(sub.include_description, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_include */ 8, - _0: a$8 - }); + const a$8 = Curry._2(sub.include_description, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_include */ 8, + _0: a$8 + }); case /* Psig_class */ 9 : - const a$9 = Stdlib__List.map(Curry._1(sub.class_description, sub), desc._0); - return mk$5(loc, { - TAG: /* Psig_class */ 9, - _0: a$9 - }); + const a$9 = Stdlib__List.map(Curry._1(sub.class_description, sub), desc._0); + return mk$5(loc, { + TAG: /* Psig_class */ 9, + _0: a$9 + }); case /* Psig_class_type */ 10 : - const a$10 = Stdlib__List.map(Curry._1(sub.class_type_declaration, sub), desc._0); - return mk$5(loc, { - TAG: /* Psig_class_type */ 10, - _0: a$10 - }); + const a$10 = Stdlib__List.map(Curry._1(sub.class_type_declaration, sub), desc._0); + return mk$5(loc, { + TAG: /* Psig_class_type */ 10, + _0: a$10 + }); case /* Psig_attribute */ 11 : - const a$11 = Curry._2(sub.attribute, sub, desc._0); - return mk$5(loc, { - TAG: /* Psig_attribute */ 11, - _0: a$11 - }); + const a$11 = Curry._2(sub.attribute, sub, desc._0); + return mk$5(loc, { + TAG: /* Psig_attribute */ 11, + _0: a$11 + }); case /* Psig_extension */ 12 : - return extension$5(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.extension, sub, desc._0)); + return extension$5(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.extension, sub, desc._0)); } } @@ -9728,19 +9728,19 @@ function map$4(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pmod_attributes); switch (desc.TAG) { case /* Pmod_ident */ 0 : - return ident$2(loc, attrs, map_loc(sub, desc._0)); + return ident$2(loc, attrs, map_loc(sub, desc._0)); case /* Pmod_structure */ 1 : - return structure(loc, attrs, Curry._2(sub.structure, sub, desc._0)); + return structure(loc, attrs, Curry._2(sub.structure, sub, desc._0)); case /* Pmod_functor */ 2 : - return functor_$1(loc, attrs, map_loc(sub, desc._0), may_map(Curry._1(sub.module_type, sub), desc._1), Curry._2(sub.module_expr, sub, desc._2)); + return functor_$1(loc, attrs, map_loc(sub, desc._0), may_map(Curry._1(sub.module_type, sub), desc._1), Curry._2(sub.module_expr, sub, desc._2)); case /* Pmod_apply */ 3 : - return apply$1(loc, attrs, Curry._2(sub.module_expr, sub, desc._0), Curry._2(sub.module_expr, sub, desc._1)); + return apply$1(loc, attrs, Curry._2(sub.module_expr, sub, desc._0), Curry._2(sub.module_expr, sub, desc._1)); case /* Pmod_constraint */ 4 : - return constraint_$2(loc, attrs, Curry._2(sub.module_expr, sub, desc._0), Curry._2(sub.module_type, sub, desc._1)); + return constraint_$2(loc, attrs, Curry._2(sub.module_expr, sub, desc._0), Curry._2(sub.module_type, sub, desc._1)); case /* Pmod_unpack */ 5 : - return unpack$1(loc, attrs, Curry._2(sub.expr, sub, desc._0)); + return unpack$1(loc, attrs, Curry._2(sub.expr, sub, desc._0)); case /* Pmod_extension */ 6 : - return extension$4(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension$4(loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9750,83 +9750,83 @@ function map_structure_item(sub, param) { const loc = Curry._2(sub.location, sub, param.pstr_loc); switch (desc.TAG) { case /* Pstr_eval */ 0 : - return $$eval(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.expr, sub, desc._0)); + return $$eval(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.expr, sub, desc._0)); case /* Pstr_value */ 1 : - return value(loc, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1)); + return value(loc, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1)); case /* Pstr_primitive */ 2 : - const a = Curry._2(sub.value_description, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_primitive */ 2, - _0: a - }); + const a = Curry._2(sub.value_description, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_primitive */ 2, + _0: a + }); case /* Pstr_type */ 3 : - const a$1 = Stdlib__List.map(Curry._1(sub.type_declaration, sub), desc._0); - return mk$6(loc, { - TAG: /* Pstr_type */ 3, - _0: a$1 - }); + const a$1 = Stdlib__List.map(Curry._1(sub.type_declaration, sub), desc._0); + return mk$6(loc, { + TAG: /* Pstr_type */ 3, + _0: a$1 + }); case /* Pstr_typext */ 4 : - const a$2 = Curry._2(sub.type_extension, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_typext */ 4, - _0: a$2 - }); + const a$2 = Curry._2(sub.type_extension, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_typext */ 4, + _0: a$2 + }); case /* Pstr_exception */ 5 : - const a$3 = Curry._2(sub.extension_constructor, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_exception */ 5, - _0: a$3 - }); + const a$3 = Curry._2(sub.extension_constructor, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_exception */ 5, + _0: a$3 + }); case /* Pstr_module */ 6 : - const a$4 = Curry._2(sub.module_binding, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_module */ 6, - _0: a$4 - }); + const a$4 = Curry._2(sub.module_binding, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_module */ 6, + _0: a$4 + }); case /* Pstr_recmodule */ 7 : - const a$5 = Stdlib__List.map(Curry._1(sub.module_binding, sub), desc._0); - return mk$6(loc, { - TAG: /* Pstr_recmodule */ 7, - _0: a$5 - }); + const a$5 = Stdlib__List.map(Curry._1(sub.module_binding, sub), desc._0); + return mk$6(loc, { + TAG: /* Pstr_recmodule */ 7, + _0: a$5 + }); case /* Pstr_modtype */ 8 : - const a$6 = Curry._2(sub.module_type_declaration, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_modtype */ 8, - _0: a$6 - }); + const a$6 = Curry._2(sub.module_type_declaration, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_modtype */ 8, + _0: a$6 + }); case /* Pstr_open */ 9 : - const a$7 = Curry._2(sub.open_description, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_open */ 9, - _0: a$7 - }); + const a$7 = Curry._2(sub.open_description, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_open */ 9, + _0: a$7 + }); case /* Pstr_class */ 10 : - const a$8 = Stdlib__List.map(Curry._1(sub.class_declaration, sub), desc._0); - return mk$6(loc, { - TAG: /* Pstr_class */ 10, - _0: a$8 - }); + const a$8 = Stdlib__List.map(Curry._1(sub.class_declaration, sub), desc._0); + return mk$6(loc, { + TAG: /* Pstr_class */ 10, + _0: a$8 + }); case /* Pstr_class_type */ 11 : - const a$9 = Stdlib__List.map(Curry._1(sub.class_type_declaration, sub), desc._0); - return mk$6(loc, { - TAG: /* Pstr_class_type */ 11, - _0: a$9 - }); + const a$9 = Stdlib__List.map(Curry._1(sub.class_type_declaration, sub), desc._0); + return mk$6(loc, { + TAG: /* Pstr_class_type */ 11, + _0: a$9 + }); case /* Pstr_include */ 12 : - const a$10 = Curry._2(sub.include_declaration, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_include */ 12, - _0: a$10 - }); + const a$10 = Curry._2(sub.include_declaration, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_include */ 12, + _0: a$10 + }); case /* Pstr_attribute */ 13 : - const a$11 = Curry._2(sub.attribute, sub, desc._0); - return mk$6(loc, { - TAG: /* Pstr_attribute */ 13, - _0: a$11 - }); + const a$11 = Curry._2(sub.attribute, sub, desc._0); + return mk$6(loc, { + TAG: /* Pstr_attribute */ 13, + _0: a$11 + }); case /* Pstr_extension */ 14 : - return extension$6(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.extension, sub, desc._0)); + return extension$6(loc, Curry._2(sub.attributes, sub, desc._1), Curry._2(sub.extension, sub, desc._0)); } } @@ -9837,86 +9837,86 @@ function map$5(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pexp_attributes); switch (desc.TAG) { case /* Pexp_ident */ 0 : - return Curry._3(Ast_helper_Exp.ident, loc, attrs, map_loc(sub, desc._0)); + return Curry._3(Ast_helper_Exp.ident, loc, attrs, map_loc(sub, desc._0)); case /* Pexp_constant */ 1 : - return Curry._3(Ast_helper_Exp.constant, loc, attrs, desc._0); + return Curry._3(Ast_helper_Exp.constant, loc, attrs, desc._0); case /* Pexp_let */ 2 : - return Curry._5(Ast_helper_Exp.let_, loc, attrs, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1), Curry._2(sub.expr, sub, desc._2)); + return Curry._5(Ast_helper_Exp.let_, loc, attrs, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1), Curry._2(sub.expr, sub, desc._2)); case /* Pexp_function */ 3 : - return Curry._3(Ast_helper_Exp.function_, loc, attrs, Curry._2(sub.cases, sub, desc._0)); + return Curry._3(Ast_helper_Exp.function_, loc, attrs, Curry._2(sub.cases, sub, desc._0)); case /* Pexp_fun */ 4 : - return Curry._6(Ast_helper_Exp.fun_, loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1), Curry._2(sub.pat, sub, desc._2), Curry._2(sub.expr, sub, desc._3)); + return Curry._6(Ast_helper_Exp.fun_, loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1), Curry._2(sub.pat, sub, desc._2), Curry._2(sub.expr, sub, desc._3)); case /* Pexp_apply */ 5 : - const partial_arg = Curry._1(sub.expr, sub); - return Curry._4(Ast_helper_Exp.apply, loc, attrs, Curry._2(sub.expr, sub, desc._0), Stdlib__List.map((function (param) { - return map_snd(partial_arg, param); - }), desc._1)); + const partial_arg = Curry._1(sub.expr, sub); + return Curry._4(Ast_helper_Exp.apply, loc, attrs, Curry._2(sub.expr, sub, desc._0), Stdlib__List.map((function (param) { + return map_snd(partial_arg, param); + }), desc._1)); case /* Pexp_match */ 6 : - return Curry._4(Ast_helper_Exp.match_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.cases, sub, desc._1)); + return Curry._4(Ast_helper_Exp.match_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.cases, sub, desc._1)); case /* Pexp_try */ 7 : - return Curry._4(Ast_helper_Exp.try_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.cases, sub, desc._1)); + return Curry._4(Ast_helper_Exp.try_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.cases, sub, desc._1)); case /* Pexp_tuple */ 8 : - return Curry._3(Ast_helper_Exp.tuple, loc, attrs, Stdlib__List.map(Curry._1(sub.expr, sub), desc._0)); + return Curry._3(Ast_helper_Exp.tuple, loc, attrs, Stdlib__List.map(Curry._1(sub.expr, sub), desc._0)); case /* Pexp_construct */ 9 : - return Curry._4(Ast_helper_Exp.construct, loc, attrs, map_loc(sub, desc._0), map_opt(Curry._1(sub.expr, sub), desc._1)); + return Curry._4(Ast_helper_Exp.construct, loc, attrs, map_loc(sub, desc._0), map_opt(Curry._1(sub.expr, sub), desc._1)); case /* Pexp_variant */ 10 : - return Curry._4(Ast_helper_Exp.variant, loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1)); + return Curry._4(Ast_helper_Exp.variant, loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1)); case /* Pexp_record */ 11 : - const partial_arg$1 = Curry._1(sub.expr, sub); - return Curry._4(Ast_helper_Exp.record, loc, attrs, Stdlib__List.map((function (param) { - return map_tuple((function (param) { - return map_loc(sub, param); - }), partial_arg$1, param); - }), desc._0), map_opt(Curry._1(sub.expr, sub), desc._1)); + const partial_arg$1 = Curry._1(sub.expr, sub); + return Curry._4(Ast_helper_Exp.record, loc, attrs, Stdlib__List.map((function (param) { + return map_tuple((function (param) { + return map_loc(sub, param); + }), partial_arg$1, param); + }), desc._0), map_opt(Curry._1(sub.expr, sub), desc._1)); case /* Pexp_field */ 12 : - return Curry._4(Ast_helper_Exp.field, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_loc(sub, desc._1)); + return Curry._4(Ast_helper_Exp.field, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_loc(sub, desc._1)); case /* Pexp_setfield */ 13 : - return Curry._5(Ast_helper_Exp.setfield, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_loc(sub, desc._1), Curry._2(sub.expr, sub, desc._2)); + return Curry._5(Ast_helper_Exp.setfield, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_loc(sub, desc._1), Curry._2(sub.expr, sub, desc._2)); case /* Pexp_array */ 14 : - return Curry._3(Ast_helper_Exp.array, loc, attrs, Stdlib__List.map(Curry._1(sub.expr, sub), desc._0)); + return Curry._3(Ast_helper_Exp.array, loc, attrs, Stdlib__List.map(Curry._1(sub.expr, sub), desc._0)); case /* Pexp_ifthenelse */ 15 : - return Curry._5(Ast_helper_Exp.ifthenelse, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1), map_opt(Curry._1(sub.expr, sub), desc._2)); + return Curry._5(Ast_helper_Exp.ifthenelse, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1), map_opt(Curry._1(sub.expr, sub), desc._2)); case /* Pexp_sequence */ 16 : - return Curry._4(Ast_helper_Exp.sequence, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1)); + return Curry._4(Ast_helper_Exp.sequence, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1)); case /* Pexp_while */ 17 : - return Curry._4(Ast_helper_Exp.while_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1)); + return Curry._4(Ast_helper_Exp.while_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.expr, sub, desc._1)); case /* Pexp_for */ 18 : - return Curry._7(Ast_helper_Exp.for_, loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.expr, sub, desc._1), Curry._2(sub.expr, sub, desc._2), desc._3, Curry._2(sub.expr, sub, desc._4)); + return Curry._7(Ast_helper_Exp.for_, loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.expr, sub, desc._1), Curry._2(sub.expr, sub, desc._2), desc._3, Curry._2(sub.expr, sub, desc._4)); case /* Pexp_constraint */ 19 : - return Curry._4(Ast_helper_Exp.constraint_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.typ, sub, desc._1)); + return Curry._4(Ast_helper_Exp.constraint_, loc, attrs, Curry._2(sub.expr, sub, desc._0), Curry._2(sub.typ, sub, desc._1)); case /* Pexp_coerce */ 20 : - return Curry._5(Ast_helper_Exp.coerce, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_opt(Curry._1(sub.typ, sub), desc._1), Curry._2(sub.typ, sub, desc._2)); + return Curry._5(Ast_helper_Exp.coerce, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_opt(Curry._1(sub.typ, sub), desc._1), Curry._2(sub.typ, sub, desc._2)); case /* Pexp_send */ 21 : - return Curry._4(Ast_helper_Exp.send, loc, attrs, Curry._2(sub.expr, sub, desc._0), desc._1); + return Curry._4(Ast_helper_Exp.send, loc, attrs, Curry._2(sub.expr, sub, desc._0), desc._1); case /* Pexp_new */ 22 : - return Curry._3(Ast_helper_Exp.new_, loc, attrs, map_loc(sub, desc._0)); + return Curry._3(Ast_helper_Exp.new_, loc, attrs, map_loc(sub, desc._0)); case /* Pexp_setinstvar */ 23 : - return Curry._4(Ast_helper_Exp.setinstvar, loc, attrs, map_loc(sub, desc._0), Curry._2(sub.expr, sub, desc._1)); + return Curry._4(Ast_helper_Exp.setinstvar, loc, attrs, map_loc(sub, desc._0), Curry._2(sub.expr, sub, desc._1)); case /* Pexp_override */ 24 : - const partial_arg$2 = Curry._1(sub.expr, sub); - return Curry._3(Ast_helper_Exp.override, loc, attrs, Stdlib__List.map((function (param) { - return map_tuple((function (param) { - return map_loc(sub, param); - }), partial_arg$2, param); - }), desc._0)); + const partial_arg$2 = Curry._1(sub.expr, sub); + return Curry._3(Ast_helper_Exp.override, loc, attrs, Stdlib__List.map((function (param) { + return map_tuple((function (param) { + return map_loc(sub, param); + }), partial_arg$2, param); + }), desc._0)); case /* Pexp_letmodule */ 25 : - return Curry._5(Ast_helper_Exp.letmodule, loc, attrs, map_loc(sub, desc._0), Curry._2(sub.module_expr, sub, desc._1), Curry._2(sub.expr, sub, desc._2)); + return Curry._5(Ast_helper_Exp.letmodule, loc, attrs, map_loc(sub, desc._0), Curry._2(sub.module_expr, sub, desc._1), Curry._2(sub.expr, sub, desc._2)); case /* Pexp_assert */ 26 : - return Curry._3(Ast_helper_Exp.assert_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); + return Curry._3(Ast_helper_Exp.assert_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); case /* Pexp_lazy */ 27 : - return Curry._3(Ast_helper_Exp.lazy_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); + return Curry._3(Ast_helper_Exp.lazy_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); case /* Pexp_poly */ 28 : - return Curry._4(Ast_helper_Exp.poly, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_opt(Curry._1(sub.typ, sub), desc._1)); + return Curry._4(Ast_helper_Exp.poly, loc, attrs, Curry._2(sub.expr, sub, desc._0), map_opt(Curry._1(sub.typ, sub), desc._1)); case /* Pexp_object */ 29 : - return Curry._3(Ast_helper_Exp.object_, loc, attrs, Curry._2(sub.class_structure, sub, desc._0)); + return Curry._3(Ast_helper_Exp.object_, loc, attrs, Curry._2(sub.class_structure, sub, desc._0)); case /* Pexp_newtype */ 30 : - return Curry._4(Ast_helper_Exp.newtype, loc, attrs, desc._0, Curry._2(sub.expr, sub, desc._1)); + return Curry._4(Ast_helper_Exp.newtype, loc, attrs, desc._0, Curry._2(sub.expr, sub, desc._1)); case /* Pexp_pack */ 31 : - return Curry._3(Ast_helper_Exp.pack, loc, attrs, Curry._2(sub.module_expr, sub, desc._0)); + return Curry._3(Ast_helper_Exp.pack, loc, attrs, Curry._2(sub.module_expr, sub, desc._0)); case /* Pexp_open */ 32 : - return Curry._5(Ast_helper_Exp.open_, loc, attrs, desc._0, map_loc(sub, desc._1), Curry._2(sub.expr, sub, desc._2)); + return Curry._5(Ast_helper_Exp.open_, loc, attrs, desc._0, map_loc(sub, desc._1), Curry._2(sub.expr, sub, desc._2)); case /* Pexp_extension */ 33 : - return Curry._3(Ast_helper_Exp.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return Curry._3(Ast_helper_Exp.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9930,42 +9930,42 @@ function map$6(sub, param) { } switch (desc.TAG) { case /* Ppat_var */ 0 : - return $$var$1(loc, attrs, map_loc(sub, desc._0)); + return $$var$1(loc, attrs, map_loc(sub, desc._0)); case /* Ppat_alias */ 1 : - return alias$1(loc, attrs, Curry._2(sub.pat, sub, desc._0), map_loc(sub, desc._1)); + return alias$1(loc, attrs, Curry._2(sub.pat, sub, desc._0), map_loc(sub, desc._1)); case /* Ppat_constant */ 2 : - return constant(loc, attrs, desc._0); + return constant(loc, attrs, desc._0); case /* Ppat_interval */ 3 : - return interval(loc, attrs, desc._0, desc._1); + return interval(loc, attrs, desc._0, desc._1); case /* Ppat_tuple */ 4 : - return tuple$1(loc, attrs, Stdlib__List.map(Curry._1(sub.pat, sub), desc._0)); + return tuple$1(loc, attrs, Stdlib__List.map(Curry._1(sub.pat, sub), desc._0)); case /* Ppat_construct */ 5 : - return construct(loc, attrs, map_loc(sub, desc._0), map_opt(Curry._1(sub.pat, sub), desc._1)); + return construct(loc, attrs, map_loc(sub, desc._0), map_opt(Curry._1(sub.pat, sub), desc._1)); case /* Ppat_variant */ 6 : - return variant$1(loc, attrs, desc._0, map_opt(Curry._1(sub.pat, sub), desc._1)); + return variant$1(loc, attrs, desc._0, map_opt(Curry._1(sub.pat, sub), desc._1)); case /* Ppat_record */ 7 : - const partial_arg = Curry._1(sub.pat, sub); - return record(loc, attrs, Stdlib__List.map((function (param) { - return map_tuple((function (param) { - return map_loc(sub, param); - }), partial_arg, param); - }), desc._0), desc._1); + const partial_arg = Curry._1(sub.pat, sub); + return record(loc, attrs, Stdlib__List.map((function (param) { + return map_tuple((function (param) { + return map_loc(sub, param); + }), partial_arg, param); + }), desc._0), desc._1); case /* Ppat_array */ 8 : - return array(loc, attrs, Stdlib__List.map(Curry._1(sub.pat, sub), desc._0)); + return array(loc, attrs, Stdlib__List.map(Curry._1(sub.pat, sub), desc._0)); case /* Ppat_or */ 9 : - return or_(loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.pat, sub, desc._1)); + return or_(loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.pat, sub, desc._1)); case /* Ppat_constraint */ 10 : - return constraint_(loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.typ, sub, desc._1)); + return constraint_(loc, attrs, Curry._2(sub.pat, sub, desc._0), Curry._2(sub.typ, sub, desc._1)); case /* Ppat_type */ 11 : - return type_(loc, attrs, map_loc(sub, desc._0)); + return type_(loc, attrs, map_loc(sub, desc._0)); case /* Ppat_lazy */ 12 : - return lazy_(loc, attrs, Curry._2(sub.pat, sub, desc._0)); + return lazy_(loc, attrs, Curry._2(sub.pat, sub, desc._0)); case /* Ppat_unpack */ 13 : - return unpack(loc, attrs, map_loc(sub, desc._0)); + return unpack(loc, attrs, map_loc(sub, desc._0)); case /* Ppat_exception */ 14 : - return exception_(loc, attrs, Curry._2(sub.pat, sub, desc._0)); + return exception_(loc, attrs, Curry._2(sub.pat, sub, desc._0)); case /* Ppat_extension */ 15 : - return extension$1(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension$1(loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -9976,22 +9976,22 @@ function map$7(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pcl_attributes); switch (desc.TAG) { case /* Pcl_constr */ 0 : - return constr$1(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); + return constr$1(loc, attrs, map_loc(sub, desc._0), Stdlib__List.map(Curry._1(sub.typ, sub), desc._1)); case /* Pcl_structure */ 1 : - return structure$1(loc, attrs, Curry._2(sub.class_structure, sub, desc._0)); + return structure$1(loc, attrs, Curry._2(sub.class_structure, sub, desc._0)); case /* Pcl_fun */ 2 : - return fun_$1(loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1), Curry._2(sub.pat, sub, desc._2), Curry._2(sub.class_expr, sub, desc._3)); + return fun_$1(loc, attrs, desc._0, map_opt(Curry._1(sub.expr, sub), desc._1), Curry._2(sub.pat, sub, desc._2), Curry._2(sub.class_expr, sub, desc._3)); case /* Pcl_apply */ 3 : - const partial_arg = Curry._1(sub.expr, sub); - return apply$2(loc, attrs, Curry._2(sub.class_expr, sub, desc._0), Stdlib__List.map((function (param) { - return map_snd(partial_arg, param); - }), desc._1)); + const partial_arg = Curry._1(sub.expr, sub); + return apply$2(loc, attrs, Curry._2(sub.class_expr, sub, desc._0), Stdlib__List.map((function (param) { + return map_snd(partial_arg, param); + }), desc._1)); case /* Pcl_let */ 4 : - return let_$1(loc, attrs, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1), Curry._2(sub.class_expr, sub, desc._2)); + return let_$1(loc, attrs, desc._0, Stdlib__List.map(Curry._1(sub.value_binding, sub), desc._1), Curry._2(sub.class_expr, sub, desc._2)); case /* Pcl_constraint */ 5 : - return constraint_$3(loc, attrs, Curry._2(sub.class_expr, sub, desc._0), Curry._2(sub.class_type, sub, desc._1)); + return constraint_$3(loc, attrs, Curry._2(sub.class_expr, sub, desc._0), Curry._2(sub.class_type, sub, desc._1)); case /* Pcl_extension */ 6 : - return extension$7(loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return extension$7(loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -10017,22 +10017,22 @@ function map_field$1(sub, param) { const attrs = Curry._2(sub.attributes, sub, param.pcf_attributes); switch (desc.TAG) { case /* Pcf_inherit */ 0 : - return Curry._5(Ast_helper_Cf.inherit_, loc, attrs, desc._0, Curry._2(sub.class_expr, sub, desc._1), desc._2); + return Curry._5(Ast_helper_Cf.inherit_, loc, attrs, desc._0, Curry._2(sub.class_expr, sub, desc._1), desc._2); case /* Pcf_val */ 1 : - const match = desc._0; - return Curry._5(Ast_helper_Cf.val_, loc, attrs, map_loc(sub, match[0]), match[1], map_kind(sub, match[2])); + const match = desc._0; + return Curry._5(Ast_helper_Cf.val_, loc, attrs, map_loc(sub, match[0]), match[1], map_kind(sub, match[2])); case /* Pcf_method */ 2 : - const match$1 = desc._0; - return Curry._5(Ast_helper_Cf.method_, loc, attrs, map_loc(sub, match$1[0]), match$1[1], map_kind(sub, match$1[2])); + const match$1 = desc._0; + return Curry._5(Ast_helper_Cf.method_, loc, attrs, map_loc(sub, match$1[0]), match$1[1], map_kind(sub, match$1[2])); case /* Pcf_constraint */ 3 : - const match$2 = desc._0; - return Curry._4(Ast_helper_Cf.constraint_, loc, attrs, Curry._2(sub.typ, sub, match$2[0]), Curry._2(sub.typ, sub, match$2[1])); + const match$2 = desc._0; + return Curry._4(Ast_helper_Cf.constraint_, loc, attrs, Curry._2(sub.typ, sub, match$2[0]), Curry._2(sub.typ, sub, match$2[1])); case /* Pcf_initializer */ 4 : - return Curry._3(Ast_helper_Cf.initializer_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); + return Curry._3(Ast_helper_Cf.initializer_, loc, attrs, Curry._2(sub.expr, sub, desc._0)); case /* Pcf_attribute */ 5 : - return Curry._2(Ast_helper_Cf.attribute, loc, Curry._2(sub.attribute, sub, desc._0)); + return Curry._2(Ast_helper_Cf.attribute, loc, Curry._2(sub.attribute, sub, desc._0)); case /* Pcf_extension */ 6 : - return Curry._3(Ast_helper_Cf.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); + return Curry._3(Ast_helper_Cf.extension, loc, attrs, Curry._2(sub.extension, sub, desc._0)); } } @@ -10141,21 +10141,21 @@ function default_mapper_open_description($$this, param) { function default_mapper_payload($$this, x) { switch (x.TAG) { case /* PStr */ 0 : - return { - TAG: /* PStr */ 0, - _0: Curry._2($$this.structure, $$this, x._0) - }; + return { + TAG: /* PStr */ 0, + _0: Curry._2($$this.structure, $$this, x._0) + }; case /* PTyp */ 1 : - return { - TAG: /* PTyp */ 1, - _0: Curry._2($$this.typ, $$this, x._0) - }; + return { + TAG: /* PTyp */ 1, + _0: Curry._2($$this.typ, $$this, x._0) + }; case /* PPat */ 2 : - return { - TAG: /* PPat */ 2, - _0: Curry._2($$this.pat, $$this, x._0), - _1: map_opt(Curry._1($$this.expr, $$this), x._1) - }; + return { + TAG: /* PPat */ 2, + _0: Curry._2($$this.pat, $$this, x._0), + _1: map_opt(Curry._1($$this.expr, $$this), x._1) + }; } } @@ -10457,7 +10457,7 @@ function is_not_doc(param) { case "ocaml.doc" : case "ocaml.text" : case "text" : - return false; + return false; default: return true; } @@ -10475,29 +10475,29 @@ function attrs(s, x) { function module_path(s, p) { switch (p.TAG) { case /* Pident */ 0 : - try { - return find$2(p._0, s.modules); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return p; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + try { + return find$2(p._0, s.modules); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return p; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Pdot */ 1 : - return { - TAG: /* Pdot */ 1, - _0: module_path(s, p._0), - _1: p._1, - _2: p._2 - }; + return { + TAG: /* Pdot */ 1, + _0: module_path(s, p._0), + _1: p._1, + _2: p._2 + }; case /* Papply */ 2 : - return { - TAG: /* Papply */ 2, - _0: module_path(s, p._0), - _1: module_path(s, p._1) - }; + return { + TAG: /* Papply */ 2, + _0: module_path(s, p._0), + _1: module_path(s, p._1) + }; } } @@ -10505,30 +10505,30 @@ function module_path(s, p) { function modtype_path(s, p) { switch (p.TAG) { case /* Pident */ 0 : - try { - const p$1 = find$2(p._0, s.modtypes); - if (p$1.TAG === /* Mty_ident */ 0) { - return p$1._0; - } else { - return fatal_error("Subst.modtype_path"); - } + try { + const p$1 = find$2(p._0, s.modtypes); + if (p$1.TAG === /* Mty_ident */ 0) { + return p$1._0; + } else { + return fatal_error("Subst.modtype_path"); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return p; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return p; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Pdot */ 1 : - return { - TAG: /* Pdot */ 1, - _0: module_path(s, p._0), - _1: p._1, - _2: p._2 - }; + return { + TAG: /* Pdot */ 1, + _0: module_path(s, p._0), + _1: p._1, + _2: p._2 + }; case /* Papply */ 2 : - return fatal_error("Subst.modtype_path"); + return fatal_error("Subst.modtype_path"); } } @@ -10536,25 +10536,25 @@ function modtype_path(s, p) { function type_path(s, p) { switch (p.TAG) { case /* Pident */ 0 : - try { - return find$2(p._0, s.types); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return p; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + try { + return find$2(p._0, s.types); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return p; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Pdot */ 1 : - return { - TAG: /* Pdot */ 1, - _0: module_path(s, p._0), - _1: p._1, - _2: p._2 - }; + return { + TAG: /* Pdot */ 1, + _0: module_path(s, p._0), + _1: p._1, + _2: p._2 + }; case /* Papply */ 2 : - return fatal_error("Subst.type_path"); + return fatal_error("Subst.type_path"); } } @@ -10578,23 +10578,23 @@ function norm(d) { } switch (d.TAG) { case /* Tvar */ 0 : - if (d._0 !== undefined) { - return d; - } else { - return { - TAG: /* Tvar */ 0, - _0: undefined - }; - } + if (d._0 !== undefined) { + return d; + } else { + return { + TAG: /* Tvar */ 0, + _0: undefined + }; + } case /* Tunivar */ 9 : - if (d._0 !== undefined) { - return d; - } else { - return { - TAG: /* Tunivar */ 9, - _0: undefined - }; - } + if (d._0 !== undefined) { + return d; + } else { + return { + TAG: /* Tunivar */ 9, + _0: undefined + }; + } default: return d; } @@ -10609,233 +10609,233 @@ function typexp(s, ty) { } else { switch (desc.TAG) { case /* Tsubst */ 7 : - return desc._0; + return desc._0; case /* Tvar */ 0 : case /* Tunivar */ 9 : - exit = 2; - break; + exit = 2; + break; default: exit = 1; } } switch (exit) { case 1 : - const desc$1 = ty$1.desc; - save_desc(ty$1, desc$1); - const ty$p = s.for_saving ? newpersty({ - TAG: /* Tvar */ 0, - _0: undefined - }) : newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }); - ty$1.desc = { - TAG: /* Tsubst */ 7, - _0: ty$p - }; - let tmp; - let exit$1 = 0; - if (/* tag */ typeof desc$1 === "number" || typeof desc$1 === "string") { - exit$1 = 3; - } else { - switch (desc$1.TAG) { - case /* Tconstr */ 3 : - tmp = { - TAG: /* Tconstr */ 3, - _0: type_path(s, desc$1._0), - _1: Stdlib__List.map((function (param) { - return typexp(s, param); - }), desc$1._1), - _2: { - contents: /* Mnil */ 0 - } - }; - break; - case /* Tobject */ 4 : - const match = desc$1._1.contents; - tmp = { - TAG: /* Tobject */ 4, - _0: typexp(s, desc$1._0), - _1: { - contents: match !== undefined ? [ - type_path(s, match[0]), - Stdlib__List.map((function (param) { - return typexp(s, param); - }), match[1]) - ] : undefined + const desc$1 = ty$1.desc; + save_desc(ty$1, desc$1); + const ty$p = s.for_saving ? newpersty({ + TAG: /* Tvar */ 0, + _0: undefined + }) : newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }); + ty$1.desc = { + TAG: /* Tsubst */ 7, + _0: ty$p + }; + let tmp; + let exit$1 = 0; + if (/* tag */ typeof desc$1 === "number" || typeof desc$1 === "string") { + exit$1 = 3; + } else { + switch (desc$1.TAG) { + case /* Tconstr */ 3 : + tmp = { + TAG: /* Tconstr */ 3, + _0: type_path(s, desc$1._0), + _1: Stdlib__List.map((function (param) { + return typexp(s, param); + }), desc$1._1), + _2: { + contents: /* Mnil */ 0 + } + }; + break; + case /* Tobject */ 4 : + const match = desc$1._1.contents; + tmp = { + TAG: /* Tobject */ 4, + _0: typexp(s, desc$1._0), + _1: { + contents: match !== undefined ? [ + type_path(s, match[0]), + Stdlib__List.map((function (param) { + return typexp(s, param); + }), match[1]) + ] : undefined + } + }; + break; + case /* Tfield */ 5 : + const m = desc$1._0; + if (s === identity && ty$1.level < 100000000 && m === dummy_method) { + tmp = { + TAG: /* Tfield */ 5, + _0: m, + _1: desc$1._1, + _2: desc$1._2, + _3: typexp(s, desc$1._3) + }; + } else if (Caml_obj.caml_equal(field_kind_repr(desc$1._1), /* Fabsent */ 1)) { + tmp = { + TAG: /* Tlink */ 6, + _0: typexp(s, desc$1._3) + }; + } else { + exit$1 = 3; + } + break; + case /* Tvariant */ 8 : + const row = row_repr_aux(/* [] */ 0, desc$1._0); + const more = repr(row.row_more); + const match$1 = more.desc; + let exit$2 = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tsubst */ 7) { + exit$2 = 4; + } else { + const match$2 = match$1._0.desc; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Ttuple */ 2) { + exit$2 = 4; + } else { + const match$3 = match$2._0; + if (match$3) { + const match$4 = match$3.tl; + if (match$4 && !match$4.tl) { + const ty2 = match$4.hd; + ty$1.desc = { + TAG: /* Tsubst */ 7, + _0: ty2 + }; + tmp = { + TAG: /* Tlink */ 6, + _0: ty2 + }; + } else { + exit$2 = 4; } - }; - break; - case /* Tfield */ 5 : - const m = desc$1._0; - if (s === identity && ty$1.level < 100000000 && m === dummy_method) { - tmp = { - TAG: /* Tfield */ 5, - _0: m, - _1: desc$1._1, - _2: desc$1._2, - _3: typexp(s, desc$1._3) - }; - } else if (Caml_obj.caml_equal(field_kind_repr(desc$1._1), /* Fabsent */ 1)) { - tmp = { - TAG: /* Tlink */ 6, - _0: typexp(s, desc$1._3) - }; } else { - exit$1 = 3; - } - break; - case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, desc$1._0); - const more = repr(row.row_more); - const match$1 = more.desc; - let exit$2 = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tsubst */ 7) { exit$2 = 4; - } else { - const match$2 = match$1._0.desc; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Ttuple */ 2) { - exit$2 = 4; - } else { - const match$3 = match$2._0; - if (match$3) { - const match$4 = match$3.tl; - if (match$4 && !match$4.tl) { - const ty2 = match$4.hd; - ty$1.desc = { - TAG: /* Tsubst */ 7, - _0: ty2 - }; - tmp = { - TAG: /* Tlink */ 6, - _0: ty2 - }; - } else { - exit$2 = 4; - } - } else { - exit$2 = 4; - } - } } - if (exit$2 === 4) { - let dup = true; - if (!s.for_saving) { - let tmp$1 = true; - if (more.level !== 100000000) { - let tmp$2 = true; - if (!static_row(row)) { - const match$5 = more.desc; - let tmp$3; - tmp$3 = /* tag */ typeof match$5 === "number" || typeof match$5 === "string" || match$5.TAG !== /* Tconstr */ 3 ? false : true; - tmp$2 = tmp$3; - } - tmp$1 = tmp$2; - } - dup = tmp$1; + } + } + if (exit$2 === 4) { + let dup = true; + if (!s.for_saving) { + let tmp$1 = true; + if (more.level !== 100000000) { + let tmp$2 = true; + if (!static_row(row)) { + const match$5 = more.desc; + let tmp$3; + tmp$3 = /* tag */ typeof match$5 === "number" || typeof match$5 === "string" || match$5.TAG !== /* Tconstr */ 3 ? false : true; + tmp$2 = tmp$3; } - const ty$2 = more.desc; - let more$p; - let exit$3 = 0; - if (/* tag */ typeof ty$2 === "number" || typeof ty$2 === "string") { + tmp$1 = tmp$2; + } + dup = tmp$1; + } + const ty$2 = more.desc; + let more$p; + let exit$3 = 0; + if (/* tag */ typeof ty$2 === "number" || typeof ty$2 === "string") { + more$p = typexp(s, more); + } else { + switch (ty$2.TAG) { + case /* Tconstr */ 3 : more$p = typexp(s, more); - } else { - switch (ty$2.TAG) { - case /* Tconstr */ 3 : - more$p = typexp(s, more); - break; - case /* Tsubst */ 7 : - more$p = ty$2._0; - break; - case /* Tvar */ 0 : - case /* Tunivar */ 9 : - exit$3 = 5; - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 9179, - 23 - ] - }); - } - } - if (exit$3 === 5) { - save_desc(more, more.desc); - more$p = s.for_saving ? newpersty(norm(more.desc)) : ( - dup && is_Tvar(more) ? newty2(100000000, more.desc) : more - ); - } - more.desc = { - TAG: /* Tsubst */ 7, - _0: newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: { - hd: more$p, - tl: { - hd: ty$p, - tl: /* [] */ 0 - } - } - }) - }; - const row$1 = copy_row((function (param) { - return typexp(s, param); - }), true, row, !dup, more$p); - const match$6 = row$1.row_name; - tmp = match$6 !== undefined ? ({ - TAG: /* Tvariant */ 8, + break; + case /* Tsubst */ 7 : + more$p = ty$2._0; + break; + case /* Tvar */ 0 : + case /* Tunivar */ 9 : + exit$3 = 5; + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 9179, + 23 + ] + }); + } + } + if (exit$3 === 5) { + save_desc(more, more.desc); + more$p = s.for_saving ? newpersty(norm(more.desc)) : ( + dup && is_Tvar(more) ? newty2(100000000, more.desc) : more + ); + } + more.desc = { + TAG: /* Tsubst */ 7, + _0: newty2(100000000, { + TAG: /* Ttuple */ 2, _0: { - row_fields: row$1.row_fields, - row_more: row$1.row_more, - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: row$1.row_fixed, - row_name: [ - type_path(s, match$6[0]), - match$6[1] - ] + hd: more$p, + tl: { + hd: ty$p, + tl: /* [] */ 0 + } } - }) : ({ - TAG: /* Tvariant */ 8, - _0: row$1 - }); - } - break; - case /* Tpackage */ 11 : - tmp = { - TAG: /* Tpackage */ 11, - _0: modtype_path(s, desc$1._0), - _1: desc$1._1, - _2: Stdlib__List.map((function (param) { - return typexp(s, param); - }), desc$1._2) - }; - break; - default: - exit$1 = 3; - } - } - if (exit$1 === 3) { - tmp = copy_type_desc(undefined, (function (param) { - return typexp(s, param); - }), desc$1); + }) + }; + const row$1 = copy_row((function (param) { + return typexp(s, param); + }), true, row, !dup, more$p); + const match$6 = row$1.row_name; + tmp = match$6 !== undefined ? ({ + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$1.row_fields, + row_more: row$1.row_more, + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: row$1.row_fixed, + row_name: [ + type_path(s, match$6[0]), + match$6[1] + ] + } + }) : ({ + TAG: /* Tvariant */ 8, + _0: row$1 + }); + } + break; + case /* Tpackage */ 11 : + tmp = { + TAG: /* Tpackage */ 11, + _0: modtype_path(s, desc$1._0), + _1: desc$1._1, + _2: Stdlib__List.map((function (param) { + return typexp(s, param); + }), desc$1._2) + }; + break; + default: + exit$1 = 3; } - ty$p.desc = tmp; - return ty$p; + } + if (exit$1 === 3) { + tmp = copy_type_desc(undefined, (function (param) { + return typexp(s, param); + }), desc$1); + } + ty$p.desc = tmp; + return ty$p; case 2 : - if (!(s.for_saving || ty$1.id < 0)) { - return ty$1; - } - const ty$p$1 = s.for_saving ? newpersty(norm(desc)) : newty2(ty$1.level, desc); - save_desc(ty$1, desc); - ty$1.desc = { - TAG: /* Tsubst */ 7, - _0: ty$p$1 - }; - return ty$p$1; + if (!(s.for_saving || ty$1.id < 0)) { + return ty$1; + } + const ty$p$1 = s.for_saving ? newpersty(norm(desc)) : newty2(ty$1.level, desc); + save_desc(ty$1, desc); + ty$1.desc = { + TAG: /* Tsubst */ 7, + _0: ty$p$1 + }; + return ty$p$1; } } @@ -10931,26 +10931,26 @@ function class_signature(s, sign) { function class_type(s, sign) { switch (sign.TAG) { case /* Cty_constr */ 0 : - return { - TAG: /* Cty_constr */ 0, - _0: type_path(s, sign._0), - _1: Stdlib__List.map((function (param) { - return typexp(s, param); - }), sign._1), - _2: class_type(s, sign._2) - }; + return { + TAG: /* Cty_constr */ 0, + _0: type_path(s, sign._0), + _1: Stdlib__List.map((function (param) { + return typexp(s, param); + }), sign._1), + _2: class_type(s, sign._2) + }; case /* Cty_signature */ 1 : - return { - TAG: /* Cty_signature */ 1, - _0: class_signature(s, sign._0) - }; + return { + TAG: /* Cty_signature */ 1, + _0: class_signature(s, sign._0) + }; case /* Cty_arrow */ 2 : - return { - TAG: /* Cty_arrow */ 2, - _0: sign._0, - _1: typexp(s, sign._1), - _2: class_type(s, sign._2) - }; + return { + TAG: /* Cty_arrow */ 2, + _0: sign._0, + _1: typexp(s, sign._1), + _2: class_type(s, sign._2) + }; } } @@ -11051,47 +11051,47 @@ function rename_bound_idents(_s, _idents, _param) { const match = param.hd; switch (match.TAG) { case /* Sig_type */ 1 : - const id = match._0; - const id$p = rename(id); - _param = param.tl; - _idents = { - hd: id$p, - tl: idents - }; - _s = add_type(id, { - TAG: /* Pident */ 0, - _0: id$p - }, s); - continue; + const id = match._0; + const id$p = rename(id); + _param = param.tl; + _idents = { + hd: id$p, + tl: idents + }; + _s = add_type(id, { + TAG: /* Pident */ 0, + _0: id$p + }, s); + continue; case /* Sig_module */ 3 : - const id$1 = match._0; - const id$p$1 = rename(id$1); - _param = param.tl; - _idents = { - hd: id$p$1, - tl: idents - }; - _s = add_module(id$1, { - TAG: /* Pident */ 0, - _0: id$p$1 - }, s); - continue; + const id$1 = match._0; + const id$p$1 = rename(id$1); + _param = param.tl; + _idents = { + hd: id$p$1, + tl: idents + }; + _s = add_module(id$1, { + TAG: /* Pident */ 0, + _0: id$p$1 + }, s); + continue; case /* Sig_modtype */ 4 : - const id$2 = match._0; - const id$p$2 = rename(id$2); - _param = param.tl; - _idents = { - hd: id$p$2, - tl: idents - }; - _s = add_modtype(id$2, { - TAG: /* Mty_ident */ 0, - _0: { - TAG: /* Pident */ 0, - _0: id$p$2 - } - }, s); - continue; + const id$2 = match._0; + const id$p$2 = rename(id$2); + _param = param.tl; + _idents = { + hd: id$p$2, + tl: idents + }; + _s = add_modtype(id$2, { + TAG: /* Mty_ident */ 0, + _0: { + TAG: /* Pident */ 0, + _0: id$p$2 + } + }, s); + continue; default: const id$p$3 = rename(match._0); _param = param.tl; @@ -11107,57 +11107,57 @@ function rename_bound_idents(_s, _idents, _param) { function modtype(s, mty) { switch (mty.TAG) { case /* Mty_ident */ 0 : - const p = mty._0; - switch (p.TAG) { - case /* Pident */ 0 : - try { - return find$2(p._0, s.modtypes); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return mty; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - case /* Pdot */ 1 : - return { - TAG: /* Mty_ident */ 0, - _0: { - TAG: /* Pdot */ 1, - _0: module_path(s, p._0), - _1: p._1, - _2: p._2 - } - }; - case /* Papply */ 2 : - return fatal_error("Subst.modtype"); - - } + const p = mty._0; + switch (p.TAG) { + case /* Pident */ 0 : + try { + return find$2(p._0, s.modtypes); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return mty; + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + case /* Pdot */ 1 : + return { + TAG: /* Mty_ident */ 0, + _0: { + TAG: /* Pdot */ 1, + _0: module_path(s, p._0), + _1: p._1, + _2: p._2 + } + }; + case /* Papply */ 2 : + return fatal_error("Subst.modtype"); + + } case /* Mty_signature */ 1 : - return { - TAG: /* Mty_signature */ 1, - _0: signature$2(s, mty._0) - }; + return { + TAG: /* Mty_signature */ 1, + _0: signature$2(s, mty._0) + }; case /* Mty_functor */ 2 : - const id = mty._0; - const id$p = rename(id); - return { - TAG: /* Mty_functor */ 2, - _0: id$p, - _1: may_map((function (param) { - return modtype(s, param); - }), mty._1), - _2: modtype(add_module(id, { - TAG: /* Pident */ 0, - _0: id$p - }, s), mty._2) - }; + const id = mty._0; + const id$p = rename(id); + return { + TAG: /* Mty_functor */ 2, + _0: id$p, + _1: may_map((function (param) { + return modtype(s, param); + }), mty._1), + _2: modtype(add_module(id, { + TAG: /* Pident */ 0, + _0: id$p + }, s), mty._2) + }; case /* Mty_alias */ 3 : - return { - TAG: /* Mty_alias */ 3, - _0: module_path(s, mty._0) - }; + return { + TAG: /* Mty_alias */ 3, + _0: module_path(s, mty._0) + }; } } @@ -11168,52 +11168,52 @@ function signature$2(s, sg) { return Stdlib__List.map2((function (param, param$1) { switch (param.TAG) { case /* Sig_value */ 0 : - return { - TAG: /* Sig_value */ 0, - _0: param$1, - _1: value_description(s$p, param._1) - }; + return { + TAG: /* Sig_value */ 0, + _0: param$1, + _1: value_description(s$p, param._1) + }; case /* Sig_type */ 1 : - return { - TAG: /* Sig_type */ 1, - _0: param$1, - _1: type_declaration(s$p, param._1), - _2: param._2 - }; + return { + TAG: /* Sig_type */ 1, + _0: param$1, + _1: type_declaration(s$p, param._1), + _2: param._2 + }; case /* Sig_typext */ 2 : - return { - TAG: /* Sig_typext */ 2, - _0: param$1, - _1: extension_constructor(s$p, param._1), - _2: param._2 - }; + return { + TAG: /* Sig_typext */ 2, + _0: param$1, + _1: extension_constructor(s$p, param._1), + _2: param._2 + }; case /* Sig_module */ 3 : - return { - TAG: /* Sig_module */ 3, - _0: param$1, - _1: module_declaration(s$p, param._1), - _2: param._2 - }; + return { + TAG: /* Sig_module */ 3, + _0: param$1, + _1: module_declaration(s$p, param._1), + _2: param._2 + }; case /* Sig_modtype */ 4 : - return { - TAG: /* Sig_modtype */ 4, - _0: param$1, - _1: modtype_declaration(s$p, param._1) - }; + return { + TAG: /* Sig_modtype */ 4, + _0: param$1, + _1: modtype_declaration(s$p, param._1) + }; case /* Sig_class */ 5 : - return { - TAG: /* Sig_class */ 5, - _0: param$1, - _1: class_declaration(s$p, param._1), - _2: param._2 - }; + return { + TAG: /* Sig_class */ 5, + _0: param$1, + _1: class_declaration(s$p, param._1), + _2: param._2 + }; case /* Sig_class_type */ 6 : - return { - TAG: /* Sig_class_type */ 6, - _0: param$1, - _1: cltype_declaration(s$p, param._1), - _2: param._2 - }; + return { + TAG: /* Sig_class_type */ 6, + _0: param$1, + _1: cltype_declaration(s$p, param._1), + _2: param._2 + }; } }), sg, match[0]); @@ -11257,14 +11257,14 @@ const type_declarations = Stdlib__Hashtbl.create(undefined, 16); function add_constructor_usage(cu, param) { switch (param) { case /* Positive */ 0 : - cu.cu_positive = true; - return; + cu.cu_positive = true; + return; case /* Pattern */ 1 : - cu.cu_pattern = true; - return; + cu.cu_pattern = true; + return; case /* Privatize */ 2 : - cu.cu_privatize = true; - return; + cu.cu_privatize = true; + return; } } @@ -11279,26 +11279,26 @@ function force(f, x) { const x$1 = x.contents; switch (x$1.TAG) { case /* Done */ 0 : - return x$1._0; + return x$1._0; case /* Raise */ 1 : - throw new Caml_js_exceptions.MelangeError(x$1._0.MEL_EXN_ID, x$1._0); + throw new Caml_js_exceptions.MelangeError(x$1._0.MEL_EXN_ID, x$1._0); case /* Thunk */ 2 : - try { - const y = Curry._1(f, x$1._0); - x.contents = { - TAG: /* Done */ 0, - _0: y - }; - return y; - } - catch (raw_e){ - const e = Caml_js_exceptions.internalToOCamlException(raw_e); - x.contents = { - TAG: /* Raise */ 1, - _0: e - }; - throw new Caml_js_exceptions.MelangeError(e.MEL_EXN_ID, e); - } + try { + const y = Curry._1(f, x$1._0); + x.contents = { + TAG: /* Done */ 0, + _0: y + }; + return y; + } + catch (raw_e){ + const e = Caml_js_exceptions.internalToOCamlException(raw_e); + x.contents = { + TAG: /* Raise */ 1, + _0: e + }; + throw new Caml_js_exceptions.MelangeError(e.MEL_EXN_ID, e); + } } } @@ -11308,9 +11308,9 @@ function get_arg(x) { switch (a.TAG) { case /* Done */ 0 : case /* Raise */ 1 : - return; + return; case /* Thunk */ 2 : - return Caml_option.some(a._0); + return Caml_option.some(a._0); } } @@ -11860,39 +11860,39 @@ function find_pers_struct(checkOpt, name) { function find_module_descr(path, env) { switch (path.TAG) { case /* Pident */ 0 : - const id = path._0; - try { - return find_same$1(id, env.components)[1]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - if (id.stamp === 0 && id.name !== current_unit.contents) { - return find_pers_struct(undefined, id.name).ps_comps; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const id = path._0; + try { + return find_same$1(id, env.components)[1]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + if (id.stamp === 0 && id.name !== current_unit.contents) { + return find_pers_struct(undefined, id.name).ps_comps; } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Pdot */ 1 : - const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); - if (c.TAG === /* Structure_comps */ 0) { - return find$2(path._1, c._0.comp_components)[0]; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); + if (c.TAG === /* Structure_comps */ 0) { + return find$2(path._1, c._0.comp_components)[0]; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); case /* Papply */ 2 : - const p1 = path._0; - const f = force(components_of_module_maker$p.contents, find_module_descr(p1, env)); - if (f.TAG !== /* Structure_comps */ 0) { - return Curry._3(components_of_functor_appl$p.contents, f._0, p1, path._1); - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const p1 = path._0; + const f = force(components_of_module_maker$p.contents, find_module_descr(p1, env)); + if (f.TAG !== /* Structure_comps */ 0) { + return Curry._3(components_of_functor_appl$p.contents, f._0, p1, path._1); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -11900,19 +11900,19 @@ function find_module_descr(path, env) { function find$3(proj1, proj2, path, env) { switch (path.TAG) { case /* Pident */ 0 : - return find_same$1(path._0, Curry._1(proj1, env))[1]; + return find_same$1(path._0, Curry._1(proj1, env))[1]; case /* Pdot */ 1 : - const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); - if (c.TAG === /* Structure_comps */ 0) { - return find$2(path._1, Curry._1(proj2, c._0))[0]; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); + if (c.TAG === /* Structure_comps */ 0) { + return find$2(path._1, Curry._1(proj2, c._0))[0]; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); case /* Papply */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -11952,83 +11952,83 @@ function find_class(param, param$1) { function find_module(alias, path, env) { switch (path.TAG) { case /* Pident */ 0 : - const id = path._0; - try { - return find_same$1(id, env.modules)[1]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - if (id.stamp === 0 && id.name !== current_unit.contents) { - const ps = find_pers_struct(undefined, id.name); - return { - md_type: { - TAG: /* Mty_signature */ 1, - _0: ps.ps_sig - }, - md_attributes: /* [] */ 0, - md_loc: none - }; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const id = path._0; + try { + return find_same$1(id, env.modules)[1]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + if (id.stamp === 0 && id.name !== current_unit.contents) { + const ps = find_pers_struct(undefined, id.name); + return { + md_type: { + TAG: /* Mty_signature */ 1, + _0: ps.ps_sig + }, + md_attributes: /* [] */ 0, + md_loc: none + }; } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - case /* Pdot */ 1 : - const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); - if (c.TAG === /* Structure_comps */ 0) { - const match = find$2(path._1, c._0.comp_modules); - const md_type = force(subst_modtype_maker, match[0]); - return { - md_type: md_type, - md_attributes: /* [] */ 0, - md_loc: none - }; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - case /* Papply */ 2 : - const p2 = path._1; - const desc1 = find_module_descr(path._0, env); - const f = force(components_of_module_maker$p.contents, desc1); - if (f.TAG === /* Structure_comps */ 0) { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - const f$1 = f._0; - const p = f$1.fcomp_res; - let md_type$1; - if (p.TAG === /* Mty_alias */ 3) { - md_type$1 = { - TAG: /* Mty_alias */ 3, - _0: module_path(f$1.fcomp_subst, p._0) - }; - } else if (alias) { - md_type$1 = p; - } else { - try { - md_type$1 = Stdlib__Hashtbl.find(f$1.fcomp_subst_cache, p2); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - const mty = modtype(add_module(f$1.fcomp_param, p2, f$1.fcomp_subst), f$1.fcomp_res); - Stdlib__Hashtbl.add(f$1.fcomp_subst_cache, p2, mty); - md_type$1 = mty; - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - } - } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + case /* Pdot */ 1 : + const c = force(components_of_module_maker$p.contents, find_module_descr(path._0, env)); + if (c.TAG === /* Structure_comps */ 0) { + const match = find$2(path._1, c._0.comp_modules); + const md_type = force(subst_modtype_maker, match[0]); return { - md_type: md_type$1, + md_type: md_type, md_attributes: /* [] */ 0, md_loc: none }; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + case /* Papply */ 2 : + const p2 = path._1; + const desc1 = find_module_descr(path._0, env); + const f = force(components_of_module_maker$p.contents, desc1); + if (f.TAG === /* Structure_comps */ 0) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + const f$1 = f._0; + const p = f$1.fcomp_res; + let md_type$1; + if (p.TAG === /* Mty_alias */ 3) { + md_type$1 = { + TAG: /* Mty_alias */ 3, + _0: module_path(f$1.fcomp_subst, p._0) + }; + } else if (alias) { + md_type$1 = p; + } else { + try { + md_type$1 = Stdlib__Hashtbl.find(f$1.fcomp_subst_cache, p2); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + const mty = modtype(add_module(f$1.fcomp_param, p2, f$1.fcomp_subst), f$1.fcomp_res); + Stdlib__Hashtbl.add(f$1.fcomp_subst_cache, p2, mty); + md_type$1 = mty; + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + } + } + return { + md_type: md_type$1, + md_attributes: /* [] */ 0, + md_loc: none + }; } } @@ -12054,23 +12054,23 @@ function normalize_path(lax, env, path) { let path$1; switch (path.TAG) { case /* Pident */ 0 : - path$1 = path; - break; + path$1 = path; + break; case /* Pdot */ 1 : - path$1 = { - TAG: /* Pdot */ 1, - _0: normalize_path(lax, env, path._0), - _1: path._1, - _2: path._2 - }; - break; + path$1 = { + TAG: /* Pdot */ 1, + _0: normalize_path(lax, env, path._0), + _1: path._1, + _2: path._2 + }; + break; case /* Papply */ 2 : - path$1 = { - TAG: /* Papply */ 2, - _0: normalize_path(lax, env, path._0), - _1: normalize_path(true, env, path._1) - }; - break; + path$1 = { + TAG: /* Papply */ 2, + _0: normalize_path(lax, env, path._0), + _1: normalize_path(true, env, path._1) + }; + break; } try { @@ -12097,12 +12097,12 @@ function normalize_path(lax, env, path) { let tmp$1; switch (path$1.TAG) { case /* Pident */ 0 : - tmp$1 = path$1._0.stamp !== 0; - break; + tmp$1 = path$1._0.stamp !== 0; + break; case /* Pdot */ 1 : case /* Papply */ 2 : - tmp$1 = true; - break; + tmp$1 = true; + break; } tmp = tmp$1; @@ -12231,22 +12231,22 @@ function is_functor_arg(_path, env) { const path = _path; switch (path.TAG) { case /* Pident */ 0 : - try { - find_same(path._0, env.functor_args); - return true; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return false; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + try { + find_same(path._0, env.functor_args); + return true; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return false; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Pdot */ 1 : - _path = path._0; - continue; + _path = path._0; + continue; case /* Papply */ 2 : - return true; + return true; } }; @@ -12257,73 +12257,73 @@ const Recmodule = /* @__PURE__ */ Caml_exceptions.create("Ocaml_typedtree_test.E function lookup_module_descr(lid, env) { switch (lid.TAG) { case /* Lident */ 0 : - const s = lid._0; - try { - return find_name$1(s, env.components); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - if (s === current_unit.contents) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - const ps = find_pers_struct(undefined, s); - return [ - { - TAG: /* Pident */ 0, - _0: { - stamp: 0, - name: s, - flags: 1 - } - }, - ps.ps_comps - ]; + const s = lid._0; + try { + return find_name$1(s, env.components); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + if (s === current_unit.contents) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - case /* Ldot */ 1 : - const s$1 = lid._1; - const match = lookup_module_descr(lid._0, env); - const c = force(components_of_module_maker$p.contents, match[1]); - if (c.TAG === /* Structure_comps */ 0) { - const match$1 = find$2(s$1, c._0.comp_components); + const ps = find_pers_struct(undefined, s); return [ { - TAG: /* Pdot */ 1, - _0: match[0], - _1: s$1, - _2: match$1[1] + TAG: /* Pident */ 0, + _0: { + stamp: 0, + name: s, + flags: 1 + } }, - match$1[0] + ps.ps_comps ]; } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - case /* Lapply */ 2 : - const match$2 = lookup_module_descr(lid._0, env); - const p1 = match$2[0]; - const p2 = lookup_module(true, lid._1, env); - const match$3 = find_module(false, p2, env); - const f = force(components_of_module_maker$p.contents, match$2[1]); - if (f.TAG === /* Structure_comps */ 0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - const f$1 = f._0; - may(Curry._3(check_modtype_inclusion.contents, env, match$3.md_type, p2), f$1.fcomp_arg); + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + case /* Ldot */ 1 : + const s$1 = lid._1; + const match = lookup_module_descr(lid._0, env); + const c = force(components_of_module_maker$p.contents, match[1]); + if (c.TAG === /* Structure_comps */ 0) { + const match$1 = find$2(s$1, c._0.comp_components); return [ { - TAG: /* Papply */ 2, - _0: p1, - _1: p2 + TAG: /* Pdot */ 1, + _0: match[0], + _1: s$1, + _2: match$1[1] }, - Curry._3(components_of_functor_appl$p.contents, f$1, p1, p2) + match$1[0] ]; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + case /* Lapply */ 2 : + const match$2 = lookup_module_descr(lid._0, env); + const p1 = match$2[0]; + const p2 = lookup_module(true, lid._1, env); + const match$3 = find_module(false, p2, env); + const f = force(components_of_module_maker$p.contents, match$2[1]); + if (f.TAG === /* Structure_comps */ 0) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + const f$1 = f._0; + may(Curry._3(check_modtype_inclusion.contents, env, match$3.md_type, p2), f$1.fcomp_arg); + return [ + { + TAG: /* Papply */ 2, + _0: p1, + _1: p2 + }, + Curry._3(components_of_functor_appl$p.contents, f$1, p1, p2) + ]; } } @@ -12331,99 +12331,99 @@ function lookup_module_descr(lid, env) { function lookup_module(load, lid, env) { switch (lid.TAG) { case /* Lident */ 0 : - const s = lid._0; - try { - const r = find_name$1(s, env.modules); - const md_type = r[1].md_type; - if (md_type.TAG === /* Mty_ident */ 0) { - const id = md_type._0; - switch (id.TAG) { - case /* Pident */ 0 : - if (id._0.name === "#recmod#") { - throw new Caml_js_exceptions.MelangeError(Recmodule, { - MEL_EXN_ID: Recmodule - }); - } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - break; - - } + const s = lid._0; + try { + const r = find_name$1(s, env.modules); + const md_type = r[1].md_type; + if (md_type.TAG === /* Mty_ident */ 0) { + const id = md_type._0; + switch (id.TAG) { + case /* Pident */ 0 : + if (id._0.name === "#recmod#") { + throw new Caml_js_exceptions.MelangeError(Recmodule, { + MEL_EXN_ID: Recmodule + }); + } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + break; + } - return r[0]; } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - if (s === current_unit.contents) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + return r[0]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + if (s === current_unit.contents) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + if (transparent_modules.contents && !load) { + try { + find_pers_struct(false, s); } - if (transparent_modules.contents && !load) { - try { - find_pers_struct(false, s); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - prerr_warning(none, { - TAG: /* No_cmi_file */ 32, - _0: s - }); - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + prerr_warning(none, { + TAG: /* No_cmi_file */ 32, + _0: s + }); + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - } else { - find_pers_struct(undefined, s); } - return { - TAG: /* Pident */ 0, - _0: { - stamp: 0, - name: s, - flags: 1 - } - }; + } else { + find_pers_struct(undefined, s); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - case /* Ldot */ 1 : - const s$1 = lid._1; - const match = lookup_module_descr(lid._0, env); - const c = force(components_of_module_maker$p.contents, match[1]); - if (c.TAG === /* Structure_comps */ 0) { - const match$1 = find$2(s$1, c._0.comp_modules); return { - TAG: /* Pdot */ 1, - _0: match[0], - _1: s$1, - _2: match$1[1] + TAG: /* Pident */ 0, + _0: { + stamp: 0, + name: s, + flags: 1 + } }; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + case /* Ldot */ 1 : + const s$1 = lid._1; + const match = lookup_module_descr(lid._0, env); + const c = force(components_of_module_maker$p.contents, match[1]); + if (c.TAG === /* Structure_comps */ 0) { + const match$1 = find$2(s$1, c._0.comp_modules); + return { + TAG: /* Pdot */ 1, + _0: match[0], + _1: s$1, + _2: match$1[1] + }; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + case /* Lapply */ 2 : + const match$2 = lookup_module_descr(lid._0, env); + const p2 = lookup_module(true, lid._1, env); + const match$3 = find_module(false, p2, env); + const p_0 = match$2[0]; + const p = { + TAG: /* Papply */ 2, + _0: p_0, + _1: p2 + }; + const f = force(components_of_module_maker$p.contents, match$2[1]); + if (f.TAG === /* Structure_comps */ 0) { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); - case /* Lapply */ 2 : - const match$2 = lookup_module_descr(lid._0, env); - const p2 = lookup_module(true, lid._1, env); - const match$3 = find_module(false, p2, env); - const p_0 = match$2[0]; - const p = { - TAG: /* Papply */ 2, - _0: p_0, - _1: p2 - }; - const f = force(components_of_module_maker$p.contents, match$2[1]); - if (f.TAG === /* Structure_comps */ 0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - may(Curry._3(check_modtype_inclusion.contents, env, match$3.md_type, p2), f._0.fcomp_arg); - return p; + } + may(Curry._3(check_modtype_inclusion.contents, env, match$3.md_type, p2), f._0.fcomp_arg); + return p; } } @@ -12431,30 +12431,30 @@ function lookup_module(load, lid, env) { function lookup(proj1, proj2, lid, env) { switch (lid.TAG) { case /* Lident */ 0 : - return find_name$1(lid._0, Curry._1(proj1, env)); + return find_name$1(lid._0, Curry._1(proj1, env)); case /* Ldot */ 1 : - const s = lid._1; - const match = lookup_module_descr(lid._0, env); - const c = force(components_of_module_maker$p.contents, match[1]); - if (c.TAG === /* Structure_comps */ 0) { - const match$1 = find$2(s, Curry._1(proj2, c._0)); - return [ - { - TAG: /* Pdot */ 1, - _0: match[0], - _1: s, - _2: match$1[1] - }, - match$1[0] - ]; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + const s = lid._1; + const match = lookup_module_descr(lid._0, env); + const c = force(components_of_module_maker$p.contents, match[1]); + if (c.TAG === /* Structure_comps */ 0) { + const match$1 = find$2(s, Curry._1(proj2, c._0)); + return [ + { + TAG: /* Pdot */ 1, + _0: match[0], + _1: s, + _2: match$1[1] + }, + match$1[0] + ]; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -12462,56 +12462,56 @@ function lookup(proj1, proj2, lid, env) { function lookup_all_simple(proj1, proj2, shadow, lid, env) { switch (lid.TAG) { case /* Lident */ 0 : - const xl = find_all(lid._0, Curry._1(proj1, env)); - const do_shadow = function (param) { - if (!param) { - return /* [] */ 0; - } - const match = param.hd; - const x = match[0]; - return { - hd: [ - x, - match[1] - ], - tl: do_shadow(Stdlib__List.filter((function (param) { - return !Curry._2(shadow, x, param[0]); - }), param.tl)) - }; + const xl = find_all(lid._0, Curry._1(proj1, env)); + const do_shadow = function (param) { + if (!param) { + return /* [] */ 0; + } + const match = param.hd; + const x = match[0]; + return { + hd: [ + x, + match[1] + ], + tl: do_shadow(Stdlib__List.filter((function (param) { + return !Curry._2(shadow, x, param[0]); + }), param.tl)) }; - return do_shadow(xl); + }; + return do_shadow(xl); case /* Ldot */ 1 : - const match = lookup_module_descr(lid._0, env); - const c = force(components_of_module_maker$p.contents, match[1]); - if (c.TAG === /* Structure_comps */ 0) { - let comps; - try { - comps = find$2(lid._1, Curry._1(proj2, c._0)); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - comps = /* [] */ 0; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + const match = lookup_module_descr(lid._0, env); + const c = force(components_of_module_maker$p.contents, match[1]); + if (c.TAG === /* Structure_comps */ 0) { + let comps; + try { + comps = find$2(lid._1, Curry._1(proj2, c._0)); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + comps = /* [] */ 0; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - return Stdlib__List.map((function (param) { - return [ - param[0], - (function (param) { - - }) - ]; - }), comps); } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + return Stdlib__List.map((function (param) { + return [ + param[0], + (function (param) { + + }) + ]; + }), comps); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -12522,16 +12522,16 @@ function cstr_shadow(cstr1, cstr2) { switch (match.TAG) { case /* Cstr_constant */ 0 : case /* Cstr_block */ 1 : - return false; + return false; case /* Cstr_extension */ 2 : - switch (match$1.TAG) { - case /* Cstr_constant */ 0 : - case /* Cstr_block */ 1 : - return false; - case /* Cstr_extension */ 2 : - return true; - - } + switch (match$1.TAG) { + case /* Cstr_constant */ 0 : + case /* Cstr_block */ 1 : + return false; + case /* Cstr_extension */ 2 : + return true; + + } } } @@ -12780,10 +12780,10 @@ function lookup_constructor(lid, env) { function is_lident(param) { switch (param.TAG) { case /* Lident */ 0 : - return true; + return true; case /* Ldot */ 1 : case /* Lapply */ 2 : - return false; + return false; } } @@ -12823,24 +12823,24 @@ function mark_constructor(usage, env, name, desc) { switch (match.TAG) { case /* Cstr_constant */ 0 : case /* Cstr_block */ 1 : - break; + break; case /* Cstr_extension */ 2 : - const ty_path$1 = ty_path(desc.cstr_res); - const ty_name = last(ty_path$1); - try { - return Curry._1(Stdlib__Hashtbl.find(used_constructors, [ - ty_name, - desc.cstr_loc, - name - ]), usage); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const ty_path$1 = ty_path(desc.cstr_res); + const ty_name = last(ty_path$1); + try { + return Curry._1(Stdlib__Hashtbl.find(used_constructors, [ + ty_name, + desc.cstr_loc, + name + ]), usage); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } } const ty_path$2 = ty_path(desc.cstr_res); @@ -12929,13 +12929,13 @@ function scrape_alias_safe(env, _mty) { const id = mty._0; switch (id.TAG) { case /* Pident */ 0 : - if (id._0.stamp === 0) { - return false; - } - break; + if (id._0.stamp === 0) { + return false; + } + break; case /* Pdot */ 1 : case /* Papply */ 2 : - break; + break; } _mty = find_module(false, id, env).md_type; @@ -13112,19 +13112,19 @@ function find_all_comps(proj, s, param) { function find_shadowed_comps(path, env) { switch (path.TAG) { case /* Pident */ 0 : - return Stdlib__List.map((function (prim) { - return prim[0]; - }), find_all(path._0.name, env.components)); + return Stdlib__List.map((function (prim) { + return prim[0]; + }), find_all(path._0.name, env.components)); case /* Pdot */ 1 : - const s = path._1; - const l = find_shadowed_comps(path._0, env); - return Stdlib__List.flatten(Stdlib__List.map((function (param) { - return find_all_comps((function (comps) { - return comps.comp_components; - }), s, param); - }), l)); + const s = path._1; + const l = find_shadowed_comps(path._0, env); + return Stdlib__List.flatten(Stdlib__List.map((function (param) { + return find_all_comps((function (comps) { + return comps.comp_components; + }), s, param); + }), l)); case /* Papply */ 2 : - return /* [] */ 0; + return /* [] */ 0; } } @@ -13132,17 +13132,17 @@ function find_shadowed_comps(path, env) { function find_shadowed(proj1, proj2, path, env) { switch (path.TAG) { case /* Pident */ 0 : - return Stdlib__List.map((function (prim) { - return prim[0]; - }), find_all(path._0.name, Curry._1(proj1, env))); + return Stdlib__List.map((function (prim) { + return prim[0]; + }), find_all(path._0.name, Curry._1(proj1, env))); case /* Pdot */ 1 : - const s = path._1; - const l = find_shadowed_comps(path._0, env); - return Stdlib__List.flatten(Stdlib__List.map((function (param) { - return find_all_comps(proj2, s, param); - }), l)); + const s = path._1; + const l = find_shadowed_comps(path._0, env); + return Stdlib__List.flatten(Stdlib__List.map((function (param) { + return find_all_comps(proj2, s, param); + }), l)); case /* Papply */ 2 : - return /* [] */ 0; + return /* [] */ 0; } } @@ -13276,31 +13276,31 @@ function add_gadt_instance_chain(env, lv, t) { function scrape_alias(env, path, mty) { switch (mty.TAG) { case /* Mty_ident */ 0 : - try { - return scrape_alias(env, path, find_modtype_expansion(mty._0, env)); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return mty; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + try { + return scrape_alias(env, path, find_modtype_expansion(mty._0, env)); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return mty; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Mty_signature */ 1 : case /* Mty_functor */ 2 : - break; + break; case /* Mty_alias */ 3 : - const path$1 = mty._0; - try { - return scrape_alias(env, path$1, find_module(false, path$1, env).md_type); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - return mty; - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + const path$1 = mty._0; + try { + return scrape_alias(env, path$1, find_module(false, path$1, env).md_type); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + return mty; } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } } if (path !== undefined) { @@ -13424,65 +13424,65 @@ function constructors_of_type(ty_path, decl) { const a_id$1 = match[0]; switch (a_id$1.name) { case "None" : - const a_descr$1 = match[1]; - if (a_descr$1.cstr_args) { - return result; - } - const match$1 = result.tl; - if (!match$1) { - return result; - } - const match$2 = match$1.hd; - const b_id$1 = match$2[0]; - if (b_id$1.name !== "Some") { - return result; - } - const b_descr$1 = match$2[1]; - const match$3 = b_descr$1.cstr_args; - if (!match$3) { - return result; - } - if (match$3.tl) { - return result; - } - if (match$1.tl) { - return result; - } - a_id = a_id$1; - a_descr = a_descr$1; - b_id = b_id$1; - b_descr = b_descr$1; - break; + const a_descr$1 = match[1]; + if (a_descr$1.cstr_args) { + return result; + } + const match$1 = result.tl; + if (!match$1) { + return result; + } + const match$2 = match$1.hd; + const b_id$1 = match$2[0]; + if (b_id$1.name !== "Some") { + return result; + } + const b_descr$1 = match$2[1]; + const match$3 = b_descr$1.cstr_args; + if (!match$3) { + return result; + } + if (match$3.tl) { + return result; + } + if (match$1.tl) { + return result; + } + a_id = a_id$1; + a_descr = a_descr$1; + b_id = b_id$1; + b_descr = b_descr$1; + break; case "Some" : - const a_descr$2 = match[1]; - const match$4 = a_descr$2.cstr_args; - if (!match$4) { - return result; - } - if (match$4.tl) { - return result; - } - const match$5 = result.tl; - if (!match$5) { - return result; - } - const match$6 = match$5.hd; - const b_id$2 = match$6[0]; - if (b_id$2.name !== "None") { - return result; - } - const b_descr$2 = match$6[1]; - if (b_descr$2.cstr_args) { - return result; - } - if (match$5.tl) { - return result; - } - a_id = a_id$1; - a_descr = a_descr$2; - b_id = b_id$2; - b_descr = b_descr$2; - break; + const a_descr$2 = match[1]; + const match$4 = a_descr$2.cstr_args; + if (!match$4) { + return result; + } + if (match$4.tl) { + return result; + } + const match$5 = result.tl; + if (!match$5) { + return result; + } + const match$6 = match$5.hd; + const b_id$2 = match$6[0]; + if (b_id$2.name !== "None") { + return result; + } + const b_descr$2 = match$6[1]; + if (b_descr$2.cstr_args) { + return result; + } + if (match$5.tl) { + return result; + } + a_id = a_id$1; + a_descr = a_descr$2; + b_id = b_id$2; + b_descr = b_descr$2; + break; default: return result; } @@ -13598,126 +13598,126 @@ function prefix_idents(root, pos, sub, param) { const match = param.hd; switch (match.TAG) { case /* Sig_value */ 0 : - const p_1 = match._0.name; - const p = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1, - _2: pos - }; - const match$1 = match._1.val_kind; - let nextpos; - nextpos = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Val_prim */ 0 ? pos + 1 | 0 : pos; - const match$2 = prefix_idents(root, nextpos, sub, param.tl); - return [ - { - hd: p, - tl: match$2[0] - }, - match$2[1] - ]; + const p_1 = match._0.name; + const p = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1, + _2: pos + }; + const match$1 = match._1.val_kind; + let nextpos; + nextpos = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Val_prim */ 0 ? pos + 1 | 0 : pos; + const match$2 = prefix_idents(root, nextpos, sub, param.tl); + return [ + { + hd: p, + tl: match$2[0] + }, + match$2[1] + ]; case /* Sig_type */ 1 : - const id = match._0; - const p_1$1 = id.name; - const p$1 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$1, - _2: -1 - }; - const match$3 = prefix_idents(root, pos, add_type(id, p$1, sub), param.tl); - return [ - { - hd: p$1, - tl: match$3[0] - }, - match$3[1] - ]; + const id = match._0; + const p_1$1 = id.name; + const p$1 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$1, + _2: -1 + }; + const match$3 = prefix_idents(root, pos, add_type(id, p$1, sub), param.tl); + return [ + { + hd: p$1, + tl: match$3[0] + }, + match$3[1] + ]; case /* Sig_typext */ 2 : - const p_1$2 = match._0.name; - const p$2 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$2, - _2: pos - }; - const match$4 = prefix_idents(root, pos + 1 | 0, sub, param.tl); - return [ - { - hd: p$2, - tl: match$4[0] - }, - match$4[1] - ]; + const p_1$2 = match._0.name; + const p$2 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$2, + _2: pos + }; + const match$4 = prefix_idents(root, pos + 1 | 0, sub, param.tl); + return [ + { + hd: p$2, + tl: match$4[0] + }, + match$4[1] + ]; case /* Sig_module */ 3 : - const id$1 = match._0; - const p_1$3 = id$1.name; - const p$3 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$3, - _2: pos - }; - const match$5 = prefix_idents(root, pos + 1 | 0, add_module(id$1, p$3, sub), param.tl); - return [ - { - hd: p$3, - tl: match$5[0] - }, - match$5[1] - ]; + const id$1 = match._0; + const p_1$3 = id$1.name; + const p$3 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$3, + _2: pos + }; + const match$5 = prefix_idents(root, pos + 1 | 0, add_module(id$1, p$3, sub), param.tl); + return [ + { + hd: p$3, + tl: match$5[0] + }, + match$5[1] + ]; case /* Sig_modtype */ 4 : - const id$2 = match._0; - const p_1$4 = id$2.name; - const p$4 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$4, - _2: -1 - }; - const match$6 = prefix_idents(root, pos, add_modtype(id$2, { - TAG: /* Mty_ident */ 0, - _0: p$4 - }, sub), param.tl); - return [ - { - hd: p$4, - tl: match$6[0] - }, - match$6[1] - ]; + const id$2 = match._0; + const p_1$4 = id$2.name; + const p$4 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$4, + _2: -1 + }; + const match$6 = prefix_idents(root, pos, add_modtype(id$2, { + TAG: /* Mty_ident */ 0, + _0: p$4 + }, sub), param.tl); + return [ + { + hd: p$4, + tl: match$6[0] + }, + match$6[1] + ]; case /* Sig_class */ 5 : - const p_1$5 = match._0.name; - const p$5 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$5, - _2: pos - }; - const match$7 = prefix_idents(root, pos + 1 | 0, sub, param.tl); - return [ - { - hd: p$5, - tl: match$7[0] - }, - match$7[1] - ]; + const p_1$5 = match._0.name; + const p$5 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$5, + _2: pos + }; + const match$7 = prefix_idents(root, pos + 1 | 0, sub, param.tl); + return [ + { + hd: p$5, + tl: match$7[0] + }, + match$7[1] + ]; case /* Sig_class_type */ 6 : - const p_1$6 = match._0.name; - const p$6 = { - TAG: /* Pdot */ 1, - _0: root, - _1: p_1$6, - _2: -1 - }; - const match$8 = prefix_idents(root, pos, sub, param.tl); - return [ - { - hd: p$6, - tl: match$8[0] - }, - match$8[1] - ]; + const p_1$6 = match._0.name; + const p$6 = { + TAG: /* Pdot */ 1, + _0: root, + _1: p_1$6, + _2: -1 + }; + const match$8 = prefix_idents(root, pos, sub, param.tl); + return [ + { + hd: p$6, + tl: match$8[0] + }, + match$8[1] + ]; } } @@ -13734,52 +13734,52 @@ function prefix_idents_and_subst(root, sub, sg) { return Stdlib__List.map((function (item) { switch (item.TAG) { case /* Sig_value */ 0 : - return { - TAG: /* Sig_value */ 0, - _0: item._0, - _1: value_description(sub$1, item._1) - }; + return { + TAG: /* Sig_value */ 0, + _0: item._0, + _1: value_description(sub$1, item._1) + }; case /* Sig_type */ 1 : - return { - TAG: /* Sig_type */ 1, - _0: item._0, - _1: type_declaration(sub$1, item._1), - _2: item._2 - }; + return { + TAG: /* Sig_type */ 1, + _0: item._0, + _1: type_declaration(sub$1, item._1), + _2: item._2 + }; case /* Sig_typext */ 2 : - return { - TAG: /* Sig_typext */ 2, - _0: item._0, - _1: extension_constructor(sub$1, item._1), - _2: item._2 - }; + return { + TAG: /* Sig_typext */ 2, + _0: item._0, + _1: extension_constructor(sub$1, item._1), + _2: item._2 + }; case /* Sig_module */ 3 : - return { - TAG: /* Sig_module */ 3, - _0: item._0, - _1: module_declaration(sub$1, item._1), - _2: item._2 - }; + return { + TAG: /* Sig_module */ 3, + _0: item._0, + _1: module_declaration(sub$1, item._1), + _2: item._2 + }; case /* Sig_modtype */ 4 : - return { - TAG: /* Sig_modtype */ 4, - _0: item._0, - _1: modtype_declaration(sub$1, item._1) - }; + return { + TAG: /* Sig_modtype */ 4, + _0: item._0, + _1: modtype_declaration(sub$1, item._1) + }; case /* Sig_class */ 5 : - return { - TAG: /* Sig_class */ 5, - _0: item._0, - _1: class_declaration(sub$1, item._1), - _2: item._2 - }; + return { + TAG: /* Sig_class */ 5, + _0: item._0, + _1: class_declaration(sub$1, item._1), + _2: item._2 + }; case /* Sig_class_type */ 6 : - return { - TAG: /* Sig_class_type */ 6, - _0: item._0, - _1: cltype_declaration(sub$1, item._1), - _2: item._2 - }; + return { + TAG: /* Sig_class_type */ 6, + _0: item._0, + _1: cltype_declaration(sub$1, item._1), + _2: item._2 + }; } }), sg); @@ -14015,169 +14015,169 @@ function components_of_module_maker(param) { const sg = scrape_alias(env, undefined, param[3]); switch (sg.TAG) { case /* Mty_signature */ 1 : - const sg$1 = sg._0; - const c = { - comp_values: /* Empty */ 0, - comp_constrs: /* Empty */ 0, - comp_labels: /* Empty */ 0, - comp_types: /* Empty */ 0, - comp_modules: /* Empty */ 0, - comp_modtypes: /* Empty */ 0, - comp_components: /* Empty */ 0, - comp_classes: /* Empty */ 0, - comp_cltypes: /* Empty */ 0 - }; - const match = prefix_idents_and_subst$1(param[2], sub, sg$1); - const sub$1 = match[1]; - const env$1 = { - contents: env - }; - const pos = { - contents: 0 - }; - Stdlib__List.iter2((function (item, path) { - switch (item.TAG) { - case /* Sig_value */ 0 : - const decl = item._1; - const decl$p = value_description(sub$1, decl); - c.comp_values = add$5(item._0.name, [ - decl$p, - pos.contents - ], c.comp_values); - const match = decl.val_kind; - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Val_prim */ 0) { - pos.contents = pos.contents + 1 | 0; - return; - } else { - return; - } - case /* Sig_type */ 1 : - const decl$1 = item._1; - const id = item._0; - const decl$p$1 = type_declaration(sub$1, decl$1); - const constructors = Stdlib__List.map((function (prim) { - return prim[1]; - }), constructors_of_type(path, decl$p$1)); - const labels = Stdlib__List.map((function (prim) { - return prim[1]; - }), labels_of_type(path, decl$p$1)); - c.comp_types = add$5(id.name, [ - [ - decl$p$1, - [ - constructors, - labels - ] - ], - -1 - ], c.comp_types); - Stdlib__List.iter((function (descr) { - c.comp_constrs = add_to_tbl(descr.cstr_name, [ - descr, - -1 - ], c.comp_constrs); - }), constructors); - Stdlib__List.iter((function (descr) { - c.comp_labels = add_to_tbl(descr.lbl_name, [ - descr, - -1 - ], c.comp_labels); - }), labels); - env$1.contents = store_type_infos(undefined, id, { - TAG: /* Pident */ 0, - _0: id - }, decl$1, env$1.contents, env$1.contents); - return; - case /* Sig_typext */ 2 : - const ext$p = extension_constructor(sub$1, item._1); - const descr = extension_descr(path, ext$p); - c.comp_constrs = add_to_tbl(item._0.name, [ - descr, - pos.contents - ], c.comp_constrs); - pos.contents = pos.contents + 1 | 0; - return; - case /* Sig_module */ 3 : - const md = item._1; - const id$1 = item._0; - const mty = md.md_type; - const mty$p = { - contents: { - TAG: /* Thunk */ 2, - _0: [ - sub$1, - mty + const sg$1 = sg._0; + const c = { + comp_values: /* Empty */ 0, + comp_constrs: /* Empty */ 0, + comp_labels: /* Empty */ 0, + comp_types: /* Empty */ 0, + comp_modules: /* Empty */ 0, + comp_modtypes: /* Empty */ 0, + comp_components: /* Empty */ 0, + comp_classes: /* Empty */ 0, + comp_cltypes: /* Empty */ 0 + }; + const match = prefix_idents_and_subst$1(param[2], sub, sg$1); + const sub$1 = match[1]; + const env$1 = { + contents: env + }; + const pos = { + contents: 0 + }; + Stdlib__List.iter2((function (item, path) { + switch (item.TAG) { + case /* Sig_value */ 0 : + const decl = item._1; + const decl$p = value_description(sub$1, decl); + c.comp_values = add$5(item._0.name, [ + decl$p, + pos.contents + ], c.comp_values); + const match = decl.val_kind; + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Val_prim */ 0) { + pos.contents = pos.contents + 1 | 0; + return; + } else { + return; + } + case /* Sig_type */ 1 : + const decl$1 = item._1; + const id = item._0; + const decl$p$1 = type_declaration(sub$1, decl$1); + const constructors = Stdlib__List.map((function (prim) { + return prim[1]; + }), constructors_of_type(path, decl$p$1)); + const labels = Stdlib__List.map((function (prim) { + return prim[1]; + }), labels_of_type(path, decl$p$1)); + c.comp_types = add$5(id.name, [ + [ + decl$p$1, + [ + constructors, + labels ] - } - }; - c.comp_modules = add$5(id$1.name, [ - mty$p, - pos.contents - ], c.comp_modules); - const comps = components_of_module(env$1.contents, sub$1, path, mty); - c.comp_components = add$5(id$1.name, [ - comps, - pos.contents - ], c.comp_components); - env$1.contents = store_module(undefined, id$1, { - TAG: /* Pident */ 0, - _0: id$1 - }, md, env$1.contents, env$1.contents); - pos.contents = pos.contents + 1 | 0; - return; - case /* Sig_modtype */ 4 : - const decl$2 = item._1; - const id$2 = item._0; - const decl$p$2 = modtype_declaration(sub$1, decl$2); - c.comp_modtypes = add$5(id$2.name, [ - decl$p$2, - -1 - ], c.comp_modtypes); - env$1.contents = store_modtype(undefined, id$2, { - TAG: /* Pident */ 0, - _0: id$2 - }, decl$2, env$1.contents, env$1.contents); - return; - case /* Sig_class */ 5 : - const decl$p$3 = class_declaration(sub$1, item._1); - c.comp_classes = add$5(item._0.name, [ - decl$p$3, - pos.contents - ], c.comp_classes); - pos.contents = pos.contents + 1 | 0; - return; - case /* Sig_class_type */ 6 : - const decl$p$4 = cltype_declaration(sub$1, item._1); - c.comp_cltypes = add$5(item._0.name, [ - decl$p$4, - pos.contents - ], c.comp_cltypes); - return; - - } - }), sg$1, match[0]); - return { - TAG: /* Structure_comps */ 0, - _0: c - }; + ], + -1 + ], c.comp_types); + Stdlib__List.iter((function (descr) { + c.comp_constrs = add_to_tbl(descr.cstr_name, [ + descr, + -1 + ], c.comp_constrs); + }), constructors); + Stdlib__List.iter((function (descr) { + c.comp_labels = add_to_tbl(descr.lbl_name, [ + descr, + -1 + ], c.comp_labels); + }), labels); + env$1.contents = store_type_infos(undefined, id, { + TAG: /* Pident */ 0, + _0: id + }, decl$1, env$1.contents, env$1.contents); + return; + case /* Sig_typext */ 2 : + const ext$p = extension_constructor(sub$1, item._1); + const descr = extension_descr(path, ext$p); + c.comp_constrs = add_to_tbl(item._0.name, [ + descr, + pos.contents + ], c.comp_constrs); + pos.contents = pos.contents + 1 | 0; + return; + case /* Sig_module */ 3 : + const md = item._1; + const id$1 = item._0; + const mty = md.md_type; + const mty$p = { + contents: { + TAG: /* Thunk */ 2, + _0: [ + sub$1, + mty + ] + } + }; + c.comp_modules = add$5(id$1.name, [ + mty$p, + pos.contents + ], c.comp_modules); + const comps = components_of_module(env$1.contents, sub$1, path, mty); + c.comp_components = add$5(id$1.name, [ + comps, + pos.contents + ], c.comp_components); + env$1.contents = store_module(undefined, id$1, { + TAG: /* Pident */ 0, + _0: id$1 + }, md, env$1.contents, env$1.contents); + pos.contents = pos.contents + 1 | 0; + return; + case /* Sig_modtype */ 4 : + const decl$2 = item._1; + const id$2 = item._0; + const decl$p$2 = modtype_declaration(sub$1, decl$2); + c.comp_modtypes = add$5(id$2.name, [ + decl$p$2, + -1 + ], c.comp_modtypes); + env$1.contents = store_modtype(undefined, id$2, { + TAG: /* Pident */ 0, + _0: id$2 + }, decl$2, env$1.contents, env$1.contents); + return; + case /* Sig_class */ 5 : + const decl$p$3 = class_declaration(sub$1, item._1); + c.comp_classes = add$5(item._0.name, [ + decl$p$3, + pos.contents + ], c.comp_classes); + pos.contents = pos.contents + 1 | 0; + return; + case /* Sig_class_type */ 6 : + const decl$p$4 = cltype_declaration(sub$1, item._1); + c.comp_cltypes = add$5(item._0.name, [ + decl$p$4, + pos.contents + ], c.comp_cltypes); + return; + + } + }), sg$1, match[0]); + return { + TAG: /* Structure_comps */ 0, + _0: c + }; case /* Mty_functor */ 2 : - return { - TAG: /* Functor_comps */ 1, - _0: { - fcomp_param: sg._0, - fcomp_arg: may_map((function (param) { - return modtype(sub, param); - }), sg._1), - fcomp_res: sg._2, - fcomp_env: env, - fcomp_subst: sub, - fcomp_cache: Stdlib__Hashtbl.create(undefined, 17), - fcomp_subst_cache: Stdlib__Hashtbl.create(undefined, 17) - } - }; + return { + TAG: /* Functor_comps */ 1, + _0: { + fcomp_param: sg._0, + fcomp_arg: may_map((function (param) { + return modtype(sub, param); + }), sg._1), + fcomp_res: sg._2, + fcomp_env: env, + fcomp_subst: sub, + fcomp_cache: Stdlib__Hashtbl.create(undefined, 17), + fcomp_subst_cache: Stdlib__Hashtbl.create(undefined, 17) + } + }; case /* Mty_ident */ 0 : case /* Mty_alias */ 3 : - break; + break; } return { @@ -14650,19 +14650,19 @@ function enter_module(arg, s, mty, env) { function add_item(comp, env) { switch (comp.TAG) { case /* Sig_value */ 0 : - return add_value(undefined, comp._0, comp._1, env); + return add_value(undefined, comp._0, comp._1, env); case /* Sig_type */ 1 : - return add_type$1(false, comp._0, comp._1, env); + return add_type$1(false, comp._0, comp._1, env); case /* Sig_typext */ 2 : - return add_extension(false, comp._0, comp._1, env); + return add_extension(false, comp._0, comp._1, env); case /* Sig_module */ 3 : - return add_module_declaration(undefined, comp._0, comp._1, env); + return add_module_declaration(undefined, comp._0, comp._1, env); case /* Sig_modtype */ 4 : - return add_modtype$1(comp._0, comp._1, env); + return add_modtype$1(comp._0, comp._1, env); case /* Sig_class */ 5 : - return add_class(comp._0, comp._1, env); + return add_class(comp._0, comp._1, env); case /* Sig_class_type */ 6 : - return add_cltype(comp._0, comp._1, env); + return add_cltype(comp._0, comp._1, env); } } @@ -14686,19 +14686,19 @@ function open_signature(slot, root, sg, env0) { const newenv = Stdlib__List.fold_left2((function (env, item, p) { switch (item.TAG) { case /* Sig_value */ 0 : - return store_value(undefined, slot, hide(item._0), p, item._1, env, env0); + return store_value(undefined, slot, hide(item._0), p, item._1, env, env0); case /* Sig_type */ 1 : - return store_type(false, slot, hide(item._0), p, item._1, env, env0); + return store_type(false, slot, hide(item._0), p, item._1, env, env0); case /* Sig_typext */ 2 : - return store_extension(false, slot, hide(item._0), p, item._1, env, env0); + return store_extension(false, slot, hide(item._0), p, item._1, env, env0); case /* Sig_module */ 3 : - return store_module(slot, hide(item._0), p, item._1, env, env0); + return store_module(slot, hide(item._0), p, item._1, env, env0); case /* Sig_modtype */ 4 : - return store_modtype(slot, hide(item._0), p, item._1, env, env0); + return store_modtype(slot, hide(item._0), p, item._1, env, env0); case /* Sig_class */ 5 : - return store_class(slot, hide(item._0), p, item._1, env, env0); + return store_class(slot, hide(item._0), p, item._1, env, env0); case /* Sig_class_type */ 6 : - return store_cltype(slot, hide(item._0), p, item._1, env, env0); + return store_cltype(slot, hide(item._0), p, item._1, env, env0); } }), env0, sg$1, match[0]); @@ -14772,12 +14772,12 @@ function open_signature$1(locOpt, toplevelOpt, ovf, root, sg, env) { switch (kind) { case "constructor" : case "label" : - w = { - TAG: /* Open_shadow_label_constructor */ 28, - _0: kind, - _1: s - }; - break; + w = { + TAG: /* Open_shadow_label_constructor */ 28, + _0: kind, + _1: s + }; + break; default: w = { TAG: /* Open_shadow_identifier */ 27, @@ -15083,46 +15083,45 @@ function keep_only_summary(env) { function report_error$1(ppf, param) { switch (param.TAG) { case /* Illegal_renaming */ 0 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Wrong file naming: ", - _1: { - TAG: /* Alpha */ 15, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Wrong file naming: ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "contains the compiled interface for ", _1: { - TAG: /* String_literal */ 11, - _0: "contains the compiled interface for ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " when ", _1: { - TAG: /* String_literal */ 11, - _0: " when ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " was expected", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " was expected", + _1: /* End_of_format */ 0 } } } @@ -15130,74 +15129,74 @@ function report_error$1(ppf, param) { } } } - }, - _1: "Wrong file naming: %a@ contains the compiled interface for @ %s when %s was expected" - }), print_filename, param._2, param._0, param._1); + } + }, + _1: "Wrong file naming: %a@ contains the compiled interface for @ %s when %s was expected" + }), print_filename, param._2, param._0, param._1); case /* Inconsistent_import */ 1 : - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The files ", _1: { - TAG: /* String_literal */ 11, - _0: "The files ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "and ", _1: { - TAG: /* String_literal */ 11, - _0: "and ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "make inconsistent assumptions", _1: { - TAG: /* String_literal */ 11, - _0: "make inconsistent assumptions", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "over interface ", _1: { - TAG: /* String_literal */ 11, - _0: "over interface ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -15208,57 +15207,57 @@ function report_error$1(ppf, param) { } } } - }, - _1: "@[The files %a@ and %a@ make inconsistent assumptions@ over interface %s@]" - }), print_filename, param._1, print_filename, param._2, param._0); + } + }, + _1: "@[The files %a@ and %a@ make inconsistent assumptions@ over interface %s@]" + }), print_filename, param._1, print_filename, param._2, param._0); case /* Need_recursive_types */ 2 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Unit ", _1: { - TAG: /* String_literal */ 11, - _0: "Unit ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " imports from ", _1: { - TAG: /* String_literal */ 11, - _0: " imports from ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ", which uses recursive types.", _1: { - TAG: /* String_literal */ 11, - _0: ", which uses recursive types.", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -15266,131 +15265,131 @@ function report_error$1(ppf, param) { } } } - }, - _1: "@[Unit %s imports from %s, which uses recursive types.@ %s@]" - }), param._1, param._0, "The compilation flag -rectypes is required"); + } + }, + _1: "@[Unit %s imports from %s, which uses recursive types.@ %s@]" + }), param._1, param._0, "The compilation flag -rectypes is required"); case /* Missing_module */ 3 : - const path2 = param._2; - const path1 = param._1; - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const path2 = param._2; + const path1 = param._1; + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, - _1: { - TAG: /* Formatting_gen */ 18, + _1: /* End_of_format */ 0 + } + }, + _1: "@[@[" + }); + if (same(path1, path2)) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, + TAG: /* String_literal */ 11, + _0: "Internal path", + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, - _1: "" - } - }, - _1: /* End_of_format */ 0 - } - }, - _1: "@[@[" - }); - if (same(path1, path2)) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Internal path", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is dangling.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "is dangling.", + _1: /* End_of_format */ 0 } } } - }, - _1: "Internal path@ %s@ is dangling." - }), name(undefined, path1)); - } else { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Internal path", + } + }, + _1: "Internal path@ %s@ is dangling." + }), name(undefined, path1)); + } else { + Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Internal path", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "expands to", _1: { - TAG: /* String_literal */ 11, - _0: "expands to", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "which is dangling.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "which is dangling.", + _1: /* End_of_format */ 0 } } } @@ -15398,69 +15397,69 @@ function report_error$1(ppf, param) { } } } - }, - _1: "Internal path@ %s@ expands to@ %s@ which is dangling." - }), name(undefined, path1), name(undefined, path2)); - } - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + } + }, + _1: "Internal path@ %s@ expands to@ %s@ which is dangling." + }), name(undefined, path1), name(undefined, path2)); + } + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* '.' */46, _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + _1: /* End_of_format */ 0 } } } @@ -15470,27 +15469,28 @@ function report_error$1(ppf, param) { } } } - }, - _1: "@]@ @[%s@ %s@ %s.@]@]" - }), "The compiled interface for module", head(path2).name, "was not found"); + } + }, + _1: "@]@ @[%s@ %s@ %s.@]@]" + }), "The compiled interface for module", head(path2).name, "was not found"); case /* Illegal_value_name */ 4 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '\'' */39, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '\'' */39, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' is not a valid value identifier.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' is not a valid value identifier.", + _1: /* End_of_format */ 0 } - }, - _1: "'%s' is not a valid value identifier." - }), param._1); + } + }, + _1: "'%s' is not a valid value identifier." + }), param._1); } } @@ -15503,7 +15503,7 @@ register_error_of_exn(function (err) { switch (err$1.TAG) { case /* Missing_module */ 3 : case /* Illegal_value_name */ 4 : - break; + break; default: return error_of_printer_file(report_error$1, err$1); } @@ -15552,45 +15552,45 @@ function from_pair_suites(name, suites) { let spec = Curry._1(code, undefined); switch (spec.TAG) { case /* Eq */ 0 : - Assert.deepEqual(spec._0, spec._1); - return; + Assert.deepEqual(spec._0, spec._1); + return; case /* Neq */ 1 : - Assert.notDeepEqual(spec._0, spec._1); - return; + Assert.notDeepEqual(spec._0, spec._1); + return; case /* StrictEq */ 2 : - Assert.strictEqual(spec._0, spec._1); - return; + Assert.strictEqual(spec._0, spec._1); + return; case /* StrictNeq */ 3 : - Assert.notStrictEqual(spec._0, spec._1); - return; + Assert.notStrictEqual(spec._0, spec._1); + return; case /* Ok */ 4 : - Assert.ok(spec._0); - return; + Assert.ok(spec._0); + return; case /* Approx */ 5 : - const b = spec._1; - const a = spec._0; - if (!close_enough(undefined, a, b)) { - Assert.deepEqual(a, b); - return; - } else { - return; - } + const b = spec._1; + const a = spec._0; + if (!close_enough(undefined, a, b)) { + Assert.deepEqual(a, b); + return; + } else { + return; + } case /* ApproxThreshold */ 6 : - const b$1 = spec._2; - const a$1 = spec._1; - if (!close_enough(spec._0, a$1, b$1)) { - Assert.deepEqual(a$1, b$1); - return; - } else { - return; - } - case /* ThrowAny */ 7 : - Assert.throws(spec._0); + const b$1 = spec._2; + const a$1 = spec._1; + if (!close_enough(spec._0, a$1, b$1)) { + Assert.deepEqual(a$1, b$1); return; + } else { + return; + } + case /* ThrowAny */ 7 : + Assert.throws(spec._0); + return; case /* Fail */ 8 : - return assert_fail("failed"); + return assert_fail("failed"); case /* FailWith */ 9 : - return assert_fail(spec._0); + return assert_fail(spec._0); } })); @@ -15607,71 +15607,71 @@ function from_pair_suites(name, suites) { const fn = Curry._1(param[1], undefined); switch (fn.TAG) { case /* Eq */ 0 : - console.log([ - name, - fn._0, - "eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "eq?", + fn._1 + ]); + return; case /* Neq */ 1 : - console.log([ - name, - fn._0, - "neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "neq?", + fn._1 + ]); + return; case /* StrictEq */ 2 : - console.log([ - name, - fn._0, - "strict_eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_eq?", + fn._1 + ]); + return; case /* StrictNeq */ 3 : - console.log([ - name, - fn._0, - "strict_neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_neq?", + fn._1 + ]); + return; case /* Ok */ 4 : - console.log([ - name, - fn._0, - "ok?" - ]); - return; + console.log([ + name, + fn._0, + "ok?" + ]); + return; case /* Approx */ 5 : - console.log([ - name, - fn._0, - "~", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "~", + fn._1 + ]); + return; case /* ApproxThreshold */ 6 : - console.log([ - name, - fn._1, - "~", - fn._2, - " (", - fn._0, - ")" - ]); - return; + console.log([ + name, + fn._1, + "~", + fn._2, + " (", + fn._0, + ")" + ]); + return; case /* ThrowAny */ 7 : - return; + return; case /* Fail */ 8 : - console.log("failed"); - return; + console.log("failed"); + return; case /* FailWith */ 9 : - console.log("failed: " + fn._0); - return; + console.log("failed: " + fn._0); + return; } }), suites); @@ -15689,165 +15689,165 @@ const Escape_error = /* @__PURE__ */ Caml_exceptions.create("Ocaml_typedtree_tes function prepare_error(loc) { switch (loc.TAG) { case /* Unclosed */ 0 : - const closing = loc._3; - const opening = loc._1; - return Curry._1(errorf(loc._2, { - hd: Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This '", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } - } - }, - _1: "This '%s' might be unmatched" - }), opening), - tl: /* [] */ 0 - }, Curry._2(Stdlib__Printf.sprintf({ + const closing = loc._3; + const opening = loc._1; + return Curry._1(errorf(loc._2, { + hd: Curry._1(errorf(loc._0, undefined, undefined, { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Syntax error: '", + _0: "This '", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "' expected, the highlighted '", + _0: "' might be unmatched", + _1: /* End_of_format */ 0 + } + } + }, + _1: "This '%s' might be unmatched" + }), opening), + tl: /* [] */ 0 + }, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "' expected, the highlighted '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' might be unmatched", + _1: /* End_of_format */ 0 } } } - }, - _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" - }), closing, opening), { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: '", + } + }, + _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" + }), closing, opening), { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' expected", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' expected", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: '%s' expected" - }), closing); + } + }, + _1: "Syntax error: '%s' expected" + }), closing); case /* Expecting */ 1 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " expected.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s expected." - }), loc._1); + } + }, + _1: "Syntax error: %s expected." + }), loc._1); case /* Not_expecting */ 2 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " not expected.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " not expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s not expected." - }), loc._1); + } + }, + _1: "Syntax error: %s not expected." + }), loc._1); case /* Applicative_path */ 3 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." + }); case /* Variable_in_scope */ 4 : - const $$var = loc._1; - return Curry._2(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "In this scoped type, variable '", + const $$var = loc._1; + return Curry._2(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "In this scoped type, variable '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is reserved for the local type ", _1: { - TAG: /* String_literal */ 11, - _0: " is reserved for the local type ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } - }, - _1: "In this scoped type, variable '%s is reserved for the local type %s." - }), $$var, $$var); + } + }, + _1: "In this scoped type, variable '%s is reserved for the local type %s." + }), $$var, $$var); case /* Other */ 5 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error" - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error" + }); case /* Ill_formed_ast */ 6 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "broken invariant in parsetree: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "broken invariant in parsetree: %s" - }), loc._1); + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "broken invariant in parsetree: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "broken invariant in parsetree: %s" + }), loc._1); } } @@ -16324,135 +16324,135 @@ function varify_constructors(var_names, t) { } else { switch (x.TAG) { case /* Ptyp_var */ 0 : - const x$1 = x._0; - check_variable(var_names, t.ptyp_loc, x$1); - desc = { - TAG: /* Ptyp_var */ 0, - _0: x$1 - }; - break; + const x$1 = x._0; + check_variable(var_names, t.ptyp_loc, x$1); + desc = { + TAG: /* Ptyp_var */ 0, + _0: x$1 + }; + break; case /* Ptyp_arrow */ 1 : - desc = { - TAG: /* Ptyp_arrow */ 1, - _0: x._0, - _1: loop(x._1), - _2: loop(x._2) - }; - break; + desc = { + TAG: /* Ptyp_arrow */ 1, + _0: x._0, + _1: loop(x._1), + _2: loop(x._2) + }; + break; case /* Ptyp_tuple */ 2 : - desc = { - TAG: /* Ptyp_tuple */ 2, - _0: Stdlib__List.map(loop, x._0) - }; - break; + desc = { + TAG: /* Ptyp_tuple */ 2, + _0: Stdlib__List.map(loop, x._0) + }; + break; case /* Ptyp_constr */ 3 : - const longident = x._0; - let exit = 0; - const s = longident.txt; - switch (s.TAG) { - case /* Lident */ 0 : - if (x._1) { - exit = 1; - } else { - const s$1 = s._0; - if (Stdlib__List.mem(s$1, var_names)) { - desc = { - TAG: /* Ptyp_var */ 0, - _0: s$1 - }; - } else { - exit = 1; - } - } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + const longident = x._0; + let exit = 0; + const s = longident.txt; + switch (s.TAG) { + case /* Lident */ 0 : + if (x._1) { + exit = 1; + } else { + const s$1 = s._0; + if (Stdlib__List.mem(s$1, var_names)) { + desc = { + TAG: /* Ptyp_var */ 0, + _0: s$1 + }; + } else { exit = 1; - break; - - } - if (exit === 1) { - desc = { - TAG: /* Ptyp_constr */ 3, - _0: longident, - _1: Stdlib__List.map(loop, x._1) - }; - } - break; - case /* Ptyp_object */ 4 : - desc = { - TAG: /* Ptyp_object */ 4, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - loop(param[2]) - ]; - }), x._0), - _1: x._1 - }; - break; - case /* Ptyp_class */ 5 : + } + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + exit = 1; + break; + + } + if (exit === 1) { desc = { - TAG: /* Ptyp_class */ 5, - _0: x._0, + TAG: /* Ptyp_constr */ 3, + _0: longident, _1: Stdlib__List.map(loop, x._1) }; - break; + } + break; + case /* Ptyp_object */ 4 : + desc = { + TAG: /* Ptyp_object */ 4, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + loop(param[2]) + ]; + }), x._0), + _1: x._1 + }; + break; + case /* Ptyp_class */ 5 : + desc = { + TAG: /* Ptyp_class */ 5, + _0: x._0, + _1: Stdlib__List.map(loop, x._1) + }; + break; case /* Ptyp_alias */ 6 : - const string = x._1; - check_variable(var_names, t.ptyp_loc, string); - desc = { - TAG: /* Ptyp_alias */ 6, - _0: loop(x._0), - _1: string - }; - break; + const string = x._1; + check_variable(var_names, t.ptyp_loc, string); + desc = { + TAG: /* Ptyp_alias */ 6, + _0: loop(x._0), + _1: string + }; + break; case /* Ptyp_variant */ 7 : - desc = { - TAG: /* Ptyp_variant */ 7, - _0: Stdlib__List.map(loop_row_field, x._0), - _1: x._1, - _2: x._2 - }; - break; + desc = { + TAG: /* Ptyp_variant */ 7, + _0: Stdlib__List.map(loop_row_field, x._0), + _1: x._1, + _2: x._2 + }; + break; case /* Ptyp_poly */ 8 : - const string_lst = x._0; - const partial_arg = t.ptyp_loc; - Stdlib__List.iter((function (param) { - return check_variable(var_names, partial_arg, param); - }), string_lst); - desc = { - TAG: /* Ptyp_poly */ 8, - _0: string_lst, - _1: loop(x._1) - }; - break; + const string_lst = x._0; + const partial_arg = t.ptyp_loc; + Stdlib__List.iter((function (param) { + return check_variable(var_names, partial_arg, param); + }), string_lst); + desc = { + TAG: /* Ptyp_poly */ 8, + _0: string_lst, + _1: loop(x._1) + }; + break; case /* Ptyp_package */ 9 : - const match = x._0; - desc = { - TAG: /* Ptyp_package */ 9, - _0: [ - match[0], - Stdlib__List.map((function (param) { - return [ - param[0], - loop(param[1]) - ]; - }), match[1]) - ] - }; - break; + const match = x._0; + desc = { + TAG: /* Ptyp_package */ 9, + _0: [ + match[0], + Stdlib__List.map((function (param) { + return [ + param[0], + loop(param[1]) + ]; + }), match[1]) + ] + }; + break; case /* Ptyp_extension */ 10 : - const match$1 = x._0; - desc = { - TAG: /* Ptyp_extension */ 10, - _0: [ - match$1[0], - match$1[1] - ] - }; - break; + const match$1 = x._0; + desc = { + TAG: /* Ptyp_extension */ 10, + _0: [ + match$1[0], + match$1[1] + ] + }; + break; } } @@ -18935,51 +18935,51 @@ const yyact = [ let exit = 0; switch (_1) { case "-" : - if (match.TAG === /* Pexp_constant */ 1) { - const n = match._0; - switch (n.TAG) { - case /* Const_int */ 0 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int */ 0, - _0: -n._0 | 0 - } - }); - case /* Const_int32 */ 4 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int32 */ 4, - _0: -n._0 | 0 - } - }); - case /* Const_int64 */ 5 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int64 */ 5, - _0: Caml_int64.neg(n._0) - } - }); - case /* Const_nativeint */ 6 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_nativeint */ 6, - _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) - } - }); - default: - exit = 2; - } - } else { - exit = 2; + if (match.TAG === /* Pexp_constant */ 1) { + const n = match._0; + switch (n.TAG) { + case /* Const_int */ 0 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int */ 0, + _0: -n._0 | 0 + } + }); + case /* Const_int32 */ 4 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int32 */ 4, + _0: -n._0 | 0 + } + }); + case /* Const_int64 */ 5 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int64 */ 5, + _0: Caml_int64.neg(n._0) + } + }); + case /* Const_nativeint */ 6 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_nativeint */ 6, + _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) + } + }); + default: + exit = 2; } - break; - case "-." : + } else { exit = 2; - break; + } + break; + case "-." : + exit = 2; + break; } if (exit === 2 && match.TAG === /* Pexp_constant */ 1) { @@ -19014,23 +19014,23 @@ const yyact = [ let exit = 0; switch (_1) { case "+" : - if (desc.TAG === /* Pexp_constant */ 1) { - switch (desc._0.TAG) { - case /* Const_char */ 1 : - case /* Const_string */ 2 : - case /* Const_float */ 3 : - exit = 2; - break; - default: - return mkexp(desc); - } - } else { - exit = 2; + if (desc.TAG === /* Pexp_constant */ 1) { + switch (desc._0.TAG) { + case /* Const_char */ 1 : + case /* Const_string */ 2 : + case /* Const_float */ 3 : + exit = 2; + break; + default: + return mkexp(desc); } - break; - case "+." : + } else { exit = 2; - break; + } + break; + case "+." : + exit = 2; + break; } if (exit === 2 && desc.TAG === /* Pexp_constant */ 1 && desc._0.TAG === /* Const_float */ 3) { @@ -22816,13 +22816,13 @@ function type_of_directive(x) { } switch (x.TAG) { case /* Dir_bool */ 0 : - return /* Dir_type_bool */ 0; + return /* Dir_type_bool */ 0; case /* Dir_float */ 1 : - return /* Dir_type_float */ 1; + return /* Dir_type_float */ 1; case /* Dir_int */ 2 : - return /* Dir_type_int */ 2; + return /* Dir_type_int */ 2; case /* Dir_string */ 3 : - return /* Dir_type_string */ 3; + return /* Dir_type_string */ 3; } } @@ -22830,15 +22830,15 @@ function type_of_directive(x) { function string_of_type_directive(x) { switch (x) { case /* Dir_type_bool */ 0 : - return "bool"; + return "bool"; case /* Dir_type_float */ 1 : - return "float"; + return "float"; case /* Dir_type_int */ 2 : - return "int"; + return "int"; case /* Dir_type_string */ 3 : - return "string"; + return "string"; case /* Dir_type_null */ 4 : - return "null"; + return "null"; } } @@ -23051,15 +23051,15 @@ function value_of_token(loc, t) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* FALSE */ 29 : - return { - TAG: /* Dir_bool */ 0, - _0: false - }; + return { + TAG: /* Dir_bool */ 0, + _0: false + }; case /* TRUE */ 91 : - return { - TAG: /* Dir_bool */ 0, - _0: true - }; + return { + TAG: /* Dir_bool */ 0, + _0: true + }; default: throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, @@ -23070,22 +23070,22 @@ function value_of_token(loc, t) { } else { switch (t.TAG) { case /* FLOAT */ 1 : - return { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(t._0) - }; + return { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(t._0) + }; case /* INT */ 7 : - return { - TAG: /* Dir_int */ 2, - _0: t._0 - }; + return { + TAG: /* Dir_int */ 2, + _0: t._0 + }; case /* STRING */ 16 : - return { - TAG: /* Dir_string */ 3, - _0: t._0[0] - }; + return { + TAG: /* Dir_string */ 3, + _0: t._0[0] + }; case /* UIDENT */ 17 : - return query(loc, t._0); + return query(loc, t._0); default: throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, @@ -23112,14 +23112,14 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* EOF */ 25 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_if */ 2, + _2: curr(lexbuf) + }); case /* EOL */ 100 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -23127,8 +23127,8 @@ function directive_parse(token_with_comments, lexbuf) { switch (t.TAG) { case /* COMMENT */ 18 : case /* DOCSTRING */ 19 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -23156,8 +23156,8 @@ function directive_parse(token_with_comments, lexbuf) { case /* EQUAL */ 26 : case /* GREATER */ 34 : case /* LESS */ 51 : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -23167,151 +23167,138 @@ function directive_parse(token_with_comments, lexbuf) { } switch (op._0) { case "=~" : - if (!calc) { - return true; - } - let exit$1 = 0; - if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { - exit$1 = 2; + if (!calc) { + return true; + } + let exit$1 = 0; + if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { + exit$1 = 2; + } else { + const curr_loc = curr(lexbuf); + const rhs = value_of_token(curr_loc, token(undefined)); + let exit$2 = 0; + if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { + exit$2 = 3; } else { - const curr_loc = curr(lexbuf); - const rhs = value_of_token(curr_loc, token(undefined)); - let exit$2 = 0; - if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { - exit$2 = 3; - } else { - if (rhs.TAG === /* Dir_string */ 3) { - let lhs$1 = lhs._0; - let str = rhs._0; - const last_index = str.length - 1 | 0; - if (last_index < 0) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - const v = str.charCodeAt(0); - let match; - let exit$3 = 0; - if (v !== 94) { - if (v >= 63) { - if (v !== 126) { - exit$3 = 1; - } else { - match = [ - "Approximate", - semantic_version_parse(str, 1, last_index) - ]; - } - } else if (v >= 60) { - switch (v) { - case 60 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - match = str[1] === "=" ? [ - "Le", - semantic_version_parse(str, 2, last_index) - ] : [ - "Lt", - semantic_version_parse(str, 1, last_index) - ]; - break; - case 61 : - exit$3 = 1; - break; - case 62 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: curr_loc - }); - } - match = str[1] === "=" ? [ - "Ge", - semantic_version_parse(str, 2, last_index) - ] : [ - "Gt", - semantic_version_parse(str, 1, last_index) - ]; - break; - - } - } else { + if (rhs.TAG === /* Dir_string */ 3) { + let lhs$1 = lhs._0; + let str = rhs._0; + const last_index = str.length - 1 | 0; + if (last_index < 0) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + const v = str.charCodeAt(0); + let match; + let exit$3 = 0; + if (v !== 94) { + if (v >= 63) { + if (v !== 126) { exit$3 = 1; + } else { + match = [ + "Approximate", + semantic_version_parse(str, 1, last_index) + ]; + } + } else if (v >= 60) { + switch (v) { + case 60 : + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + match = str[1] === "=" ? [ + "Le", + semantic_version_parse(str, 2, last_index) + ] : [ + "Lt", + semantic_version_parse(str, 1, last_index) + ]; + break; + case 61 : + exit$3 = 1; + break; + case 62 : + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: curr_loc + }); + } + match = str[1] === "=" ? [ + "Ge", + semantic_version_parse(str, 2, last_index) + ] : [ + "Gt", + semantic_version_parse(str, 1, last_index) + ]; + break; + } } else { - match = [ - "Compatible", - semantic_version_parse(str, 1, last_index) - ]; - } - if (exit$3 === 1) { - match = [ - "Exact", - semantic_version_parse(str, 0, last_index) - ]; - } - const version = match[1][0]; - const major = version[0]; - const pred = match[0]; - const match$1 = semantic_version_parse(lhs$1, 0, lhs$1.length - 1 | 0); - const lversion = match$1[0]; - if (pred === "Ge") { - return Caml_obj.caml_greaterequal(lversion, version); - } - if (pred === "Gt") { - return Caml_obj.caml_greaterthan(lversion, version); - } - if (pred === "Le") { - return Caml_obj.caml_lessequal(lversion, version); - } - if (pred === "Lt") { - return Caml_obj.caml_lessthan(lversion, version); - } - if (pred === "Exact") { - return Caml_obj.caml_equal(lversion, version); - } - const l_major = lversion[0]; - if (pred === "Compatible") { - return major === l_major; - } else if (major === l_major) { - return version[1] === lversion[1]; - } else { - return false; + exit$3 = 1; } + } else { + match = [ + "Compatible", + semantic_version_parse(str, 1, last_index) + ]; + } + if (exit$3 === 1) { + match = [ + "Exact", + semantic_version_parse(str, 0, last_index) + ]; + } + const version = match[1][0]; + const major = version[0]; + const pred = match[0]; + const match$1 = semantic_version_parse(lhs$1, 0, lhs$1.length - 1 | 0); + const lversion = match$1[0]; + if (pred === "Ge") { + return Caml_obj.caml_greaterequal(lversion, version); + } + if (pred === "Gt") { + return Caml_obj.caml_greaterthan(lversion, version); + } + if (pred === "Le") { + return Caml_obj.caml_lessequal(lversion, version); + } + if (pred === "Lt") { + return Caml_obj.caml_lessthan(lversion, version); + } + if (pred === "Exact") { + return Caml_obj.caml_equal(lversion, version); + } + const l_major = lversion[0]; + if (pred === "Compatible") { + return major === l_major; + } else if (major === l_major) { + return version[1] === lversion[1]; + } else { + return false; } - exit$2 = 3; - } - if (exit$2 === 3) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_string */ 3, - _1: type_of_directive(lhs) - }, - _2: curr(lexbuf) - }); } - + exit$2 = 3; } - if (exit$1 === 2) { + if (exit$2 === 3) { throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, _1: { @@ -23322,12 +23309,25 @@ function directive_parse(token_with_comments, lexbuf) { _2: curr(lexbuf) }); } - break; + + } + if (exit$1 === 2) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_string */ 3, + _1: type_of_directive(lhs) + }, + _2: curr(lexbuf) + }); + } + break; case "<=" : case "<>" : case ">=" : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -23338,25 +23338,25 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof op === "number" || typeof op === "string") { switch (op) { case /* EQUAL */ 26 : - f = Caml_obj.caml_equal; - break; + f = Caml_obj.caml_equal; + break; case /* GREATER */ 34 : - f = Caml_obj.caml_greaterthan; - break; + f = Caml_obj.caml_greaterthan; + break; case /* LESS */ 51 : - f = Caml_obj.caml_lessthan; - break; + f = Caml_obj.caml_lessthan; + break; default: exit$4 = 2; } } else if (op.TAG === /* INFIXOP0 */ 2) { switch (op._0) { case "<=" : - f = Caml_obj.caml_lessequal; - break; + f = Caml_obj.caml_lessequal; + break; case "<>" : - f = Caml_obj.caml_notequal; - break; + f = Caml_obj.caml_notequal; + break; default: exit$4 = 2; } @@ -23408,28 +23408,28 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof curr_token === "number" || typeof curr_token === "string") { switch (curr_token) { case /* FALSE */ 29 : - return false; + return false; case /* LPAREN */ 54 : - const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); - const match = token(undefined); - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (match === /* RPAREN */ 81) { - return v; - } - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); - } else { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); + const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); + const match = token(undefined); + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (match === /* RPAREN */ 81) { + return v; } + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } else { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } case /* TRUE */ 91 : - return true; + return true; default: throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, @@ -23440,108 +23440,108 @@ function directive_parse(token_with_comments, lexbuf) { } else { switch (curr_token.TAG) { case /* FLOAT */ 1 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_float */ 1 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(curr_token._0) - }); + return token_op(calc, (function (e) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_float */ 1 + }, + _2: curr_loc + }); + }), { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(curr_token._0) + }); case /* INT */ 7 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_int */ 2 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_int */ 2, - _0: curr_token._0 - }); - case /* LIDENT */ 11 : - const r = curr_token._0; - switch (r) { - case "defined" : - case "undefined" : - break; - default: + return token_op(calc, (function (e) { throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_token_in_conditional */ 4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_int */ 2 + }, _2: curr_loc }); - } - const t = token(undefined); - const loc = curr(lexbuf); - if (/* tag */ typeof t === "number" || typeof t === "string") { + }), { + TAG: /* Dir_int */ 2, + _0: curr_token._0 + }); + case /* LIDENT */ 11 : + const r = curr_token._0; + switch (r) { + case "defined" : + case "undefined" : + break; + default: throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, _1: /* Unexpected_token_in_conditional */ 4, - _2: loc + _2: curr_loc }); - } - if (t.TAG === /* UIDENT */ 17) { - const s = t._0; - if (calc) { - if (Caml_string.get(r, 0) === /* 'u' */117) { - return !defined(s); - } else { - return defined(s); - } - } else { - return true; - } - } + } + const t = token(undefined); + const loc = curr(lexbuf); + if (/* tag */ typeof t === "number" || typeof t === "string") { throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, _1: /* Unexpected_token_in_conditional */ 4, _2: loc }); - break; + } + if (t.TAG === /* UIDENT */ 17) { + const s = t._0; + if (calc) { + if (Caml_string.get(r, 0) === /* 'u' */117) { + return !defined(s); + } else { + return defined(s); + } + } else { + return true; + } + } + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_token_in_conditional */ 4, + _2: loc + }); + break; case /* STRING */ 16 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_string */ 3 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_string */ 3, - _0: curr_token._0[0] - }); + return token_op(calc, (function (e) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_string */ 3 + }, + _2: curr_loc + }); + }), { + TAG: /* Dir_string */ 3, + _0: curr_token._0[0] + }); case /* UIDENT */ 17 : - const value_v = query(curr_loc, curr_token._0); - return token_op(calc, (function (e) { - push(e); - if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { - return value_v._0; - } - const ty = type_of_directive(value_v); - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: ty - }, - _2: curr_loc - }); - }), value_v); + const value_v = query(curr_loc, curr_token._0); + return token_op(calc, (function (e) { + push(e); + if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { + return value_v._0; + } + const ty = type_of_directive(value_v); + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: ty + }, + _2: curr_loc + }); + }), value_v); default: throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, @@ -24055,16 +24055,16 @@ function char_for_backslash(c) { } switch (c) { case 110 : - return /* '\n' */10; + return /* '\n' */10; case 114 : - return /* '\r' */13; + return /* '\r' */13; case 111 : case 112 : case 113 : case 115 : - return c; + return c; case 116 : - return /* '\t' */9; + return /* '\t' */9; } } @@ -24206,218 +24206,218 @@ function report_error$2(ppf, c) { if (/* tag */ typeof c === "number" || typeof c === "string") { switch (c) { case /* Unterminated_string */ 0 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal not terminated", - _1: /* End_of_format */ 0 - }, - _1: "String literal not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "String literal not terminated", + _1: /* End_of_format */ 0 + }, + _1: "String literal not terminated" + }); case /* Unterminated_paren_in_conditional */ 1 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unterminated parens in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unterminated parens in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unterminated parens in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unterminated parens in conditional predicate" + }); case /* Unterminated_if */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#if not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#if not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#if not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#if not terminated" + }); case /* Unterminated_else */ 3 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#else not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#else not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#else not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#else not terminated" + }); case /* Unexpected_token_in_conditional */ 4 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected token in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected token in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected token in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected token in conditional predicate" + }); case /* Expect_hash_then_in_conditional */ 5 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Expect `then` after conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Expect `then` after conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Expect `then` after conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Expect `then` after conditional predicate" + }); case /* Unexpected_directive */ 6 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected directive", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected directive" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected directive", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected directive" + }); } } else { switch (c.TAG) { case /* Illegal_character */ 0 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal character (%s)" - }), Stdlib__Char.escaped(c._0)); + } + }, + _1: "Illegal character (%s)" + }), Stdlib__Char.escaped(c._0)); case /* Illegal_escape */ 1 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal backslash escape in string or character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal backslash escape in string or character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal backslash escape in string or character (%s)" - }), c._0); + } + }, + _1: "Illegal backslash escape in string or character (%s)" + }), c._0); case /* Unterminated_comment */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Comment not terminated", - _1: /* End_of_format */ 0 - }, - _1: "Comment not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Comment not terminated", + _1: /* End_of_format */ 0 + }, + _1: "Comment not terminated" + }); case /* Unterminated_string_in_comment */ 3 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This comment contains an unterminated string literal", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal begins here", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "This comment contains an unterminated string literal@.%aString literal begins here" - }), print_error, c._1); - case /* Keyword_as_label */ 4 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '`' */96, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This comment contains an unterminated string literal", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* String_literal */ 11, - _0: "' is a keyword, it cannot be used as label name", + _0: "String literal begins here", _1: /* End_of_format */ 0 } } - }, - _1: "`%s' is a keyword, it cannot be used as label name" - }), c._0); - case /* Literal_overflow */ 5 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Integer literal exceeds the range of representable integers of type ", + } + }, + _1: "This comment contains an unterminated string literal@.%aString literal begins here" + }), print_error, c._1); + case /* Keyword_as_label */ 4 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '`' */96, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "' is a keyword, it cannot be used as label name", _1: /* End_of_format */ 0 } - }, - _1: "Integer literal exceeds the range of representable integers of type %s" - }), c._0); + } + }, + _1: "`%s' is a keyword, it cannot be used as label name" + }), c._0); + case /* Literal_overflow */ 5 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Integer literal exceeds the range of representable integers of type ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Integer literal exceeds the range of representable integers of type %s" + }), c._0); case /* Illegal_semver */ 6 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal semantic version string ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "Illegal semantic version string %s" - }), c._0); + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal semantic version string ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Illegal semantic version string %s" + }), c._0); case /* Conditional_expr_expected_type */ 7 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Conditional expression type mismatch (", + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Conditional expression type mismatch (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } - }, - _1: "Conditional expression type mismatch (%s,%s)" - }), string_of_type_directive(c._0), string_of_type_directive(c._1)); + } + }, + _1: "Conditional expression type mismatch (%s,%s)" + }), string_of_type_directive(c._0), string_of_type_directive(c._1)); } } @@ -24452,479 +24452,479 @@ function token(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - if (!escaped_newlines.contents) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); - } - update_loc(lexbuf, undefined, 1, false, 0); - return token(lexbuf); + if (!escaped_newlines.contents) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); + } + update_loc(lexbuf, undefined, 1, false, 0); + return token(lexbuf); case 1 : - update_loc(lexbuf, undefined, 1, false, 0); - return /* EOL */ 100; + update_loc(lexbuf, undefined, 1, false, 0); + return /* EOL */ 100; case 2 : - return token(lexbuf); + return token(lexbuf); case 3 : - return /* UNDERSCORE */ 94; + return /* UNDERSCORE */ 94; case 4 : - return /* TILDE */ 89; + return /* TILDE */ 89; case 5 : - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 6 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 7 : - return /* QUESTION */ 76; + return /* QUESTION */ 76; case 8 : - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 9 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 10 : - const s = Stdlib__Lexing.lexeme(lexbuf); - try { - return Stdlib__Hashtbl.find(keyword_table, s); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return { - TAG: /* LIDENT */ 11, - _0: s - }; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const s = Stdlib__Lexing.lexeme(lexbuf); + try { + return Stdlib__Hashtbl.find(keyword_table, s); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return { + TAG: /* LIDENT */ 11, + _0: s + }; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case 11 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LIDENT */ 11, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LIDENT */ 11, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 12 : - return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 13 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; + case 14 : + try { return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) + TAG: /* INT */ 7, + _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 14 : - try { - return { - TAG: /* INT */ 7, - _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int" + }, + _2: curr(lexbuf) + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } case 15 : + return { + TAG: /* FLOAT */ 1, + _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) + }; + case 16 : + try { return { - TAG: /* FLOAT */ 1, - _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) + TAG: /* INT32 */ 8, + _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 16 : - try { - return { - TAG: /* INT32 */ 8, - _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int32" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int32" + }, + _2: curr(lexbuf) + }); } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } case 17 : - try { - return { - TAG: /* INT64 */ 9, - _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int64" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + try { + return { + TAG: /* INT64 */ 9, + _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) + }; + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int64" + }, + _2: curr(lexbuf) + }); } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } case 18 : - try { - return { - TAG: /* NATIVEINT */ 12, - _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "nativeint" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); - } - case 19 : - reset_string_buffer(undefined); - is_in_string.contents = true; - const string_start = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - string(lexbuf); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start; + try { return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - undefined - ] + TAG: /* NATIVEINT */ 12, + _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) }; + } + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "nativeint" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + case 19 : + reset_string_buffer(undefined); + is_in_string.contents = true; + const string_start = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + string(lexbuf); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + undefined + ] + }; case 20 : - reset_string_buffer(undefined); - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - is_in_string.contents = true; - const string_start$1 = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start$1; - return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - delim$1 - ] - }; + reset_string_buffer(undefined); + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + is_in_string.contents = true; + const string_start$1 = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start$1; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + delim$1 + ] + }; case 21 : - update_loc(lexbuf, undefined, 1, false, 1); - return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) - }; + update_loc(lexbuf, undefined, 1, false, 1); + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 22 : - return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) - }; + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 23 : - return { - TAG: /* CHAR */ 0, - _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) + }; case 24 : - return { - TAG: /* CHAR */ 0, - _0: char_for_decimal_code(lexbuf, 2) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_decimal_code(lexbuf, 2) + }; case 25 : - return { - TAG: /* CHAR */ 0, - _0: char_for_hexadecimal_code(lexbuf, 3) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_hexadecimal_code(lexbuf, 3) + }; case 26 : - const l = Stdlib__Lexing.lexeme(lexbuf); - const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_escape */ 1, - _0: esc - }, - _2: curr(lexbuf) - }); + const l = Stdlib__Lexing.lexeme(lexbuf); + const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_escape */ 1, + _0: esc + }, + _2: curr(lexbuf) + }); case 27 : - const match = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match[0], - match[1] - ] - }; + const match = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match[0], + match[1] + ] + }; case 28 : - const match$1 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* DOCSTRING */ 19, - _0: docstring(match$1[0], match$1[1]) - }; + const match$1 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* DOCSTRING */ 19, + _0: docstring(match$1[0], match$1[1]) + }; case 29 : - const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - const match$2 = with_comment_buffer((function (lexbuf) { - store_string("*" + stars); - return __ocaml_lex_comment_rec(lexbuf, 132); - }), lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$2[0], - match$2[1] - ] - }; + const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + const match$2 = with_comment_buffer((function (lexbuf) { + store_string("*" + stars); + return __ocaml_lex_comment_rec(lexbuf, 132); + }), lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$2[0], + match$2[1] + ] + }; case 30 : - if (print_warnings.contents) { - prerr_warning(curr(lexbuf), /* Comment_start */ 0); - } - const match$3 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$3[0], - match$3[1] - ] - }; + if (print_warnings.contents) { + prerr_warning(curr(lexbuf), /* Comment_start */ 0); + } + const match$3 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$3[0], + match$3[1] + ] + }; case 31 : - const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); - return { - TAG: /* COMMENT */ 18, - _0: [ - stars$1, - curr(lexbuf) - ] - }; + const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); + return { + TAG: /* COMMENT */ 18, + _0: [ + stars$1, + curr(lexbuf) + ] + }; case 32 : - const loc = curr(lexbuf); - prerr_warning(loc, /* Comment_not_end */ 1); - lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; - const curpos = lexbuf.lex_curr_p; - lexbuf.lex_curr_p = { - pos_fname: curpos.pos_fname, - pos_lnum: curpos.pos_lnum, - pos_bol: curpos.pos_bol, - pos_cnum: curpos.pos_cnum - 1 | 0 - }; - return /* STAR */ 86; + const loc = curr(lexbuf); + prerr_warning(loc, /* Comment_not_end */ 1); + lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; + const curpos = lexbuf.lex_curr_p; + lexbuf.lex_curr_p = { + pos_fname: curpos.pos_fname, + pos_lnum: curpos.pos_lnum, + pos_bol: curpos.pos_bol, + pos_cnum: curpos.pos_cnum - 1 | 0 + }; + return /* STAR */ 86; case 33 : - const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); - update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); - return token(lexbuf); + const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); + update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); + return token(lexbuf); case 34 : - return /* SHARP */ 84; + return /* SHARP */ 84; case 35 : - return /* AMPERSAND */ 1; + return /* AMPERSAND */ 1; case 36 : - return /* AMPERAMPER */ 0; + return /* AMPERAMPER */ 0; case 37 : - return /* BACKQUOTE */ 5; + return /* BACKQUOTE */ 5; case 38 : - return /* QUOTE */ 77; + return /* QUOTE */ 77; case 39 : - return /* LPAREN */ 54; + return /* LPAREN */ 54; case 40 : - return /* RPAREN */ 81; + return /* RPAREN */ 81; case 41 : - return /* STAR */ 86; + return /* STAR */ 86; case 42 : - return /* COMMA */ 16; + return /* COMMA */ 16; case 43 : - return /* MINUSGREATER */ 62; + return /* MINUSGREATER */ 62; case 44 : - return /* DOT */ 20; + return /* DOT */ 20; case 45 : - return /* DOTDOT */ 21; + return /* DOTDOT */ 21; case 46 : - return /* COLON */ 12; + return /* COLON */ 12; case 47 : - return /* COLONCOLON */ 13; + return /* COLONCOLON */ 13; case 48 : - return /* COLONEQUAL */ 14; + return /* COLONEQUAL */ 14; case 49 : - return /* COLONGREATER */ 15; + return /* COLONGREATER */ 15; case 50 : - return /* SEMI */ 82; + return /* SEMI */ 82; case 51 : - return /* SEMISEMI */ 83; + return /* SEMISEMI */ 83; case 52 : - return /* LESS */ 51; + return /* LESS */ 51; case 53 : - return /* LESSMINUS */ 52; + return /* LESSMINUS */ 52; case 54 : - return /* EQUAL */ 26; + return /* EQUAL */ 26; case 55 : - return /* LBRACKET */ 45; + return /* LBRACKET */ 45; case 56 : - return /* LBRACKETBAR */ 46; + return /* LBRACKETBAR */ 46; case 57 : - return /* LBRACKETLESS */ 47; + return /* LBRACKETLESS */ 47; case 58 : - return /* LBRACKETGREATER */ 48; + return /* LBRACKETGREATER */ 48; case 59 : - return /* RBRACKET */ 79; + return /* RBRACKET */ 79; case 60 : - return /* LBRACE */ 43; + return /* LBRACE */ 43; case 61 : - return /* LBRACELESS */ 44; + return /* LBRACELESS */ 44; case 62 : - return /* BAR */ 7; + return /* BAR */ 7; case 63 : - return /* BARBAR */ 8; + return /* BARBAR */ 8; case 64 : - return /* BARRBRACKET */ 9; + return /* BARRBRACKET */ 9; case 65 : - return /* GREATER */ 34; + return /* GREATER */ 34; case 66 : - return /* GREATERRBRACKET */ 36; + return /* GREATERRBRACKET */ 36; case 67 : - return /* RBRACE */ 78; + return /* RBRACE */ 78; case 68 : - return /* GREATERRBRACE */ 35; + return /* GREATERRBRACE */ 35; case 69 : - return /* LBRACKETAT */ 55; + return /* LBRACKETAT */ 55; case 70 : - return /* LBRACKETPERCENT */ 49; + return /* LBRACKETPERCENT */ 49; case 71 : - return /* LBRACKETPERCENTPERCENT */ 50; + return /* LBRACKETPERCENTPERCENT */ 50; case 72 : - return /* LBRACKETATAT */ 56; + return /* LBRACKETATAT */ 56; case 73 : - return /* LBRACKETATATAT */ 57; + return /* LBRACKETATATAT */ 57; case 74 : - return /* BANG */ 6; + return /* BANG */ 6; case 75 : - return { - TAG: /* INFIXOP0 */ 2, - _0: "!=" - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: "!=" + }; case 76 : - return /* PLUS */ 72; + return /* PLUS */ 72; case 77 : - return /* PLUSDOT */ 73; + return /* PLUSDOT */ 73; case 78 : - return /* PLUSEQ */ 74; + return /* PLUSEQ */ 74; case 79 : - return /* MINUS */ 60; + return /* MINUS */ 60; case 80 : - return /* MINUSDOT */ 61; + return /* MINUSDOT */ 61; case 81 : case 82 : - return { - TAG: /* PREFIXOP */ 14, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* PREFIXOP */ 14, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 83 : - return { - TAG: /* INFIXOP0 */ 2, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 84 : - return { - TAG: /* INFIXOP1 */ 3, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP1 */ 3, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 85 : - return { - TAG: /* INFIXOP2 */ 4, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP2 */ 4, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 86 : - return { - TAG: /* INFIXOP4 */ 6, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP4 */ 6, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 87 : - return /* PERCENT */ 71; + return /* PERCENT */ 71; case 88 : - return { - TAG: /* INFIXOP3 */ 5, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP3 */ 5, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 89 : - return { - TAG: /* SHARPOP */ 15, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* SHARPOP */ 15, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 90 : - if (if_then_else.contents === /* Dir_out */ 2) { - return /* EOF */ 25; - } - if (if_then_else.contents === /* Dir_if_true */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); - } + if (if_then_else.contents === /* Dir_out */ 2) { + return /* EOF */ 25; + } + if (if_then_else.contents === /* Dir_if_true */ 0) { throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_else */ 3, + _1: /* Unterminated_if */ 2, _2: curr(lexbuf) }); + } + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); case 91 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -24945,46 +24945,46 @@ function string(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return; + return; case 1 : - const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - update_loc(lexbuf, undefined, 1, false, space.length); - return string(lexbuf); + const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + update_loc(lexbuf, undefined, 1, false, space.length); + return string(lexbuf); case 2 : - store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); - return string(lexbuf); + store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); + return string(lexbuf); case 3 : - store_string_char(char_for_decimal_code(lexbuf, 1)); - return string(lexbuf); + store_string_char(char_for_decimal_code(lexbuf, 1)); + return string(lexbuf); case 4 : - store_string_char(char_for_hexadecimal_code(lexbuf, 2)); - return string(lexbuf); + store_string_char(char_for_hexadecimal_code(lexbuf, 2)); + return string(lexbuf); case 5 : - if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - return string(lexbuf); - } - const loc = curr(lexbuf); - prerr_warning(loc, /* Illegal_backslash */ 7); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { return string(lexbuf); + } + const loc = curr(lexbuf); + prerr_warning(loc, /* Illegal_backslash */ 7); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + return string(lexbuf); case 6 : - if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); - } - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - return string(lexbuf); + if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { + prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); + } + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + return string(lexbuf); case 7 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 8 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - return string(lexbuf); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + return string(lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -24999,174 +24999,174 @@ function __ocaml_lex_comment_rec(lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - comment_start_loc.contents = { - hd: curr(lexbuf), - tl: comment_start_loc.contents - }; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + comment_start_loc.contents = { + hd: curr(lexbuf), + tl: comment_start_loc.contents + }; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 1 : - const match = comment_start_loc.contents; - if (match) { - if (match.tl) { - comment_start_loc.contents = match.tl; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; - } - comment_start_loc.contents = /* [] */ 0; - return curr(lexbuf); + const match = comment_start_loc.contents; + if (match) { + if (match.tl) { + comment_start_loc.contents = match.tl; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 26844, - 16 - ] - }); + comment_start_loc.contents = /* [] */ 0; + return curr(lexbuf); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 26844, + 16 + ] + }); case 2 : - string_start_loc.contents = curr(lexbuf); - store_string_char(/* '"' */34); - is_in_string.contents = true; - try { - string(lexbuf); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === $$Error$4) { - let tmp = exn._1; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - if (tmp === /* Unterminated_string */ 0) { - const match$1 = comment_start_loc.contents; - if (match$1) { - const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start, - _1: exn._2 - }, - _2: match$1.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 26861, - 18 - ] + string_start_loc.contents = curr(lexbuf); + store_string_char(/* '"' */34); + is_in_string.contents = true; + try { + string(lexbuf); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === $$Error$4) { + let tmp = exn._1; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + if (tmp === /* Unterminated_string */ 0) { + const match$1 = comment_start_loc.contents; + if (match$1) { + const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start, + _1: exn._2 + }, + _2: match$1.hd }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 26861, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } else { throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - is_in_string.contents = false; - store_string_char(/* '"' */34); - ___ocaml_lex_state = 132; - continue; + } + is_in_string.contents = false; + store_string_char(/* '"' */34); + ___ocaml_lex_state = 132; + continue; case 3 : - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - string_start_loc.contents = curr(lexbuf); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - is_in_string.contents = true; - try { - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === $$Error$4) { - let tmp$1 = exn$1._1; - if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { - if (tmp$1 === /* Unterminated_string */ 0) { - const match$2 = comment_start_loc.contents; - if (match$2) { - const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start$1, - _1: exn$1._2 - }, - _2: match$2.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 26884, - 18 - ] + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + string_start_loc.contents = curr(lexbuf); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + is_in_string.contents = true; + try { + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === $$Error$4) { + let tmp$1 = exn$1._1; + if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { + if (tmp$1 === /* Unterminated_string */ 0) { + const match$2 = comment_start_loc.contents; + if (match$2) { + const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start$1, + _1: exn$1._2 + }, + _2: match$2.hd }); } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 26884, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } else { throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - is_in_string.contents = false; - store_string_char(/* '|' */124); - store_string(delim$1); - store_string_char(/* '}' */125); - ___ocaml_lex_state = 132; - continue; + } + is_in_string.contents = false; + store_string_char(/* '|' */124); + store_string(delim$1); + store_string_char(/* '}' */125); + ___ocaml_lex_state = 132; + continue; case 5 : - update_loc(lexbuf, undefined, 1, false, 1); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + update_loc(lexbuf, undefined, 1, false, 1); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 10 : - const match$3 = comment_start_loc.contents; - if (match$3) { - const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: { - TAG: /* Unterminated_comment */ 2, - _0: start$2 - }, - _2: match$3.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 26934, - 16 - ] + const match$3 = comment_start_loc.contents; + if (match$3) { + const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: { + TAG: /* Unterminated_comment */ 2, + _0: start$2 + }, + _2: match$3.hd }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 26934, + 16 + ] + }); case 11 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 4 : case 6 : case 7 : case 8 : case 9 : case 12 : - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -25181,30 +25181,30 @@ function __ocaml_lex_quoted_string_rec(delim, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 1 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 2 : - const edelim = Stdlib__Lexing.lexeme(lexbuf); - const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); - if (delim === edelim$1) { - return; - } - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + const edelim = Stdlib__Lexing.lexeme(lexbuf); + const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); + if (delim === edelim$1) { + return; + } + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 3 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - ___ocaml_lex_state = 183; - continue; + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + ___ocaml_lex_state = 183; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -25238,10 +25238,10 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a)); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); + set_post_docstrings(post_pos, Stdlib__List.rev(a)); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); } set_post_docstrings(post_pos, Stdlib__List.rev(a)); @@ -25253,12 +25253,12 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); - set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); + set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); + set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); } set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); @@ -25275,308 +25275,308 @@ function token$1(lexbuf) { if (/* tag */ typeof doc === "number" || typeof doc === "string") { switch (doc) { case /* SHARP */ 84 : - if (at_bol(lexbuf)) { - const cont = function (lexbuf) { - return loop(lines, docs, lexbuf); - }; - const look_ahead = function (token) { - sharp_look_ahead.contents = token; - return /* SHARP */ 84; - }; - const if_then_else$1 = if_then_else.contents; - const match = token_with_comments(lexbuf); - if (/* tag */ typeof match === "number" || typeof match === "string") { - switch (match) { - case /* ELSE */ 23 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - break; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } + if (at_bol(lexbuf)) { + const cont = function (lexbuf) { + return loop(lines, docs, lexbuf); + }; + const look_ahead = function (token) { + sharp_look_ahead.contents = token; + return /* SHARP */ 84; + }; + const if_then_else$1 = if_then_else.contents; + const match = token_with_comments(lexbuf); + if (/* tag */ typeof match === "number" || typeof match === "string") { + switch (match) { + case /* ELSE */ 23 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : break; - case /* END */ 24 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - case /* IF */ 37 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + break; + case /* END */ 24 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + case /* IF */ 37 : + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + case /* Dir_out */ 2 : + if (directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } else { + let _param; + while (true) { + const token = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token, /* EOF */ 25)) { throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, + _1: /* Unterminated_if */ 2, _2: curr(lexbuf) }); - case /* Dir_out */ 2 : - if (directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; - return Curry._1(cont, lexbuf); - } else { - let _param; - while (true) { - const token = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token, /* EOF */ 25)) { + } + if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$1 = token_with_comments(lexbuf); + if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { + switch (token$1) { + case /* ELSE */ 23 : + if_then_else.contents = /* Dir_if_false */ 1; + return Curry._1(cont, lexbuf); + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_if */ 2, + _1: /* Unexpected_directive */ 6, _2: curr(lexbuf) }); - } - if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$1 = token_with_comments(lexbuf); - if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { - switch (token$1) { - case /* ELSE */ 23 : - if_then_else.contents = /* Dir_if_false */ 1; - return Curry._1(cont, lexbuf); - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - } - if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; - return Curry._1(cont, lexbuf); - } - _param = undefined; - continue; - } - _param = undefined; - continue; - }; + + } } - + if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } + _param = undefined; + continue; + } + _param = undefined; + continue; + }; } - default: - return Curry._1(look_ahead, match); - } - } else { - if (match.TAG !== /* LIDENT */ 11) { - return Curry._1(look_ahead, match); - } - if (match._0 !== "elif") { + + } + default: return Curry._1(look_ahead, match); - } - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - break; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } + } + } else { + if (match.TAG !== /* LIDENT */ 11) { + return Curry._1(look_ahead, match); + } + if (match._0 !== "elif") { + return Curry._1(look_ahead, match); } switch (if_then_else$1) { case /* Dir_if_true */ 0 : - let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); - while (true) { - const else_seen = _else_seen; - const token$2 = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unterminated_else */ 3, - _2: curr(lexbuf) - }); - } - if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$3 = token_with_comments(lexbuf); - if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { - switch (token$3) { - case /* ELSE */ 23 : - if (else_seen) { - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - } - _else_seen = true; - continue; - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$4, { - MEL_EXN_ID: $$Error$4, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - + break; + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + } + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); + while (true) { + const else_seen = _else_seen; + const token$2 = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); + } + if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$3 = token_with_comments(lexbuf); + if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { + switch (token$3) { + case /* ELSE */ 23 : + if (else_seen) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); } - } - if (else_seen && is_elif(token$3)) { + _else_seen = true; + continue; + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : throw new Caml_js_exceptions.MelangeError($$Error$4, { MEL_EXN_ID: $$Error$4, _1: /* Unexpected_directive */ 6, _2: curr(lexbuf) }); - } - continue; + } - continue; - }; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - return Curry._1(look_ahead, match); - - } + } + if (else_seen && is_elif(token$3)) { + throw new Caml_js_exceptions.MelangeError($$Error$4, { + MEL_EXN_ID: $$Error$4, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + } + continue; + } + continue; + }; + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + return Curry._1(look_ahead, match); + } - break; + } + break; case /* EOL */ 100 : - let lines$p; + let lines$p; + switch (lines) { + case /* NoLine */ 0 : + lines$p = /* NewLine */ 1; + break; + case /* NewLine */ 1 : + case /* BlankLine */ 2 : + lines$p = /* BlankLine */ 2; + break; + + } + _lines = lines$p; + continue; + + } + } else { + switch (doc.TAG) { + case /* COMMENT */ 18 : + const match$1 = doc._0; + add_comment([ + match$1[0], + match$1[1] + ]); + let lines$p$1; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + lines$p$1 = /* NoLine */ 0; + break; + case /* BlankLine */ 2 : + lines$p$1 = /* BlankLine */ 2; + break; + + } + _lines = lines$p$1; + continue; + case /* DOCSTRING */ 19 : + const doc$1 = doc._0; + add_docstring_comment(doc$1); + let docs$p; + if (/* tag */ typeof docs === "number" || typeof docs === "string") { switch (lines) { case /* NoLine */ 0 : - lines$p = /* NewLine */ 1; - break; case /* NewLine */ 1 : + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; case /* BlankLine */ 2 : - lines$p = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: /* [] */ 0, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p; - continue; - - } - } else { - switch (doc.TAG) { - case /* COMMENT */ 18 : - const match$1 = doc._0; - add_comment([ - match$1[0], - match$1[1] - ]); - let lines$p$1; + } else if (docs.TAG === /* After */ 0) { + const a = docs._0; switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - lines$p$1 = /* NoLine */ 0; - break; + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: a + } + }; + break; case /* BlankLine */ 2 : - lines$p$1 = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: a, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p$1; - continue; - case /* DOCSTRING */ 19 : - const doc$1 = doc._0; - add_docstring_comment(doc$1); - let docs$p; - if (/* tag */ typeof docs === "number" || typeof docs === "string") { - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: /* [] */ 0, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else if (docs.TAG === /* After */ 0) { - const a = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: a - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else { - const b = docs._2; - const f = docs._1; - const a$1 = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: f, - _2: { - hd: doc$1, - tl: b - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: Stdlib.$at(b, f), - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } + } else { + const b = docs._2; + const f = docs._1; + const a$1 = docs._0; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: f, + _2: { + hd: doc$1, + tl: b + } + }; + break; + case /* BlankLine */ 2 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: Stdlib.$at(b, f), + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; + } - _docs = docs$p; - _lines = /* NoLine */ 0; - continue; + } + _docs = docs$p; + _lines = /* NoLine */ 0; + continue; } } @@ -25616,7 +25616,7 @@ function skip_phrase(lexbuf) { switch (match) { case /* EOF */ 25 : case /* SEMISEMI */ 83 : - return; + return; default: return skip_phrase(lexbuf); } @@ -25635,7 +25635,7 @@ function skip_phrase(lexbuf) { case /* Illegal_character */ 0 : case /* Unterminated_comment */ 2 : case /* Unterminated_string_in_comment */ 3 : - continue; + continue; default: throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } @@ -25712,22 +25712,22 @@ function iter_pattern_desc(f, patl) { } switch (patl.TAG) { case /* Tpat_construct */ 4 : - return Stdlib__List.iter(f, patl._2); + return Stdlib__List.iter(f, patl._2); case /* Tpat_variant */ 5 : - return may(f, patl._1); + return may(f, patl._1); case /* Tpat_record */ 6 : - return Stdlib__List.iter((function (param) { - Curry._1(f, param[2]); - }), patl._0); + return Stdlib__List.iter((function (param) { + Curry._1(f, param[2]); + }), patl._0); case /* Tpat_tuple */ 3 : case /* Tpat_array */ 7 : - return Stdlib__List.iter(f, patl._0); + return Stdlib__List.iter(f, patl._0); case /* Tpat_or */ 8 : - Curry._1(f, patl._0); - return Curry._1(f, patl._1); + Curry._1(f, patl._0); + return Curry._1(f, patl._1); case /* Tpat_alias */ 1 : case /* Tpat_lazy */ 9 : - return Curry._1(f, patl._0); + return Curry._1(f, patl._0); default: return; } @@ -25739,65 +25739,65 @@ function map_pattern_desc(f, d) { } switch (d.TAG) { case /* Tpat_alias */ 1 : - return { - TAG: /* Tpat_alias */ 1, - _0: Curry._1(f, d._0), - _1: d._1, - _2: d._2 - }; + return { + TAG: /* Tpat_alias */ 1, + _0: Curry._1(f, d._0), + _1: d._1, + _2: d._2 + }; case /* Tpat_tuple */ 3 : - return { - TAG: /* Tpat_tuple */ 3, - _0: Stdlib__List.map(f, d._0) - }; + return { + TAG: /* Tpat_tuple */ 3, + _0: Stdlib__List.map(f, d._0) + }; case /* Tpat_construct */ 4 : + return { + TAG: /* Tpat_construct */ 4, + _0: d._0, + _1: d._1, + _2: Stdlib__List.map(f, d._2) + }; + case /* Tpat_variant */ 5 : + const p1 = d._1; + if (p1 !== undefined) { return { - TAG: /* Tpat_construct */ 4, + TAG: /* Tpat_variant */ 5, _0: d._0, - _1: d._1, - _2: Stdlib__List.map(f, d._2) + _1: Curry._1(f, p1), + _2: d._2 }; - case /* Tpat_variant */ 5 : - const p1 = d._1; - if (p1 !== undefined) { - return { - TAG: /* Tpat_variant */ 5, - _0: d._0, - _1: Curry._1(f, p1), - _2: d._2 - }; - } else { - return d; - } + } else { + return d; + } case /* Tpat_record */ 6 : - return { - TAG: /* Tpat_record */ 6, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - Curry._1(f, param[2]) - ]; - }), d._0), - _1: d._1 - }; + return { + TAG: /* Tpat_record */ 6, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + Curry._1(f, param[2]) + ]; + }), d._0), + _1: d._1 + }; case /* Tpat_array */ 7 : - return { - TAG: /* Tpat_array */ 7, - _0: Stdlib__List.map(f, d._0) - }; + return { + TAG: /* Tpat_array */ 7, + _0: Stdlib__List.map(f, d._0) + }; case /* Tpat_or */ 8 : - return { - TAG: /* Tpat_or */ 8, - _0: Curry._1(f, d._0), - _1: Curry._1(f, d._1), - _2: d._2 - }; + return { + TAG: /* Tpat_or */ 8, + _0: Curry._1(f, d._0), + _1: Curry._1(f, d._1), + _2: d._2 + }; case /* Tpat_lazy */ 9 : - return { - TAG: /* Tpat_lazy */ 9, - _0: Curry._1(f, d._0) - }; + return { + TAG: /* Tpat_lazy */ 9, + _0: Curry._1(f, d._0) + }; default: return d; } @@ -25816,27 +25816,27 @@ function bound_idents(_pat) { } switch (d.TAG) { case /* Tpat_var */ 0 : - idents.contents = { - hd: [ - d._0, - d._1 - ], - tl: idents.contents - }; - return; + idents.contents = { + hd: [ + d._0, + d._1 + ], + tl: idents.contents + }; + return; case /* Tpat_alias */ 1 : - bound_idents(d._0); - idents.contents = { - hd: [ - d._1, - d._2 - ], - tl: idents.contents - }; - return; + bound_idents(d._0); + idents.contents = { + hd: [ + d._1, + d._2 + ], + tl: idents.contents + }; + return; case /* Tpat_or */ 8 : - _pat = d._0; - continue; + _pat = d._0; + continue; default: return iter_pattern_desc(bound_idents, d); } @@ -25872,54 +25872,54 @@ function alpha_pat(env, p) { if (!/* tag */ (typeof d === "number" || typeof d === "string")) { switch (d.TAG) { case /* Tpat_var */ 0 : - let tmp; - try { - tmp = { - TAG: /* Tpat_var */ 0, - _0: Stdlib__List.assoc(d._0, env), - _1: d._1 - }; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - tmp = /* Tpat_any */ 0; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + let tmp; + try { + tmp = { + TAG: /* Tpat_var */ 0, + _0: Stdlib__List.assoc(d._0, env), + _1: d._1 + }; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + tmp = /* Tpat_any */ 0; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } + return { + pat_desc: tmp, + pat_loc: p.pat_loc, + pat_extra: p.pat_extra, + pat_type: p.pat_type, + pat_env: p.pat_env, + pat_attributes: p.pat_attributes + }; + case /* Tpat_alias */ 1 : + const new_p = alpha_pat(env, d._0); + try { return { - pat_desc: tmp, + pat_desc: { + TAG: /* Tpat_alias */ 1, + _0: new_p, + _1: Stdlib__List.assoc(d._1, env), + _2: d._2 + }, pat_loc: p.pat_loc, pat_extra: p.pat_extra, pat_type: p.pat_type, pat_env: p.pat_env, pat_attributes: p.pat_attributes }; - case /* Tpat_alias */ 1 : - const new_p = alpha_pat(env, d._0); - try { - return { - pat_desc: { - TAG: /* Tpat_alias */ 1, - _0: new_p, - _1: Stdlib__List.assoc(d._1, env), - _2: d._2 - }, - pat_loc: p.pat_loc, - pat_extra: p.pat_extra, - pat_type: p.pat_type, - pat_env: p.pat_env, - pat_attributes: p.pat_attributes - }; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - return new_p; - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + return new_p; } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } } } @@ -26113,27 +26113,27 @@ function TypedtreeMap_MakeMap(funarg) { let cltyp_desc; switch (csg.TAG) { case /* Tcty_constr */ 0 : - cltyp_desc = { - TAG: /* Tcty_constr */ 0, - _0: csg._0, - _1: csg._1, - _2: Stdlib__List.map(map_core_type, csg._2) - }; - break; + cltyp_desc = { + TAG: /* Tcty_constr */ 0, + _0: csg._0, + _1: csg._1, + _2: Stdlib__List.map(map_core_type, csg._2) + }; + break; case /* Tcty_signature */ 1 : - cltyp_desc = { - TAG: /* Tcty_signature */ 1, - _0: map_class_signature(csg._0) - }; - break; + cltyp_desc = { + TAG: /* Tcty_signature */ 1, + _0: map_class_signature(csg._0) + }; + break; case /* Tcty_arrow */ 2 : - cltyp_desc = { - TAG: /* Tcty_arrow */ 2, - _0: csg._0, - _1: map_core_type(csg._1), - _2: map_class_type(csg._2) - }; - break; + cltyp_desc = { + TAG: /* Tcty_arrow */ 2, + _0: csg._0, + _1: map_core_type(csg._1), + _2: map_class_type(csg._2) + }; + break; } return Curry._1(funarg.leave_class_type, { @@ -26153,79 +26153,79 @@ function TypedtreeMap_MakeMap(funarg) { } else { switch (list.TAG) { case /* Ttyp_var */ 0 : - ctyp_desc = ct$1.ctyp_desc; - break; + ctyp_desc = ct$1.ctyp_desc; + break; case /* Ttyp_arrow */ 1 : - ctyp_desc = { - TAG: /* Ttyp_arrow */ 1, - _0: list._0, - _1: map_core_type(list._1), - _2: map_core_type(list._2) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_arrow */ 1, + _0: list._0, + _1: map_core_type(list._1), + _2: map_core_type(list._2) + }; + break; case /* Ttyp_tuple */ 2 : - ctyp_desc = { - TAG: /* Ttyp_tuple */ 2, - _0: Stdlib__List.map(map_core_type, list._0) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_tuple */ 2, + _0: Stdlib__List.map(map_core_type, list._0) + }; + break; case /* Ttyp_constr */ 3 : - ctyp_desc = { - TAG: /* Ttyp_constr */ 3, - _0: list._0, - _1: list._1, - _2: Stdlib__List.map(map_core_type, list._2) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_constr */ 3, + _0: list._0, + _1: list._1, + _2: Stdlib__List.map(map_core_type, list._2) + }; + break; case /* Ttyp_object */ 4 : - ctyp_desc = { - TAG: /* Ttyp_object */ 4, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_core_type(param[2]) - ]; - }), list._0), - _1: list._1 - }; - break; + ctyp_desc = { + TAG: /* Ttyp_object */ 4, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_core_type(param[2]) + ]; + }), list._0), + _1: list._1 + }; + break; case /* Ttyp_class */ 5 : - ctyp_desc = { - TAG: /* Ttyp_class */ 5, - _0: list._0, - _1: list._1, - _2: Stdlib__List.map(map_core_type, list._2) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_class */ 5, + _0: list._0, + _1: list._1, + _2: Stdlib__List.map(map_core_type, list._2) + }; + break; case /* Ttyp_alias */ 6 : - ctyp_desc = { - TAG: /* Ttyp_alias */ 6, - _0: map_core_type(list._0), - _1: list._1 - }; - break; + ctyp_desc = { + TAG: /* Ttyp_alias */ 6, + _0: map_core_type(list._0), + _1: list._1 + }; + break; case /* Ttyp_variant */ 7 : - ctyp_desc = { - TAG: /* Ttyp_variant */ 7, - _0: Stdlib__List.map(map_row_field, list._0), - _1: list._1, - _2: list._2 - }; - break; + ctyp_desc = { + TAG: /* Ttyp_variant */ 7, + _0: Stdlib__List.map(map_row_field, list._0), + _1: list._1, + _2: list._2 + }; + break; case /* Ttyp_poly */ 8 : - ctyp_desc = { - TAG: /* Ttyp_poly */ 8, - _0: list._0, - _1: map_core_type(list._1) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_poly */ 8, + _0: list._0, + _1: map_core_type(list._1) + }; + break; case /* Ttyp_package */ 9 : - ctyp_desc = { - TAG: /* Ttyp_package */ 9, - _0: map_package_type(list._0) - }; - break; + ctyp_desc = { + TAG: /* Ttyp_package */ 9, + _0: map_package_type(list._0) + }; + break; } } @@ -26243,43 +26243,43 @@ function TypedtreeMap_MakeMap(funarg) { let mty_desc; switch (sg.TAG) { case /* Tmty_signature */ 1 : - mty_desc = { - TAG: /* Tmty_signature */ 1, - _0: map_signature(sg._0) - }; - break; + mty_desc = { + TAG: /* Tmty_signature */ 1, + _0: map_signature(sg._0) + }; + break; case /* Tmty_functor */ 2 : - mty_desc = { - TAG: /* Tmty_functor */ 2, - _0: sg._0, - _1: sg._1, - _2: may_map(map_module_type, sg._2), - _3: map_module_type(sg._3) - }; - break; + mty_desc = { + TAG: /* Tmty_functor */ 2, + _0: sg._0, + _1: sg._1, + _2: may_map(map_module_type, sg._2), + _3: map_module_type(sg._3) + }; + break; case /* Tmty_with */ 3 : - mty_desc = { - TAG: /* Tmty_with */ 3, - _0: map_module_type(sg._0), - _1: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_with_constraint(param[2]) - ]; - }), sg._1) - }; - break; + mty_desc = { + TAG: /* Tmty_with */ 3, + _0: map_module_type(sg._0), + _1: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_with_constraint(param[2]) + ]; + }), sg._1) + }; + break; case /* Tmty_typeof */ 4 : - mty_desc = { - TAG: /* Tmty_typeof */ 4, - _0: map_module_expr(sg._0) - }; - break; + mty_desc = { + TAG: /* Tmty_typeof */ 4, + _0: map_module_expr(sg._0) + }; + break; case /* Tmty_ident */ 0 : case /* Tmty_alias */ 5 : - mty_desc = mty$1.mty_desc; - break; + mty_desc = mty$1.mty_desc; + break; } return Curry._1(funarg.leave_module_type, { @@ -26296,219 +26296,219 @@ function TypedtreeMap_MakeMap(funarg) { let exp_desc; switch (list.TAG) { case /* Texp_let */ 2 : - const rec_flag = list._0; - exp_desc = { - TAG: /* Texp_let */ 2, - _0: rec_flag, - _1: Stdlib__List.map(map_binding, list._1), - _2: map_expression(list._2) - }; - break; + const rec_flag = list._0; + exp_desc = { + TAG: /* Texp_let */ 2, + _0: rec_flag, + _1: Stdlib__List.map(map_binding, list._1), + _2: map_expression(list._2) + }; + break; case /* Texp_function */ 3 : - exp_desc = { - TAG: /* Texp_function */ 3, - _0: list._0, - _1: Stdlib__List.map(map_case, list._1), - _2: list._2 - }; - break; + exp_desc = { + TAG: /* Texp_function */ 3, + _0: list._0, + _1: Stdlib__List.map(map_case, list._1), + _2: list._2 + }; + break; case /* Texp_apply */ 4 : - exp_desc = { - TAG: /* Texp_apply */ 4, - _0: map_expression(list._0), - _1: Stdlib__List.map((function (param) { - const expo = param[1]; - const expo$1 = expo !== undefined ? map_expression(expo) : expo; - return [ - param[0], - expo$1, - param[2] - ]; - }), list._1) - }; - break; + exp_desc = { + TAG: /* Texp_apply */ 4, + _0: map_expression(list._0), + _1: Stdlib__List.map((function (param) { + const expo = param[1]; + const expo$1 = expo !== undefined ? map_expression(expo) : expo; + return [ + param[0], + expo$1, + param[2] + ]; + }), list._1) + }; + break; case /* Texp_match */ 5 : - exp_desc = { - TAG: /* Texp_match */ 5, - _0: map_expression(list._0), - _1: Stdlib__List.map(map_case, list._1), - _2: Stdlib__List.map(map_case, list._2), - _3: list._3 - }; - break; + exp_desc = { + TAG: /* Texp_match */ 5, + _0: map_expression(list._0), + _1: Stdlib__List.map(map_case, list._1), + _2: Stdlib__List.map(map_case, list._2), + _3: list._3 + }; + break; case /* Texp_try */ 6 : - exp_desc = { - TAG: /* Texp_try */ 6, - _0: map_expression(list._0), - _1: Stdlib__List.map(map_case, list._1) - }; - break; + exp_desc = { + TAG: /* Texp_try */ 6, + _0: map_expression(list._0), + _1: Stdlib__List.map(map_case, list._1) + }; + break; case /* Texp_tuple */ 7 : - exp_desc = { - TAG: /* Texp_tuple */ 7, - _0: Stdlib__List.map(map_expression, list._0) - }; - break; + exp_desc = { + TAG: /* Texp_tuple */ 7, + _0: Stdlib__List.map(map_expression, list._0) + }; + break; case /* Texp_construct */ 8 : - exp_desc = { - TAG: /* Texp_construct */ 8, - _0: list._0, - _1: list._1, - _2: Stdlib__List.map(map_expression, list._2) - }; - break; + exp_desc = { + TAG: /* Texp_construct */ 8, + _0: list._0, + _1: list._1, + _2: Stdlib__List.map(map_expression, list._2) + }; + break; case /* Texp_variant */ 9 : - const expo = list._1; - const expo$1 = expo !== undefined ? map_expression(expo) : expo; - exp_desc = { - TAG: /* Texp_variant */ 9, - _0: list._0, - _1: expo$1 - }; - break; + const expo = list._1; + const expo$1 = expo !== undefined ? map_expression(expo) : expo; + exp_desc = { + TAG: /* Texp_variant */ 9, + _0: list._0, + _1: expo$1 + }; + break; case /* Texp_record */ 10 : - const expo$2 = list._1; - const list$1 = Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_expression(param[2]) - ]; - }), list._0); - const expo$3 = expo$2 !== undefined ? map_expression(expo$2) : expo$2; - exp_desc = { - TAG: /* Texp_record */ 10, - _0: list$1, - _1: expo$3 - }; - break; + const expo$2 = list._1; + const list$1 = Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_expression(param[2]) + ]; + }), list._0); + const expo$3 = expo$2 !== undefined ? map_expression(expo$2) : expo$2; + exp_desc = { + TAG: /* Texp_record */ 10, + _0: list$1, + _1: expo$3 + }; + break; case /* Texp_field */ 11 : - exp_desc = { - TAG: /* Texp_field */ 11, - _0: map_expression(list._0), - _1: list._1, - _2: list._2 - }; - break; + exp_desc = { + TAG: /* Texp_field */ 11, + _0: map_expression(list._0), + _1: list._1, + _2: list._2 + }; + break; case /* Texp_setfield */ 12 : - exp_desc = { - TAG: /* Texp_setfield */ 12, - _0: map_expression(list._0), - _1: list._1, - _2: list._2, - _3: map_expression(list._3) - }; - break; + exp_desc = { + TAG: /* Texp_setfield */ 12, + _0: map_expression(list._0), + _1: list._1, + _2: list._2, + _3: map_expression(list._3) + }; + break; case /* Texp_array */ 13 : - exp_desc = { - TAG: /* Texp_array */ 13, - _0: Stdlib__List.map(map_expression, list._0) - }; - break; + exp_desc = { + TAG: /* Texp_array */ 13, + _0: Stdlib__List.map(map_expression, list._0) + }; + break; case /* Texp_ifthenelse */ 14 : - const expo$4 = list._2; - exp_desc = { - TAG: /* Texp_ifthenelse */ 14, - _0: map_expression(list._0), - _1: map_expression(list._1), - _2: expo$4 !== undefined ? map_expression(expo$4) : expo$4 - }; - break; + const expo$4 = list._2; + exp_desc = { + TAG: /* Texp_ifthenelse */ 14, + _0: map_expression(list._0), + _1: map_expression(list._1), + _2: expo$4 !== undefined ? map_expression(expo$4) : expo$4 + }; + break; case /* Texp_sequence */ 15 : - exp_desc = { - TAG: /* Texp_sequence */ 15, - _0: map_expression(list._0), - _1: map_expression(list._1) - }; - break; + exp_desc = { + TAG: /* Texp_sequence */ 15, + _0: map_expression(list._0), + _1: map_expression(list._1) + }; + break; case /* Texp_while */ 16 : - exp_desc = { - TAG: /* Texp_while */ 16, - _0: map_expression(list._0), - _1: map_expression(list._1) - }; - break; + exp_desc = { + TAG: /* Texp_while */ 16, + _0: map_expression(list._0), + _1: map_expression(list._1) + }; + break; case /* Texp_for */ 17 : - exp_desc = { - TAG: /* Texp_for */ 17, - _0: list._0, - _1: list._1, - _2: map_expression(list._2), - _3: map_expression(list._3), - _4: list._4, - _5: map_expression(list._5) - }; - break; + exp_desc = { + TAG: /* Texp_for */ 17, + _0: list._0, + _1: list._1, + _2: map_expression(list._2), + _3: map_expression(list._3), + _4: list._4, + _5: map_expression(list._5) + }; + break; case /* Texp_send */ 18 : - exp_desc = { - TAG: /* Texp_send */ 18, - _0: map_expression(list._0), - _1: list._1, - _2: may_map(map_expression, list._2) - }; - break; + exp_desc = { + TAG: /* Texp_send */ 18, + _0: map_expression(list._0), + _1: list._1, + _2: may_map(map_expression, list._2) + }; + break; case /* Texp_ident */ 0 : case /* Texp_constant */ 1 : case /* Texp_new */ 19 : case /* Texp_instvar */ 20 : - exp_desc = exp$1.exp_desc; - break; + exp_desc = exp$1.exp_desc; + break; case /* Texp_setinstvar */ 21 : - exp_desc = { - TAG: /* Texp_setinstvar */ 21, - _0: list._0, - _1: list._1, - _2: list._2, - _3: map_expression(list._3) - }; - break; + exp_desc = { + TAG: /* Texp_setinstvar */ 21, + _0: list._0, + _1: list._1, + _2: list._2, + _3: map_expression(list._3) + }; + break; case /* Texp_override */ 22 : - exp_desc = { - TAG: /* Texp_override */ 22, - _0: list._0, - _1: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_expression(param[2]) - ]; - }), list._1) - }; - break; + exp_desc = { + TAG: /* Texp_override */ 22, + _0: list._0, + _1: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_expression(param[2]) + ]; + }), list._1) + }; + break; case /* Texp_letmodule */ 23 : - exp_desc = { - TAG: /* Texp_letmodule */ 23, - _0: list._0, - _1: list._1, - _2: map_module_expr(list._2), - _3: map_expression(list._3) - }; - break; + exp_desc = { + TAG: /* Texp_letmodule */ 23, + _0: list._0, + _1: list._1, + _2: map_module_expr(list._2), + _3: map_expression(list._3) + }; + break; case /* Texp_assert */ 24 : - exp_desc = { - TAG: /* Texp_assert */ 24, - _0: map_expression(list._0) - }; - break; + exp_desc = { + TAG: /* Texp_assert */ 24, + _0: map_expression(list._0) + }; + break; case /* Texp_lazy */ 25 : - exp_desc = { - TAG: /* Texp_lazy */ 25, - _0: map_expression(list._0) - }; - break; + exp_desc = { + TAG: /* Texp_lazy */ 25, + _0: map_expression(list._0) + }; + break; case /* Texp_object */ 26 : - exp_desc = { - TAG: /* Texp_object */ 26, - _0: map_class_structure(list._0), - _1: list._1 - }; - break; + exp_desc = { + TAG: /* Texp_object */ 26, + _0: map_class_structure(list._0), + _1: list._1 + }; + break; case /* Texp_pack */ 27 : - exp_desc = { - TAG: /* Texp_pack */ 27, - _0: map_module_expr(list._0) - }; - break; + exp_desc = { + TAG: /* Texp_pack */ 27, + _0: map_module_expr(list._0) + }; + break; } const exp_extra = Stdlib__List.map(map_exp_extra, exp$1.exp_extra); @@ -26527,59 +26527,59 @@ function TypedtreeMap_MakeMap(funarg) { let mod_desc; switch (st.TAG) { case /* Tmod_ident */ 0 : - mod_desc = mexpr$1.mod_desc; - break; + mod_desc = mexpr$1.mod_desc; + break; case /* Tmod_structure */ 1 : - mod_desc = { - TAG: /* Tmod_structure */ 1, - _0: map_structure(st._0) - }; - break; + mod_desc = { + TAG: /* Tmod_structure */ 1, + _0: map_structure(st._0) + }; + break; case /* Tmod_functor */ 2 : - mod_desc = { - TAG: /* Tmod_functor */ 2, - _0: st._0, - _1: st._1, - _2: may_map(map_module_type, st._2), - _3: map_module_expr(st._3) - }; - break; + mod_desc = { + TAG: /* Tmod_functor */ 2, + _0: st._0, + _1: st._1, + _2: may_map(map_module_type, st._2), + _3: map_module_expr(st._3) + }; + break; case /* Tmod_apply */ 3 : - mod_desc = { - TAG: /* Tmod_apply */ 3, - _0: map_module_expr(st._0), - _1: map_module_expr(st._1), - _2: st._2 - }; - break; + mod_desc = { + TAG: /* Tmod_apply */ 3, + _0: map_module_expr(st._0), + _1: map_module_expr(st._1), + _2: st._2 + }; + break; case /* Tmod_constraint */ 4 : - const mtype = st._2; - const mod_type = st._1; - const mexpr$2 = st._0; - mod_desc = /* tag */ typeof mtype === "number" || typeof mtype === "string" ? ({ - TAG: /* Tmod_constraint */ 4, - _0: map_module_expr(mexpr$2), - _1: mod_type, - _2: /* Tmodtype_implicit */ 0, - _3: st._3 - }) : ({ - TAG: /* Tmod_constraint */ 4, - _0: map_module_expr(mexpr$2), - _1: mod_type, - _2: { - TAG: /* Tmodtype_explicit */ 0, - _0: map_module_type(mtype._0) - }, - _3: st._3 - }); - break; + const mtype = st._2; + const mod_type = st._1; + const mexpr$2 = st._0; + mod_desc = /* tag */ typeof mtype === "number" || typeof mtype === "string" ? ({ + TAG: /* Tmod_constraint */ 4, + _0: map_module_expr(mexpr$2), + _1: mod_type, + _2: /* Tmodtype_implicit */ 0, + _3: st._3 + }) : ({ + TAG: /* Tmod_constraint */ 4, + _0: map_module_expr(mexpr$2), + _1: mod_type, + _2: { + TAG: /* Tmodtype_explicit */ 0, + _0: map_module_type(mtype._0) + }, + _3: st._3 + }); + break; case /* Tmod_unpack */ 5 : - mod_desc = { - TAG: /* Tmod_unpack */ 5, - _0: map_expression(st._0), - _1: st._1 - }; - break; + mod_desc = { + TAG: /* Tmod_unpack */ 5, + _0: map_expression(st._0), + _1: st._1 + }; + break; } return Curry._1(funarg.leave_module_expr, { @@ -26748,113 +26748,113 @@ function TypedtreeMap_MakeMap(funarg) { let str_desc; switch (vd.TAG) { case /* Tstr_eval */ 0 : - str_desc = { - TAG: /* Tstr_eval */ 0, - _0: map_expression(vd._0), - _1: vd._1 - }; - break; + str_desc = { + TAG: /* Tstr_eval */ 0, + _0: map_expression(vd._0), + _1: vd._1 + }; + break; case /* Tstr_value */ 1 : - const rec_flag = vd._0; - str_desc = { - TAG: /* Tstr_value */ 1, - _0: rec_flag, - _1: Stdlib__List.map(map_binding, vd._1) - }; - break; + const rec_flag = vd._0; + str_desc = { + TAG: /* Tstr_value */ 1, + _0: rec_flag, + _1: Stdlib__List.map(map_binding, vd._1) + }; + break; case /* Tstr_primitive */ 2 : - str_desc = { - TAG: /* Tstr_primitive */ 2, - _0: map_value_description(vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_primitive */ 2, + _0: map_value_description(vd._0) + }; + break; case /* Tstr_type */ 3 : - str_desc = { - TAG: /* Tstr_type */ 3, - _0: Stdlib__List.map(map_type_declaration, vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_type */ 3, + _0: Stdlib__List.map(map_type_declaration, vd._0) + }; + break; case /* Tstr_typext */ 4 : - str_desc = { - TAG: /* Tstr_typext */ 4, - _0: map_type_extension(vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_typext */ 4, + _0: map_type_extension(vd._0) + }; + break; case /* Tstr_exception */ 5 : - str_desc = { - TAG: /* Tstr_exception */ 5, - _0: map_extension_constructor(vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_exception */ 5, + _0: map_extension_constructor(vd._0) + }; + break; case /* Tstr_module */ 6 : - str_desc = { - TAG: /* Tstr_module */ 6, - _0: map_module_binding(vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_module */ 6, + _0: map_module_binding(vd._0) + }; + break; case /* Tstr_recmodule */ 7 : - const list = Stdlib__List.map(map_module_binding, vd._0); - str_desc = { - TAG: /* Tstr_recmodule */ 7, - _0: list - }; - break; + const list = Stdlib__List.map(map_module_binding, vd._0); + str_desc = { + TAG: /* Tstr_recmodule */ 7, + _0: list + }; + break; case /* Tstr_modtype */ 8 : - str_desc = { - TAG: /* Tstr_modtype */ 8, - _0: map_module_type_declaration(vd._0) - }; - break; + str_desc = { + TAG: /* Tstr_modtype */ 8, + _0: map_module_type_declaration(vd._0) + }; + break; case /* Tstr_open */ 9 : - str_desc = { - TAG: /* Tstr_open */ 9, - _0: vd._0 - }; - break; + str_desc = { + TAG: /* Tstr_open */ 9, + _0: vd._0 + }; + break; case /* Tstr_class */ 10 : - const list$1 = Stdlib__List.map((function (param) { - return [ - map_class_declaration(param[0]), - param[1], - param[2] - ]; - }), vd._0); - str_desc = { - TAG: /* Tstr_class */ 10, - _0: list$1 - }; - break; + const list$1 = Stdlib__List.map((function (param) { + return [ + map_class_declaration(param[0]), + param[1], + param[2] + ]; + }), vd._0); + str_desc = { + TAG: /* Tstr_class */ 10, + _0: list$1 + }; + break; case /* Tstr_class_type */ 11 : - const list$2 = Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_class_type_declaration(param[2]) - ]; - }), vd._0); - str_desc = { - TAG: /* Tstr_class_type */ 11, - _0: list$2 - }; - break; + const list$2 = Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_class_type_declaration(param[2]) + ]; + }), vd._0); + str_desc = { + TAG: /* Tstr_class_type */ 11, + _0: list$2 + }; + break; case /* Tstr_include */ 12 : - const incl = vd._0; - str_desc = { - TAG: /* Tstr_include */ 12, - _0: { - incl_mod: map_module_expr(incl.incl_mod), - incl_type: incl.incl_type, - incl_loc: incl.incl_loc, - incl_attributes: incl.incl_attributes - } - }; - break; + const incl = vd._0; + str_desc = { + TAG: /* Tstr_include */ 12, + _0: { + incl_mod: map_module_expr(incl.incl_mod), + incl_type: incl.incl_type, + incl_loc: incl.incl_loc, + incl_attributes: incl.incl_attributes + } + }; + break; case /* Tstr_attribute */ 13 : - str_desc = { - TAG: /* Tstr_attribute */ 13, - _0: vd._0 - }; - break; + str_desc = { + TAG: /* Tstr_attribute */ 13, + _0: vd._0 + }; + break; } return Curry._1(funarg.leave_structure_item, { @@ -26897,71 +26897,71 @@ function TypedtreeMap_MakeMap(funarg) { } else { switch (list.TAG) { case /* Tpat_alias */ 1 : - const pat1 = map_pattern(list._0); - pat_desc = { - TAG: /* Tpat_alias */ 1, - _0: pat1, - _1: list._1, - _2: list._2 - }; - break; + const pat1 = map_pattern(list._0); + pat_desc = { + TAG: /* Tpat_alias */ 1, + _0: pat1, + _1: list._1, + _2: list._2 + }; + break; case /* Tpat_tuple */ 3 : - pat_desc = { - TAG: /* Tpat_tuple */ 3, - _0: Stdlib__List.map(map_pattern, list._0) - }; - break; + pat_desc = { + TAG: /* Tpat_tuple */ 3, + _0: Stdlib__List.map(map_pattern, list._0) + }; + break; case /* Tpat_construct */ 4 : - pat_desc = { - TAG: /* Tpat_construct */ 4, - _0: list._0, - _1: list._1, - _2: Stdlib__List.map(map_pattern, list._2) - }; - break; + pat_desc = { + TAG: /* Tpat_construct */ 4, + _0: list._0, + _1: list._1, + _2: Stdlib__List.map(map_pattern, list._2) + }; + break; case /* Tpat_variant */ 5 : - const pato = list._1; - const pato$1 = pato !== undefined ? map_pattern(pato) : pato; - pat_desc = { - TAG: /* Tpat_variant */ 5, - _0: list._0, - _1: pato$1, - _2: list._2 - }; - break; + const pato = list._1; + const pato$1 = pato !== undefined ? map_pattern(pato) : pato; + pat_desc = { + TAG: /* Tpat_variant */ 5, + _0: list._0, + _1: pato$1, + _2: list._2 + }; + break; case /* Tpat_record */ 6 : - pat_desc = { - TAG: /* Tpat_record */ 6, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_pattern(param[2]) - ]; - }), list._0), - _1: list._1 - }; - break; + pat_desc = { + TAG: /* Tpat_record */ 6, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_pattern(param[2]) + ]; + }), list._0), + _1: list._1 + }; + break; case /* Tpat_array */ 7 : - pat_desc = { - TAG: /* Tpat_array */ 7, - _0: Stdlib__List.map(map_pattern, list._0) - }; - break; + pat_desc = { + TAG: /* Tpat_array */ 7, + _0: Stdlib__List.map(map_pattern, list._0) + }; + break; case /* Tpat_or */ 8 : - pat_desc = { - TAG: /* Tpat_or */ 8, - _0: map_pattern(list._0), - _1: map_pattern(list._1), - _2: list._2 - }; - break; + pat_desc = { + TAG: /* Tpat_or */ 8, + _0: map_pattern(list._0), + _1: map_pattern(list._1), + _2: list._2 + }; + break; case /* Tpat_lazy */ 9 : - pat_desc = { - TAG: /* Tpat_lazy */ 9, - _0: map_pattern(list._0) - }; - break; + pat_desc = { + TAG: /* Tpat_lazy */ 9, + _0: map_pattern(list._0) + }; + break; default: pat_desc = pat$1.pat_desc; } @@ -26990,83 +26990,83 @@ function TypedtreeMap_MakeMap(funarg) { let cl_desc; switch (clstr.TAG) { case /* Tcl_ident */ 0 : - cl_desc = { - TAG: /* Tcl_ident */ 0, - _0: clstr._0, - _1: clstr._1, - _2: Stdlib__List.map(map_core_type, clstr._2) - }; - break; + cl_desc = { + TAG: /* Tcl_ident */ 0, + _0: clstr._0, + _1: clstr._1, + _2: Stdlib__List.map(map_core_type, clstr._2) + }; + break; case /* Tcl_structure */ 1 : - cl_desc = { - TAG: /* Tcl_structure */ 1, - _0: map_class_structure(clstr._0) - }; - break; + cl_desc = { + TAG: /* Tcl_structure */ 1, + _0: map_class_structure(clstr._0) + }; + break; case /* Tcl_fun */ 2 : - cl_desc = { - TAG: /* Tcl_fun */ 2, - _0: clstr._0, - _1: map_pattern(clstr._1), - _2: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_expression(param[2]) - ]; - }), clstr._2), - _3: map_class_expr(clstr._3), - _4: clstr._4 - }; - break; + cl_desc = { + TAG: /* Tcl_fun */ 2, + _0: clstr._0, + _1: map_pattern(clstr._1), + _2: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_expression(param[2]) + ]; + }), clstr._2), + _3: map_class_expr(clstr._3), + _4: clstr._4 + }; + break; case /* Tcl_apply */ 3 : - cl_desc = { - TAG: /* Tcl_apply */ 3, - _0: map_class_expr(clstr._0), - _1: Stdlib__List.map((function (param) { - return [ - param[0], - may_map(map_expression, param[1]), - param[2] - ]; - }), clstr._1) - }; - break; + cl_desc = { + TAG: /* Tcl_apply */ 3, + _0: map_class_expr(clstr._0), + _1: Stdlib__List.map((function (param) { + return [ + param[0], + may_map(map_expression, param[1]), + param[2] + ]; + }), clstr._1) + }; + break; case /* Tcl_let */ 4 : - const rec_flat = clstr._0; - cl_desc = { - TAG: /* Tcl_let */ 4, - _0: rec_flat, - _1: Stdlib__List.map(map_binding, clstr._1), - _2: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - map_expression(param[2]) - ]; - }), clstr._2), - _3: map_class_expr(clstr._3) - }; - break; + const rec_flat = clstr._0; + cl_desc = { + TAG: /* Tcl_let */ 4, + _0: rec_flat, + _1: Stdlib__List.map(map_binding, clstr._1), + _2: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + map_expression(param[2]) + ]; + }), clstr._2), + _3: map_class_expr(clstr._3) + }; + break; case /* Tcl_constraint */ 5 : - const clty = clstr._1; - const cl = clstr._0; - cl_desc = clty !== undefined ? ({ - TAG: /* Tcl_constraint */ 5, - _0: map_class_expr(cl), - _1: map_class_type(clty), - _2: clstr._2, - _3: clstr._3, - _4: clstr._4 - }) : ({ - TAG: /* Tcl_constraint */ 5, - _0: map_class_expr(cl), - _1: undefined, - _2: clstr._2, - _3: clstr._3, - _4: clstr._4 - }); - break; + const clty = clstr._1; + const cl = clstr._0; + cl_desc = clty !== undefined ? ({ + TAG: /* Tcl_constraint */ 5, + _0: map_class_expr(cl), + _1: map_class_type(clty), + _2: clstr._2, + _3: clstr._3, + _4: clstr._4 + }) : ({ + TAG: /* Tcl_constraint */ 5, + _0: map_class_expr(cl), + _1: undefined, + _2: clstr._2, + _3: clstr._3, + _4: clstr._4 + }); + break; } return Curry._1(funarg.leave_class_expr, { @@ -27102,21 +27102,21 @@ function TypedtreeMap_MakeMap(funarg) { let tmp; switch (cstr$1.TAG) { case /* Twith_type */ 0 : - tmp = { - TAG: /* Twith_type */ 0, - _0: map_type_declaration(cstr$1._0) - }; - break; + tmp = { + TAG: /* Twith_type */ 0, + _0: map_type_declaration(cstr$1._0) + }; + break; case /* Twith_typesubst */ 2 : - tmp = { - TAG: /* Twith_typesubst */ 2, - _0: map_type_declaration(cstr$1._0) - }; - break; + tmp = { + TAG: /* Twith_typesubst */ 2, + _0: map_type_declaration(cstr$1._0) + }; + break; case /* Twith_module */ 1 : case /* Twith_modsubst */ 3 : - tmp = cstr$1; - break; + tmp = cstr$1; + break; } return Curry._1(funarg.leave_with_constraint, tmp); @@ -27127,82 +27127,82 @@ function TypedtreeMap_MakeMap(funarg) { let cf_desc; switch (exp.TAG) { case /* Tcf_inherit */ 0 : - cf_desc = { - TAG: /* Tcf_inherit */ 0, - _0: exp._0, - _1: map_class_expr(exp._1), - _2: exp._2, - _3: exp._3, - _4: exp._4 - }; - break; + cf_desc = { + TAG: /* Tcf_inherit */ 0, + _0: exp._0, + _1: map_class_expr(exp._1), + _2: exp._2, + _3: exp._3, + _4: exp._4 + }; + break; case /* Tcf_val */ 1 : - const cty = exp._3; - const ident = exp._2; - const mut = exp._1; - const lab = exp._0; - cf_desc = cty.TAG === /* Tcfk_virtual */ 0 ? ({ - TAG: /* Tcf_val */ 1, - _0: lab, - _1: mut, - _2: ident, - _3: { - TAG: /* Tcfk_virtual */ 0, - _0: map_core_type(cty._0) - }, - _4: exp._4 - }) : ({ - TAG: /* Tcf_val */ 1, - _0: lab, - _1: mut, - _2: ident, - _3: { - TAG: /* Tcfk_concrete */ 1, - _0: cty._0, - _1: map_expression(cty._1) - }, - _4: exp._4 - }); - break; + const cty = exp._3; + const ident = exp._2; + const mut = exp._1; + const lab = exp._0; + cf_desc = cty.TAG === /* Tcfk_virtual */ 0 ? ({ + TAG: /* Tcf_val */ 1, + _0: lab, + _1: mut, + _2: ident, + _3: { + TAG: /* Tcfk_virtual */ 0, + _0: map_core_type(cty._0) + }, + _4: exp._4 + }) : ({ + TAG: /* Tcf_val */ 1, + _0: lab, + _1: mut, + _2: ident, + _3: { + TAG: /* Tcfk_concrete */ 1, + _0: cty._0, + _1: map_expression(cty._1) + }, + _4: exp._4 + }); + break; case /* Tcf_method */ 2 : - const cty$1 = exp._2; - const priv = exp._1; - const lab$1 = exp._0; - cf_desc = cty$1.TAG === /* Tcfk_virtual */ 0 ? ({ - TAG: /* Tcf_method */ 2, - _0: lab$1, - _1: priv, - _2: { - TAG: /* Tcfk_virtual */ 0, - _0: map_core_type(cty$1._0) - } - }) : ({ - TAG: /* Tcf_method */ 2, - _0: lab$1, - _1: priv, - _2: { - TAG: /* Tcfk_concrete */ 1, - _0: cty$1._0, - _1: map_expression(cty$1._1) - } - }); - break; + const cty$1 = exp._2; + const priv = exp._1; + const lab$1 = exp._0; + cf_desc = cty$1.TAG === /* Tcfk_virtual */ 0 ? ({ + TAG: /* Tcf_method */ 2, + _0: lab$1, + _1: priv, + _2: { + TAG: /* Tcfk_virtual */ 0, + _0: map_core_type(cty$1._0) + } + }) : ({ + TAG: /* Tcf_method */ 2, + _0: lab$1, + _1: priv, + _2: { + TAG: /* Tcfk_concrete */ 1, + _0: cty$1._0, + _1: map_expression(cty$1._1) + } + }); + break; case /* Tcf_constraint */ 3 : - cf_desc = { - TAG: /* Tcf_constraint */ 3, - _0: map_core_type(exp._0), - _1: map_core_type(exp._1) - }; - break; + cf_desc = { + TAG: /* Tcf_constraint */ 3, + _0: map_core_type(exp._0), + _1: map_core_type(exp._1) + }; + break; case /* Tcf_initializer */ 4 : - cf_desc = { - TAG: /* Tcf_initializer */ 4, - _0: map_expression(exp._0) - }; - break; + cf_desc = { + TAG: /* Tcf_initializer */ 4, + _0: map_expression(exp._0) + }; + break; case /* Tcf_attribute */ 5 : - cf_desc = exp; - break; + cf_desc = exp; + break; } return Curry._1(funarg.leave_class_field, { @@ -27245,92 +27245,92 @@ function TypedtreeMap_MakeMap(funarg) { let sig_desc; switch (vd.TAG) { case /* Tsig_value */ 0 : - sig_desc = { - TAG: /* Tsig_value */ 0, - _0: map_value_description(vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_value */ 0, + _0: map_value_description(vd._0) + }; + break; case /* Tsig_type */ 1 : - sig_desc = { - TAG: /* Tsig_type */ 1, - _0: Stdlib__List.map(map_type_declaration, vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_type */ 1, + _0: Stdlib__List.map(map_type_declaration, vd._0) + }; + break; case /* Tsig_typext */ 2 : - sig_desc = { - TAG: /* Tsig_typext */ 2, - _0: map_type_extension(vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_typext */ 2, + _0: map_type_extension(vd._0) + }; + break; case /* Tsig_exception */ 3 : - sig_desc = { - TAG: /* Tsig_exception */ 3, - _0: map_extension_constructor(vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_exception */ 3, + _0: map_extension_constructor(vd._0) + }; + break; case /* Tsig_module */ 4 : - const md = vd._0; - sig_desc = { - TAG: /* Tsig_module */ 4, - _0: { - md_id: md.md_id, - md_name: md.md_name, - md_type: map_module_type(md.md_type), - md_attributes: md.md_attributes, - md_loc: md.md_loc - } - }; - break; + const md = vd._0; + sig_desc = { + TAG: /* Tsig_module */ 4, + _0: { + md_id: md.md_id, + md_name: md.md_name, + md_type: map_module_type(md.md_type), + md_attributes: md.md_attributes, + md_loc: md.md_loc + } + }; + break; case /* Tsig_recmodule */ 5 : - sig_desc = { - TAG: /* Tsig_recmodule */ 5, - _0: Stdlib__List.map((function (md) { - return { - md_id: md.md_id, - md_name: md.md_name, - md_type: map_module_type(md.md_type), - md_attributes: md.md_attributes, - md_loc: md.md_loc - }; - }), vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_recmodule */ 5, + _0: Stdlib__List.map((function (md) { + return { + md_id: md.md_id, + md_name: md.md_name, + md_type: map_module_type(md.md_type), + md_attributes: md.md_attributes, + md_loc: md.md_loc + }; + }), vd._0) + }; + break; case /* Tsig_modtype */ 6 : - sig_desc = { - TAG: /* Tsig_modtype */ 6, - _0: map_module_type_declaration(vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_modtype */ 6, + _0: map_module_type_declaration(vd._0) + }; + break; case /* Tsig_open */ 7 : - sig_desc = item$1.sig_desc; - break; + sig_desc = item$1.sig_desc; + break; case /* Tsig_include */ 8 : - const incl = vd._0; - sig_desc = { - TAG: /* Tsig_include */ 8, - _0: { - incl_mod: map_module_type(incl.incl_mod), - incl_type: incl.incl_type, - incl_loc: incl.incl_loc, - incl_attributes: incl.incl_attributes - } - }; - break; + const incl = vd._0; + sig_desc = { + TAG: /* Tsig_include */ 8, + _0: { + incl_mod: map_module_type(incl.incl_mod), + incl_type: incl.incl_type, + incl_loc: incl.incl_loc, + incl_attributes: incl.incl_attributes + } + }; + break; case /* Tsig_class */ 9 : - sig_desc = { - TAG: /* Tsig_class */ 9, - _0: Stdlib__List.map(map_class_description, vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_class */ 9, + _0: Stdlib__List.map(map_class_description, vd._0) + }; + break; case /* Tsig_class_type */ 10 : - sig_desc = { - TAG: /* Tsig_class_type */ 10, - _0: Stdlib__List.map(map_class_type_declaration, vd._0) - }; - break; + sig_desc = { + TAG: /* Tsig_class_type */ 10, + _0: Stdlib__List.map(map_class_type_declaration, vd._0) + }; + break; case /* Tsig_attribute */ 11 : - sig_desc = vd; - break; + sig_desc = vd; + break; } return Curry._1(funarg.leave_signature_item, { @@ -27355,48 +27355,48 @@ function TypedtreeMap_MakeMap(funarg) { let ctf_desc; switch (ct.TAG) { case /* Tctf_inherit */ 0 : - ctf_desc = { - TAG: /* Tctf_inherit */ 0, - _0: map_class_type(ct._0) - }; - break; + ctf_desc = { + TAG: /* Tctf_inherit */ 0, + _0: map_class_type(ct._0) + }; + break; case /* Tctf_val */ 1 : - const match = ct._0; - ctf_desc = { - TAG: /* Tctf_val */ 1, - _0: [ - match[0], - match[1], - match[2], - map_core_type(match[3]) - ] - }; - break; + const match = ct._0; + ctf_desc = { + TAG: /* Tctf_val */ 1, + _0: [ + match[0], + match[1], + match[2], + map_core_type(match[3]) + ] + }; + break; case /* Tctf_method */ 2 : - const match$1 = ct._0; - ctf_desc = { - TAG: /* Tctf_method */ 2, - _0: [ - match$1[0], - match$1[1], - match$1[2], - map_core_type(match$1[3]) - ] - }; - break; + const match$1 = ct._0; + ctf_desc = { + TAG: /* Tctf_method */ 2, + _0: [ + match$1[0], + match$1[1], + match$1[2], + map_core_type(match$1[3]) + ] + }; + break; case /* Tctf_constraint */ 3 : - const match$2 = ct._0; - ctf_desc = { - TAG: /* Tctf_constraint */ 3, - _0: [ - map_core_type(match$2[0]), - map_core_type(match$2[1]) - ] - }; - break; + const match$2 = ct._0; + ctf_desc = { + TAG: /* Tctf_constraint */ 3, + _0: [ + map_core_type(match$2[0]), + map_core_type(match$2[1]) + ] + }; + break; case /* Tctf_attribute */ 4 : - ctf_desc = ct; - break; + ctf_desc = ct; + break; } return Curry._1(funarg.leave_class_type_field, { @@ -27449,54 +27449,54 @@ function TypedtreeMap_MakeMap(funarg) { const desc = exp_extra[0]; switch (desc.TAG) { case /* Texp_constraint */ 0 : + return [ + { + TAG: /* Texp_constraint */ 0, + _0: map_core_type(desc._0) + }, + loc, + attrs + ]; + case /* Texp_coerce */ 1 : + const ct1 = desc._0; + if (ct1 !== undefined) { return [ { - TAG: /* Texp_constraint */ 0, - _0: map_core_type(desc._0) + TAG: /* Texp_coerce */ 1, + _0: map_core_type(ct1), + _1: map_core_type(desc._1) }, loc, attrs ]; - case /* Texp_coerce */ 1 : - const ct1 = desc._0; - if (ct1 !== undefined) { - return [ - { - TAG: /* Texp_coerce */ 1, - _0: map_core_type(ct1), - _1: map_core_type(desc._1) - }, - loc, - attrs - ]; - } else { - return [ - { - TAG: /* Texp_coerce */ 1, - _0: undefined, - _1: map_core_type(desc._1) - }, - loc, - attrs - ]; - } + } else { + return [ + { + TAG: /* Texp_coerce */ 1, + _0: undefined, + _1: map_core_type(desc._1) + }, + loc, + attrs + ]; + } case /* Texp_poly */ 3 : - const ct = desc._0; - if (ct !== undefined) { - return [ - { - TAG: /* Texp_poly */ 3, - _0: map_core_type(ct) - }, - loc, - attrs - ]; - } else { - return exp_extra; - } + const ct = desc._0; + if (ct !== undefined) { + return [ + { + TAG: /* Texp_poly */ 3, + _0: map_core_type(ct) + }, + loc, + attrs + ]; + } else { + return exp_extra; + } case /* Texp_open */ 2 : case /* Texp_newtype */ 4 : - return exp_extra; + return exp_extra; } }; @@ -27705,45 +27705,45 @@ const ClearEnv = Curry._1(TypedtreeMap_MakeMap, { function clear_part(p) { switch (p.TAG) { case /* Partial_structure */ 0 : - return { - TAG: /* Partial_structure */ 0, - _0: Curry._1(ClearEnv.map_structure, p._0) - }; + return { + TAG: /* Partial_structure */ 0, + _0: Curry._1(ClearEnv.map_structure, p._0) + }; case /* Partial_structure_item */ 1 : - return { - TAG: /* Partial_structure_item */ 1, - _0: Curry._1(ClearEnv.map_structure_item, p._0) - }; + return { + TAG: /* Partial_structure_item */ 1, + _0: Curry._1(ClearEnv.map_structure_item, p._0) + }; case /* Partial_expression */ 2 : - return { - TAG: /* Partial_expression */ 2, - _0: Curry._1(ClearEnv.map_expression, p._0) - }; + return { + TAG: /* Partial_expression */ 2, + _0: Curry._1(ClearEnv.map_expression, p._0) + }; case /* Partial_pattern */ 3 : - return { - TAG: /* Partial_pattern */ 3, - _0: Curry._1(ClearEnv.map_pattern, p._0) - }; + return { + TAG: /* Partial_pattern */ 3, + _0: Curry._1(ClearEnv.map_pattern, p._0) + }; case /* Partial_class_expr */ 4 : - return { - TAG: /* Partial_class_expr */ 4, - _0: Curry._1(ClearEnv.map_class_expr, p._0) - }; + return { + TAG: /* Partial_class_expr */ 4, + _0: Curry._1(ClearEnv.map_class_expr, p._0) + }; case /* Partial_signature */ 5 : - return { - TAG: /* Partial_signature */ 5, - _0: Curry._1(ClearEnv.map_signature, p._0) - }; + return { + TAG: /* Partial_signature */ 5, + _0: Curry._1(ClearEnv.map_signature, p._0) + }; case /* Partial_signature_item */ 6 : - return { - TAG: /* Partial_signature_item */ 6, - _0: Curry._1(ClearEnv.map_signature_item, p._0) - }; + return { + TAG: /* Partial_signature_item */ 6, + _0: Curry._1(ClearEnv.map_signature_item, p._0) + }; case /* Partial_module_type */ 7 : - return { - TAG: /* Partial_module_type */ 7, - _0: Curry._1(ClearEnv.map_module_type, p._0) - }; + return { + TAG: /* Partial_module_type */ 7, + _0: Curry._1(ClearEnv.map_module_type, p._0) + }; } } @@ -27754,27 +27754,27 @@ function clear_env(binary_annots) { } switch (binary_annots.TAG) { case /* Packed */ 0 : - return binary_annots; + return binary_annots; case /* Implementation */ 1 : - return { - TAG: /* Implementation */ 1, - _0: Curry._1(ClearEnv.map_structure, binary_annots._0) - }; + return { + TAG: /* Implementation */ 1, + _0: Curry._1(ClearEnv.map_structure, binary_annots._0) + }; case /* Interface */ 2 : - return { - TAG: /* Interface */ 2, - _0: Curry._1(ClearEnv.map_signature, binary_annots._0) - }; + return { + TAG: /* Interface */ 2, + _0: Curry._1(ClearEnv.map_signature, binary_annots._0) + }; case /* Partial_implementation */ 3 : - return { - TAG: /* Partial_implementation */ 3, - _0: Stdlib__Array.map(clear_part, binary_annots._0) - }; + return { + TAG: /* Partial_implementation */ 3, + _0: Stdlib__Array.map(clear_part, binary_annots._0) + }; case /* Partial_interface */ 4 : - return { - TAG: /* Partial_interface */ 4, - _0: Stdlib__Array.map(clear_part, binary_annots._0) - }; + return { + TAG: /* Partial_interface */ 4, + _0: Stdlib__Array.map(clear_part, binary_annots._0) + }; } } @@ -28051,20 +28051,20 @@ function is_object_type(path) { let name; switch (path.TAG) { case /* Pident */ 0 : - name = path._0.name; - break; + name = path._0.name; + break; case /* Pdot */ 1 : - name = path._1; - break; + name = path._1; + break; case /* Papply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 30161, - 23 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 30161, + 23 + ] + }); } return Caml_string.get(name, 0) === /* '#' */35; @@ -28205,10 +28205,10 @@ function set_mode_pattern(generate, injective, f) { function in_current_module(param) { switch (param.TAG) { case /* Pident */ 0 : - return true; + return true; case /* Pdot */ 1 : case /* Papply */ 2 : - return false; + return false; } } @@ -28412,11 +28412,11 @@ function object_row(_ty) { } switch (match.TAG) { case /* Tobject */ 4 : - _ty = match._0; - continue; + _ty = match._0; + continue; case /* Tfield */ 5 : - _ty = match._3; - continue; + _ty = match._3; + continue; default: return ty$1; } @@ -28432,7 +28432,7 @@ function opened_object(ty) { case /* Tvar */ 0 : case /* Tconstr */ 3 : case /* Tunivar */ 9 : - return true; + return true; default: return false; } @@ -28477,10 +28477,10 @@ function close_object(ty) { } switch (match$1.TAG) { case /* Tvar */ 0 : - return link_type(ty$2, newty2(ty$2.level, /* Tnil */ 0)); + return link_type(ty$2, newty2(ty$2.level, /* Tnil */ 0)); case /* Tfield */ 5 : - _ty = match$1._3; - continue; + _ty = match$1._3; + continue; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -28533,10 +28533,10 @@ function row_variable(ty) { } switch (match$1.TAG) { case /* Tvar */ 0 : - return ty$2; + return ty$2; case /* Tfield */ 5 : - _ty = match$1._3; - continue; + _ty = match$1._3; + continue; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -28632,11 +28632,11 @@ function signature_of_class_type(_sign) { const sign = _sign; switch (sign.TAG) { case /* Cty_signature */ 1 : - return sign._0; + return sign._0; case /* Cty_constr */ 0 : case /* Cty_arrow */ 2 : - _sign = sign._2; - continue; + _sign = sign._2; + continue; } }; @@ -28647,12 +28647,12 @@ function class_type_arity(_param) { const param = _param; switch (param.TAG) { case /* Cty_constr */ 0 : - _param = param._2; - continue; + _param = param._2; + continue; case /* Cty_signature */ 1 : - return 0; + return 0; case /* Cty_arrow */ 2 : - return 1 + class_type_arity(param._2) | 0; + return 1 + class_type_arity(param._2) | 0; } }; @@ -28797,26 +28797,26 @@ function closed_schema_rec(_ty) { } switch (row.TAG) { case /* Tvar */ 0 : - if (level !== 100000000) { - throw new Caml_js_exceptions.MelangeError(Non_closed0, { - MEL_EXN_ID: Non_closed0 - }); - } - return iter_type_expr(closed_schema_rec, ty$1); + if (level !== 100000000) { + throw new Caml_js_exceptions.MelangeError(Non_closed0, { + MEL_EXN_ID: Non_closed0 + }); + } + return iter_type_expr(closed_schema_rec, ty$1); case /* Tfield */ 5 : - if (Caml_obj.caml_equal(field_kind_repr(row._1), /* Fpresent */ 0)) { - closed_schema_rec(row._2); - } - _ty = row._3; - continue; + if (Caml_obj.caml_equal(field_kind_repr(row._1), /* Fpresent */ 0)) { + closed_schema_rec(row._2); + } + _ty = row._3; + continue; case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - iter_row(closed_schema_rec, row$1); - if (static_row(row$1)) { - return; - } - _ty = row$1.row_more; - continue; + const row$1 = row_repr_aux(/* [] */ 0, row._0); + iter_row(closed_schema_rec, row$1); + if (static_row(row$1)) { + return; + } + _ty = row$1.row_more; + continue; default: return iter_type_expr(closed_schema_rec, ty$1); } @@ -28867,63 +28867,63 @@ function free_vars_rec(_real, _ty) { } switch (match.TAG) { case /* Tvar */ 0 : - free_variables.contents = { - hd: [ - ty$1, - real - ], - tl: free_variables.contents - }; - return; + free_variables.contents = { + hd: [ + ty$1, + real + ], + tl: free_variables.contents + }; + return; case /* Tconstr */ 3 : - if (match$1 === undefined) { - return iter_type_expr((function (param) { - return free_vars_rec(true, param); - }), ty$1); - } - try { - const match$2 = find_type_expansion(match._0, Caml_option.valFromOption(match$1)); - if (repr(match$2[1]).level !== 100000000) { - free_variables.contents = { - hd: [ - ty$1, - real - ], - tl: free_variables.contents - }; - } - + if (match$1 === undefined) { + return iter_type_expr((function (param) { + return free_vars_rec(true, param); + }), ty$1); + } + try { + const match$2 = find_type_expansion(match._0, Caml_option.valFromOption(match$1)); + if (repr(match$2[1]).level !== 100000000) { + free_variables.contents = { + hd: [ + ty$1, + real + ], + tl: free_variables.contents + }; } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID !== Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - + + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID !== Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - return Stdlib__List.iter((function (param) { - return free_vars_rec(true, param); - }), match._1); + + } + return Stdlib__List.iter((function (param) { + return free_vars_rec(true, param); + }), match._1); case /* Tobject */ 4 : - _ty = match._0; - _real = false; - continue; + _ty = match._0; + _real = false; + continue; case /* Tfield */ 5 : - free_vars_rec(true, match._2); - _ty = match._3; - _real = false; - continue; + free_vars_rec(true, match._2); + _ty = match._3; + _real = false; + continue; case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, match._0); - iter_row((function (param) { - return free_vars_rec(true, param); - }), row); - if (static_row(row)) { - return; - } - _ty = row.row_more; - _real = false; - continue; + const row = row_repr_aux(/* [] */ 0, match._0); + iter_row((function (param) { + return free_vars_rec(true, param); + }), row); + if (static_row(row)) { + return; + } + _ty = row.row_more; + _real = false; + continue; default: return iter_type_expr((function (param) { return free_vars_rec(true, param); @@ -29173,28 +29173,28 @@ function generalize_spine(_ty) { } switch (match.TAG) { case /* Tarrow */ 1 : - set_level(ty$1, 100000000); - generalize_spine(match._1); - _ty = match._2; - continue; + set_level(ty$1, 100000000); + generalize_spine(match._1); + _ty = match._2; + continue; case /* Ttuple */ 2 : - set_level(ty$1, 100000000); - return Stdlib__List.iter(generalize_spine, match._0); + set_level(ty$1, 100000000); + return Stdlib__List.iter(generalize_spine, match._0); case /* Tconstr */ 3 : - if (!is_object_type(match._0)) { - set_level(ty$1, 100000000); - match._2.contents = /* Mnil */ 0; - return Stdlib__List.iter(generalize_spine, match._1); - } else { - return; - } - case /* Tpoly */ 10 : + if (!is_object_type(match._0)) { set_level(ty$1, 100000000); - _ty = match._0; - continue; + match._2.contents = /* Mnil */ 0; + return Stdlib__List.iter(generalize_spine, match._1); + } else { + return; + } + case /* Tpoly */ 10 : + set_level(ty$1, 100000000); + _ty = match._0; + continue; case /* Tpackage */ 11 : - set_level(ty$1, 100000000); - return Stdlib__List.iter(generalize_spine, match._2); + set_level(ty$1, 100000000); + return Stdlib__List.iter(generalize_spine, match._2); default: return; } @@ -29280,55 +29280,96 @@ function update_level(env, level, _ty) { if (!/* tag */ (typeof row === "number" || typeof row === "string")) { switch (row.TAG) { case /* Tconstr */ 3 : - const p = row._0; - if (level < get_level(env, p)) { - try { - link_type(ty$1, Curry._2(forward_try_expand_once.contents, env, ty$1)); - return update_level(env, level, ty$1); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Cannot_expand) { - if (level < get_level(env, p)) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: { - hd: [ - ty$1, - newty2(level, { - TAG: /* Tvar */ 0, - _0: undefined - }) - ], - tl: /* [] */ 0 - } - }); - } - return iter_type_expr((function (param) { - return update_level(env, level, param); - }), ty$1); + const p = row._0; + if (level < get_level(env, p)) { + try { + link_type(ty$1, Curry._2(forward_try_expand_once.contents, env, ty$1)); + return update_level(env, level, ty$1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Cannot_expand) { + if (level < get_level(env, p)) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: { + hd: [ + ty$1, + newty2(level, { + TAG: /* Tvar */ 0, + _0: undefined + }) + ], + tl: /* [] */ 0 + } + }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + return iter_type_expr((function (param) { + return update_level(env, level, param); + }), ty$1); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - break; + } + break; case /* Tobject */ 4 : - const nm = row._1; - const match = nm.contents; - if (match !== undefined && level < get_level(env, match[0])) { - set_name(nm, undefined); - _ty = ty$1; - continue; - } - break; + const nm = row._1; + const match = nm.contents; + if (match !== undefined && level < get_level(env, match[0])) { + set_name(nm, undefined); + _ty = ty$1; + continue; + } + break; case /* Tfield */ 5 : - const ty1 = row._2; - if (row._0 === dummy_method && repr(ty1).level > level) { + const ty1 = row._2; + if (row._0 === dummy_method && repr(ty1).level > level) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: { + hd: [ + ty1, + newty2(level, { + TAG: /* Tvar */ 0, + _0: undefined + }) + ], + tl: /* [] */ 0 + } + }); + } + break; + case /* Tvariant */ 8 : + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const match$1 = row$1.row_name; + if (match$1 !== undefined && level < get_level(env, match$1[0])) { + log_type(ty$1); + ty$1.desc = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$1.row_fields, + row_more: row$1.row_more, + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: row$1.row_fixed, + row_name: undefined + } + }; + } + set_level(ty$1, level); + return iter_type_expr((function (param) { + return update_level(env, level, param); + }), ty$1); + case /* Tpackage */ 11 : + const p$1 = row._0; + if (level < get_level(env, p$1)) { + const p$p = normalize_package_path(env, p$1); + if (same(p$1, p$p)) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: { hd: [ - ty1, + ty$1, newty2(level, { TAG: /* Tvar */ 0, _0: undefined @@ -29338,58 +29379,17 @@ function update_level(env, level, _ty) { } }); } - break; - case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const match$1 = row$1.row_name; - if (match$1 !== undefined && level < get_level(env, match$1[0])) { - log_type(ty$1); - ty$1.desc = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$1.row_fields, - row_more: row$1.row_more, - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: row$1.row_fixed, - row_name: undefined - } - }; - } - set_level(ty$1, level); - return iter_type_expr((function (param) { - return update_level(env, level, param); - }), ty$1); - case /* Tpackage */ 11 : - const p$1 = row._0; - if (level < get_level(env, p$1)) { - const p$p = normalize_package_path(env, p$1); - if (same(p$1, p$p)) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: { - hd: [ - ty$1, - newty2(level, { - TAG: /* Tvar */ 0, - _0: undefined - }) - ], - tl: /* [] */ 0 - } - }); - } - log_type(ty$1); - ty$1.desc = { - TAG: /* Tpackage */ 11, - _0: p$p, - _1: row._1, - _2: row._2 - }; - _ty = ty$1; - continue; - } - break; + log_type(ty$1); + ty$1.desc = { + TAG: /* Tpackage */ 11, + _0: p$p, + _1: row._1, + _2: row._2 + }; + _ty = ty$1; + continue; + } + break; } } @@ -29429,38 +29429,38 @@ function generalize_expansive(env, var_level, _ty) { } switch (match.TAG) { case /* Tarrow */ 1 : - generalize_contravariant(env)(var_level, match._1); - _ty = match._2; - continue; + generalize_contravariant(env)(var_level, match._1); + _ty = match._2; + continue; case /* Tconstr */ 3 : - const tyl = match._1; - let variance; - try { - variance = find_type_full(match._0, env)[0].type_variance; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - variance = Stdlib__List.map((function (param) { - return Types_Variance.may_inv; - }), tyl); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + const tyl = match._1; + let variance; + try { + variance = find_type_full(match._0, env)[0].type_variance; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + variance = Stdlib__List.map((function (param) { + return Types_Variance.may_inv; + }), tyl); + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - match._2.contents = /* Mnil */ 0; - return Stdlib__List.iter2((function (v, t) { - if (Curry._2(Types_Variance.mem, /* May_weak */ 2, v)) { - return generalize_contravariant(env)(var_level, t); - } else { - return generalize_expansive(env, var_level, t); - } - }), variance, tyl); + } + match._2.contents = /* Mnil */ 0; + return Stdlib__List.iter2((function (v, t) { + if (Curry._2(Types_Variance.mem, /* May_weak */ 2, v)) { + return generalize_contravariant(env)(var_level, t); + } else { + return generalize_expansive(env, var_level, t); + } + }), variance, tyl); case /* Tpackage */ 11 : - const partial_arg = generalize_contravariant(env); - return Stdlib__List.iter((function (param) { - return partial_arg(var_level, param); - }), match._2); + const partial_arg = generalize_contravariant(env); + return Stdlib__List.iter((function (param) { + return partial_arg(var_level, param); + }), match._2); default: return iter_type_expr((function (param) { return generalize_expansive(env, var_level, param); @@ -29759,204 +29759,204 @@ function copy(env, partial, keep_names, ty) { } else { switch (desc.TAG) { case /* Tconstr */ 3 : - const tl = desc._1; - const p = desc._0; - const abbrevs = proper_abbrevs(p, tl, abbreviations.contents); - const ty$3 = find_repr(p, abbrevs.contents); - let exit$1 = 0; - if (ty$3 !== undefined && repr(ty$3) !== t) { - tmp = { - TAG: /* Tlink */ 6, - _0: ty$3 - }; - } else { - exit$1 = 2; - } - if (exit$1 === 2) { - const abbrev = abbreviations.contents.contents; - let tmp$1; - tmp$1 = /* tag */ typeof abbrev === "number" || typeof abbrev === "string" || abbrev.TAG !== /* Mcons */ 0 ? abbrev : ({ - TAG: /* Mlink */ 1, - _0: abbreviations.contents - }); - tmp = { - TAG: /* Tconstr */ 3, - _0: p, - _1: Stdlib__List.map(copy$1, tl), - _2: { - contents: tmp$1 - } - }; - } - break; + const tl = desc._1; + const p = desc._0; + const abbrevs = proper_abbrevs(p, tl, abbreviations.contents); + const ty$3 = find_repr(p, abbrevs.contents); + let exit$1 = 0; + if (ty$3 !== undefined && repr(ty$3) !== t) { + tmp = { + TAG: /* Tlink */ 6, + _0: ty$3 + }; + } else { + exit$1 = 2; + } + if (exit$1 === 2) { + const abbrev = abbreviations.contents.contents; + let tmp$1; + tmp$1 = /* tag */ typeof abbrev === "number" || typeof abbrev === "string" || abbrev.TAG !== /* Mcons */ 0 ? abbrev : ({ + TAG: /* Mlink */ 1, + _0: abbreviations.contents + }); + tmp = { + TAG: /* Tconstr */ 3, + _0: p, + _1: Stdlib__List.map(copy$1, tl), + _2: { + contents: tmp$1 + } + }; + } + break; case /* Tobject */ 4 : - tmp = partial !== undefined ? ({ - TAG: /* Tobject */ 4, - _0: copy$1(desc._0), - _1: { - contents: undefined - } - }) : copy_type_desc(keep_names, copy$1, desc); - break; + tmp = partial !== undefined ? ({ + TAG: /* Tobject */ 4, + _0: copy$1(desc._0), + _1: { + contents: undefined + } + }) : copy_type_desc(keep_names, copy$1, desc); + break; case /* Tfield */ 5 : - const r = field_kind_repr(desc._1); - if (/* tag */ typeof r === "number" || typeof r === "string") { - tmp = r === /* Fpresent */ 0 ? copy_type_desc(undefined, copy$1, desc) : ({ - TAG: /* Tlink */ 6, - _0: copy$1(desc._3) - }); - } else { - dup_kind(r._0); - tmp = copy_type_desc(undefined, copy$1, desc); - } - break; + const r = field_kind_repr(desc._1); + if (/* tag */ typeof r === "number" || typeof r === "string") { + tmp = r === /* Fpresent */ 0 ? copy_type_desc(undefined, copy$1, desc) : ({ + TAG: /* Tlink */ 6, + _0: copy$1(desc._3) + }); + } else { + dup_kind(r._0); + tmp = copy_type_desc(undefined, copy$1, desc); + } + break; case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, desc._0); - const more = repr(row.row_more); - const match = more.desc; - let exit$2 = 0; - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tsubst */ 7) { + const row = row_repr_aux(/* [] */ 0, desc._0); + const more = repr(row.row_more); + const match = more.desc; + let exit$2 = 0; + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tsubst */ 7) { + exit$2 = 2; + } else { + const match$1 = match._0.desc; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Ttuple */ 2) { exit$2 = 2; } else { - const match$1 = match._0.desc; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Ttuple */ 2) { - exit$2 = 2; - } else { - const match$2 = match$1._0; - if (match$2) { - const match$3 = match$2.tl; - if (match$3 && !match$3.tl) { - const ty2 = match$3.hd; - ty$1.desc = { - TAG: /* Tsubst */ 7, - _0: ty2 - }; - tmp = { - TAG: /* Tlink */ 6, - _0: ty2 - }; - } else { - exit$2 = 2; - } + const match$2 = match$1._0; + if (match$2) { + const match$3 = match$2.tl; + if (match$3 && !match$3.tl) { + const ty2 = match$3.hd; + ty$1.desc = { + TAG: /* Tsubst */ 7, + _0: ty2 + }; + tmp = { + TAG: /* Tlink */ 6, + _0: ty2 + }; } else { exit$2 = 2; } + } else { + exit$2 = 2; } } - if (exit$2 === 2) { - const keep = more.level !== 100000000; - const ty$4 = more.desc; - let more$p; - let exit$3 = 0; - if (/* tag */ typeof ty$4 === "number" || typeof ty$4 === "string") { - exit$3 = 3; - } else { - switch (ty$4.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tsubst */ 7 : - more$p = ty$4._0; - break; - case /* Tvar */ 0 : - case /* Tunivar */ 9 : - exit$3 = 4; - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 31059, - 24 - ] - }); - } + } + if (exit$2 === 2) { + const keep = more.level !== 100000000; + const ty$4 = more.desc; + let more$p; + let exit$3 = 0; + if (/* tag */ typeof ty$4 === "number" || typeof ty$4 === "string") { + exit$3 = 3; + } else { + switch (ty$4.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tsubst */ 7 : + more$p = ty$4._0; + break; + case /* Tvar */ 0 : + case /* Tunivar */ 9 : + exit$3 = 4; + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 31059, + 24 + ] + }); } - switch (exit$3) { - case 3 : - if (keep) { - save_desc(more, more.desc); - } - more$p = copy$1(more); - break; - case 4 : - save_desc(more, more.desc); - more$p = keep ? more : newty2(current_level.contents, more.desc); - break; - + } + switch (exit$3) { + case 3 : + if (keep) { + save_desc(more, more.desc); + } + more$p = copy$1(more); + break; + case 4 : + save_desc(more, more.desc); + more$p = keep ? more : newty2(current_level.contents, more.desc); + break; + + } + const match$4 = repr(more$p); + const match$5 = match$4.desc; + let row$1; + row$1 = /* tag */ typeof match$5 === "number" || typeof match$5 === "string" || !(match$5.TAG === /* Tconstr */ 3 && !row.row_fixed) ? row : ({ + row_fields: row.row_fields, + row_more: row.row_more, + row_bound: row.row_bound, + row_closed: row.row_closed, + row_fixed: true, + row_name: row.row_name + }); + let match$6; + if (partial !== undefined && !partial[1]) { + let more$p$1; + if (more.id !== more$p.id) { + more$p$1 = more$p; + } else { + const lv$1 = keep ? more.level : current_level.contents; + more$p$1 = newty2(lv$1, { + TAG: /* Tvar */ 0, + _0: undefined + }); } - const match$4 = repr(more$p); - const match$5 = match$4.desc; - let row$1; - row$1 = /* tag */ typeof match$5 === "number" || typeof match$5 === "string" || !(match$5.TAG === /* Tconstr */ 3 && !row.row_fixed) ? row : ({ - row_fields: row.row_fields, - row_more: row.row_more, - row_bound: row.row_bound, - row_closed: row.row_closed, - row_fixed: true, - row_name: row.row_name - }); - let match$6; - if (partial !== undefined && !partial[1]) { - let more$p$1; - if (more.id !== more$p.id) { - more$p$1 = more$p; + const not_reither = function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG === /* Rpresent */ 0) { + return true; } else { - const lv$1 = keep ? more.level : current_level.contents; - more$p$1 = newty2(lv$1, { - TAG: /* Tvar */ 0, - _0: undefined - }); + return false; } - const not_reither = function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG === /* Rpresent */ 0) { - return true; - } else { - return false; + }; + match$6 = row$1.row_closed && !row$1.row_fixed && Curry._1(is_empty$2, Curry._1(partial[0], ty$1)) && !Stdlib__List.for_all(not_reither, row$1.row_fields) ? [ + more$p$1, + { + row_fields: Stdlib__List.filter(not_reither, row$1.row_fields), + row_more: more$p$1, + row_bound: undefined, + row_closed: false, + row_fixed: false, + row_name: undefined } - }; - match$6 = row$1.row_closed && !row$1.row_fixed && Curry._1(is_empty$2, Curry._1(partial[0], ty$1)) && !Stdlib__List.for_all(not_reither, row$1.row_fields) ? [ - more$p$1, - { - row_fields: Stdlib__List.filter(not_reither, row$1.row_fields), - row_more: more$p$1, - row_bound: undefined, - row_closed: false, - row_fixed: false, - row_name: undefined - } - ] : [ - more$p$1, - row$1 - ]; - } else { - match$6 = [ - more$p, + ] : [ + more$p$1, row$1 ]; - } - const more$p$2 = match$6[0]; - more.desc = { - TAG: /* Tsubst */ 7, - _0: newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: { - hd: more$p$2, - tl: { - hd: t, - tl: /* [] */ 0 - } - } - }) - }; - tmp = { - TAG: /* Tvariant */ 8, - _0: copy_row(copy$1, true, match$6[1], keep, more$p$2) - }; + } else { + match$6 = [ + more$p, + row$1 + ]; } - break; + const more$p$2 = match$6[0]; + more.desc = { + TAG: /* Tsubst */ 7, + _0: newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: { + hd: more$p$2, + tl: { + hd: t, + tl: /* [] */ 0 + } + } + }) + }; + tmp = { + TAG: /* Tvariant */ 8, + _0: copy_row(copy$1, true, match$6[1], keep, more$p$2) + }; + } + break; default: tmp = copy_type_desc(keep_names, copy$1, desc); } @@ -30182,41 +30182,41 @@ function instance_class(params, cty) { const copy_class_type = function (sign) { switch (sign.TAG) { case /* Cty_constr */ 0 : - return { - TAG: /* Cty_constr */ 0, - _0: sign._0, - _1: Stdlib__List.map(simple_copy, sign._1), - _2: copy_class_type(sign._2) - }; + return { + TAG: /* Cty_constr */ 0, + _0: sign._0, + _1: Stdlib__List.map(simple_copy, sign._1), + _2: copy_class_type(sign._2) + }; case /* Cty_signature */ 1 : - const sign$1 = sign._0; - return { - TAG: /* Cty_signature */ 1, - _0: { - csig_self: copy(undefined, undefined, undefined, sign$1.csig_self), - csig_vars: Curry._2(Meths.map, (function (param) { - return [ - param[0], - param[1], - copy(undefined, undefined, undefined, param[2]) - ]; - }), sign$1.csig_vars), - csig_concr: sign$1.csig_concr, - csig_inher: Stdlib__List.map((function (param) { - return [ - param[0], - Stdlib__List.map(simple_copy, param[1]) - ]; - }), sign$1.csig_inher) - } - }; + const sign$1 = sign._0; + return { + TAG: /* Cty_signature */ 1, + _0: { + csig_self: copy(undefined, undefined, undefined, sign$1.csig_self), + csig_vars: Curry._2(Meths.map, (function (param) { + return [ + param[0], + param[1], + copy(undefined, undefined, undefined, param[2]) + ]; + }), sign$1.csig_vars), + csig_concr: sign$1.csig_concr, + csig_inher: Stdlib__List.map((function (param) { + return [ + param[0], + Stdlib__List.map(simple_copy, param[1]) + ]; + }), sign$1.csig_inher) + } + }; case /* Cty_arrow */ 2 : - return { - TAG: /* Cty_arrow */ 2, - _0: sign._0, - _1: copy(undefined, undefined, undefined, sign._1), - _2: copy_class_type(sign._2) - }; + return { + TAG: /* Cty_arrow */ 2, + _0: sign._0, + _1: copy(undefined, undefined, undefined, sign._1), + _2: copy_class_type(sign._2) + }; } }; @@ -30305,8 +30305,8 @@ function copy_sep(fixed, free, bound, visited, ty) { case /* Tobject */ 4 : case /* Tvariant */ 8 : case /* Tpackage */ 11 : - exit = 1; - break; + exit = 1; + break; default: visited$1 = visited; } @@ -30333,38 +30333,38 @@ function copy_sep(fixed, free, bound, visited, ty) { } else { switch (row0.TAG) { case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, row0._0); - const more = repr(row.row_more); - const keep = is_Tvar(more) && more.level !== 100000000; - const more$p = copy_rec(more); - const fixed$p = fixed && is_Tvar(repr(more$p)); - const row$1 = copy_row(copy_rec, fixed$p, row, keep, more$p); - tmp = { - TAG: /* Tvariant */ 8, - _0: row$1 - }; - break; + const row = row_repr_aux(/* [] */ 0, row0._0); + const more = repr(row.row_more); + const keep = is_Tvar(more) && more.level !== 100000000; + const more$p = copy_rec(more); + const fixed$p = fixed && is_Tvar(repr(more$p)); + const row$1 = copy_row(copy_rec, fixed$p, row, keep, more$p); + tmp = { + TAG: /* Tvariant */ 8, + _0: row$1 + }; + break; case /* Tpoly */ 10 : - const tl = Stdlib__List.map(repr, row0._1); - const tl$p = Stdlib__List.map((function (t) { - return newty2(current_level.contents, t.desc); - }), tl); - const bound$1 = Stdlib.$at(tl, bound); - const visited$2 = Stdlib.$at(Stdlib__List.map2((function (ty, t) { - return [ - ty, - [ - t, - bound$1 - ] - ]; - }), tl, tl$p), visited$1); - tmp = { - TAG: /* Tpoly */ 10, - _0: copy_sep(fixed, free, bound$1, visited$2, row0._0), - _1: tl$p - }; - break; + const tl = Stdlib__List.map(repr, row0._1); + const tl$p = Stdlib__List.map((function (t) { + return newty2(current_level.contents, t.desc); + }), tl); + const bound$1 = Stdlib.$at(tl, bound); + const visited$2 = Stdlib.$at(Stdlib__List.map2((function (ty, t) { + return [ + ty, + [ + t, + bound$1 + ] + ]; + }), tl, tl$p), visited$1); + tmp = { + TAG: /* Tpoly */ 10, + _0: copy_sep(fixed, free, bound$1, visited$2, row0._0), + _1: tl$p + }; + break; default: tmp = copy_type_desc(undefined, copy_rec, ty$1.desc); } @@ -31024,77 +31024,77 @@ function occur_rec(env, visited, ty0, ty) { if (!/* tag */ (typeof match === "number" || typeof match === "string")) { switch (match.TAG) { case /* Tconstr */ 3 : - try { - if (occur_ok || Stdlib__List.memq(ty, visited)) { - throw new Caml_js_exceptions.MelangeError(Occur, { - MEL_EXN_ID: Occur - }); - } - const partial_arg = { - hd: ty, - tl: visited - }; - return iter_type_expr((function (param) { - return occur_rec(env, partial_arg, ty0, param); - }), ty); + try { + if (occur_ok || Stdlib__List.memq(ty, visited)) { + throw new Caml_js_exceptions.MelangeError(Occur, { + MEL_EXN_ID: Occur + }); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Occur) { - try { - const ty$p = try_expand_head$1(try_expand_once, env, ty); - if (ty$p === ty0 || Stdlib__List.memq(ty$p, visited)) { - throw new Caml_js_exceptions.MelangeError(Occur, { - MEL_EXN_ID: Occur - }); - } - const match$1 = ty$p.desc; - let exit = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 2; - } else { - switch (match$1.TAG) { - case /* Tobject */ 4 : - case /* Tvariant */ 8 : - return; - default: - exit = 2; - } - } - if (exit === 2) { - if (recursive_types.contents && is_contractive(env, ty$p)) { + const partial_arg = { + hd: ty, + tl: visited + }; + return iter_type_expr((function (param) { + return occur_rec(env, partial_arg, ty0, param); + }), ty); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Occur) { + try { + const ty$p = try_expand_head$1(try_expand_once, env, ty); + if (ty$p === ty0 || Stdlib__List.memq(ty$p, visited)) { + throw new Caml_js_exceptions.MelangeError(Occur, { + MEL_EXN_ID: Occur + }); + } + const match$1 = ty$p.desc; + let exit = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 2; + } else { + switch (match$1.TAG) { + case /* Tobject */ 4 : + case /* Tvariant */ 8 : return; - } - const partial_arg$1 = { - hd: ty$p, - tl: visited - }; - return iter_type_expr((function (param) { - return occur_rec(env, partial_arg$1, ty0, param); - }), ty$p); + default: + exit = 2; } - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Cannot_expand) { - if (occur_ok) { - return; - } - throw new Caml_js_exceptions.MelangeError(Occur, { - MEL_EXN_ID: Occur - }); + if (exit === 2) { + if (recursive_types.contents && is_contractive(env, ty$p)) { + return; } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + const partial_arg$1 = { + hd: ty$p, + tl: visited + }; + return iter_type_expr((function (param) { + return occur_rec(env, partial_arg$1, ty0, param); + }), ty$p); } - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Cannot_expand) { + if (occur_ok) { + return; + } + throw new Caml_js_exceptions.MelangeError(Occur, { + MEL_EXN_ID: Occur + }); + } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - break; + } + break; case /* Tobject */ 4 : case /* Tvariant */ 8 : - return; + return; } } @@ -31276,50 +31276,50 @@ function occur_univar(env, ty) { } switch (match.TAG) { case /* Tconstr */ 3 : - if (!match._1) { - return; - } - const tl = match._1; - try { - const td = find_type_full(match._0, env)[0]; - return Stdlib__List.iter2((function (t, v) { - if (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) { - return occur_rec(bound, t); - } - - }), tl, td.type_variance); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - return Stdlib__List.iter((function (param) { - return occur_rec(bound, param); - }), tl); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + if (!match._1) { + return; + } + const tl = match._1; + try { + const td = find_type_full(match._0, env)[0]; + return Stdlib__List.iter2((function (t, v) { + if (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) { + return occur_rec(bound, t); + } + + }), tl, td.type_variance); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + return Stdlib__List.iter((function (param) { + return occur_rec(bound, param); + }), tl); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } case /* Tunivar */ 9 : - if (Curry._2(mem$3, ty$1, bound)) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: { - hd: [ - ty$1, - newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }) - ], - tl: /* [] */ 0 - } - }); + if (Curry._2(mem$3, ty$1, bound)) { + return; + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: { + hd: [ + ty$1, + newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }) + ], + tl: /* [] */ 0 + } + }); case /* Tpoly */ 10 : - const bound$1 = Stdlib__List.fold_right(add$3, Stdlib__List.map(repr, match._1), bound); - _ty = match._0; - _bound = bound$1; - continue; + const bound$1 = Stdlib__List.fold_right(add$3, Stdlib__List.map(repr, match._1), bound); + _ty = match._0; + _bound = bound$1; + continue; default: return iter_type_expr((function (param) { return occur_rec(bound, param); @@ -31380,41 +31380,41 @@ function univars_escape(env, univar_pairs, vl, ty) { } switch (match.TAG) { case /* Tconstr */ 3 : - if (!match._1) { - return; - } - const tl = match._1; - try { - const td = find_type_full(match._0, env)[0]; - return Stdlib__List.iter2((function (t, v) { - if (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) { - return occur(t); - } - - }), tl, td.type_variance); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return Stdlib__List.iter(occur, tl); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + if (!match._1) { + return; + } + const tl = match._1; + try { + const td = find_type_full(match._0, env)[0]; + return Stdlib__List.iter2((function (t, v) { + if (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) { + return occur(t); + } + + }), tl, td.type_variance); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return Stdlib__List.iter(occur, tl); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Tunivar */ 9 : - if (!Curry._2(mem$3, t$1, family)) { - return; - } - throw new Caml_js_exceptions.MelangeError(Occur, { - MEL_EXN_ID: Occur - }); + if (!Curry._2(mem$3, t$1, family)) { + return; + } + throw new Caml_js_exceptions.MelangeError(Occur, { + MEL_EXN_ID: Occur + }); case /* Tpoly */ 10 : - if (Stdlib__List.exists((function (t) { - return Curry._2(mem$3, repr(t), family); - }), match._1)) { - return; - } - _t = match._0; - continue; + if (Stdlib__List.exists((function (t) { + return Curry._2(mem$3, repr(t), family); + }), match._1)) { + return; + } + _t = match._0; + continue; default: return iter_type_expr(occur, t$1); } @@ -31644,66 +31644,66 @@ function reify(env, t) { } switch (o.TAG) { case /* Tvar */ 0 : - const o$1 = o._0; - const name = o$1 !== undefined ? o$1 : "ex"; - const t = create_fresh_constr(ty$1.level, name); - return link_type(ty$1, t); + const o$1 = o._0; + const name = o$1 !== undefined ? o$1 : "ex"; + const t = create_fresh_constr(ty$1.level, name); + return link_type(ty$1, t); case /* Tconstr */ 3 : - if (is_object_type(o._0)) { - return iter_type_expr(iterator, full_expand(env.contents, ty$1)); - } else { - return iter_type_expr(iterator, ty$1); - } + if (is_object_type(o._0)) { + return iter_type_expr(iterator, full_expand(env.contents, ty$1)); + } else { + return iter_type_expr(iterator, ty$1); + } case /* Tvariant */ 8 : - const r = row_repr_aux(/* [] */ 0, o._0); - if (!static_row(r)) { - if (r.row_fixed) { - iterator(row_more(r)); + const r = row_repr_aux(/* [] */ 0, o._0); + if (!static_row(r)) { + if (r.row_fixed) { + iterator(row_more(r)); + } else { + const m = r.row_more; + const o$2 = m.desc; + if (/* tag */ typeof o$2 === "number" || typeof o$2 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 31999, + 19 + ] + }); + } + if (o$2.TAG === /* Tvar */ 0) { + const o$3 = o$2._0; + const name$1 = o$3 !== undefined ? o$3 : "ex"; + const t$1 = create_fresh_constr(m.level, name$1); + const row_row_bound = r.row_bound; + const row_row_closed = r.row_closed; + const row_row_name = r.row_name; + const row = { + row_fields: /* [] */ 0, + row_more: t$1, + row_bound: row_row_bound, + row_closed: row_row_closed, + row_fixed: true, + row_name: row_row_name + }; + link_type(m, newty2(m.level, { + TAG: /* Tvariant */ 8, + _0: row + })); } else { - const m = r.row_more; - const o$2 = m.desc; - if (/* tag */ typeof o$2 === "number" || typeof o$2 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 31999, - 19 - ] - }); - } - if (o$2.TAG === /* Tvar */ 0) { - const o$3 = o$2._0; - const name$1 = o$3 !== undefined ? o$3 : "ex"; - const t$1 = create_fresh_constr(m.level, name$1); - const row_row_bound = r.row_bound; - const row_row_closed = r.row_closed; - const row_row_name = r.row_name; - const row = { - row_fields: /* [] */ 0, - row_more: t$1, - row_bound: row_row_bound, - row_closed: row_row_closed, - row_fixed: true, - row_name: row_row_name - }; - link_type(m, newty2(m.level, { - TAG: /* Tvariant */ 8, - _0: row - })); - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 31999, - 19 - ] - }); - } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 31999, + 19 + ] + }); } } - return iter_row(iterator, r); + } + return iter_row(iterator, r); default: return iter_type_expr(iterator, ty$1); } @@ -31786,32 +31786,32 @@ function mcomp(type_pairs, env, _t1, _t2) { } else { switch (match.TAG) { case /* Tvar */ 0 : - return; + return; case /* Tconstr */ 3 : - if (match._1) { - exit$1 = 2; - } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$1 = 2; - break; - case /* Tconstr */ 3 : - if (match$1._1) { - exit = 1; - } else { - if (same(match._0, match$1._0)) { - return; - } - exit = 1; - } - break; - default: + if (match._1) { + exit$1 = 2; + } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$1 = 2; + break; + case /* Tconstr */ 3 : + if (match$1._1) { exit = 1; - } + } else { + if (same(match._0, match$1._0)) { + return; + } + exit = 1; + } + break; + default: + exit = 1; } - break; + } + break; default: exit$1 = 2; } @@ -31867,177 +31867,222 @@ function mcomp(type_pairs, env, _t1, _t2) { } else { switch (match$2.TAG) { case /* Tvar */ 0 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tvar */ 0 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 32063, + 30 + ] + }); + case /* Tconstr */ 3 : + exit$3 = 3; + break; + default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - switch (match$3.TAG) { - case /* Tvar */ 0 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 32063, - 30 - ] - }); - case /* Tconstr */ 3 : - exit$3 = 3; - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + } + break; case /* Tarrow */ 1 : - const l1 = match$2._0; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + const l1 = match$2._0; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tarrow */ 1 : + const l2 = match$3._0; + if (l1 === l2 || !(is_optional(l1) || is_optional(l2))) { + mcomp(type_pairs, env, match$2._1, match$3._1); + _t2 = match$3._2; + _t1 = match$2._2; + continue; + } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - switch (match$3.TAG) { - case /* Tarrow */ 1 : - const l2 = match$3._0; - if (l1 === l2 || !(is_optional(l1) || is_optional(l2))) { - mcomp(type_pairs, env, match$2._1, match$3._1); - _t2 = match$3._2; - _t1 = match$2._2; - continue; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - case /* Tconstr */ 3 : - exit$3 = 3; - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + case /* Tconstr */ 3 : + exit$3 = 3; + break; + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; case /* Ttuple */ 2 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Ttuple */ 2 : + return mcomp_list(type_pairs, env, match$2._0, match$3._0); + case /* Tconstr */ 3 : + exit$3 = 3; + break; + default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - switch (match$3.TAG) { - case /* Ttuple */ 2 : - return mcomp_list(type_pairs, env, match$2._0, match$3._0); - case /* Tconstr */ 3 : - exit$3 = 3; - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + } + break; case /* Tconstr */ 3 : - const p1 = match$2._0; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - p = p1; - exit$2 = 2; - } else { - if (match$3.TAG === /* Tconstr */ 3) { - let p2 = match$3._0; - let tl1 = match$2._1; - let tl2 = match$3._1; - try { - const decl = find_type_full(p1, env)[0]; - const decl$p = find_type_full(p2, env)[0]; - if (same(p1, p2)) { - let inj; - try { - inj = Stdlib__List.map(Curry._1(Types_Variance.mem, /* Inj */ 3), find_type_full(p1, env)[0].type_variance); + const p1 = match$2._0; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + p = p1; + exit$2 = 2; + } else { + if (match$3.TAG === /* Tconstr */ 3) { + let p2 = match$3._0; + let tl1 = match$2._1; + let tl2 = match$3._1; + try { + const decl = find_type_full(p1, env)[0]; + const decl$p = find_type_full(p2, env)[0]; + if (same(p1, p2)) { + let inj; + try { + inj = Stdlib__List.map(Curry._1(Types_Variance.mem, /* Inj */ 3), find_type_full(p1, env)[0].type_variance); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + inj = Stdlib__List.map((function (param) { + return false; + }), tl1); + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - inj = Stdlib__List.map((function (param) { - return false; - }), tl1); - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + return Stdlib__List.iter2((function (i, param) { + if (i) { + return mcomp(type_pairs, env, param[0], param[1]); + } + + }), inj, Stdlib__List.combine(tl1, tl2)); + } + if (non_aliasable(p1, decl) && non_aliasable(p2, decl$p)) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + const match$4 = decl.type_kind; + const match$5 = decl$p.type_kind; + let exit$4 = 0; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + if (match$4 === /* Type_abstract */ 0) { + let exit$5 = 0; + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + if (match$5 === /* Type_abstract */ 0) { + return; + } + exit$5 = 2; + } else { + exit$5 = 2; + } + if (exit$5 === 2) { + if (!non_aliasable(p1, decl)) { + return; } + exit$4 = 1; + } + + } else if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + if (match$5 !== /* Type_abstract */ 0) { + return mcomp_list(type_pairs, env, tl1, tl2); + } + exit$4 = 1; + } else { + if (match$5.TAG === /* Type_record */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - return Stdlib__List.iter2((function (i, param) { - if (i) { - return mcomp(type_pairs, env, param[0], param[1]); - } - - }), inj, Stdlib__List.combine(tl1, tl2)); - } - if (non_aliasable(p1, decl) && non_aliasable(p2, decl$p)) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - const match$4 = decl.type_kind; - const match$5 = decl$p.type_kind; - let exit$4 = 0; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - if (match$4 === /* Type_abstract */ 0) { - let exit$5 = 0; - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - if (match$5 === /* Type_abstract */ 0) { - return; - } - exit$5 = 2; - } else { - exit$5 = 2; - } - if (exit$5 === 2) { - if (!non_aliasable(p1, decl)) { - return; - } - exit$4 = 1; - } - - } else if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - if (match$5 !== /* Type_abstract */ 0) { - return mcomp_list(type_pairs, env, tl1, tl2); - } + } else if (match$4.TAG === /* Type_record */ 0) { + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + if (match$5 === /* Type_abstract */ 0) { exit$4 = 1; } else { - if (match$5.TAG === /* Type_record */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - } else if (match$4.TAG === /* Type_record */ 0) { - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - if (match$5 === /* Type_abstract */ 0) { - exit$4 = 1; - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } else { + if (match$5.TAG === /* Type_record */ 0) { + if (match$4._1 === match$5._1) { + mcomp_list(type_pairs, env, tl1, tl2); + return mcomp_record_description(type_pairs, env)(match$4._0, match$5._0); } - } else { - if (match$5.TAG === /* Type_record */ 0) { - if (match$4._1 === match$5._1) { - mcomp_list(type_pairs, env, tl1, tl2); - return mcomp_record_description(type_pairs, env)(match$4._0, match$5._0); + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } else if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + if (match$5 === /* Type_abstract */ 0) { + exit$4 = 1; + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } else { + if (match$5.TAG === /* Type_record */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + mcomp_list(type_pairs, env, tl1, tl2); + let xs = match$4._0; + let ys = match$5._0; + let _x = xs; + let _y = ys; + while (true) { + const y = _y; + const x = _x; + if (x) { + if (y) { + const c2 = y.hd; + const c1 = x.hd; + mcomp_type_option(type_pairs, env, c1.cd_res, c2.cd_res); + mcomp_list(type_pairs, env, c1.cd_args, c2.cd_args); + if (c1.cd_id.name === c2.cd_id.name) { + _y = y.tl; + _x = x.tl; + continue; } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -32049,64 +32094,241 @@ function mcomp(type_pairs, env, _t1, _t2) { _1: /* [] */ 0 }); } - } else if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { + if (!y) { + return; + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + }; + } + if (exit$4 === 1) { + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { if (match$5 === /* Type_abstract */ 0) { - exit$4 = 1; - } else { + if (!non_aliasable(p2, decl$p)) { + return; + } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } else { - if (match$5.TAG === /* Type_record */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - mcomp_list(type_pairs, env, tl1, tl2); - let xs = match$4._0; - let ys = match$5._0; - let _x = xs; - let _y = ys; - while (true) { - const y = _y; - const x = _x; - if (x) { - if (y) { - const c2 = y.hd; - const c1 = x.hd; - mcomp_type_option(type_pairs, env, c1.cd_res, c2.cd_res); - mcomp_list(type_pairs, env, c1.cd_args, c2.cd_args); - if (c1.cd_id.name === c2.cd_id.name) { - _y = y.tl; - _x = x.tl; - continue; + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } + + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + return; + } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + } + p = p1; + exit$2 = 2; + } + break; + case /* Tobject */ 4 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tobject */ 4 : + return mcomp_fields(type_pairs, env, match$2._0, match$3._0); + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tfield */ 5 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tfield */ 5 : + return mcomp_fields(type_pairs, env, t1$p$1, t2$p$1); + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tlink */ 6 : + case /* Tsubst */ 7 : + exit$3 = 3; + break; + case /* Tvariant */ 8 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tvariant */ 8 : + let row1 = match$2._0; + let row2 = match$3._0; + const row1$1 = row_repr_aux(/* [] */ 0, row1); + const row2$1 = row_repr_aux(/* [] */ 0, row2); + const match$6 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); + const cannot_erase = function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { + return false; + } else { + return true; + } + }; + if (row1$1.row_closed && Stdlib__List.exists(cannot_erase, match$6[1]) || row2$1.row_closed && Stdlib__List.exists(cannot_erase, match$6[0])) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + return Stdlib__List.iter((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); + let exit = 0; + let exit$1 = 0; + if (/* tag */ typeof match === "number" || typeof match === "string") { + exit$1 = 2; + } else if (match.TAG === /* Rpresent */ 0) { + const t1 = match._0; + if (t1 !== undefined) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + const t2 = match$1._0; + if (t2 !== undefined) { + return mcomp(type_pairs, env, t1, t2); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$1._0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + return Stdlib__List.iter((function (param) { + return mcomp(type_pairs, env, t1, param); + }), match$1._1); + } else { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + if (match$1._0 === undefined) { + return; } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } + if (!match$1._1) { + return; + } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (!y) { + } else { + let exit$2 = 0; + if (match._0 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Rpresent */ 0) { + exit$2 = 3; + } else { + const t2$1 = match$1._0; + if (t2$1 !== undefined) { + return Stdlib__List.iter((function (param) { + return mcomp(type_pairs, env, t2$1, param); + }), match._1); + } + exit$2 = 3; + } + if (exit$2 === 3) { + if (match._1) { + exit$1 = 2; + } else { + exit = 1; + } + } + + } + if (exit$1 === 2) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { return; } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - }; - } - if (exit$4 === 1) { - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string") { - if (match$5 === /* Type_abstract */ 0) { - if (!non_aliasable(p2, decl$p)) { + if (match$1.TAG !== /* Rpresent */ 0) { + return; + } + if (match$1._0 !== undefined) { + exit = 1; + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } + if (exit === 1) { + let exit$3 = 0; + if (/* tag */ typeof match === "number" || typeof match === "string") { + exit$3 = 2; + } else { + if (!match._0) { + return; + } + exit$3 = 2; + } + if (exit$3 === 2) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return; + } + if (match$1.TAG !== /* Rpresent */ 0) { + return; + } + if (match$1._0 === undefined) { return; } throw new Caml_js_exceptions.MelangeError(Unify, { @@ -32114,32 +32336,44 @@ function mcomp(type_pairs, env, _t1, _t2) { _1: /* [] */ 0 }); } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } - } - - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - return; - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - } - p = p1; - exit$2 = 2; - } - break; - case /* Tobject */ 4 : + + }), match$6[2]); + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tunivar */ 9 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tunivar */ 9 : + return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tpoly */ 10 : + const tl1$1 = match$2._1; + const t1$2 = match$2._0; + let exit$6 = 0; + if (tl1$1) { + exit$6 = 4; + } else { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -32148,18 +32382,25 @@ function mcomp(type_pairs, env, _t1, _t2) { } switch (match$3.TAG) { case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tobject */ 4 : - return mcomp_fields(type_pairs, env, match$2._0, match$3._0); + exit$3 = 3; + break; + case /* Tpoly */ 10 : + if (match$3._1) { + exit$6 = 4; + } else { + _t2 = match$3._0; + _t1 = t1$2; + continue; + } + break; default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; - case /* Tfield */ 5 : + } + if (exit$6 === 4) { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -32168,281 +32409,40 @@ function mcomp(type_pairs, env, _t1, _t2) { } switch (match$3.TAG) { case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tfield */ 5 : - return mcomp_fields(type_pairs, env, t1$p$1, t2$p$1); + exit$3 = 3; + break; + case /* Tpoly */ 10 : + return enter_poly(env, univar_pairs, t1$2, tl1$1, match$3._0, match$3._1, (function (param, param$1) { + return mcomp(type_pairs, env, param, param$1); + })); default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; - case /* Tlink */ 6 : - case /* Tsubst */ 7 : - exit$3 = 3; - break; - case /* Tvariant */ 8 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + } + break; + case /* Tpackage */ 11 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (match$3.TAG) { + case /* Tconstr */ 3 : + exit$3 = 3; + break; + case /* Tpackage */ 11 : + return; + default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - switch (match$3.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tvariant */ 8 : - let row1 = match$2._0; - let row2 = match$3._0; - const row1$1 = row_repr_aux(/* [] */ 0, row1); - const row2$1 = row_repr_aux(/* [] */ 0, row2); - const match$6 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); - const cannot_erase = function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { - return false; - } else { - return true; - } - }; - if (row1$1.row_closed && Stdlib__List.exists(cannot_erase, match$6[1]) || row2$1.row_closed && Stdlib__List.exists(cannot_erase, match$6[0])) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - return Stdlib__List.iter((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); - let exit = 0; - let exit$1 = 0; - if (/* tag */ typeof match === "number" || typeof match === "string") { - exit$1 = 2; - } else if (match.TAG === /* Rpresent */ 0) { - const t1 = match._0; - if (t1 !== undefined) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - const t2 = match$1._0; - if (t2 !== undefined) { - return mcomp(type_pairs, env, t1, t2); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1._0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - return Stdlib__List.iter((function (param) { - return mcomp(type_pairs, env, t1, param); - }), match$1._1); - } else { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - if (match$1._0 === undefined) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (!match$1._1) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } else { - let exit$2 = 0; - if (match._0 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Rpresent */ 0) { - exit$2 = 3; - } else { - const t2$1 = match$1._0; - if (t2$1 !== undefined) { - return Stdlib__List.iter((function (param) { - return mcomp(type_pairs, env, t2$1, param); - }), match._1); - } - exit$2 = 3; - } - if (exit$2 === 3) { - if (match._1) { - exit$1 = 2; - } else { - exit = 1; - } - } - - } - if (exit$1 === 2) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return; - } - if (match$1.TAG !== /* Rpresent */ 0) { - return; - } - if (match$1._0 !== undefined) { - exit = 1; - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - if (exit === 1) { - let exit$3 = 0; - if (/* tag */ typeof match === "number" || typeof match === "string") { - exit$3 = 2; - } else { - if (!match._0) { - return; - } - exit$3 = 2; - } - if (exit$3 === 2) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return; - } - if (match$1.TAG !== /* Rpresent */ 0) { - return; - } - if (match$1._0 === undefined) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - - } - - }), match$6[2]); - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; - case /* Tunivar */ 9 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (match$3.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tunivar */ 9 : - return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; - case /* Tpoly */ 10 : - const tl1$1 = match$2._1; - const t1$2 = match$2._0; - let exit$6 = 0; - if (tl1$1) { - exit$6 = 4; - } else { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (match$3.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tpoly */ 10 : - if (match$3._1) { - exit$6 = 4; - } else { - _t2 = match$3._0; - _t1 = t1$2; - continue; - } - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - if (exit$6 === 4) { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (match$3.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tpoly */ 10 : - return enter_poly(env, univar_pairs, t1$2, tl1$1, match$3._0, match$3._1, (function (param, param$1) { - return mcomp(type_pairs, env, param, param$1); - })); - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - break; - case /* Tpackage */ 11 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (match$3.TAG) { - case /* Tconstr */ 3 : - exit$3 = 3; - break; - case /* Tpackage */ 11 : - return; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + } + break; } } @@ -32754,23 +32754,23 @@ function concat_longident(lid1) { return function (s) { switch (s.TAG) { case /* Lident */ 0 : - return { - TAG: /* Ldot */ 1, - _0: lid1, - _1: s._0 - }; + return { + TAG: /* Ldot */ 1, + _0: lid1, + _1: s._0 + }; case /* Ldot */ 1 : - return { - TAG: /* Ldot */ 1, - _0: concat_longident(lid1)(s._0), - _1: s._1 - }; + return { + TAG: /* Ldot */ 1, + _0: concat_longident(lid1)(s._0), + _1: s._1 + }; case /* Lapply */ 2 : - return { - TAG: /* Lapply */ 2, - _0: concat_longident(lid1)(s._0), - _1: s._1 - }; + return { + TAG: /* Lapply */ 2, + _0: concat_longident(lid1)(s._0), + _1: s._1 + }; } }; @@ -32952,84 +32952,84 @@ function unify(env, t1, t2) { } else { switch (match.TAG) { case /* Tvar */ 0 : - let exit$1 = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && deep_occur(t1$1, t2$1))) { - exit$1 = 2; - } else { - unify2(env, t1$1, t2$1); - } - if (exit$1 === 2) { - occur(env.contents, t1$1, t2$1); - occur_univar(env.contents, t2$1); - link_type(t1$1, t2$1); - update_level(env.contents, t1$1.level, t2$1); - } - break; + let exit$1 = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && deep_occur(t1$1, t2$1))) { + exit$1 = 2; + } else { + unify2(env, t1$1, t2$1); + } + if (exit$1 === 2) { + occur(env.contents, t1$1, t2$1); + occur_univar(env.contents, t2$1); + link_type(t1$1, t2$1); + update_level(env.contents, t1$1.level, t2$1); + } + break; case /* Tconstr */ 3 : - const p1 = match._0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - unify2(env, t1$1, t2$1); - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - if (deep_occur(t2$1, t1$1)) { - unify2(env, t1$1, t2$1); - } else { - exit = 1; - } - break; - case /* Tconstr */ 3 : - if (match._1 || match$1._1) { - unify2(env, t1$1, t2$1); - } else { - const p2 = match$1._0; - if (same(p1, p2) && !(has_cached_expansion(p1, match._2.contents) || has_cached_expansion(p2, match$1._2.contents))) { - update_level(env.contents, t1$1.level, t2$1); - link_type(t1$1, t2$1); - } else if (env.contents.local_constraints && is_newtype(env.contents, p1) && is_newtype(env.contents, p2)) { - try { - if (Caml_obj.caml_lessthan(find_newtype_level(env.contents, p1), find_newtype_level(env.contents, p2))) { - unify(env, t1$1, try_expand_once(env.contents, t2$1)); - } else { - unify(env, try_expand_once(env.contents, t1$1), t2$1); - } - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Cannot_expand) { - unify2(env, t1$1, t2$1); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - } + const p1 = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + unify2(env, t1$1, t2$1); + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + if (deep_occur(t2$1, t1$1)) { + unify2(env, t1$1, t2$1); + } else { + exit = 1; + } + break; + case /* Tconstr */ 3 : + if (match._1 || match$1._1) { + unify2(env, t1$1, t2$1); + } else { + const p2 = match$1._0; + if (same(p1, p2) && !(has_cached_expansion(p1, match._2.contents) || has_cached_expansion(p2, match$1._2.contents))) { + update_level(env.contents, t1$1.level, t2$1); + link_type(t1$1, t2$1); + } else if (env.contents.local_constraints && is_newtype(env.contents, p1) && is_newtype(env.contents, p2)) { + try { + if (Caml_obj.caml_lessthan(find_newtype_level(env.contents, p1), find_newtype_level(env.contents, p2))) { + unify(env, t1$1, try_expand_once(env.contents, t2$1)); } else { + unify(env, try_expand_once(env.contents, t1$1), t2$1); + } + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Cannot_expand) { unify2(env, t1$1, t2$1); + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } } - break; - default: - unify2(env, t1$1, t2$1); - } + } else { + unify2(env, t1$1, t2$1); + } + } + break; + default: + unify2(env, t1$1, t2$1); } - break; + } + break; case /* Tunivar */ 9 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - unify2(env, t1$1, t2$1); - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit = 1; - break; - case /* Tunivar */ 9 : - unify_univar(t1$1, t2$1, univar_pairs.contents); - update_level(env.contents, t1$1.level, t2$1); - link_type(t1$1, t2$1); - break; - default: - unify2(env, t1$1, t2$1); - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + unify2(env, t1$1, t2$1); + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit = 1; + break; + case /* Tunivar */ 9 : + unify_univar(t1$1, t2$1, univar_pairs.contents); + update_level(env.contents, t1$1.level, t2$1); + link_type(t1$1, t2$1); + break; + default: + unify2(env, t1$1, t2$1); } - break; + } + break; default: exit = 1; } @@ -33819,40 +33819,40 @@ function unify3(env, t1, t1$p, t2, t2$p) { } else { switch (d1.TAG) { case /* Tvar */ 0 : - occur(env.contents, t1$p, t2); - occur_univar(env.contents, t2); - return link_type(t1$p, t2); + occur(env.contents, t1$p, t2); + occur_univar(env.contents, t2); + return link_type(t1$p, t2); case /* Tfield */ 5 : - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - exit = 1; - } else { - switch (d2.TAG) { - case /* Tvar */ 0 : - exit$1 = 2; - break; - case /* Tfield */ 5 : - return unify_fields(env, t1$p, t2$p); - default: - exit = 1; - } + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + exit = 1; + } else { + switch (d2.TAG) { + case /* Tvar */ 0 : + exit$1 = 2; + break; + case /* Tfield */ 5 : + return unify_fields(env, t1$p, t2$p); + default: + exit = 1; } - break; + } + break; case /* Tunivar */ 9 : - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - exit = 1; - } else { - switch (d2.TAG) { - case /* Tvar */ 0 : - exit$1 = 2; - break; - case /* Tunivar */ 9 : - unify_univar(t1$p, t2$p, univar_pairs.contents); - return link_type(t1$p, t2$p); - default: - exit = 1; - } + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + exit = 1; + } else { + switch (d2.TAG) { + case /* Tvar */ 0 : + exit$1 = 2; + break; + case /* Tunivar */ 9 : + unify_univar(t1$p, t2$p, univar_pairs.contents); + return link_type(t1$p, t2$p); + default: + exit = 1; } - break; + } + break; default: exit$1 = 2; } @@ -33888,14 +33888,14 @@ function unify3(env, t1, t1$p, t2, t2$p) { if (!/* tag */ (typeof d2 === "number" || typeof d2 === "string")) { switch (d2.TAG) { case /* Tconstr */ 3 : - exit$4 = 5; - break; + exit$4 = 5; + break; case /* Tfield */ 5 : - f = d2._0; - kind = d2._1; - rem = d2._3; - exit$2 = 3; - break; + f = d2._0; + kind = d2._1; + rem = d2._3; + exit$2 = 3; + break; default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -33907,278 +33907,327 @@ function unify3(env, t1, t1$p, t2, t2$p) { } else { switch (d1.TAG) { case /* Tarrow */ 1 : - const l1 = d1._0; - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (d2.TAG) { - case /* Tarrow */ 1 : - const l2 = d2._0; - if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { - unify(env, d1._1, d2._1); - unify(env, d1._2, d2._2); - const match$1 = commu_repr(d1._3); - const match$2 = commu_repr(d2._3); - let exit$5 = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit$5 = 6; - } else { - set_commu(match$1._0, match$2); - } - if (exit$5 === 6) { - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { - match$2 === /* Cok */ 0; - } else { - set_commu(match$2._0, match$1); - } - } - + const l1 = d1._0; + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (d2.TAG) { + case /* Tarrow */ 1 : + const l2 = d2._0; + if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { + unify(env, d1._1, d2._1); + unify(env, d1._2, d2._2); + const match$1 = commu_repr(d1._3); + const match$2 = commu_repr(d2._3); + let exit$5 = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit$5 = 6; + } else { + set_commu(match$1._0, match$2); + } + if (exit$5 === 6) { + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + match$2 === /* Cok */ 0; } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + set_commu(match$2._0, match$1); } - break; - case /* Tconstr */ 3 : - exit$4 = 5; - break; - default: + } + + } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - break; + } + break; + case /* Tconstr */ 3 : + exit$4 = 5; + break; + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; case /* Ttuple */ 2 : - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (d2.TAG) { + case /* Ttuple */ 2 : + unify_list(env, d1._0, d2._0); + break; + case /* Tconstr */ 3 : + exit$4 = 5; + break; + default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - switch (d2.TAG) { - case /* Ttuple */ 2 : - unify_list(env, d1._0, d2._0); - break; - case /* Tconstr */ 3 : - exit$4 = 5; - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + } + break; case /* Tconstr */ 3 : - const p1 = d1._0; - let exit$6 = 0; - if (/* tag */ typeof d2 === "number" || typeof d2 === "string" || d2.TAG !== /* Tconstr */ 3) { - exit$6 = 6; - } else { - const tl2 = d2._1; - const tl1 = d1._1; - if (same(p1, d2._0)) { - if (umode.contents === /* Expression */ 0 || !generate_equations.contents) { - unify_list(env, tl1, tl2); - } else if (assume_injective.contents) { - set_mode_pattern(true, false, (function (param) { - unify_list(env, tl1, tl2); - })); - } else { - let tmp = true; - if (!in_current_module(p1)) { - const partial_arg = env.contents; - tmp = Stdlib__List.exists((function (param) { - return expands_to_datatype(partial_arg, param); - }), { - hd: t1$p, + const p1 = d1._0; + let exit$6 = 0; + if (/* tag */ typeof d2 === "number" || typeof d2 === "string" || d2.TAG !== /* Tconstr */ 3) { + exit$6 = 6; + } else { + const tl2 = d2._1; + const tl1 = d1._1; + if (same(p1, d2._0)) { + if (umode.contents === /* Expression */ 0 || !generate_equations.contents) { + unify_list(env, tl1, tl2); + } else if (assume_injective.contents) { + set_mode_pattern(true, false, (function (param) { + unify_list(env, tl1, tl2); + })); + } else { + let tmp = true; + if (!in_current_module(p1)) { + const partial_arg = env.contents; + tmp = Stdlib__List.exists((function (param) { + return expands_to_datatype(partial_arg, param); + }), { + hd: t1$p, + tl: { + hd: t1, tl: { - hd: t1, - tl: { - hd: t2, - tl: /* [] */ 0 - } + hd: t2, + tl: /* [] */ 0 } - }); + } + }); + } + if (tmp) { + unify_list(env, tl1, tl2); + } else { + let inj; + try { + inj = Stdlib__List.map(Curry._1(Types_Variance.mem, /* Inj */ 3), find_type_full(p1, env.contents)[0].type_variance); } - if (tmp) { - unify_list(env, tl1, tl2); - } else { - let inj; - try { - inj = Stdlib__List.map(Curry._1(Types_Variance.mem, /* Inj */ 3), find_type_full(p1, env.contents)[0].type_variance); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - inj = Stdlib__List.map((function (param) { - return false; - }), tl1); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + inj = Stdlib__List.map((function (param) { + return false; + }), tl1); + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - Stdlib__List.iter2((function (i, param) { - const t2 = param[1]; - const t1 = param[0]; - if (i) { - return unify(env, t1, t2); - } else { - return set_mode_pattern(false, false, (function (param) { - const snap = snapshot(undefined); - try { - return unify(env, t1, t2); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - backtrack(snap); - reify(env, t1); - return reify(env, t2); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - })); - } - }), inj, Stdlib__List.combine(tl1, tl2)); } + Stdlib__List.iter2((function (i, param) { + const t2 = param[1]; + const t1 = param[0]; + if (i) { + return unify(env, t1, t2); + } else { + return set_mode_pattern(false, false, (function (param) { + const snap = snapshot(undefined); + try { + return unify(env, t1, t2); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + backtrack(snap); + reify(env, t1); + return reify(env, t2); + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + })); + } + }), inj, Stdlib__List.combine(tl1, tl2)); } - } else { - exit$6 = 6; } + } else { + exit$6 = 6; } - if (exit$6 === 6) { - switch (p1.TAG) { - case /* Pident */ 0 : - if (d1._1) { - exit$4 = 5; - } else { - const p = p1._0; - let exit$7 = 0; - if (/* tag */ typeof d2 === "number" || typeof d2 === "string" || d2.TAG !== /* Tconstr */ 3) { - exit$7 = 7; - } else { - const path$p = d2._0; - switch (path$p.TAG) { - case /* Pident */ 0 : - if (d2._1 || !(is_newtype(env.contents, p1) && is_newtype(env.contents, path$p) && generate_equations.contents)) { - exit$7 = 7; - } else { - const match$3 = Caml_obj.caml_greaterthan(find_newtype_level(env.contents, p1), find_newtype_level(env.contents, path$p)) ? [ - p, - t2$p - ] : [ - path$p._0, - t1$p - ]; - add_gadt_equation(env, match$3[0], match$3[1]); - } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - exit$7 = 7; - break; - - } - } - if (exit$7 === 7) { - if (is_newtype(env.contents, p1) && generate_equations.contents) { - reify(env, t2$p); - add_gadt_equation(env, p, t2$p); + } + if (exit$6 === 6) { + switch (p1.TAG) { + case /* Pident */ 0 : + if (d1._1) { + exit$4 = 5; + } else { + const p = p1._0; + let exit$7 = 0; + if (/* tag */ typeof d2 === "number" || typeof d2 === "string" || d2.TAG !== /* Tconstr */ 3) { + exit$7 = 7; + } else { + const path$p = d2._0; + switch (path$p.TAG) { + case /* Pident */ 0 : + if (d2._1 || !(is_newtype(env.contents, p1) && is_newtype(env.contents, path$p) && generate_equations.contents)) { + exit$7 = 7; } else { - exit$4 = 5; + const match$3 = Caml_obj.caml_greaterthan(find_newtype_level(env.contents, p1), find_newtype_level(env.contents, path$p)) ? [ + p, + t2$p + ] : [ + path$p._0, + t1$p + ]; + add_gadt_equation(env, match$3[0], match$3[1]); } - } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + exit$7 = 7; + break; } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - exit$4 = 5; - break; - - } + } + if (exit$7 === 7) { + if (is_newtype(env.contents, p1) && generate_equations.contents) { + reify(env, t2$p); + add_gadt_equation(env, p, t2$p); + } else { + exit$4 = 5; + } + } + + } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + exit$4 = 5; + break; + } - break; + } + break; case /* Tobject */ 4 : - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (d2.TAG) { - case /* Tconstr */ 3 : - exit$4 = 5; - break; - case /* Tobject */ 4 : - unify_fields(env, d1._0, d2._0); - const match$4 = repr(t2$p).desc; - if (!/* tag */ (typeof match$4 === "number" || typeof match$4 === "string") && match$4.TAG === /* Tobject */ 4) { - let exit$8 = 0; - const match$5 = match$4._1.contents; - if (match$5 !== undefined) { - const match$6 = match$5[1]; - if (match$6) { - const match$7 = repr(match$6.hd).desc; - let tmp$1; - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (d2.TAG) { + case /* Tconstr */ 3 : + exit$4 = 5; + break; + case /* Tobject */ 4 : + unify_fields(env, d1._0, d2._0); + const match$4 = repr(t2$p).desc; + if (!/* tag */ (typeof match$4 === "number" || typeof match$4 === "string") && match$4.TAG === /* Tobject */ 4) { + let exit$8 = 0; + const match$5 = match$4._1.contents; + if (match$5 !== undefined) { + const match$6 = match$5[1]; + if (match$6) { + const match$7 = repr(match$6.hd).desc; + let tmp$1; + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + tmp$1 = true; + } else { + switch (match$7.TAG) { + case /* Tvar */ 0 : + case /* Tunivar */ 9 : tmp$1 = true; - } else { - switch (match$7.TAG) { - case /* Tvar */ 0 : - case /* Tunivar */ 9 : - tmp$1 = true; - break; - default: - tmp$1 = false; - } - } - if (!tmp$1) { - exit$8 = 6; - } - - } else { - exit$8 = 6; + break; + default: + tmp$1 = false; } - } else { - exit$8 = 6; } - if (exit$8 === 6) { - set_name(match$4._1, d1._1.contents); + if (!tmp$1) { + exit$8 = 6; } + } else { + exit$8 = 6; } - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - break; + } else { + exit$8 = 6; + } + if (exit$8 === 6) { + set_name(match$4._1, d1._1.contents); + } + + } + break; + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; case /* Tfield */ 5 : - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - f = d1._0; - kind = d1._1; - rem = d1._3; - exit$2 = 3; - } else if (d2.TAG === /* Tconstr */ 3) { + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + f = d1._0; + kind = d1._1; + rem = d1._3; + exit$2 = 3; + } else if (d2.TAG === /* Tconstr */ 3) { + exit$4 = 5; + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tvariant */ 8 : + const row1 = d1._0; + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (d2.TAG) { + case /* Tconstr */ 3 : exit$4 = 5; - } else { + break; + case /* Tvariant */ 8 : + const row2 = d2._0; + if (umode.contents === /* Expression */ 0) { + unify_row(env, row1, row2); + } else { + const snap = snapshot(undefined); + try { + unify_row(env, row1, row2); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Unify) { + backtrack(snap); + reify(env, t1$p); + reify(env, t2$p); + if (generate_equations.contents) { + mcomp$1(env.contents, t1$p, t2$p); + } + + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + } + } + break; + default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - break; - case /* Tvariant */ 8 : - const row1 = d1._0; + } + break; + case /* Tpoly */ 10 : + const tl1$1 = d1._1; + const t1$1 = d1._0; + let exit$9 = 0; + if (tl1$1) { + exit$9 = 6; + } else { if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -34187,97 +34236,23 @@ function unify3(env, t1, t1$p, t2, t2$p) { } switch (d2.TAG) { case /* Tconstr */ 3 : - exit$4 = 5; - break; - case /* Tvariant */ 8 : - const row2 = d2._0; - if (umode.contents === /* Expression */ 0) { - unify_row(env, row1, row2); - } else { - const snap = snapshot(undefined); - try { - unify_row(env, row1, row2); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Unify) { - backtrack(snap); - reify(env, t1$p); - reify(env, t2$p); - if (generate_equations.contents) { - mcomp$1(env.contents, t1$p, t2$p); - } - - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - } - } - break; + exit$4 = 5; + break; + case /* Tpoly */ 10 : + if (d2._1) { + exit$9 = 6; + } else { + unify(env, t1$1, d2._0); + } + break; default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; - case /* Tpoly */ 10 : - const tl1$1 = d1._1; - const t1$1 = d1._0; - let exit$9 = 0; - if (tl1$1) { - exit$9 = 6; - } else { - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (d2.TAG) { - case /* Tconstr */ 3 : - exit$4 = 5; - break; - case /* Tpoly */ 10 : - if (d2._1) { - exit$9 = 6; - } else { - unify(env, t1$1, d2._0); - } - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - if (exit$9 === 6) { - if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - switch (d2.TAG) { - case /* Tconstr */ 3 : - exit$4 = 5; - break; - case /* Tpoly */ 10 : - enter_poly(env.contents, univar_pairs, t1$1, tl1$1, d2._0, d2._1, (function (param, param$1) { - return unify(env, param, param$1); - })); - break; - default: - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - break; - case /* Tpackage */ 11 : - const tl1$2 = d1._2; + } + if (exit$9 === 6) { if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -34286,39 +34261,64 @@ function unify3(env, t1, t1$p, t2, t2$p) { } switch (d2.TAG) { case /* Tconstr */ 3 : - exit$4 = 5; - break; - case /* Tpackage */ 11 : - const tl2$1 = d2._2; - try { - unify_package(env.contents, (function (param, param$1) { - return unify_list(env, param, param$1); - }), t1.level, d1._0, d1._1, tl1$2, t2.level, d2._0, d2._1, tl2$1); - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - if (umode.contents === /* Expression */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - Stdlib__List.iter((function (param) { - return reify(env, param); - }), Stdlib.$at(tl1$2, tl2$1)); - } else { - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - } - break; + exit$4 = 5; + break; + case /* Tpoly */ 10 : + enter_poly(env.contents, univar_pairs, t1$1, tl1$1, d2._0, d2._1, (function (param, param$1) { + return unify(env, param, param$1); + })); + break; default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; + } + break; + case /* Tpackage */ 11 : + const tl1$2 = d1._2; + if (/* tag */ typeof d2 === "number" || typeof d2 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + switch (d2.TAG) { + case /* Tconstr */ 3 : + exit$4 = 5; + break; + case /* Tpackage */ 11 : + const tl2$1 = d2._2; + try { + unify_package(env.contents, (function (param, param$1) { + return unify_list(env, param, param$1); + }), t1.level, d1._0, d1._1, tl1$2, t2.level, d2._0, d2._1, tl2$1); + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + if (umode.contents === /* Expression */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + Stdlib__List.iter((function (param) { + return reify(env, param); + }), Stdlib.$at(tl1$2, tl2$1)); + } else { + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + } + break; + default: + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; default: exit$4 = 5; } @@ -34330,17 +34330,17 @@ function unify3(env, t1, t1$p, t2, t2$p) { const path = d2._0; switch (path.TAG) { case /* Pident */ 0 : - if (d2._1 || !(is_newtype(env.contents, path) && generate_equations.contents)) { - exit$2 = 2; - } else { - reify(env, t1$p); - add_gadt_equation(env, path._0, t1$p); - } - break; + if (d2._1 || !(is_newtype(env.contents, path) && generate_equations.contents)) { + exit$2 = 2; + } else { + reify(env, t1$p); + add_gadt_equation(env, path._0, t1$p); + } + break; case /* Pdot */ 1 : case /* Papply */ 2 : - exit$2 = 2; - break; + exit$2 = 2; + break; } } @@ -34363,47 +34363,47 @@ function unify3(env, t1, t1$p, t2, t2$p) { } switch (exit$2) { case 2 : - if (umode.contents === /* Pattern */ 1) { - reify(env, t1$p); - reify(env, t2$p); - if (generate_equations.contents) { - mcomp$1(env.contents, t1$p, t2$p); - } - - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + if (umode.contents === /* Pattern */ 1) { + reify(env, t1$p); + reify(env, t2$p); + if (generate_equations.contents) { + mcomp$1(env.contents, t1$p, t2$p); } - break; + + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; case 3 : - const r = field_kind_repr(kind); - if (/* tag */ typeof r === "number" || typeof r === "string") { - if (r === /* Fpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } + const r = field_kind_repr(kind); + if (/* tag */ typeof r === "number" || typeof r === "string") { + if (r === /* Fpresent */ 0) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } else if (f !== dummy_method) { - set_kind(r._0, /* Fabsent */ 1); - if (Caml_obj.caml_equal(d2, /* Tnil */ 0)) { - unify(env, rem, t2$p); - } else { - unify(env, newty2(rem.level, /* Tnil */ 0), rem); - } + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } else if (f !== dummy_method) { + set_kind(r._0, /* Fabsent */ 1); + if (Caml_obj.caml_equal(d2, /* Tnil */ 0)) { + unify(env, rem, t2$p); } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + unify(env, newty2(rem.level, /* Tnil */ 0), rem); } - break; + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; } if (!create_recursion) { @@ -34542,39 +34542,39 @@ function filter_arrow(env, t, l) { } switch (match.TAG) { case /* Tvar */ 0 : - const lv = t$1.level; - const t1 = newty2(lv, { - TAG: /* Tvar */ 0, - _0: undefined - }); - const t2 = newty2(lv, { - TAG: /* Tvar */ 0, - _0: undefined - }); - const t$p = newty2(lv, { - TAG: /* Tarrow */ 1, - _0: l, - _1: t1, - _2: t2, - _3: /* Cok */ 0 - }); - link_type(t$1, t$p); + const lv = t$1.level; + const t1 = newty2(lv, { + TAG: /* Tvar */ 0, + _0: undefined + }); + const t2 = newty2(lv, { + TAG: /* Tvar */ 0, + _0: undefined + }); + const t$p = newty2(lv, { + TAG: /* Tarrow */ 1, + _0: l, + _1: t1, + _2: t2, + _3: /* Cok */ 0 + }); + link_type(t$1, t$p); + return [ + t1, + t2 + ]; + case /* Tarrow */ 1 : + const l$p = match._0; + if (l === l$p || classic.contents && l === "" && !is_optional(l$p)) { return [ - t1, - t2 + match._1, + match._2 ]; - case /* Tarrow */ 1 : - const l$p = match._0; - if (l === l$p || classic.contents && l === "" && !is_optional(l$p)) { - return [ - match._1, - match._2 - ]; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -34596,41 +34596,41 @@ function filter_method_field(env, name, priv, _ty) { } switch (match.TAG) { case /* Tvar */ 0 : - const level = ty$1.level; - const ty1 = newty2(level, { - TAG: /* Tvar */ 0, - _0: undefined - }); - const ty2 = newty2(level, { - TAG: /* Tvar */ 0, - _0: undefined - }); - let tmp; - tmp = priv === /* Private */ 0 ? ({ - TAG: /* Fvar */ 0, - _0: { - contents: undefined - } - }) : /* Fpresent */ 0; - const ty$p = newty2(level, { - TAG: /* Tfield */ 5, - _0: name, - _1: tmp, - _2: ty1, - _3: ty2 - }); - link_type(ty$1, ty$p); - return ty1; - case /* Tfield */ 5 : - const kind = field_kind_repr(match._1); - if (match._0 === name && Caml_obj.caml_notequal(kind, /* Fabsent */ 1)) { - if (priv === /* Public */ 1) { - unify_kind(kind, /* Fpresent */ 0); + const level = ty$1.level; + const ty1 = newty2(level, { + TAG: /* Tvar */ 0, + _0: undefined + }); + const ty2 = newty2(level, { + TAG: /* Tvar */ 0, + _0: undefined + }); + let tmp; + tmp = priv === /* Private */ 0 ? ({ + TAG: /* Fvar */ 0, + _0: { + contents: undefined } - return match._2; + }) : /* Fpresent */ 0; + const ty$p = newty2(level, { + TAG: /* Tfield */ 5, + _0: name, + _1: tmp, + _2: ty1, + _3: ty2 + }); + link_type(ty$1, ty$p); + return ty1; + case /* Tfield */ 5 : + const kind = field_kind_repr(match._1); + if (match._0 === name && Caml_obj.caml_notequal(kind, /* Fabsent */ 1)) { + if (priv === /* Public */ 1) { + unify_kind(kind, /* Fpresent */ 0); } - _ty = match._3; - continue; + return match._2; + } + _ty = match._3; + continue; default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -34651,13 +34651,13 @@ function filter_method(env, name, priv, ty) { } switch (match.TAG) { case /* Tvar */ 0 : - const ty1 = newvar(undefined, undefined); - const ty$p = newobj(ty1); - update_level(env, ty$1.level, ty$p); - link_type(ty$1, ty$p); - return filter_method_field(env, name, priv, ty1); + const ty1 = newvar(undefined, undefined); + const ty$p = newobj(ty1); + update_level(env, ty$1.level, ty$p); + link_type(ty$1, ty$p); + return filter_method_field(env, name, priv, ty1); case /* Tobject */ 4 : - return filter_method_field(env, name, priv, match._0); + return filter_method_field(env, name, priv, match._0); default: throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -34757,23 +34757,23 @@ function moregen(inst_nongen, type_pairs, env, t1, t2) { } else { switch (match.TAG) { case /* Tvar */ 0 : - if (may_instantiate(inst_nongen, t1$1)) { - moregen_occur(env, t1$1.level, t2$1); - occur(env, t1$1, t2$1); - return link_type(t1$1, t2$1); + if (may_instantiate(inst_nongen, t1$1)) { + moregen_occur(env, t1$1.level, t2$1); + occur(env, t1$1, t2$1); + return link_type(t1$1, t2$1); + } + exit = 1; + break; + case /* Tconstr */ 3 : + if (match._1 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && !match$1._1)) { + exit = 1; + } else { + if (same(match._0, match$1._0)) { + return; } exit = 1; - break; - case /* Tconstr */ 3 : - if (match._1 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && !match$1._1)) { - exit = 1; - } else { - if (same(match._0, match$1._0)) { - return; - } - exit = 1; - } - break; + } + break; default: exit = 1; } @@ -34812,231 +34812,254 @@ function moregen(inst_nongen, type_pairs, env, t1, t2) { } switch (match$2.TAG) { case /* Tvar */ 0 : - if (may_instantiate(inst_nongen, t1$p$1)) { - moregen_occur(env, t1$p$1.level, t2$1); - return link_type(t1$p$1, t2$1); - } + if (may_instantiate(inst_nongen, t1$p$1)) { + moregen_occur(env, t1$p$1.level, t2$1); + return link_type(t1$p$1, t2$1); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tarrow */ 1 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - case /* Tarrow */ 1 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tarrow */ 1) { - const l2 = match$3._0; - const l1 = match$2._0; - if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { - moregen(inst_nongen, type_pairs, env, match$2._1, match$3._1); - return moregen(inst_nongen, type_pairs, env, match$2._2, match$3._2); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } + if (match$3.TAG === /* Tarrow */ 1) { + const l2 = match$3._0; + const l1 = match$2._0; + if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { + moregen(inst_nongen, type_pairs, env, match$2._1, match$3._1); + return moregen(inst_nongen, type_pairs, env, match$2._2, match$3._2); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Ttuple */ 2 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Ttuple */ 2) { - return moregen_list(inst_nongen, type_pairs, env, match$2._0, match$3._0); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Ttuple */ 2) { + return moregen_list(inst_nongen, type_pairs, env, match$2._0, match$3._0); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tconstr */ 3 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tconstr */ 3) { - if (same(match$2._0, match$3._0)) { - return moregen_list(inst_nongen, type_pairs, env, match$2._1, match$3._1); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tconstr */ 3) { + if (same(match$2._0, match$3._0)) { + return moregen_list(inst_nongen, type_pairs, env, match$2._1, match$3._1); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tobject */ 4 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tobject */ 4) { - return moregen_fields(inst_nongen, type_pairs, env, match$2._0, match$3._0); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Tobject */ 4) { + return moregen_fields(inst_nongen, type_pairs, env, match$2._0, match$3._0); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tfield */ 5 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tfield */ 5) { - return moregen_fields(inst_nongen, type_pairs, env, t1$p$1, t2$p$1); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Tfield */ 5) { + return moregen_fields(inst_nongen, type_pairs, env, t1$p$1, t2$p$1); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tlink */ 6 : case /* Tsubst */ 7 : + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tvariant */ 8 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - case /* Tvariant */ 8 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + } + if (match$3.TAG === /* Tvariant */ 8) { + let row1 = match$2._0; + let row2 = match$3._0; + const row1$1 = row_repr_aux(/* [] */ 0, row1); + const row2$1 = row_repr_aux(/* [] */ 0, row2); + const rm1 = repr(row1$1.row_more); + const rm2 = repr(row2$1.row_more); + if (rm1 === rm2) { + return; + } + const may_inst = is_Tvar(rm1) && may_instantiate(inst_nongen, rm1) || Caml_obj.caml_equal(rm1.desc, /* Tnil */ 0); + const match$4 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); + const r2 = match$4[1]; + const r1 = match$4[0]; + const match$5 = row2$1.row_closed ? [ + filter_row_fields(may_inst, r1), + filter_row_fields(false, r2) + ] : [ + r1, + r2 + ]; + const r2$1 = match$5[1]; + if (Caml_obj.caml_notequal(match$5[0], /* [] */ 0) || row1$1.row_closed && (!row2$1.row_closed || Caml_obj.caml_notequal(r2$1, /* [] */ 0))) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$3.TAG === /* Tvariant */ 8) { - let row1 = match$2._0; - let row2 = match$3._0; - const row1$1 = row_repr_aux(/* [] */ 0, row1); - const row2$1 = row_repr_aux(/* [] */ 0, row2); - const rm1 = repr(row1$1.row_more); - const rm2 = repr(row2$1.row_more); - if (rm1 === rm2) { - return; + const match$6 = rm1.desc; + const match$7 = rm2.desc; + let exit$1 = 0; + let exit$2 = 0; + if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string" || match$6.TAG !== /* Tunivar */ 9) { + exit$2 = 2; + } else { + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - const may_inst = is_Tvar(rm1) && may_instantiate(inst_nongen, rm1) || Caml_obj.caml_equal(rm1.desc, /* Tnil */ 0); - const match$4 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); - const r2 = match$4[1]; - const r1 = match$4[0]; - const match$5 = row2$1.row_closed ? [ - filter_row_fields(may_inst, r1), - filter_row_fields(false, r2) - ] : [ - r1, - r2 - ]; - const r2$1 = match$5[1]; - if (Caml_obj.caml_notequal(match$5[0], /* [] */ 0) || row1$1.row_closed && (!row2$1.row_closed || Caml_obj.caml_notequal(r2$1, /* [] */ 0))) { + if (match$7.TAG === /* Tunivar */ 9) { + unify_univar(rm1, rm2, univar_pairs.contents); + } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - const match$6 = rm1.desc; - const match$7 = rm2.desc; - let exit$1 = 0; - let exit$2 = 0; - if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string" || match$6.TAG !== /* Tunivar */ 9) { - exit$2 = 2; + } + if (exit$2 === 2) { + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + exit$1 = 1; } else { - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + if (match$7.TAG === /* Tunivar */ 9) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$7.TAG === /* Tunivar */ 9) { - unify_univar(rm1, rm2, univar_pairs.contents); - } else { + exit$1 = 1; + } + } + if (exit$1 === 1 && !static_row(row1$1)) { + if (may_inst) { + const ext = newty2(100000000, { + TAG: /* Tvariant */ 8, + _0: { + row_fields: r2$1, + row_more: row2$1.row_more, + row_bound: row2$1.row_bound, + row_closed: row2$1.row_closed, + row_fixed: row2$1.row_fixed, + row_name: row2$1.row_name + } + }); + moregen_occur(env, rm1.level, ext); + link_type(rm1, ext); + } else { + if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - } - if (exit$2 === 2) { - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { - exit$1 = 1; - } else { - if (match$7.TAG === /* Tunivar */ 9) { + if (match$6.TAG === /* Tconstr */ 3) { + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - exit$1 = 1; - } - } - if (exit$1 === 1 && !static_row(row1$1)) { - if (may_inst) { - const ext = newty2(100000000, { - TAG: /* Tvariant */ 8, - _0: { - row_fields: r2$1, - row_more: row2$1.row_more, - row_bound: row2$1.row_bound, - row_closed: row2$1.row_closed, - row_fixed: row2$1.row_fixed, - row_name: row2$1.row_name - } - }); - moregen_occur(env, rm1.level, ext); - link_type(rm1, ext); - } else { - if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { + if (match$7.TAG === /* Tconstr */ 3) { + moregen(inst_nongen, type_pairs, env, rm1, rm2); + } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$6.TAG === /* Tconstr */ 3) { - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } + } + return Stdlib__List.iter((function (param) { + const f1 = row_field_repr_aux(/* [] */ 0, param[1]); + const f2 = row_field_repr_aux(/* [] */ 0, param[2]); + if (f1 === f2) { + return; + } + if (/* tag */ typeof f1 === "number" || typeof f1 === "string") { + if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { + return; } - if (match$7.TAG === /* Tconstr */ 3) { - moregen(inst_nongen, type_pairs, env, rm1, rm2); - } else { + if (f2.TAG === /* Rpresent */ 0) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } - } - } - return Stdlib__List.iter((function (param) { - const f1 = row_field_repr_aux(/* [] */ 0, param[1]); - const f2 = row_field_repr_aux(/* [] */ 0, param[2]); - if (f1 === f2) { - return; - } - if (/* tag */ typeof f1 === "number" || typeof f1 === "string") { + } else if (f1.TAG === /* Rpresent */ 0) { + const t1 = f1._0; + if (t1 !== undefined) { if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { - return; + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } if (f2.TAG === /* Rpresent */ 0) { + const t2 = f2._0; + if (t2 !== undefined) { + return moregen(inst_nongen, type_pairs, env, t1, t2); + } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 @@ -35046,235 +35069,212 @@ function moregen(inst_nongen, type_pairs, env, t1, t2) { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } else if (f1.TAG === /* Rpresent */ 0) { - const t1 = f1._0; - if (t1 !== undefined) { - if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (f2.TAG === /* Rpresent */ 0) { - const t2 = f2._0; - if (t2 !== undefined) { - return moregen(inst_nongen, type_pairs, env, t1, t2); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } + } else { + if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } else { - if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (f2.TAG === /* Rpresent */ 0) { - if (f2._0 === undefined) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } + if (f2.TAG === /* Rpresent */ 0) { + if (f2._0 === undefined) { + return; } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - } else { - const c1 = f1._0; - if (c1) { - if (!f1._1 && !/* tag */ (typeof f2 === "number" || typeof f2 === "string") && f2.TAG === /* Rpresent */ 0) { - if (f2._0 !== undefined) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (may_inst) { - return set_row_field(f1._3, f2); - } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } else { + const c1 = f1._0; + if (c1) { + if (!f1._1 && !/* tag */ (typeof f2 === "number" || typeof f2 === "string") && f2.TAG === /* Rpresent */ 0) { + if (f2._0 !== undefined) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - - } else if (!/* tag */ (typeof f2 === "number" || typeof f2 === "string") && f2.TAG === /* Rpresent */ 0) { - const t2$1 = f2._0; - if (t2$1 !== undefined) { - if (may_inst) { - set_row_field(f1._3, f2); - return Stdlib__List.iter((function (t1) { - moregen(inst_nongen, type_pairs, env, t1, t2$1); - }), f1._1); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + if (may_inst) { + return set_row_field(f1._3, f2); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - const e1 = f1._3; - const tl1 = f1._1; - if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { + + } else if (!/* tag */ (typeof f2 === "number" || typeof f2 === "string") && f2.TAG === /* Rpresent */ 0) { + const t2$1 = f2._0; + if (t2$1 !== undefined) { if (may_inst) { - return set_row_field(e1, f2); + set_row_field(f1._3, f2); + return Stdlib__List.iter((function (t1) { + moregen(inst_nongen, type_pairs, env, t1, t2$1); + }), f1._1); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (f2.TAG === /* Rpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - const e2 = f2._3; - if (e1 === e2) { - return; - } - const tl2 = f2._1; - const c2 = f2._0; - if (c1 && !c2) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - set_row_field(e1, { - TAG: /* Reither */ 1, - _0: c2, - _1: /* [] */ 0, - _2: f2._2, - _3: e2 + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 }); - if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2)) { - return Stdlib__List.iter2((function (param, param$1) { - return moregen(inst_nongen, type_pairs, env, param, param$1); - }), tl1, tl2); - } - if (tl2) { - const t2$2 = tl2.hd; - return Stdlib__List.iter((function (t1) { - moregen(inst_nongen, type_pairs, env, t1, t2$2); - }), tl1); - } - if (!Caml_obj.caml_notequal(tl1, /* [] */ 0)) { - return; + } + const e1 = f1._3; + const tl1 = f1._1; + if (/* tag */ typeof f2 === "number" || typeof f2 === "string") { + if (may_inst) { + return set_row_field(e1, f2); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - }), match$4[2]); - } + if (f2.TAG === /* Rpresent */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + const e2 = f2._3; + if (e1 === e2) { + return; + } + const tl2 = f2._1; + const c2 = f2._0; + if (c1 && !c2) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + set_row_field(e1, { + TAG: /* Reither */ 1, + _0: c2, + _1: /* [] */ 0, + _2: f2._2, + _3: e2 + }); + if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2)) { + return Stdlib__List.iter2((function (param, param$1) { + return moregen(inst_nongen, type_pairs, env, param, param$1); + }), tl1, tl2); + } + if (tl2) { + const t2$2 = tl2.hd; + return Stdlib__List.iter((function (t1) { + moregen(inst_nongen, type_pairs, env, t1, t2$2); + }), tl1); + } + if (!Caml_obj.caml_notequal(tl1, /* [] */ 0)) { + return; + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + }), match$4[2]); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tunivar */ 9 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - case /* Tunivar */ 9 : + } + if (match$3.TAG === /* Tunivar */ 9) { + return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tpoly */ 10 : + const tl1 = match$2._1; + const t1$2 = match$2._0; + let exit$3 = 0; + if (tl1) { + exit$3 = 2; + } else { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$3.TAG === /* Tunivar */ 9) { - return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - case /* Tpoly */ 10 : - const tl1 = match$2._1; - const t1$2 = match$2._0; - let exit$3 = 0; - if (tl1) { + if (match$3.TAG === /* Tpoly */ 10) { + if (!match$3._1) { + return moregen(inst_nongen, type_pairs, env, t1$2, match$3._0); + } exit$3 = 2; } else { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tpoly */ 10) { - if (!match$3._1) { - return moregen(inst_nongen, type_pairs, env, t1$2, match$3._0); - } - exit$3 = 2; - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - if (exit$3 === 2) { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tpoly */ 10) { - return enter_poly(env, univar_pairs, t1$2, tl1, match$3._0, match$3._1, (function (param, param$1) { - return moregen(inst_nongen, type_pairs, env, param, param$1); - })); - } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; - case /* Tpackage */ 11 : + } + if (exit$3 === 2) { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$3.TAG === /* Tpackage */ 11) { - try { - return unify_package(env, (function (param, param$1) { - return moregen_list(inst_nongen, type_pairs, env, param, param$1); - }), t1$p$1.level, match$2._0, match$2._1, match$2._2, t2$p$1.level, match$3._0, match$3._1, match$3._2); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + if (match$3.TAG === /* Tpoly */ 10) { + return enter_poly(env, univar_pairs, t1$2, tl1, match$3._0, match$3._1, (function (param, param$1) { + return moregen(inst_nongen, type_pairs, env, param, param$1); + })); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tpackage */ 11 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tpackage */ 11) { + try { + return unify_package(env, (function (param, param$1) { + return moregen_list(inst_nongen, type_pairs, env, param, param$1); + }), t1$p$1.level, match$2._0, match$2._1, match$2._2, t2$p$1.level, match$3._0, match$3._1, match$3._2); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } } } else { @@ -35455,44 +35455,44 @@ function rigidify_rec(vars, _ty) { } switch (row.TAG) { case /* Tvar */ 0 : - if (!Stdlib__List.memq(ty$1, vars.contents)) { - vars.contents = { - hd: ty$1, - tl: vars.contents - }; - return; - } else { - return; - } + if (!Stdlib__List.memq(ty$1, vars.contents)) { + vars.contents = { + hd: ty$1, + tl: vars.contents + }; + return; + } else { + return; + } case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const more = repr(row$1.row_more); - if (is_Tvar(more) && !row_fixed(row$1)) { - const more$p = newty2(more.level, more.desc); - const row$p_row_bound = row$1.row_bound; - const row$p_row_closed = row$1.row_closed; - const row$p_row_name = row$1.row_name; - const row$p = { - row_fields: /* [] */ 0, - row_more: more$p, - row_bound: row$p_row_bound, - row_closed: row$p_row_closed, - row_fixed: true, - row_name: row$p_row_name - }; - link_type(more, newty2(ty$1.level, { - TAG: /* Tvariant */ 8, - _0: row$p - })); - } - iter_row((function (param) { - return rigidify_rec(vars, param); - }), row$1); - if (static_row(row$1)) { - return; - } - _ty = row_more(row$1); - continue; + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const more = repr(row$1.row_more); + if (is_Tvar(more) && !row_fixed(row$1)) { + const more$p = newty2(more.level, more.desc); + const row$p_row_bound = row$1.row_bound; + const row$p_row_closed = row$1.row_closed; + const row$p_row_name = row$1.row_name; + const row$p = { + row_fields: /* [] */ 0, + row_more: more$p, + row_bound: row$p_row_bound, + row_closed: row$p_row_closed, + row_fixed: true, + row_name: row$p_row_name + }; + link_type(more, newty2(ty$1.level, { + TAG: /* Tvariant */ 8, + _0: row$p + })); + } + iter_row((function (param) { + return rigidify_rec(vars, param); + }), row$1); + if (static_row(row$1)) { + return; + } + _ty = row_more(row$1); + continue; default: return iter_type_expr((function (param) { return rigidify_rec(vars, param); @@ -35595,53 +35595,53 @@ function eqtype(rename, type_pairs, subst, env, t1, t2) { } else { switch (match.TAG) { case /* Tvar */ 0 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tvar */ 0 && rename)) { - exit = 1; - } else { - try { - normalize_subst(subst); - if (Stdlib__List.assq(t1$1, subst.contents) === t2$1) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tvar */ 0 && rename)) { + exit = 1; + } else { + try { + normalize_subst(subst); + if (Stdlib__List.assq(t1$1, subst.contents) === t2$1) { + return; } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - if (Stdlib__List.exists((function (param) { - return param[1] === t2$1; - }), subst.contents)) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - subst.contents = { - hd: [ - t1$1, - t2$1 - ], - tl: subst.contents - }; - return; + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + if (Stdlib__List.exists((function (param) { + return param[1] === t2$1; + }), subst.contents)) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + subst.contents = { + hd: [ + t1$1, + t2$1 + ], + tl: subst.contents + }; + return; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - break; + } + break; case /* Tconstr */ 3 : - if (match._1 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && !match$1._1)) { - exit = 1; - } else { - if (same(match._0, match$1._0)) { - return; - } - exit = 1; + if (match._1 || /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || !(match$1.TAG === /* Tconstr */ 3 && !match$1._1)) { + exit = 1; + } else { + if (same(match._0, match$1._0)) { + return; } - break; + exit = 1; + } + break; default: exit = 1; } @@ -35680,189 +35680,212 @@ function eqtype(rename, type_pairs, subst, env, t1, t2) { } switch (match$2.TAG) { case /* Tvar */ 0 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tvar */ 0) { - if (rename) { - try { - normalize_subst(subst); - if (Stdlib__List.assq(t1$p$1, subst.contents) === t2$p$1) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - if (Stdlib__List.exists((function (param) { - return param[1] === t2$p$1; - }), subst.contents)) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - subst.contents = { - hd: [ - t1$p$1, - t2$p$1 - ], - tl: subst.contents - }; - return; - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tvar */ 0) { + if (rename) { + try { + normalize_subst(subst); + if (Stdlib__List.assq(t1$p$1, subst.contents) === t2$p$1) { + return; } - } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + if (Stdlib__List.exists((function (param) { + return param[1] === t2$p$1; + }), subst.contents)) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + subst.contents = { + hd: [ + t1$p$1, + t2$p$1 + ], + tl: subst.contents + }; + return; + } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } } else { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - case /* Tarrow */ 1 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tarrow */ 1) { - const l2 = match$3._0; - const l1 = match$2._0; - if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { - eqtype(rename, type_pairs, subst, env, match$2._1, match$3._1); - return eqtype(rename, type_pairs, subst, env, match$2._2, match$3._2); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + case /* Tarrow */ 1 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tarrow */ 1) { + const l2 = match$3._0; + const l1 = match$2._0; + if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { + eqtype(rename, type_pairs, subst, env, match$2._1, match$3._1); + return eqtype(rename, type_pairs, subst, env, match$2._2, match$3._2); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Ttuple */ 2 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Ttuple */ 2) { - return eqtype_list(rename, type_pairs, subst, env, match$2._0, match$3._0); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Ttuple */ 2) { + return eqtype_list(rename, type_pairs, subst, env, match$2._0, match$3._0); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tconstr */ 3 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tconstr */ 3) { - if (same(match$2._0, match$3._0)) { - return eqtype_list(rename, type_pairs, subst, env, match$2._1, match$3._1); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tconstr */ 3) { + if (same(match$2._0, match$3._0)) { + return eqtype_list(rename, type_pairs, subst, env, match$2._1, match$3._1); } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tobject */ 4 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tobject */ 4) { - return eqtype_fields(rename, type_pairs, subst, env, match$2._0, match$3._0); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Tobject */ 4) { + return eqtype_fields(rename, type_pairs, subst, env, match$2._0, match$3._0); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tfield */ 5 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tfield */ 5) { - return eqtype_fields(rename, type_pairs, subst, env, t1$p$1, t2$p$1); - } + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); + } + if (match$3.TAG === /* Tfield */ 5) { + return eqtype_fields(rename, type_pairs, subst, env, t1$p$1, t2$p$1); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); case /* Tlink */ 6 : case /* Tsubst */ 7 : + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tvariant */ 8 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - case /* Tvariant */ 8 : - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tvariant */ 8) { - let row1 = match$2._0; - let _row2 = match$3._0; - while (true) { - const row2 = _row2; - const match$4 = expand_head_rigid(env, row_more(row2)); - const row2$1 = match$4.desc; - if (!/* tag */ (typeof row2$1 === "number" || typeof row2$1 === "string") && row2$1.TAG === /* Tvariant */ 8) { - _row2 = row2$1._0; - continue; - } - const row1$1 = row_repr_aux(/* [] */ 0, row1); - const row2$2 = row_repr_aux(/* [] */ 0, row2); - const match$5 = merge_row_fields(row1$1.row_fields, row2$2.row_fields); - const r2 = match$5[1]; - const r1 = match$5[0]; - if (row1$1.row_closed !== row2$2.row_closed || !row1$1.row_closed && (Caml_obj.caml_notequal(r1, /* [] */ 0) || Caml_obj.caml_notequal(r2, /* [] */ 0)) || Caml_obj.caml_notequal(filter_row_fields(false, Stdlib.$at(r1, r2)), /* [] */ 0)) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (!static_row(row1$1)) { - eqtype(rename, type_pairs, subst, env, row1$1.row_more, row2$2.row_more); - } - return Stdlib__List.iter((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); - if (/* tag */ typeof match === "number" || typeof match === "string") { + } + if (match$3.TAG === /* Tvariant */ 8) { + let row1 = match$2._0; + let _row2 = match$3._0; + while (true) { + const row2 = _row2; + const match$4 = expand_head_rigid(env, row_more(row2)); + const row2$1 = match$4.desc; + if (!/* tag */ (typeof row2$1 === "number" || typeof row2$1 === "string") && row2$1.TAG === /* Tvariant */ 8) { + _row2 = row2$1._0; + continue; + } + const row1$1 = row_repr_aux(/* [] */ 0, row1); + const row2$2 = row_repr_aux(/* [] */ 0, row2); + const match$5 = merge_row_fields(row1$1.row_fields, row2$2.row_fields); + const r2 = match$5[1]; + const r1 = match$5[0]; + if (row1$1.row_closed !== row2$2.row_closed || !row1$1.row_closed && (Caml_obj.caml_notequal(r1, /* [] */ 0) || Caml_obj.caml_notequal(r2, /* [] */ 0)) || Caml_obj.caml_notequal(filter_row_fields(false, Stdlib.$at(r1, r2)), /* [] */ 0)) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (!static_row(row1$1)) { + eqtype(rename, type_pairs, subst, env, row1$1.row_more, row2$2.row_more); + } + return Stdlib__List.iter((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return; + } + if (match$1.TAG === /* Rpresent */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } else if (match.TAG === /* Rpresent */ 0) { + const t1 = match._0; + if (t1 !== undefined) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return; + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } if (match$1.TAG === /* Rpresent */ 0) { + const t2 = match$1._0; + if (t2 !== undefined) { + return eqtype(rename, type_pairs, subst, env, t1, t2); + } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 @@ -35872,57 +35895,64 @@ function eqtype(rename, type_pairs, subst, env, t1, t2) { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } else if (match.TAG === /* Rpresent */ 0) { - const t1 = match._0; - if (t1 !== undefined) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - const t2 = match$1._0; - if (t2 !== undefined) { - return eqtype(rename, type_pairs, subst, env, t1, t2); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } + } else { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - } else { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - if (match$1._0 === undefined) { - return; - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + } + if (match$1.TAG === /* Rpresent */ 0) { + if (match$1._0 === undefined) { + return; } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - } else if (match._0) { - if (match._1) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + } else if (match._0) { + if (match._1) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$1._0) { + if (match$1._1) { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } + return; + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } else { + const match$2 = match._1; + if (match$2) { + const tl1 = match$2.tl; + const t1$1 = match$2.hd; if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, @@ -35936,163 +35966,133 @@ function eqtype(rename, type_pairs, subst, env, t1, t2) { }); } if (match$1._0) { - if (match$1._1) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + const match$3 = match$1._1; + if (match$3) { + const tl2 = match$3.tl; + const t2$1 = match$3.hd; + eqtype(rename, type_pairs, subst, env, t1$1, t2$1); + if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2)) { + return Stdlib__List.iter2((function (param, param$1) { + return eqtype(rename, type_pairs, subst, env, param, param$1); + }), tl1, tl2); + } else { + Stdlib__List.iter((function (param) { + return eqtype(rename, type_pairs, subst, env, t1$1, param); + }), tl2); + return Stdlib__List.iter((function (t1) { + eqtype(rename, type_pairs, subst, env, t1, t2$1); + }), tl1); } - return; } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } else { - const match$2 = match._1; - if (match$2) { - const tl1 = match$2.tl; - const t1$1 = match$2.hd; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$1._0) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - const match$3 = match$1._1; - if (match$3) { - const tl2 = match$3.tl; - const t2$1 = match$3.hd; - eqtype(rename, type_pairs, subst, env, t1$1, t2$1); - if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2)) { - return Stdlib__List.iter2((function (param, param$1) { - return eqtype(rename, type_pairs, subst, env, param, param$1); - }), tl1, tl2); - } else { - Stdlib__List.iter((function (param) { - return eqtype(rename, type_pairs, subst, env, t1$1, param); - }), tl2); - return Stdlib__List.iter((function (t1) { - eqtype(rename, type_pairs, subst, env, t1, t2$1); - }), tl1); - } - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - }), match$5[2]); - }; - } + } + }), match$5[2]); + }; + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tunivar */ 9 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); - case /* Tunivar */ 9 : + } + if (match$3.TAG === /* Tunivar */ 9) { + return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + case /* Tpoly */ 10 : + const tl1 = match$2._1; + const t1$2 = match$2._0; + let exit$1 = 0; + if (tl1) { + exit$1 = 2; + } else { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$3.TAG === /* Tunivar */ 9) { - return unify_univar(t1$p$1, t2$p$1, univar_pairs.contents); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - case /* Tpoly */ 10 : - const tl1 = match$2._1; - const t1$2 = match$2._0; - let exit$1 = 0; - if (tl1) { + if (match$3.TAG === /* Tpoly */ 10) { + if (!match$3._1) { + return eqtype(rename, type_pairs, subst, env, t1$2, match$3._0); + } exit$1 = 2; } else { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tpoly */ 10) { - if (!match$3._1) { - return eqtype(rename, type_pairs, subst, env, t1$2, match$3._0); - } - exit$1 = 2; - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - } - if (exit$1 === 2) { - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - if (match$3.TAG === /* Tpoly */ 10) { - return enter_poly(env, univar_pairs, t1$2, tl1, match$3._0, match$3._1, (function (param, param$1) { - return eqtype(rename, type_pairs, subst, env, param, param$1); - })); - } throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - break; - case /* Tpackage */ 11 : + } + if (exit$1 === 2) { if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { throw new Caml_js_exceptions.MelangeError(Unify, { MEL_EXN_ID: Unify, _1: /* [] */ 0 }); } - if (match$3.TAG === /* Tpackage */ 11) { - try { - return unify_package(env, (function (param, param$1) { - return eqtype_list(rename, type_pairs, subst, env, param, param$1); - }), t1$p$1.level, match$2._0, match$2._1, match$2._2, t2$p$1.level, match$3._0, match$3._1, match$3._2); - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + if (match$3.TAG === /* Tpoly */ 10) { + return enter_poly(env, univar_pairs, t1$2, tl1, match$3._0, match$3._1, (function (param, param$1) { + return eqtype(rename, type_pairs, subst, env, param, param$1); + })); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + break; + case /* Tpackage */ 11 : + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + if (match$3.TAG === /* Tpackage */ 11) { + try { + return unify_package(env, (function (param, param$1) { + return eqtype_list(rename, type_pairs, subst, env, param, param$1); + }), t1$p$1.level, match$2._0, match$2._1, match$2._2, t2$p$1.level, match$3._0, match$3._1, match$3._2); + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); } - } else { - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); } + } else { + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } } } else { @@ -36276,116 +36276,116 @@ function moregen_clty(trace, type_pairs, env, cty1, cty2) { let exit = 0; switch (cty1.TAG) { case /* Cty_constr */ 0 : - return moregen_clty(true, type_pairs, env, cty1._2, cty2); + return moregen_clty(true, type_pairs, env, cty1._2, cty2); case /* Cty_signature */ 1 : - const sign1 = cty1._0; - switch (cty2.TAG) { - case /* Cty_constr */ 0 : - exit = 1; - break; - case /* Cty_signature */ 1 : - const sign2 = cty2._0; - const ty1 = object_fields(repr(sign1.csig_self)); - const ty2 = object_fields(repr(sign2.csig_self)); - const match = flatten_fields(ty1); - const match$1 = flatten_fields(ty2); - const match$2 = associate_fields(match[0], match$1[0]); - Stdlib__List.iter((function (param) { - try { - return moregen$1(true, type_pairs, env, param[2], param[4]); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: { - hd: { - TAG: /* CM_Meth_type_mismatch */ 5, - _0: param[0], - _1: env, - _2: expand_trace(env, trace._1) - }, - tl: /* [] */ 0 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), match$2[0]); - return Curry._2(Meths.iter, (function (lab, param) { - const match = Curry._2(Meths.find, lab, sign1.csig_vars); - try { - return moregen$1(true, type_pairs, env, match[2], param[2]); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: { - hd: { - TAG: /* CM_Val_type_mismatch */ 4, - _0: lab, - _1: env, - _2: expand_trace(env, trace._1) - }, - tl: /* [] */ 0 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), sign2.csig_vars); - case /* Cty_arrow */ 2 : - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: /* [] */ 0 - }); - - } - break; - case /* Cty_arrow */ 2 : - switch (cty2.TAG) { - case /* Cty_constr */ 0 : - exit = 1; - break; - case /* Cty_signature */ 1 : - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: /* [] */ 0 - }); - case /* Cty_arrow */ 2 : - if (cty1._0 === cty2._0) { + const sign1 = cty1._0; + switch (cty2.TAG) { + case /* Cty_constr */ 0 : + exit = 1; + break; + case /* Cty_signature */ 1 : + const sign2 = cty2._0; + const ty1 = object_fields(repr(sign1.csig_self)); + const ty2 = object_fields(repr(sign2.csig_self)); + const match = flatten_fields(ty1); + const match$1 = flatten_fields(ty2); + const match$2 = associate_fields(match[0], match$1[0]); + Stdlib__List.iter((function (param) { + try { + return moregen$1(true, type_pairs, env, param[2], param[4]); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: { + hd: { + TAG: /* CM_Meth_type_mismatch */ 5, + _0: param[0], + _1: env, + _2: expand_trace(env, trace._1) + }, + tl: /* [] */ 0 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + }), match$2[0]); + return Curry._2(Meths.iter, (function (lab, param) { + const match = Curry._2(Meths.find, lab, sign1.csig_vars); try { - moregen$1(true, type_pairs, env, cty1._1, cty2._1); + return moregen$1(true, type_pairs, env, match[2], param[2]); } catch (raw_trace){ - const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace$1.MEL_EXN_ID === Unify) { + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError(Failure, { MEL_EXN_ID: Failure, _1: { hd: { - TAG: /* CM_Parameter_mismatch */ 3, - _0: env, - _1: expand_trace(env, trace$1._1) + TAG: /* CM_Val_type_mismatch */ 4, + _0: lab, + _1: env, + _2: expand_trace(env, trace._1) }, tl: /* [] */ 0 } }); } - throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); } - return moregen_clty(false, type_pairs, env, cty1._2, cty2._2); + }), sign2.csig_vars); + case /* Cty_arrow */ 2 : + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: /* [] */ 0 + }); + + } + break; + case /* Cty_arrow */ 2 : + switch (cty2.TAG) { + case /* Cty_constr */ 0 : + exit = 1; + break; + case /* Cty_signature */ 1 : + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: /* [] */ 0 + }); + case /* Cty_arrow */ 2 : + if (cty1._0 === cty2._0) { + try { + moregen$1(true, type_pairs, env, cty1._1, cty2._1); + } + catch (raw_trace){ + const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace$1.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: { + hd: { + TAG: /* CM_Parameter_mismatch */ 3, + _0: env, + _1: expand_trace(env, trace$1._1) + }, + tl: /* [] */ 0 + } + }); } - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: /* [] */ 0 - }); - - } - break; + throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + } + return moregen_clty(false, type_pairs, env, cty1._2, cty2._2); + } + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: /* [] */ 0 + }); + + } + break; } if (exit === 1) { @@ -36594,144 +36594,144 @@ function equal_clty(trace, type_pairs, subst, env, cty1, cty2) { let exit = 0; switch (cty1.TAG) { case /* Cty_constr */ 0 : - let exit$1 = 0; - switch (cty2.TAG) { - case /* Cty_constr */ 0 : - return equal_clty(true, type_pairs, subst, env, cty1._2, cty2._2); - case /* Cty_signature */ 1 : - case /* Cty_arrow */ 2 : - exit$1 = 3; - break; - - } - if (exit$1 === 3) { - return equal_clty(true, type_pairs, subst, env, cty1._2, cty2); - } - break; + let exit$1 = 0; + switch (cty2.TAG) { + case /* Cty_constr */ 0 : + return equal_clty(true, type_pairs, subst, env, cty1._2, cty2._2); + case /* Cty_signature */ 1 : + case /* Cty_arrow */ 2 : + exit$1 = 3; + break; + + } + if (exit$1 === 3) { + return equal_clty(true, type_pairs, subst, env, cty1._2, cty2); + } + break; case /* Cty_signature */ 1 : - const sign1 = cty1._0; - switch (cty2.TAG) { - case /* Cty_constr */ 0 : - exit = 1; - break; - case /* Cty_signature */ 1 : - const sign2 = cty2._0; - const ty1 = object_fields(repr(sign1.csig_self)); - const ty2 = object_fields(repr(sign2.csig_self)); - const match = flatten_fields(ty1); - const match$1 = flatten_fields(ty2); - const match$2 = associate_fields(match[0], match$1[0]); - Stdlib__List.iter((function (param) { - try { - return eqtype$1(true, type_pairs, subst, env, param[2], param[4]); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: { - hd: { - TAG: /* CM_Meth_type_mismatch */ 5, - _0: param[0], - _1: env, - _2: expand_trace(env, trace._1) - }, - tl: /* [] */ 0 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), match$2[0]); - return Curry._2(Meths.iter, (function (lab, param) { - const match = Curry._2(Meths.find, lab, sign1.csig_vars); - try { - return eqtype$1(true, type_pairs, subst, env, match[2], param[2]); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: { - hd: { - TAG: /* CM_Val_type_mismatch */ 4, - _0: lab, - _1: env, - _2: expand_trace(env, trace._1) - }, - tl: /* [] */ 0 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), sign2.csig_vars); - case /* Cty_arrow */ 2 : - exit = 2; - break; - - } - break; - case /* Cty_arrow */ 2 : - switch (cty2.TAG) { - case /* Cty_constr */ 0 : - exit = 1; - break; - case /* Cty_signature */ 1 : - exit = 2; - break; - case /* Cty_arrow */ 2 : - if (cty1._0 === cty2._0) { + const sign1 = cty1._0; + switch (cty2.TAG) { + case /* Cty_constr */ 0 : + exit = 1; + break; + case /* Cty_signature */ 1 : + const sign2 = cty2._0; + const ty1 = object_fields(repr(sign1.csig_self)); + const ty2 = object_fields(repr(sign2.csig_self)); + const match = flatten_fields(ty1); + const match$1 = flatten_fields(ty2); + const match$2 = associate_fields(match[0], match$1[0]); + Stdlib__List.iter((function (param) { try { - eqtype$1(true, type_pairs, subst, env, cty1._1, cty2._1); + return eqtype$1(true, type_pairs, subst, env, param[2], param[4]); } catch (raw_trace){ - const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace$1.MEL_EXN_ID === Unify) { + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError(Failure, { MEL_EXN_ID: Failure, _1: { hd: { - TAG: /* CM_Parameter_mismatch */ 3, - _0: env, - _1: expand_trace(env, trace$1._1) + TAG: /* CM_Meth_type_mismatch */ 5, + _0: param[0], + _1: env, + _2: expand_trace(env, trace._1) }, tl: /* [] */ 0 } }); } - throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); } - return equal_clty(false, type_pairs, subst, env, cty1._2, cty2._2); - } - exit = 2; - break; - - } - break; - - } - switch (exit) { - case 1 : - return equal_clty(true, type_pairs, subst, env, cty1, cty2._2); - case 2 : - throw new Caml_js_exceptions.MelangeError(Failure, { - MEL_EXN_ID: Failure, - _1: trace ? /* [] */ 0 : ({ - hd: { - TAG: /* CM_Class_type_mismatch */ 2, - _0: env, - _1: cty1, - _2: cty2 - }, - tl: /* [] */ 0 - }) - }); - - } - } + }), match$2[0]); + return Curry._2(Meths.iter, (function (lab, param) { + const match = Curry._2(Meths.find, lab, sign1.csig_vars); + try { + return eqtype$1(true, type_pairs, subst, env, match[2], param[2]); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: { + hd: { + TAG: /* CM_Val_type_mismatch */ 4, + _0: lab, + _1: env, + _2: expand_trace(env, trace._1) + }, + tl: /* [] */ 0 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + }), sign2.csig_vars); + case /* Cty_arrow */ 2 : + exit = 2; + break; + + } + break; + case /* Cty_arrow */ 2 : + switch (cty2.TAG) { + case /* Cty_constr */ 0 : + exit = 1; + break; + case /* Cty_signature */ 1 : + exit = 2; + break; + case /* Cty_arrow */ 2 : + if (cty1._0 === cty2._0) { + try { + eqtype$1(true, type_pairs, subst, env, cty1._1, cty2._1); + } + catch (raw_trace){ + const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace$1.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: { + hd: { + TAG: /* CM_Parameter_mismatch */ 3, + _0: env, + _1: expand_trace(env, trace$1._1) + }, + tl: /* [] */ 0 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + } + return equal_clty(false, type_pairs, subst, env, cty1._2, cty2._2); + } + exit = 2; + break; + + } + break; + + } + switch (exit) { + case 1 : + return equal_clty(true, type_pairs, subst, env, cty1, cty2._2); + case 2 : + throw new Caml_js_exceptions.MelangeError(Failure, { + MEL_EXN_ID: Failure, + _1: trace ? /* [] */ 0 : ({ + hd: { + TAG: /* CM_Class_type_mismatch */ 2, + _0: env, + _1: cty1, + _2: cty2 + }, + tl: /* [] */ 0 + }) + }); + + } + } catch (raw_error){ const error = Caml_js_exceptions.internalToOCamlException(raw_error); if (error.MEL_EXN_ID === Failure) { @@ -37023,7 +37023,7 @@ function filter_visited(_l) { switch (match.TAG) { case /* Tobject */ 4 : case /* Tvariant */ 8 : - return l; + return l; default: _l = l.tl; continue; @@ -37044,22 +37044,22 @@ function lid_of_path(sharpOpt, id) { const sharp = sharpOpt !== undefined ? sharpOpt : ""; switch (id.TAG) { case /* Pident */ 0 : - return { - TAG: /* Lident */ 0, - _0: sharp + id._0.name - }; + return { + TAG: /* Lident */ 0, + _0: sharp + id._0.name + }; case /* Pdot */ 1 : - return { - TAG: /* Ldot */ 1, - _0: lid_of_path(undefined, id._0), - _1: sharp + id._1 - }; + return { + TAG: /* Ldot */ 1, + _0: lid_of_path(undefined, id._0), + _1: sharp + id._1 + }; case /* Papply */ 2 : - return { - TAG: /* Lapply */ 2, - _0: lid_of_path(sharp, id._0), - _1: lid_of_path(undefined, id._1) - }; + return { + TAG: /* Lapply */ 2, + _0: lid_of_path(sharp, id._0), + _1: lid_of_path(undefined, id._1) + }; } } @@ -37126,129 +37126,124 @@ function build_subtype(env, visited, loops, posi, level, t) { } switch (tlist.TAG) { case /* Tvar */ 0 : - if (!posi) { + if (!posi) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + try { + const t$p = Stdlib__List.assq(t$1, loops); + warn.contents = true; + return [ + t$p, + /* Equiv */ 1 + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { return [ t$1, /* Unchanged */ 0 ]; } - try { - const t$p = Stdlib__List.assq(t$1, loops); - warn.contents = true; - return [ - t$p, - /* Equiv */ 1 - ]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Tarrow */ 1 : - if (memq_warn(t$1, visited)) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - const visited$1 = { - hd: t$1, - tl: visited - }; - const match = build_subtype(env, visited$1, loops, !posi, level, tlist._1); - const match$1 = build_subtype(env, visited$1, loops, posi, level, tlist._2); - const c = Caml.caml_int_max(match[1], match$1[1]); - if (c > /* Unchanged */ 0) { - return [ - newty2(current_level.contents, { - TAG: /* Tarrow */ 1, - _0: tlist._0, - _1: match[0], - _2: match$1[0], - _3: /* Cok */ 0 - }), - c - ]; - } else { - return [ - t$1, - /* Unchanged */ 0 - ]; - } + if (memq_warn(t$1, visited)) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + const visited$1 = { + hd: t$1, + tl: visited + }; + const match = build_subtype(env, visited$1, loops, !posi, level, tlist._1); + const match$1 = build_subtype(env, visited$1, loops, posi, level, tlist._2); + const c = Caml.caml_int_max(match[1], match$1[1]); + if (c > /* Unchanged */ 0) { + return [ + newty2(current_level.contents, { + TAG: /* Tarrow */ 1, + _0: tlist._0, + _1: match[0], + _2: match$1[0], + _3: /* Cok */ 0 + }), + c + ]; + } else { + return [ + t$1, + /* Unchanged */ 0 + ]; + } case /* Ttuple */ 2 : - if (memq_warn(t$1, visited)) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - const visited$2 = { - hd: t$1, - tl: visited - }; - const tlist$p = Stdlib__List.map((function (param) { - return build_subtype(env, visited$2, loops, posi, level, param); - }), tlist._0); - const c$1 = collect(tlist$p); - if (c$1 <= /* Unchanged */ 0) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - const desc = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (prim) { - return prim[0]; - }), tlist$p) - }; + if (memq_warn(t$1, visited)) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + const visited$2 = { + hd: t$1, + tl: visited + }; + const tlist$p = Stdlib__List.map((function (param) { + return build_subtype(env, visited$2, loops, posi, level, param); + }), tlist._0); + const c$1 = collect(tlist$p); + if (c$1 <= /* Unchanged */ 0) { return [ - newty2(current_level.contents, desc), - c$1 + t$1, + /* Unchanged */ 0 ]; + } + const desc = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (prim) { + return prim[0]; + }), tlist$p) + }; + return [ + newty2(current_level.contents, desc), + c$1 + ]; case /* Tconstr */ 3 : - const p = tlist._0; - if (level > 0 && generic_abbrev(env, p) && safe_abbrev(env, t$1) && !has_constr_row(expand_abbrev(env)(t$1))) { - const t$p$1 = repr(expand_abbrev(env)(t$1)); - const level$p = pred_expand(level); - try { - const match$2 = t$p$1.desc; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (match$2.TAG === /* Tobject */ 4) { - if (posi && !opened_object(t$p$1)) { - const match$3 = find_cltype_for_path(env, p); - const ty = subst(env, current_level.contents, /* Public */ 1, tlist._2, undefined, match$3[0].type_params, tlist._1, match$3[1]); - const ty$1 = repr(ty); - const match$4 = ty$1.desc; - let match$5; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (match$4.TAG === /* Tobject */ 4) { - const match$6 = match$4._1.contents; - if (match$6 !== undefined) { - if (same(p, match$6[0])) { - match$5 = [ - match$4._0, - match$6[1] - ]; - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } + const p = tlist._0; + if (level > 0 && generic_abbrev(env, p) && safe_abbrev(env, t$1) && !has_constr_row(expand_abbrev(env)(t$1))) { + const t$p$1 = repr(expand_abbrev(env)(t$1)); + const level$p = pred_expand(level); + try { + const match$2 = t$p$1.desc; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + if (match$2.TAG === /* Tobject */ 4) { + if (posi && !opened_object(t$p$1)) { + const match$3 = find_cltype_for_path(env, p); + const ty = subst(env, current_level.contents, /* Public */ 1, tlist._2, undefined, match$3[0].type_params, tlist._1, match$3[1]); + const ty$1 = repr(ty); + const match$4 = ty$1.desc; + let match$5; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + if (match$4.TAG === /* Tobject */ 4) { + const match$6 = match$4._1.contents; + if (match$6 !== undefined) { + if (same(p, match$6[0])) { + match$5 = [ + match$4._0, + match$6[1] + ]; } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found @@ -37259,146 +37254,97 @@ function build_subtype(env, visited, loops, posi, level, t) { MEL_EXN_ID: Stdlib.Not_found }); } - const tl1 = match$5[1]; - if (Stdlib__List.exists((function (param) { - return deep_occur(ty$1, param); - }), tl1)) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - ty$1.desc = { - TAG: /* Tvar */ 0, - _0: undefined - }; - const t$p$p = newvar(undefined, undefined); - const loops_0 = [ - ty$1, - t$p$p + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + const tl1 = match$5[1]; + if (Stdlib__List.exists((function (param) { + return deep_occur(ty$1, param); + }), tl1)) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + ty$1.desc = { + TAG: /* Tvar */ 0, + _0: undefined + }; + const t$p$p = newvar(undefined, undefined); + const loops_0 = [ + ty$1, + t$p$p + ]; + const loops$1 = { + hd: loops_0, + tl: loops + }; + const match$7 = build_subtype(env, { + hd: t$p$1, + tl: /* [] */ 0 + }, loops$1, posi, pred_enlarge(level$p), match$5[0]); + const ty1$p = match$7[0]; + if (!is_Tvar(t$p$p)) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 33782, + 10 + ] + }); + } + const nm = match$7[1] > /* Equiv */ 1 || deep_occur(ty$1, ty1$p) ? undefined : [ + p, + tl1 ]; - const loops$1 = { - hd: loops_0, - tl: loops - }; - const match$7 = build_subtype(env, { - hd: t$p$1, - tl: /* [] */ 0 - }, loops$1, posi, pred_enlarge(level$p), match$5[0]); - const ty1$p = match$7[0]; - if (!is_Tvar(t$p$p)) { + t$p$p.desc = { + TAG: /* Tobject */ 4, + _0: ty1$p, + _1: { + contents: nm + } + }; + try { + unify_var(env, ty$1, t$1); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 33782, - 10 + 33786, + 50 ] }); } - const nm = match$7[1] > /* Equiv */ 1 || deep_occur(ty$1, ty1$p) ? undefined : [ - p, - tl1 - ]; - t$p$p.desc = { - TAG: /* Tobject */ 4, - _0: ty1$p, - _1: { - contents: nm - } - }; - try { - unify_var(env, ty$1, t$1); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 33786, - 50 - ] - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - return [ - t$p$p, - /* Changed */ 2 - ]; + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + return [ + t$p$p, + /* Changed */ 2 + ]; } throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - const match$8 = build_subtype(env, visited, loops, posi, level$p, t$p$1); - const c$2 = match$8[1]; - if (c$2 > /* Unchanged */ 0) { - return [ - match$8[0], - c$2 - ]; - } else { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - } else { - if (memq_warn(t$1, visited)) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - const visited$3 = { - hd: t$1, - tl: visited - }; - try { - const decl = find_type_full(p, env)[0]; - if (level === 0 && generic_abbrev(env, p) && safe_abbrev(env, t$1) && !has_constr_row(expand_abbrev(env)(t$1))) { - warn.contents = true; - } - const tl$p = Stdlib__List.map2((function (v, t) { - const match = Curry._1(Types_Variance.get_upper, v); - const co = match[0]; - if (match[1]) { - if (co) { - return [ - t, - /* Unchanged */ 0 - ]; - } else { - return build_subtype(env, visited$3, loops, !posi, level, t); - } - } else if (co) { - return build_subtype(env, visited$3, loops, posi, level, t); - } else { - return [ - newvar(undefined, undefined), - /* Changed */ 2 - ]; - } - }), decl.type_variance, tlist._1); - const c$3 = collect(tl$p); - if (c$3 > /* Unchanged */ 0) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + const match$8 = build_subtype(env, visited, loops, posi, level$p, t$p$1); + const c$2 = match$8[1]; + if (c$2 > /* Unchanged */ 0) { return [ - newconstr(p, Stdlib__List.map((function (prim) { - return prim[0]; - }), tl$p)), - c$3 + match$8[0], + c$2 ]; } else { return [ @@ -37407,937 +37353,901 @@ function build_subtype(env, visited, loops, posi, level, t) { ]; } } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); - } - } - case /* Tobject */ 4 : - const t1 = tlist._0; - if (memq_warn(t$1, visited) || opened_object(t1)) { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - const level$p$1 = pred_enlarge(level); - const visited_1 = level$p$1 < level ? /* [] */ 0 : filter_visited(visited); - const visited$4 = { - hd: t$1, - tl: visited_1 - }; - const match$9 = build_subtype(env, visited$4, loops, posi, level$p$1, t1); - const c$4 = match$9[1]; - if (c$4 > /* Unchanged */ 0) { - return [ - newty2(current_level.contents, { - TAG: /* Tobject */ 4, - _0: match$9[0], - _1: { - contents: undefined - } - }), - c$4 - ]; - } else { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - case /* Tfield */ 5 : - const match$10 = build_subtype(env, visited, loops, posi, level, tlist._2); - const match$11 = build_subtype(env, visited, loops, posi, level, tlist._3); - const c$5 = Caml.caml_int_max(match$10[1], match$11[1]); - if (c$5 > /* Unchanged */ 0) { - return [ - newty2(current_level.contents, { - TAG: /* Tfield */ 5, - _0: tlist._0, - _1: /* Fpresent */ 0, - _2: match$10[0], - _3: match$11[0] - }), - c$5 - ]; - } else { - return [ - t$1, - /* Unchanged */ 0 - ]; + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); } - case /* Tlink */ 6 : - case /* Tsubst */ 7 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 33877, - 6 - ] - }); - case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, tlist._0); - if (memq_warn(t$1, visited) || !static_row(row)) { + } else { + if (memq_warn(t$1, visited)) { return [ t$1, /* Unchanged */ 0 ]; } - const level$p$2 = pred_enlarge(level); - const visited_1$1 = level$p$2 < level ? /* [] */ 0 : filter_visited(visited); - const visited$5 = { + const visited$3 = { hd: t$1, - tl: visited_1$1 + tl: visited }; - const fields = filter_row_fields(false, row.row_fields); - const fields$1 = Stdlib__List.map((function (orig) { - const l = orig[0]; - const match = row_field_repr_aux(/* [] */ 0, orig[1]); - if (/* tag */ typeof match === "number" || typeof match === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 33844, - 17 - ] - }); - } - if (match.TAG === /* Rpresent */ 0) { - const t = match._0; - if (t === undefined) { - if (posi) { + try { + const decl = find_type_full(p, env)[0]; + if (level === 0 && generic_abbrev(env, p) && safe_abbrev(env, t$1) && !has_constr_row(expand_abbrev(env)(t$1))) { + warn.contents = true; + } + const tl$p = Stdlib__List.map2((function (v, t) { + const match = Curry._1(Types_Variance.get_upper, v); + const co = match[0]; + if (match[1]) { + if (co) { return [ - [ - l, - { - TAG: /* Reither */ 1, - _0: true, - _1: /* [] */ 0, - _2: false, - _3: { - contents: undefined - } - } - ], + t, /* Unchanged */ 0 ]; } else { - return [ - orig, - /* Unchanged */ 0 - ]; + return build_subtype(env, visited$3, loops, !posi, level, t); } + } else if (co) { + return build_subtype(env, visited$3, loops, posi, level, t); + } else { + return [ + newvar(undefined, undefined), + /* Changed */ 2 + ]; } - const match$1 = build_subtype(env, visited$5, loops, posi, level$p$2, t); - const t$p = match$1[0]; - const f = posi && level > 0 ? ({ - TAG: /* Reither */ 1, - _0: false, - _1: { - hd: t$p, - tl: /* [] */ 0 - }, - _2: false, - _3: { - contents: undefined - } - }) : ({ - TAG: /* Rpresent */ 0, - _0: t$p - }); - return [ - [ - l, - f - ], - match$1[1] - ]; - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 33844, - 17 - ] - }); - }), fields); - const c$6 = collect(fields$1); - const row_row_fields = Stdlib__List.map((function (prim) { - return prim[0]; - }), fields$1); - const row_row_more = newvar(undefined, undefined); - const row_row_name = c$6 > /* Unchanged */ 0 ? undefined : row.row_name; - const row$1 = { - row_fields: row_row_fields, - row_more: row_row_more, - row_bound: undefined, - row_closed: posi, - row_fixed: false, - row_name: row_row_name - }; + }), decl.type_variance, tlist._1); + const c$3 = collect(tl$p); + if (c$3 > /* Unchanged */ 0) { + return [ + newconstr(p, Stdlib__List.map((function (prim) { + return prim[0]; + }), tl$p)), + c$3 + ]; + } else { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } + } + case /* Tobject */ 4 : + const t1 = tlist._0; + if (memq_warn(t$1, visited) || opened_object(t1)) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + const level$p$1 = pred_enlarge(level); + const visited_1 = level$p$1 < level ? /* [] */ 0 : filter_visited(visited); + const visited$4 = { + hd: t$1, + tl: visited_1 + }; + const match$9 = build_subtype(env, visited$4, loops, posi, level$p$1, t1); + const c$4 = match$9[1]; + if (c$4 > /* Unchanged */ 0) { return [ newty2(current_level.contents, { - TAG: /* Tvariant */ 8, - _0: row$1 + TAG: /* Tobject */ 4, + _0: match$9[0], + _1: { + contents: undefined + } }), - /* Changed */ 2 + c$4 ]; - case /* Tpoly */ 10 : - const match$12 = build_subtype(env, visited, loops, posi, level, tlist._0); - const c$7 = match$12[1]; - if (c$7 > /* Unchanged */ 0) { - return [ - newty2(current_level.contents, { - TAG: /* Tpoly */ 10, - _0: match$12[0], - _1: tlist._1 - }), - c$7 - ]; - } else { - return [ - t$1, - /* Unchanged */ 0 - ]; - } - case /* Tunivar */ 9 : - case /* Tpackage */ 11 : + } else { return [ t$1, /* Unchanged */ 0 ]; - - } -} - -function enlarge_type(env, ty) { - warn.contents = false; - const match = build_subtype(env, /* [] */ 0, /* [] */ 0, true, 4, ty); - return [ - match[0], - warn.contents - ]; -} - -const subtypes = Curry._1(TypePairs.create, 17); - -function subtype_error(env, trace) { - throw new Caml_js_exceptions.MelangeError(Subtype, { - MEL_EXN_ID: Subtype, - _1: expand_trace(env, Stdlib__List.rev(trace)), - _2: /* [] */ 0 - }); -} - -function subtype_rec(env, _trace, _t1, _t2, _cstrs) { - while (true) { - const cstrs = _cstrs; - const t2 = _t2; - const t1 = _t1; - const trace = _trace; - const t1$1 = repr(t1); - const t2$1 = repr(t2); - if (t1$1 === t2$1) { - return cstrs; - } - try { - Curry._2(TypePairs.find, subtypes, [ - t1$1, - t2$1 - ]); - return cstrs; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - Curry._3(TypePairs.add, subtypes, [ - t1$1, - t2$1 - ], undefined); - const match = t1$1.desc; - const match$1 = t2$1.desc; - let exit = 0; - let exit$1 = 0; - let exit$2 = 0; - let exit$3 = 0; - let exit$4 = 0; - if (/* tag */ typeof match === "number" || typeof match === "string") { - exit$4 = 6; - } else { - switch (match.TAG) { - case /* Tvar */ 0 : - exit = 2; - break; - case /* Tarrow */ 1 : - const u1 = match._2; - const t1$2 = match._1; - const l1 = match._0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; + } + case /* Tfield */ 5 : + const match$10 = build_subtype(env, visited, loops, posi, level, tlist._2); + const match$11 = build_subtype(env, visited, loops, posi, level, tlist._3); + const c$5 = Caml.caml_int_max(match$10[1], match$11[1]); + if (c$5 > /* Unchanged */ 0) { + return [ + newty2(current_level.contents, { + TAG: /* Tfield */ 5, + _0: tlist._0, + _1: /* Fpresent */ 0, + _2: match$10[0], + _3: match$11[0] + }), + c$5 + ]; + } else { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + case /* Tlink */ 6 : + case /* Tsubst */ 7 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 33877, + 6 + ] + }); + case /* Tvariant */ 8 : + const row = row_repr_aux(/* [] */ 0, tlist._0); + if (memq_warn(t$1, visited) || !static_row(row)) { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + const level$p$2 = pred_enlarge(level); + const visited_1$1 = level$p$2 < level ? /* [] */ 0 : filter_visited(visited); + const visited$5 = { + hd: t$1, + tl: visited_1$1 + }; + const fields = filter_row_fields(false, row.row_fields); + const fields$1 = Stdlib__List.map((function (orig) { + const l = orig[0]; + const match = row_field_repr_aux(/* [] */ 0, orig[1]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 33844, + 17 + ] + }); + } + if (match.TAG === /* Rpresent */ 0) { + const t = match._0; + if (t === undefined) { + if (posi) { + return [ + [ + l, + { + TAG: /* Reither */ 1, + _0: true, + _1: /* [] */ 0, + _2: false, + _3: { + contents: undefined + } + } + ], + /* Unchanged */ 0 + ]; } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tarrow */ 1 : - const u2 = match$1._2; - const t2$2 = match$1._1; - const l2 = match$1._0; - if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { - const cstrs$1 = subtype_rec(env, { - hd: [ - t2$2, - t1$2 - ], - tl: trace - }, t2$2, t1$2, cstrs); - _cstrs = cstrs$1; - _t2 = u2; - _t1 = u1; - _trace = { + return [ + orig, + /* Unchanged */ 0 + ]; + } + } + const match$1 = build_subtype(env, visited$5, loops, posi, level$p$2, t); + const t$p = match$1[0]; + const f = posi && level > 0 ? ({ + TAG: /* Reither */ 1, + _0: false, + _1: { + hd: t$p, + tl: /* [] */ 0 + }, + _2: false, + _3: { + contents: undefined + } + }) : ({ + TAG: /* Rpresent */ 0, + _0: t$p + }); + return [ + [ + l, + f + ], + match$1[1] + ]; + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 33844, + 17 + ] + }); + }), fields); + const c$6 = collect(fields$1); + const row_row_fields = Stdlib__List.map((function (prim) { + return prim[0]; + }), fields$1); + const row_row_more = newvar(undefined, undefined); + const row_row_name = c$6 > /* Unchanged */ 0 ? undefined : row.row_name; + const row$1 = { + row_fields: row_row_fields, + row_more: row_row_more, + row_bound: undefined, + row_closed: posi, + row_fixed: false, + row_name: row_row_name + }; + return [ + newty2(current_level.contents, { + TAG: /* Tvariant */ 8, + _0: row$1 + }), + /* Changed */ 2 + ]; + case /* Tpoly */ 10 : + const match$12 = build_subtype(env, visited, loops, posi, level, tlist._0); + const c$7 = match$12[1]; + if (c$7 > /* Unchanged */ 0) { + return [ + newty2(current_level.contents, { + TAG: /* Tpoly */ 10, + _0: match$12[0], + _1: tlist._1 + }), + c$7 + ]; + } else { + return [ + t$1, + /* Unchanged */ 0 + ]; + } + case /* Tunivar */ 9 : + case /* Tpackage */ 11 : + return [ + t$1, + /* Unchanged */ 0 + ]; + + } +} + +function enlarge_type(env, ty) { + warn.contents = false; + const match = build_subtype(env, /* [] */ 0, /* [] */ 0, true, 4, ty); + return [ + match[0], + warn.contents + ]; +} + +const subtypes = Curry._1(TypePairs.create, 17); + +function subtype_error(env, trace) { + throw new Caml_js_exceptions.MelangeError(Subtype, { + MEL_EXN_ID: Subtype, + _1: expand_trace(env, Stdlib__List.rev(trace)), + _2: /* [] */ 0 + }); +} + +function subtype_rec(env, _trace, _t1, _t2, _cstrs) { + while (true) { + const cstrs = _cstrs; + const t2 = _t2; + const t1 = _t1; + const trace = _trace; + const t1$1 = repr(t1); + const t2$1 = repr(t2); + if (t1$1 === t2$1) { + return cstrs; + } + try { + Curry._2(TypePairs.find, subtypes, [ + t1$1, + t2$1 + ]); + return cstrs; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + Curry._3(TypePairs.add, subtypes, [ + t1$1, + t2$1 + ], undefined); + const match = t1$1.desc; + const match$1 = t2$1.desc; + let exit = 0; + let exit$1 = 0; + let exit$2 = 0; + let exit$3 = 0; + let exit$4 = 0; + if (/* tag */ typeof match === "number" || typeof match === "string") { + exit$4 = 6; + } else { + switch (match.TAG) { + case /* Tvar */ 0 : + exit = 2; + break; + case /* Tarrow */ 1 : + const u1 = match._2; + const t1$2 = match._1; + const l1 = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tarrow */ 1 : + const u2 = match$1._2; + const t2$2 = match$1._1; + const l2 = match$1._0; + if (l1 === l2 || classic.contents && !(is_optional(l1) || is_optional(l2))) { + const cstrs$1 = subtype_rec(env, { hd: [ - u1, - u2 + t2$2, + t1$2 ], tl: trace - }; - continue; - } - exit = 1; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - default: - exit = 1; - } + }, t2$2, t1$2, cstrs); + _cstrs = cstrs$1; + _t2 = u2; + _t1 = u1; + _trace = { + hd: [ + u1, + u2 + ], + tl: trace + }; + continue; + } + exit = 1; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + default: + exit = 1; } - break; + } + break; case /* Ttuple */ 2 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Ttuple */ 2 : - let tl1 = match._0; - let tl2 = match$1._0; - if (Stdlib__List.length(tl1) !== Stdlib__List.length(tl2)) { - subtype_error(env, trace); - } - return Stdlib__List.fold_left2((function (cstrs, t1, t2) { - return subtype_rec(env, { - hd: [ - t1, - t2 - ], - tl: trace - }, t1, t2, cstrs); - }), cstrs, tl1, tl2); - case /* Tconstr */ 3 : - exit$2 = 4; - break; - default: - exit = 1; - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Ttuple */ 2 : + let tl1 = match._0; + let tl2 = match$1._0; + if (Stdlib__List.length(tl1) !== Stdlib__List.length(tl2)) { + subtype_error(env, trace); + } + return Stdlib__List.fold_left2((function (cstrs, t1, t2) { + return subtype_rec(env, { + hd: [ + t1, + t2 + ], + tl: trace + }, t1, t2, cstrs); + }), cstrs, tl1, tl2); + case /* Tconstr */ 3 : + exit$2 = 4; + break; + default: + exit = 1; } - break; + } + break; case /* Tconstr */ 3 : - if (match._1) { - exit$4 = 6; - } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit$3 = 5; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tconstr */ 3 : - if (match$1._1) { - exit$3 = 5; - } else { - if (same(match._0, match$1._0)) { - return cstrs; - } - exit$3 = 5; - } - break; - default: + if (match._1) { + exit$4 = 6; + } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit$3 = 5; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tconstr */ 3 : + if (match$1._1) { exit$3 = 5; - } + } else { + if (same(match._0, match$1._0)) { + return cstrs; + } + exit$3 = 5; + } + break; + default: + exit$3 = 5; } - break; + } + break; case /* Tobject */ 4 : - const f1 = match._0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tobject */ 4 : - const f2 = match$1._0; - if (is_Tvar(object_row(f1)) && is_Tvar(object_row(f2))) { - return { - hd: [ - trace, - t1$1, - t2$1, - univar_pairs.contents - ], - tl: cstrs - }; - } else { - const match$2 = flatten_fields(f1); - const rest1 = match$2[1]; - const match$3 = flatten_fields(f2); - const rest2 = match$3[1]; - const match$4 = associate_fields(match$2[0], match$3[0]); - const miss2 = match$4[2]; - const miss1 = match$4[1]; - const cstrs$2 = Caml_obj.caml_equal(rest2.desc, /* Tnil */ 0) ? cstrs : ( - Caml_obj.caml_equal(miss1, /* [] */ 0) ? subtype_rec(env, { - hd: [ - rest1, - rest2 - ], - tl: trace - }, rest1, rest2, cstrs) : ({ + const f1 = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + case /* Tobject */ 4 : + const f2 = match$1._0; + if (is_Tvar(object_row(f1)) && is_Tvar(object_row(f2))) { + return { + hd: [ + trace, + t1$1, + t2$1, + univar_pairs.contents + ], + tl: cstrs + }; + } else { + const match$2 = flatten_fields(f1); + const rest1 = match$2[1]; + const match$3 = flatten_fields(f2); + const rest2 = match$3[1]; + const match$4 = associate_fields(match$2[0], match$3[0]); + const miss2 = match$4[2]; + const miss1 = match$4[1]; + const cstrs$2 = Caml_obj.caml_equal(rest2.desc, /* Tnil */ 0) ? cstrs : ( + Caml_obj.caml_equal(miss1, /* [] */ 0) ? subtype_rec(env, { hd: [ - trace, - build_fields(repr(f1).level)(miss1, rest1), - rest2, - univar_pairs.contents + rest1, + rest2 ], - tl: cstrs - }) - ); - const cstrs$3 = Caml_obj.caml_equal(miss2, /* [] */ 0) ? cstrs$2 : ({ + tl: trace + }, rest1, rest2, cstrs) : ({ hd: [ trace, - rest1, - build_fields(repr(f2).level)(miss2, newvar(undefined, undefined)), + build_fields(repr(f1).level)(miss1, rest1), + rest2, univar_pairs.contents ], - tl: cstrs$2 - }); - return Stdlib__List.fold_left((function (cstrs, param) { - const t2 = param[4]; - const t1 = param[2]; + tl: cstrs + }) + ); + const cstrs$3 = Caml_obj.caml_equal(miss2, /* [] */ 0) ? cstrs$2 : ({ + hd: [ + trace, + rest1, + build_fields(repr(f2).level)(miss2, newvar(undefined, undefined)), + univar_pairs.contents + ], + tl: cstrs$2 + }); + return Stdlib__List.fold_left((function (cstrs, param) { + const t2 = param[4]; + const t1 = param[2]; + return subtype_rec(env, { + hd: [ + t1, + t2 + ], + tl: trace + }, t1, t2, cstrs); + }), cstrs$3, match$4[0]); + } + default: + exit = 1; + } + } + break; + case /* Tvariant */ 8 : + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + case /* Tvariant */ 8 : + try { + let row1 = match._0; + let row2 = match$1._0; + const row1$1 = row_repr_aux(/* [] */ 0, row1); + const row2$1 = row_repr_aux(/* [] */ 0, row2); + const match$5 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); + const pairs = match$5[2]; + const r1 = match$5[0]; + const more1 = repr(row1$1.row_more); + const more2 = repr(row2$1.row_more); + const match$6 = more1.desc; + const match$7 = more2.desc; + let exit$5 = 0; + if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { + exit$5 = 1; + } else { + switch (match$6.TAG) { + case /* Tvar */ 0 : + exit$5 = 1; + break; + case /* Tconstr */ 3 : + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string" || match$7.TAG !== /* Tconstr */ 3) { + exit$5 = 1; + } else { + if (same(match$6._0, match$7._0)) { return subtype_rec(env, { hd: [ - t1, - t2 + more1, + more2 ], tl: trace - }, t1, t2, cstrs); - }), cstrs$3, match$4[0]); - } - default: - exit = 1; - } - } - break; - case /* Tvariant */ 8 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tvariant */ 8 : - try { - let row1 = match._0; - let row2 = match$1._0; - const row1$1 = row_repr_aux(/* [] */ 0, row1); - const row2$1 = row_repr_aux(/* [] */ 0, row2); - const match$5 = merge_row_fields(row1$1.row_fields, row2$1.row_fields); - const pairs = match$5[2]; - const r1 = match$5[0]; - const more1 = repr(row1$1.row_more); - const more2 = repr(row2$1.row_more); - const match$6 = more1.desc; - const match$7 = more2.desc; - let exit$5 = 0; - if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { - exit$5 = 1; - } else { - switch (match$6.TAG) { - case /* Tvar */ 0 : - exit$5 = 1; - break; - case /* Tconstr */ 3 : - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string" || match$7.TAG !== /* Tconstr */ 3) { - exit$5 = 1; - } else { - if (same(match$6._0, match$7._0)) { - return subtype_rec(env, { - hd: [ - more1, - more2 - ], - tl: trace - }, more1, more2, cstrs); - } - exit$5 = 1; - } - break; - case /* Tunivar */ 9 : - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$7.TAG === /* Tunivar */ 9) { - if (row1$1.row_closed === row2$1.row_closed && Caml_obj.caml_equal(r1, /* [] */ 0) && Caml_obj.caml_equal(match$5[1], /* [] */ 0)) { - const cstrs$4 = subtype_rec(env, { - hd: [ - more1, - more2 - ], - tl: trace - }, more1, more2, cstrs); - return Stdlib__List.fold_left((function (cstrs, param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); - let t1; - let t2; - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return cstrs; - } - if (match$1.TAG === /* Rpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } else if (match.TAG === /* Rpresent */ 0) { - const t1$1 = match._0; - if (t1$1 !== undefined) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - const t2$1 = match$1._0; - if (t2$1 !== undefined) { - t1 = t1$1; - t2 = t2$1; - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - } else { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - if (match$1._0 !== undefined) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - return cstrs; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - } else if (match._0) { - if (match._1) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1._0) { - if (match$1._1) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - return cstrs; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } else { - const match$2 = match._1; - if (match$2) { - if (match$2.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1._0) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - const match$3 = match$1._1; - if (match$3) { - if (match$3.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - t1 = match$2.hd; - t2 = match$3.hd; - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - } - return subtype_rec(env, { - hd: [ - t1, - t2 - ], - tl: trace - }, t1, t2, cstrs); - }), cstrs$4, pairs); - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - default: - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); + }, more1, more2, cstrs); + } + exit$5 = 1; } - } - if (exit$5 === 1) { - let exit$6 = 0; + break; + case /* Tunivar */ 9 : if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { - exit$6 = 2; - } else { - switch (match$7.TAG) { - case /* Tvar */ 0 : - case /* Tconstr */ 3 : - exit$6 = 2; - break; - default: - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } - if (exit$6 === 2) { - if (row1$1.row_closed && Caml_obj.caml_equal(r1, /* [] */ 0)) { + if (match$7.TAG === /* Tunivar */ 9) { + if (row1$1.row_closed === row2$1.row_closed && Caml_obj.caml_equal(r1, /* [] */ 0) && Caml_obj.caml_equal(match$5[1], /* [] */ 0)) { + const cstrs$4 = subtype_rec(env, { + hd: [ + more1, + more2 + ], + tl: trace + }, more1, more2, cstrs); return Stdlib__List.fold_left((function (cstrs, param) { const match = row_field_repr_aux(/* [] */ 0, param[1]); const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); + let t1; + let t2; if (/* tag */ typeof match === "number" || typeof match === "string") { - return cstrs; - } - if (match.TAG === /* Rpresent */ 0) { - const t1 = match._0; - if (t1 !== undefined) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return cstrs; + } + if (match$1.TAG === /* Rpresent */ 0) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } else if (match.TAG === /* Rpresent */ 0) { + const t1$1 = match._0; + if (t1$1 !== undefined) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } if (match$1.TAG === /* Rpresent */ 0) { - const t2 = match$1._0; - if (t2 !== undefined) { - return subtype_rec(env, { - hd: [ - t1, - t2 - ], - tl: trace - }, t1, t2, cstrs); + const t2$1 = match$1._0; + if (t2$1 !== undefined) { + t1 = t1$1; + t2 = t2$1; + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + } else { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } + if (match$1.TAG === /* Rpresent */ 0) { + if (match$1._0 !== undefined) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + return cstrs; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + } else if (match._0) { + if (match._1) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$1.TAG === /* Rpresent */ 0) { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } - - } else if (!match._0) { + if (match$1._0) { + if (match$1._1) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + return cstrs; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } else { const match$2 = match._1; if (match$2) { - const t1$1 = match$2.hd; + if (match$2.tl) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } if (match$1.TAG === /* Rpresent */ 0) { - const t2$1 = match$1._0; - if (t2$1 !== undefined) { - return subtype_rec(env, { - hd: [ - t1$1, - t2$1 - ], - tl: trace - }, t1$1, t2$1, cstrs); + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$1._0) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + const match$3 = match$1._1; + if (match$3) { + if (match$3.tl) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } + t1 = match$2.hd; + t2 = match$3.hd; + } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } } - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$1.TAG === /* Rpresent */ 0) { - if (match$1._0 !== undefined) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - return cstrs; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - }), cstrs, pairs); + return subtype_rec(env, { + hd: [ + t1, + t2 + ], + tl: trace + }, t1, t2, cstrs); + }), cstrs$4, pairs); } throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } - + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + default: + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + } + if (exit$5 === 1) { + let exit$6 = 0; + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string") { + exit$6 = 2; + } else { + switch (match$7.TAG) { + case /* Tvar */ 0 : + case /* Tconstr */ 3 : + exit$6 = 2; + break; + default: + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Exit) { - return { - hd: [ - trace, - t1$1, - t2$1, - univar_pairs.contents - ], - tl: cstrs - }; + if (exit$6 === 2) { + if (row1$1.row_closed && Caml_obj.caml_equal(r1, /* [] */ 0)) { + return Stdlib__List.fold_left((function (cstrs, param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + return cstrs; + } + if (match.TAG === /* Rpresent */ 0) { + const t1 = match._0; + if (t1 !== undefined) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + const t2 = match$1._0; + if (t2 !== undefined) { + return subtype_rec(env, { + hd: [ + t1, + t2 + ], + tl: trace + }, t1, t2, cstrs); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + + } else if (!match._0) { + const match$2 = match._1; + if (match$2) { + const t1$1 = match$2.hd; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + const t2$1 = match$1._0; + if (t2$1 !== undefined) { + return subtype_rec(env, { + hd: [ + t1$1, + t2$1 + ], + tl: trace + }, t1$1, t2$1, cstrs); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$1.TAG === /* Rpresent */ 0) { + if (match$1._0 !== undefined) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + return cstrs; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + }), cstrs, pairs); } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } - default: - exit = 1; - } + + } + + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Exit) { + return { + hd: [ + trace, + t1$1, + t2$1, + univar_pairs.contents + ], + tl: cstrs + }; + } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + default: + exit = 1; } - break; + } + break; case /* Tpoly */ 10 : - const tl1$1 = match._1; - const u1$1 = match._0; - let exit$7 = 0; - if (tl1$1) { - exit$7 = 7; - } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tpoly */ 10 : - if (match$1._1) { - exit$7 = 7; - } else { - _t2 = match$1._0; - _t1 = u1$1; - continue; - } - break; - default: - exit = 1; - } - } - if (exit$7 === 7) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 6; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tpoly */ 10 : - const u2$1 = match$1._0; - if (match$1._1) { - try { - return enter_poly(env, univar_pairs, u1$1, tl1$1, u2$1, match$1._1, (function (t1, t2) { - return subtype_rec(env, trace, t1, t2, cstrs); - })); - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Unify) { - return { - hd: [ - trace, - t1$1, - t2$1, - univar_pairs.contents - ], - tl: cstrs - }; - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - } else { - const match$8 = instance_poly(undefined, false, tl1$1, u1$1); - _t2 = u2$1; - _t1 = match$8[1]; - continue; - } - default: - exit = 1; + const tl1$1 = match._1; + const u1$1 = match._0; + let exit$7 = 0; + if (tl1$1) { + exit$7 = 7; + } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + case /* Tpoly */ 10 : + if (match$1._1) { + exit$7 = 7; + } else { + _t2 = match$1._0; + _t1 = u1$1; + continue; } - } + break; + default: + exit = 1; } - break; - case /* Tpackage */ 11 : - const tl1$2 = match._2; - const nl1 = match._1; - const p1 = match._0; + } + if (exit$7 === 7) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { exit = 1; } else { switch (match$1.TAG) { case /* Tvar */ 0 : - exit$4 = 6; - break; + exit$4 = 6; + break; case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tpackage */ 11 : - const tl2$1 = match$1._2; - const nl2 = match$1._1; - const p2 = match$1._0; + exit$2 = 4; + break; + case /* Tpoly */ 10 : + const u2$1 = match$1._0; + if (match$1._1) { try { - const ntl1 = complete_type_list(undefined, env, nl2, t1$1.level, { - TAG: /* Mty_ident */ 0, - _0: p1 - }, nl1, tl1$2); - const ntl2 = complete_type_list(true, env, nl1, t2$1.level, { - TAG: /* Mty_ident */ 0, - _0: p2 - }, nl2, tl2$1); - const cstrs$p = Stdlib__List.map((function (param) { - return [ - trace, - Stdlib__List.assoc(param[0], ntl1), - param[1], - univar_pairs.contents - ]; - }), ntl2); - if (eq_package_path(env, p1, p2)) { - return Stdlib.$at(cstrs$p, cstrs); - } - const snap = snapshot(undefined); - try { - Stdlib__List.iter((function (param) { - unify$2(env, param[1], param[2]); - }), cstrs$p); - if (Curry._7(package_subtype.contents, env, p1, nl1, tl1$2, p2, nl2, tl2$1)) { - backtrack(snap); - return Stdlib.$at(cstrs$p, cstrs); - } - throw new Caml_js_exceptions.MelangeError(Unify, { - MEL_EXN_ID: Unify, - _1: /* [] */ 0 - }); - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Unify) { - backtrack(snap); - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); - } + return enter_poly(env, univar_pairs, u1$1, tl1$1, u2$1, match$1._1, (function (t1, t2) { + return subtype_rec(env, trace, t1, t2, cstrs); + })); } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Stdlib.Not_found) { + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Unify) { return { hd: [ trace, @@ -38348,13 +38258,103 @@ function subtype_rec(env, _trace, _t1, _t2, _cstrs) { tl: cstrs }; } - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); } + } else { + const match$8 = instance_poly(undefined, false, tl1$1, u1$1); + _t2 = u2$1; + _t1 = match$8[1]; + continue; + } default: exit = 1; } } - break; + } + break; + case /* Tpackage */ 11 : + const tl1$2 = match._2; + const nl1 = match._1; + const p1 = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 6; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + case /* Tpackage */ 11 : + const tl2$1 = match$1._2; + const nl2 = match$1._1; + const p2 = match$1._0; + try { + const ntl1 = complete_type_list(undefined, env, nl2, t1$1.level, { + TAG: /* Mty_ident */ 0, + _0: p1 + }, nl1, tl1$2); + const ntl2 = complete_type_list(true, env, nl1, t2$1.level, { + TAG: /* Mty_ident */ 0, + _0: p2 + }, nl2, tl2$1); + const cstrs$p = Stdlib__List.map((function (param) { + return [ + trace, + Stdlib__List.assoc(param[0], ntl1), + param[1], + univar_pairs.contents + ]; + }), ntl2); + if (eq_package_path(env, p1, p2)) { + return Stdlib.$at(cstrs$p, cstrs); + } + const snap = snapshot(undefined); + try { + Stdlib__List.iter((function (param) { + unify$2(env, param[1], param[2]); + }), cstrs$p); + if (Curry._7(package_subtype.contents, env, p1, nl1, tl1$2, p2, nl2, tl2$1)) { + backtrack(snap); + return Stdlib.$at(cstrs$p, cstrs); + } + throw new Caml_js_exceptions.MelangeError(Unify, { + MEL_EXN_ID: Unify, + _1: /* [] */ 0 + }); + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Unify) { + backtrack(snap); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } + } + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Stdlib.Not_found) { + return { + hd: [ + trace, + t1$1, + t2$1, + univar_pairs.contents + ], + tl: cstrs + }; + } + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + default: + exit = 1; + } + } + break; default: exit$4 = 6; } @@ -38481,15 +38481,15 @@ function subtype_rec(env, _trace, _t1, _t2, _cstrs) { switch (exit) { case 1 : case 2 : - return { - hd: [ - trace, - t1$1, - t2$1, - univar_pairs.contents - ], - tl: cstrs - }; + return { + hd: [ + trace, + t1$1, + t2$1, + univar_pairs.contents + ], + tl: cstrs + }; } } else { @@ -38540,22 +38540,22 @@ function unalias_object(ty) { } switch (match.TAG) { case /* Tvar */ 0 : - return newty2(ty$1.level, ty$1.desc); + return newty2(ty$1.level, ty$1.desc); case /* Tconstr */ 3 : - return newty2(ty$1.level, { - TAG: /* Tvar */ 0, - _0: undefined - }); + return newty2(ty$1.level, { + TAG: /* Tvar */ 0, + _0: undefined + }); case /* Tfield */ 5 : - return newty2(ty$1.level, { - TAG: /* Tfield */ 5, - _0: match._0, - _1: match._1, - _2: match._2, - _3: unalias_object(match._3) - }); + return newty2(ty$1.level, { + TAG: /* Tfield */ 5, + _0: match._0, + _1: match._1, + _2: match._2, + _3: unalias_object(match._3) + }); case /* Tunivar */ 9 : - return ty$1; + return ty$1; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -38576,29 +38576,29 @@ function unalias(ty) { } switch (row.TAG) { case /* Tobject */ 4 : - const ty$2 = row._0; - return newty2(ty$2.level, { - TAG: /* Tobject */ 4, - _0: unalias_object(ty$2), - _1: row._1 - }); + const ty$2 = row._0; + return newty2(ty$2.level, { + TAG: /* Tobject */ 4, + _0: unalias_object(ty$2), + _1: row._1 + }); case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const more = row$1.row_more; - return newty2(ty$1.level, { - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$1.row_fields, - row_more: newty2(more.level, more.desc), - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: row$1.row_fixed, - row_name: row$1.row_name - } - }); + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const more = row$1.row_more; + return newty2(ty$1.level, { + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$1.row_fields, + row_more: newty2(more.level, more.desc), + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: row$1.row_fixed, + row_name: row$1.row_name + } + }); case /* Tvar */ 0 : case /* Tunivar */ 9 : - return ty$1; + return ty$1; default: return newty2(ty$1.level, ty$1.desc); } @@ -38662,140 +38662,140 @@ function normalize_type_rec(env, visited, ty) { if (!/* tag */ (typeof row === "number" || typeof row === "string")) { switch (row.TAG) { case /* Tobject */ 4 : - const nm = row._1; - const match = nm.contents; - if (match !== undefined) { - const match$1 = match[1]; - if (match$1) { - const l = match$1.tl; - const v = match$1.hd; - const n = match[0]; - if (deep_occur(ty$1, newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: l - }))) { - set_name(nm, undefined); - } else { - const v$p = repr(v); - const match$2 = v$p.desc; - let exit = 0; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { - log_type(ty$1); - ty$1.desc = { - TAG: /* Tconstr */ 3, - _0: n, - _1: l, - _2: { - contents: /* Mnil */ 0 - } - }; - } else { - switch (match$2.TAG) { - case /* Tvar */ 0 : - case /* Tunivar */ 9 : - exit = 1; - break; - default: - set_name(nm, undefined); + const nm = row._1; + const match = nm.contents; + if (match !== undefined) { + const match$1 = match[1]; + if (match$1) { + const l = match$1.tl; + const v = match$1.hd; + const n = match[0]; + if (deep_occur(ty$1, newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: l + }))) { + set_name(nm, undefined); + } else { + const v$p = repr(v); + const match$2 = v$p.desc; + let exit = 0; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + log_type(ty$1); + ty$1.desc = { + TAG: /* Tconstr */ 3, + _0: n, + _1: l, + _2: { + contents: /* Mnil */ 0 } + }; + } else { + switch (match$2.TAG) { + case /* Tvar */ 0 : + case /* Tunivar */ 9 : + exit = 1; + break; + default: + set_name(nm, undefined); } - if (exit === 1) { - if (v$p !== v) { - set_name(nm, [ - n, - { - hd: v$p, - tl: l - } - ]); - } - + } + if (exit === 1) { + if (v$p !== v) { + set_name(nm, [ + n, + { + hd: v$p, + tl: l + } + ]); } } - } else { - fatal_error("Ctype.normalize_type_rec"); + } + } else { + fatal_error("Ctype.normalize_type_rec"); } - const fi = repr(row._0); - if (fi.level >= 0) { - const match$3 = flatten_fields(fi); - const fi$p = build_fields(fi.level)(match$3[0], match$3[1]); - log_type(ty$1); - fi.desc = fi$p.desc; - } - break; + } + const fi = repr(row._0); + if (fi.level >= 0) { + const match$3 = flatten_fields(fi); + const fi$p = build_fields(fi.level)(match$3[0], match$3[1]); + log_type(ty$1); + fi.desc = fi$p.desc; + } + break; case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const fields = Stdlib__List.map((function (param) { - const f0 = param[1]; - const f = row_field_repr_aux(/* [] */ 0, f0); - let tmp; - if (/* tag */ typeof f === "number" || typeof f === "string" || f.TAG === /* Rpresent */ 0) { - tmp = f; - } else { - const match = f._1; - if (match) { - const tyl = match.tl; - if (tyl) { - const tyl$p = Stdlib__List.fold_left((function (tyl, ty) { - if (Stdlib__List.exists((function (ty$p) { - return equal$5(env, false, { - hd: ty, - tl: /* [] */ 0 - }, { - hd: ty$p, - tl: /* [] */ 0 - }); - }), tyl)) { - return tyl; - } else { - return { - hd: ty, - tl: tyl - }; - } - }), { - hd: match.hd, - tl: /* [] */ 0 - }, tyl); - tmp = f !== f0 || Stdlib__List.length(tyl$p) < Stdlib__List.length(tyl) ? ({ - TAG: /* Reither */ 1, - _0: f._0, - _1: Stdlib__List.rev(tyl$p), - _2: f._2, - _3: f._3 - }) : f; - } else { - tmp = f; - } + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const fields = Stdlib__List.map((function (param) { + const f0 = param[1]; + const f = row_field_repr_aux(/* [] */ 0, f0); + let tmp; + if (/* tag */ typeof f === "number" || typeof f === "string" || f.TAG === /* Rpresent */ 0) { + tmp = f; + } else { + const match = f._1; + if (match) { + const tyl = match.tl; + if (tyl) { + const tyl$p = Stdlib__List.fold_left((function (tyl, ty) { + if (Stdlib__List.exists((function (ty$p) { + return equal$5(env, false, { + hd: ty, + tl: /* [] */ 0 + }, { + hd: ty$p, + tl: /* [] */ 0 + }); + }), tyl)) { + return tyl; + } else { + return { + hd: ty, + tl: tyl + }; + } + }), { + hd: match.hd, + tl: /* [] */ 0 + }, tyl); + tmp = f !== f0 || Stdlib__List.length(tyl$p) < Stdlib__List.length(tyl) ? ({ + TAG: /* Reither */ 1, + _0: f._0, + _1: Stdlib__List.rev(tyl$p), + _2: f._2, + _3: f._3 + }) : f; } else { tmp = f; } + } else { + tmp = f; } - return [ - param[0], - tmp - ]; - }), row$1.row_fields); - const fields$1 = Stdlib__List.sort((function (param, param$1) { - return Caml.caml_string_compare(param[0], param$1[0]); - }), Stdlib__List.filter((function (param) { - return Caml_obj.caml_notequal(param[1], /* Rabsent */ 0); - }), fields)); - log_type(ty$1); - ty$1.desc = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: fields$1, - row_more: row$1.row_more, - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: row$1.row_fixed, - row_name: row$1.row_name - } - }; - break; + } + return [ + param[0], + tmp + ]; + }), row$1.row_fields); + const fields$1 = Stdlib__List.sort((function (param, param$1) { + return Caml.caml_string_compare(param[0], param$1[0]); + }), Stdlib__List.filter((function (param) { + return Caml_obj.caml_notequal(param[1], /* Rabsent */ 0); + }), fields)); + log_type(ty$1); + ty$1.desc = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: fields$1, + row_more: row$1.row_more, + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: row$1.row_fixed, + row_name: row$1.row_name + } + }; + break; } } @@ -38824,11 +38824,11 @@ function nondep_type_rec(env, id, _ty) { } else { switch (ty$1.TAG) { case /* Tlink */ 6 : - _ty = ty$1._0; - continue; + _ty = ty$1._0; + continue; case /* Tvar */ 0 : case /* Tunivar */ 9 : - return ty; + return ty; default: exit = 1; } @@ -38853,124 +38853,124 @@ function nondep_type_rec(env, id, _ty) { } else { switch (row.TAG) { case /* Tconstr */ 3 : - const p = row._0; - if (isfree(id, p)) { - try { - tmp = { - TAG: /* Tlink */ 6, - _0: nondep_type_rec(env, id, expand_abbrev(env)(newty2(ty.level, ty.desc))) - }; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Cannot_expand) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (exn$1.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - } else { - tmp = { - TAG: /* Tconstr */ 3, - _0: p, - _1: Stdlib__List.map((function (param) { - return nondep_type_rec(env, id, param); - }), row._1), - _2: { - contents: /* Mnil */ 0 - } - }; - } - break; - case /* Tobject */ 4 : - const match = row._1.contents; - let tmp$1; - if (match !== undefined) { - const p$1 = match[0]; - tmp$1 = isfree(id, p$1) ? undefined : [ - p$1, - Stdlib__List.map((function (param) { - return nondep_type_rec(env, id, param); - }), match[1]) - ]; - } else { - tmp$1 = undefined; - } - tmp = { - TAG: /* Tobject */ 4, - _0: nondep_type_rec(env, id, row._0), - _1: { - contents: tmp$1 - } - }; - break; - case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const more = repr(row$1.row_more); + const p = row._0; + if (isfree(id, p)) { try { - const ty2 = Curry._2(TypeHash.find, nondep_variants, more); - Curry._3(TypeHash.add, nondep_hash, ty, ty2); tmp = { TAG: /* Tlink */ 6, - _0: ty2 + _0: nondep_type_rec(env, id, expand_abbrev(env)(newty2(ty.level, ty.desc))) }; } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - Curry._3(TypeHash.add, nondep_variants, more, ty$p); - const $$static = static_row(row$1); - const more$p = $$static ? newty2(100000000, /* Tnil */ 0) : more; - const row$2 = copy_row((function (param) { - return nondep_type_rec(env, id, param); - }), true, row$1, true, more$p); - const match$1 = row$2.row_name; - tmp = match$1 !== undefined && isfree(id, match$1[0]) ? ({ - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$2.row_fields, - row_more: row$2.row_more, - row_bound: row$2.row_bound, - row_closed: row$2.row_closed, - row_fixed: row$2.row_fixed, - row_name: undefined - } - }) : ({ - TAG: /* Tvariant */ 8, - _0: row$2 - }); - } else { - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Cannot_expand) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - } - break; - case /* Tpackage */ 11 : - const p$2 = row._0; - if (isfree(id, p$2)) { - const p$p = normalize_package_path(env, p$2); - if (isfree(id, p$p)) { + if (exn$1.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - tmp = { - TAG: /* Tpackage */ 11, - _0: p$p, - _1: row._1, - _2: Stdlib__List.map((function (param) { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + } else { + tmp = { + TAG: /* Tconstr */ 3, + _0: p, + _1: Stdlib__List.map((function (param) { + return nondep_type_rec(env, id, param); + }), row._1), + _2: { + contents: /* Mnil */ 0 + } + }; + } + break; + case /* Tobject */ 4 : + const match = row._1.contents; + let tmp$1; + if (match !== undefined) { + const p$1 = match[0]; + tmp$1 = isfree(id, p$1) ? undefined : [ + p$1, + Stdlib__List.map((function (param) { return nondep_type_rec(env, id, param); - }), row._2) - }; + }), match[1]) + ]; + } else { + tmp$1 = undefined; + } + tmp = { + TAG: /* Tobject */ 4, + _0: nondep_type_rec(env, id, row._0), + _1: { + contents: tmp$1 + } + }; + break; + case /* Tvariant */ 8 : + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const more = repr(row$1.row_more); + try { + const ty2 = Curry._2(TypeHash.find, nondep_variants, more); + Curry._3(TypeHash.add, nondep_hash, ty, ty2); + tmp = { + TAG: /* Tlink */ 6, + _0: ty2 + }; + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + Curry._3(TypeHash.add, nondep_variants, more, ty$p); + const $$static = static_row(row$1); + const more$p = $$static ? newty2(100000000, /* Tnil */ 0) : more; + const row$2 = copy_row((function (param) { + return nondep_type_rec(env, id, param); + }), true, row$1, true, more$p); + const match$1 = row$2.row_name; + tmp = match$1 !== undefined && isfree(id, match$1[0]) ? ({ + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$2.row_fields, + row_more: row$2.row_more, + row_bound: row$2.row_bound, + row_closed: row$2.row_closed, + row_fixed: row$2.row_fixed, + row_name: undefined + } + }) : ({ + TAG: /* Tvariant */ 8, + _0: row$2 + }); } else { - exit$1 = 2; + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); } - break; + } + break; + case /* Tpackage */ 11 : + const p$2 = row._0; + if (isfree(id, p$2)) { + const p$p = normalize_package_path(env, p$2); + if (isfree(id, p$p)) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + tmp = { + TAG: /* Tpackage */ 11, + _0: p$p, + _1: row._1, + _2: Stdlib__List.map((function (param) { + return nondep_type_rec(env, id, param); + }), row._2) + }; + } else { + exit$1 = 2; + } + break; default: exit$1 = 2; } @@ -39229,31 +39229,31 @@ function nondep_class_type(env, id, _sign) { const sign = _sign; switch (sign.TAG) { case /* Cty_constr */ 0 : - const p = sign._0; - if (!isfree(id, p)) { - return { - TAG: /* Cty_constr */ 0, - _0: p, - _1: Stdlib__List.map((function (param) { - return nondep_type_rec(env, id, param); - }), sign._1), - _2: nondep_class_type(env, id, sign._2) - }; - } - _sign = sign._2; - continue; - case /* Cty_signature */ 1 : + const p = sign._0; + if (!isfree(id, p)) { return { - TAG: /* Cty_signature */ 1, - _0: nondep_class_signature(env, id, sign._0) - }; - case /* Cty_arrow */ 2 : - return { - TAG: /* Cty_arrow */ 2, - _0: sign._0, - _1: nondep_type_rec(env, id, sign._1), + TAG: /* Cty_constr */ 0, + _0: p, + _1: Stdlib__List.map((function (param) { + return nondep_type_rec(env, id, param); + }), sign._1), _2: nondep_class_type(env, id, sign._2) }; + } + _sign = sign._2; + continue; + case /* Cty_signature */ 1 : + return { + TAG: /* Cty_signature */ 1, + _0: nondep_class_signature(env, id, sign._0) + }; + case /* Cty_arrow */ 2 : + return { + TAG: /* Cty_arrow */ 2, + _0: sign._0, + _1: nondep_type_rec(env, id, sign._1), + _2: nondep_class_type(env, id, sign._2) + }; } }; @@ -39391,31 +39391,31 @@ const out_ident = { function print_ident(ppf, s) { switch (s.TAG) { case /* Oide_apply */ 0 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } - }, - _1: "%a(%a)" - }), print_ident, s._0, print_ident, s._1); + } + }, + _1: "%a(%a)" + }), print_ident, s._0, print_ident, s._1); case /* Oide_dot */ 1 : - print_ident(ppf, s._0); - Stdlib__Format.pp_print_char(ppf, /* '.' */46); - return Curry._2(out_ident.contents, ppf, s._1); + print_ident(ppf, s._0); + Stdlib__Format.pp_print_char(ppf, /* '.' */46); + return Curry._2(out_ident.contents, ppf, s._1); case /* Oide_ident */ 2 : - return Curry._2(out_ident.contents, ppf, s._0); + return Curry._2(out_ident.contents, ppf, s._0); } } @@ -39575,90 +39575,90 @@ function print_out_type(ppf, ty) { } switch (ty.TAG) { case /* Otyp_alias */ 0 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "as '", _1: { - TAG: /* String_literal */ 11, - _0: "as '", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[%a@ as '%s@]" - }), print_out_type, ty._0, ty._1); + } + }, + _1: "@[%a@ as '%s@]" + }), print_out_type, ty._0, ty._1); case /* Otyp_poly */ 12 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[%a.@ %a@]" - }), pr_vars, ty._0, print_out_type, ty._1); + } + }, + _1: "@[%a.@ %a@]" + }), pr_vars, ty._0, print_out_type, ty._1); default: return print_out_type_1(ppf, ty); } @@ -39726,535 +39726,581 @@ function print_simple_out_type(ppf, s) { } switch (s.TAG) { case /* Otyp_class */ 2 : - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '#' */35, _1: { - TAG: /* Char_literal */ 12, - _0: /* '#' */35, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[%a%s#%a@]" - }), print_typargs, s._2, s._0 ? "_" : "", print_ident, s._1); + } + }, + _1: "@[%a%s#%a@]" + }), print_typargs, s._2, s._0 ? "_" : "", print_ident, s._1); case /* Otyp_constr */ 3 : - const id = s._0; - let exit = 0; - switch (id.TAG) { - case /* Oide_dot */ 1 : - const match = id._0; - let exit$1 = 0; - switch (match.TAG) { + const id = s._0; + let exit = 0; + switch (id.TAG) { + case /* Oide_dot */ 1 : + const match = id._0; + let exit$1 = 0; + switch (match.TAG) { + case /* Oide_apply */ 0 : + exit = 2; + break; + case /* Oide_dot */ 1 : + const match$1 = match._0; + switch (match$1.TAG) { case /* Oide_apply */ 0 : - exit = 2; - break; case /* Oide_dot */ 1 : - const match$1 = match._0; - switch (match$1.TAG) { - case /* Oide_apply */ 0 : - case /* Oide_dot */ 1 : - exit = 2; - break; - case /* Oide_ident */ 2 : - if (match$1._0 === "Js" && match._1 === "Internal") { - exit$1 = 3; - } else { - exit = 2; - } - break; - - } - break; + exit = 2; + break; case /* Oide_ident */ 2 : - if (match._0 === "Js_internal") { - exit$1 = 3; - } else { - exit = 2; - } - break; + if (match$1._0 === "Js" && match._1 === "Internal") { + exit$1 = 3; + } else { + exit = 2; + } + break; } - if (exit$1 === 3) { - const name = id._1; - let exit$2 = 0; - switch (name) { - case "fn" : - case "meth" : - exit$2 = 4; - break; - case "meth_callback" : - const tyl = s._1; - if (tyl) { - const match$2 = tyl.hd; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Otyp_variant */ 11) { - exit = 2; - } else { - const match$3 = match$2._1; - if (match$3.TAG === /* Ovar_fields */ 0) { - const match$4 = match$3._0; - if (match$4 && !match$4.tl) { - const match$5 = tyl.tl; - if (match$5 && !match$5.tl) { - const match$6 = match$4.hd; - const variant = match$6[0]; - const make = function (tys, result) { - if (tys) { - const single = tys.hd; - if (!/* tag */ (typeof single === "number" || typeof single === "string") && single.TAG === /* Otyp_tuple */ 9) { - if (tys.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (variant === "Arity_1") { - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: single, - _2: result - }; - } else { - return Stdlib__List.fold_right((function (x, acc) { - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: x, - _2: acc - }; - }), single._0, result); - } - } - if (tys.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: single, - _2: result - }; - } + break; + case /* Oide_ident */ 2 : + if (match._0 === "Js_internal") { + exit$1 = 3; + } else { + exit = 2; + } + break; + + } + if (exit$1 === 3) { + const name = id._1; + let exit$2 = 0; + switch (name) { + case "fn" : + case "meth" : + exit$2 = 4; + break; + case "meth_callback" : + const tyl = s._1; + if (tyl) { + const match$2 = tyl.hd; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string" || match$2.TAG !== /* Otyp_variant */ 11) { + exit = 2; + } else { + const match$3 = match$2._1; + if (match$3.TAG === /* Ovar_fields */ 0) { + const match$4 = match$3._0; + if (match$4 && !match$4.tl) { + const match$5 = tyl.tl; + if (match$5 && !match$5.tl) { + const match$6 = match$4.hd; + const variant = match$6[0]; + const make = function (tys, result) { + if (tys) { + const single = tys.hd; + if (!/* tag */ (typeof single === "number" || typeof single === "string") && single.TAG === /* Otyp_tuple */ 9) { + if (tys.tl) { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); - }; - let exit$3 = 0; - let res; - try { - res = make(match$6[2], match$5.hd); - exit$3 = 5; } - catch (exn){ - Stdlib__Format.pp_open_box(ppf, 0); - print_typargs(ppf, tyl); - print_ident(ppf, id); - return Stdlib__Format.pp_close_box(ppf, undefined); + if (variant === "Arity_1") { + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: single, + _2: result + }; + } else { + return Stdlib__List.fold_right((function (x, acc) { + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: x, + _2: acc + }; + }), single._0, result); } - if (exit$3 === 5) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ + } + if (tys.tl) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: single, + _2: result + }; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + }; + let exit$3 = 0; + let res; + try { + res = make(match$6[2], match$5.hd); + exit$3 = 5; + } + catch (exn){ + Stdlib__Format.pp_open_box(ppf, 0); + print_typargs(ppf, tyl); + print_ident(ppf, id); + return Stdlib__Format.pp_close_box(ppf, undefined); + } + if (exit$3 === 5) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* String_literal */ 11, + _0: "<0>", + _1: /* End_of_format */ 0 + }, + _1: "<0>" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<0>", - _1: /* End_of_format */ 0 - }, - _1: "<0>" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { TAG: /* Char_literal */ 12, - _0: /* '(' */40, + _0: /* '[' */91, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Scan_indic */ 2, + _0: /* 'm' */109 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "el.this])", _1: { - TAG: /* Char_literal */ 12, - _0: /* '[' */91, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Scan_indic */ 2, - _0: /* 'm' */109 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "el.this])", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[<0>(%a@ [@mel.this])@]" - }), print_out_type_1, res); - } - - } else { - exit = 2; - } - } else { - exit = 2; - } - } else { - exit = 2; + } + } + } + }, + _1: "@[<0>(%a@ [@mel.this])@]" + }), print_out_type_1, res); } + + } else { + exit = 2; } } else { exit = 2; } - break; - default: - exit = 2; - } - if (exit$2 === 4) { - const tyl$1 = s._1; - if (tyl$1) { - const match$7 = tyl$1.hd; - if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string" || match$7.TAG !== /* Otyp_variant */ 11) { - exit = 2; } else { - const match$8 = match$7._1; - if (match$8.TAG === /* Ovar_fields */ 0) { - const match$9 = match$8._0; - if (match$9 && !match$9.tl) { - const match$10 = tyl$1.tl; - if (match$10 && !match$10.tl) { - const match$11 = match$9.hd; - const variant$1 = match$11[0]; - const make$1 = function (tys, result) { - if (Caml_obj.caml_equal(tys, /* [] */ 0)) { - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: { - TAG: /* Otyp_constr */ 3, - _0: { - TAG: /* Oide_ident */ 2, - _0: "unit" - }, - _1: /* [] */ 0 - }, - _2: result - }; + exit = 2; + } + } + } else { + exit = 2; + } + break; + default: + exit = 2; + } + if (exit$2 === 4) { + const tyl$1 = s._1; + if (tyl$1) { + const match$7 = tyl$1.hd; + if (/* tag */ typeof match$7 === "number" || typeof match$7 === "string" || match$7.TAG !== /* Otyp_variant */ 11) { + exit = 2; + } else { + const match$8 = match$7._1; + if (match$8.TAG === /* Ovar_fields */ 0) { + const match$9 = match$8._0; + if (match$9 && !match$9.tl) { + const match$10 = tyl$1.tl; + if (match$10 && !match$10.tl) { + const match$11 = match$9.hd; + const variant$1 = match$11[0]; + const make$1 = function (tys, result) { + if (Caml_obj.caml_equal(tys, /* [] */ 0)) { + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: { + TAG: /* Otyp_constr */ 3, + _0: { + TAG: /* Oide_ident */ 2, + _0: "unit" + }, + _1: /* [] */ 0 + }, + _2: result + }; + } + if (tys) { + const single = tys.hd; + if (!/* tag */ (typeof single === "number" || typeof single === "string") && single.TAG === /* Otyp_tuple */ 9) { + if (tys.tl) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - if (tys) { - const single = tys.hd; - if (!/* tag */ (typeof single === "number" || typeof single === "string") && single.TAG === /* Otyp_tuple */ 9) { - if (tys.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (variant$1 === "Arity_1") { - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: single, - _2: result - }; - } else { - return Stdlib__List.fold_right((function (x, acc) { - return { - TAG: /* Otyp_arrow */ 1, - _0: "", - _1: x, - _2: acc - }; - }), single._0, result); - } - } - if (tys.tl) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } + if (variant$1 === "Arity_1") { return { TAG: /* Otyp_arrow */ 1, _0: "", _1: single, _2: result }; + } else { + return Stdlib__List.fold_right((function (x, acc) { + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: x, + _2: acc + }; + }), single._0, result); } + } + if (tys.tl) { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); - }; - let exit$4 = 0; - let res$1; - try { - res$1 = make$1(match$11[2], match$10.hd); - exit$4 = 5; } - catch (exn$1){ - Stdlib__Format.pp_open_box(ppf, 0); - print_typargs(ppf, tyl$1); - print_ident(ppf, id); - return Stdlib__Format.pp_close_box(ppf, undefined); - } - if (exit$4 === 5) { - switch (name) { - case "fn" : - return Curry._2(Stdlib__Format.fprintf(ppf)({ + return { + TAG: /* Otyp_arrow */ 1, + _0: "", + _1: single, + _2: result + }; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + }; + let exit$4 = 0; + let res$1; + try { + res$1 = make$1(match$11[2], match$10.hd); + exit$4 = 5; + } + catch (exn$1){ + Stdlib__Format.pp_open_box(ppf, 0); + print_typargs(ppf, tyl$1); + print_ident(ppf, id); + return Stdlib__Format.pp_close_box(ppf, undefined); + } + if (exit$4 === 5) { + switch (name) { + case "fn" : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* String_literal */ 11, + _0: "<0>", + _1: /* End_of_format */ 0 + }, + _1: "<0>" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<0>", - _1: /* End_of_format */ 0 - }, - _1: "<0>" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { TAG: /* Char_literal */ 12, - _0: /* '(' */40, + _0: /* '[' */91, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Scan_indic */ 2, + _0: /* 'u' */117 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "])", _1: { - TAG: /* Char_literal */ 12, - _0: /* '[' */91, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Scan_indic */ 2, - _0: /* 'u' */117 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "])", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[<0>(%a@ [@u])@]" - }), print_out_type_1, res$1); - case "meth" : - return Curry._2(Stdlib__Format.fprintf(ppf)({ + } + } + } + }, + _1: "@[<0>(%a@ [@u])@]" + }), print_out_type_1, res$1); + case "meth" : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* String_literal */ 11, + _0: "<0>", + _1: /* End_of_format */ 0 + }, + _1: "<0>" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<0>", - _1: /* End_of_format */ 0 - }, - _1: "<0>" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { TAG: /* Char_literal */ 12, - _0: /* '(' */40, + _0: /* '[' */91, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Scan_indic */ 2, + _0: /* 'm' */109 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "el.meth])", _1: { - TAG: /* Char_literal */ 12, - _0: /* '[' */91, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Scan_indic */ 2, - _0: /* 'm' */109 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "el.meth])", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[<0>(%a@ [@mel.meth])@]" - }), print_out_type_1, res$1); - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 34910, - 17 - ] - }); - } - } - - } else { - exit = 2; + } + } + } + }, + _1: "@[<0>(%a@ [@mel.meth])@]" + }), print_out_type_1, res$1); + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 34910, + 17 + ] + }); } - } else { - exit = 2; } + } else { exit = 2; } + } else { + exit = 2; } } else { exit = 2; } } - + } else { + exit = 2; } - break; - case /* Oide_apply */ 0 : - case /* Oide_ident */ 2 : - exit = 2; - break; - - } - if (exit === 2) { - Stdlib__Format.pp_open_box(ppf, 0); - print_typargs(ppf, s._1); - print_ident(ppf, id); - return Stdlib__Format.pp_close_box(ppf, undefined); - } - break; + } + + } + break; + case /* Oide_apply */ 0 : + case /* Oide_ident */ 2 : + exit = 2; + break; + + } + if (exit === 2) { + Stdlib__Format.pp_open_box(ppf, 0); + print_typargs(ppf, s._1); + print_ident(ppf, id); + return Stdlib__Format.pp_close_box(ppf, undefined); + } + break; case /* Otyp_object */ 5 : - const rest = s._1; - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const rest = s._1; + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "< ", _1: { - TAG: /* String_literal */ 11, - _0: "< ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " >", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " >", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<2>< %a >@]" - }), (function (param, param$1) { - return print_fields(rest, param, param$1); - }), s._0); + } + }, + _1: "@[<2>< %a >@]" + }), (function (param, param$1) { + return print_fields(rest, param, param$1); + }), s._0); case /* Otyp_stuff */ 7 : - return Stdlib__Format.pp_print_string(ppf, s._0); + return Stdlib__Format.pp_print_string(ppf, s._0); case /* Otyp_var */ 10 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '\'' */39, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '\'' */39, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + _1: /* End_of_format */ 0 } - }, - _1: "'%s%s" - }), s._0 ? "_" : "", s._1); + } + }, + _1: "'%s%s" + }), s._0 ? "_" : "", s._1); case /* Otyp_variant */ 11 : - const tags = s._3; - const print_present = function (ppf, l) { - if (l !== undefined && l) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ + const tags = s._3; + const print_present = function (ppf, l) { + if (l !== undefined && l) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "> ", + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "@;<1 -2>> @[%a@]" + }), pr_present, l); + } + + }; + const print_fields$1 = function (ppf, fields) { + if (fields.TAG === /* Ovar_fields */ 0) { + return print_list(print_row_field, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, @@ -40266,99 +40312,67 @@ function print_simple_out_type(ppf, s) { }, _1: { TAG: /* String_literal */ 11, - _0: "> ", - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + _0: "| ", + _1: /* End_of_format */ 0 } }, - _1: "@;<1 -2>> @[%a@]" - }), pr_present, l); - } - - }; - const print_fields$1 = function (ppf, fields) { - if (fields.TAG === /* Ovar_fields */ 0) { - return print_list(print_row_field, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: "@;<1 -2>| " + }); + }), ppf, fields._0); + } else { + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "| ", + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: /* End_of_format */ 0 } - }, - _1: "@;<1 -2>| " - }); - }), ppf, fields._0); - } else { - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + } + } + }, + _1: "@[%a%a@]" + }), print_typargs, fields._1, print_ident, fields._0); + } + }; + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '[' */91, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Alpha */ 15, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* String_literal */ 11, + _0: "", _1: /* End_of_format */ 0 - } + }, + _1: "" } - } - }, - _1: "@[%a%a@]" - }), print_typargs, fields._1, print_ident, fields._0); - } - }; - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '[' */91, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + }, _1: { TAG: /* Formatting_gen */ 18, _0: { @@ -40374,34 +40388,19 @@ function print_simple_out_type(ppf, s) { } }, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Alpha */ 15, _0: { TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " ]", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + _0: " ]", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -40410,94 +40409,95 @@ function print_simple_out_type(ppf, s) { } } } - }, - _1: "%s[%s@[@[%a@]%a ]@]" - }), s._0 ? "_" : "", s._2 ? ( - tags === undefined ? " " : "< " - ) : ( - tags === undefined ? "> " : "? " - ), print_fields$1, s._1, print_present, tags); + } + }, + _1: "%s[%s@[@[%a@]%a ]@]" + }), s._0 ? "_" : "", s._2 ? ( + tags === undefined ? " " : "< " + ) : ( + tags === undefined ? "> " : "? " + ), print_fields$1, s._1, print_present, tags); case /* Otyp_alias */ 0 : case /* Otyp_arrow */ 1 : case /* Otyp_tuple */ 9 : case /* Otyp_poly */ 12 : - break; + break; case /* Otyp_module */ 13 : - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "(module ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "<1>", _1: /* End_of_format */ 0 - } + }, + _1: "<1>" } }, - _1: "@[<1>(module %s" - }), s._0); - const first = { - contents: true - }; - Stdlib__List.iter2((function (s, t) { - const sep = first.contents ? (first.contents = false, "with") : "and"; - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + _1: { + TAG: /* String_literal */ 11, + _0: "(module ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + } + }, + _1: "@[<1>(module %s" + }), s._0); + const first = { + contents: true + }; + Stdlib__List.iter2((function (s, t) { + const sep = first.contents ? (first.contents = false, "with") : "and"; + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " type ", _1: { - TAG: /* String_literal */ 11, - _0: " type ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " = ", _1: { - TAG: /* String_literal */ 11, - _0: " = ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } } } - }, - _1: " %s type %s = %a" - }), sep, s, print_out_type, t); - }), s._1, s._2); - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: ")@]" - }); + } + }, + _1: " %s type %s = %a" + }), sep, s, print_out_type, t); + }), s._1, s._2); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: ")@]" + }); default: return; } @@ -40838,59 +40838,12 @@ function print_out_class_params(ppf, tyl) { function print_out_class_type(ppf, param) { switch (param.TAG) { case /* Octy_constr */ 0 : - const pr_tyl = function (ppf, tyl) { - if (!tyl) { - return; - } - const partial_arg = out_type.contents; - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '[' */91, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ']' */93, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - } - } - } - } - } - }, - _1: "@[<1>[%a]@]@ " - }), (function (param, param$1) { - return print_typlist(partial_arg, ",", param, param$1); - }), tyl); - }; - return Curry._4(Stdlib__Format.fprintf(ppf)({ + const pr_tyl = function (ppf, tyl) { + if (!tyl) { + return; + } + const partial_arg = out_type.contents; + Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -40898,217 +40851,179 @@ function print_out_class_type(ppf, param) { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Alpha */ 15, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* String_literal */ 11, + _0: "<1>", _1: /* End_of_format */ 0 - } - } - } - }, - _1: "@[%a%a@]" - }), pr_tyl, param._1, print_ident, param._0); - case /* Octy_arrow */ 1 : - const lab = param._0; - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + }, + _1: "<1>" } }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* '[' */91, _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: " ->", + TAG: /* Char_literal */ 12, + _0: /* ']' */93, _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + _0: /* Close_box */ 0, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: /* End_of_format */ 0 } } } } } }, - _1: "@[%s%a ->@ %a@]" - }), lab !== "" ? lab + ":" : "", print_out_type_2, param._1, print_out_class_type, param._2); - case /* Octy_signature */ 2 : - const pr_param = function (ppf, ty) { - if (ty !== undefined) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ + _1: "@[<1>[%a]@]@ " + }), (function (param, param$1) { + return print_typlist(partial_arg, ",", param, param$1); + }), tyl); + }; + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "@[%a%a@]" + }), pr_tyl, param._1, print_ident, param._0); + case /* Octy_arrow */ 1 : + const lab = param._0; + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " ->", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@ @[(%a)@]" - }), out_type.contents, ty); - } - - }; - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" } - }, - _1: { - TAG: /* Formatting_gen */ 18, + } + } + }, + _1: "@[%s%a ->@ %a@]" + }), lab !== "" ? lab + ":" : "", print_out_type_2, param._1, print_out_class_type, param._2); + case /* Octy_signature */ 2 : + const pr_param = function (ppf, ty) { + if (ty !== undefined) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "object", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "end", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } + }, + _1: "@ @[(%a)@]" + }), out_type.contents, ty); + } + + }; + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, - _1: "@[@[<2>object%a@]@ %a@;<1 -2>end@]" - }), pr_param, param._0, (function (param, param$1) { - return print_list(print_out_class_sig_item, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - }, - _1: "@ " - }); - }), param, param$1); - }), param._1); - - } -} - -function print_out_class_sig_item(ppf, param) { - switch (param.TAG) { - case /* Ocsg_constraint */ 0 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -41124,12 +41039,12 @@ function print_out_class_sig_item(ppf, param) { }, _1: { TAG: /* String_literal */ 11, - _0: "constraint ", + _0: "object", _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: " =", + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -41142,37 +41057,125 @@ function print_out_class_sig_item(ppf, param) { TAG: /* Alpha */ 15, _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "end", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } } } } } - }, - _1: "@[<2>constraint %a =@ %a@]" - }), out_type.contents, param._0, out_type.contents, param._1); - case /* Ocsg_method */ 1 : - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { + } + }, + _1: "@[@[<2>object%a@]@ %a@;<1 -2>end@]" + }), pr_param, param._0, (function (param, param$1) { + return print_list(print_out_class_sig_item, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* String_literal */ 11, - _0: "<2>", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: /* End_of_format */ 0 }, - _1: "<2>" + _1: "@ " + }); + }), param, param$1); + }), param._1); + + } +} + +function print_out_class_sig_item(ppf, param) { + switch (param.TAG) { + case /* Ocsg_constraint */ 0 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "constraint ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " =", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } } - }, + } + } + }, + _1: "@[<2>constraint %a =@ %a@]" + }), out_type.contents, param._0, out_type.contents, param._1); + case /* Ocsg_method */ 1 : + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "method ", _1: { - TAG: /* String_literal */ 11, - _0: "method ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, @@ -41180,26 +41183,22 @@ function print_out_class_sig_item(ppf, param) { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " :", _1: { - TAG: /* String_literal */ 11, - _0: " :", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -41207,29 +41206,33 @@ function print_out_class_sig_item(ppf, param) { } } } - }, - _1: "@[<2>method %s%s%s :@ %a@]" - }), param._1 ? "private " : "", param._2 ? "virtual " : "", param._0, out_type.contents, param._3); + } + }, + _1: "@[<2>method %s%s%s :@ %a@]" + }), param._1 ? "private " : "", param._2 ? "virtual " : "", param._0, out_type.contents, param._3); case /* Ocsg_value */ 2 : - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "val ", _1: { - TAG: /* String_literal */ 11, - _0: "val ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, @@ -41237,26 +41240,22 @@ function print_out_class_sig_item(ppf, param) { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " :", _1: { - TAG: /* String_literal */ 11, - _0: " :", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -41264,9 +41263,10 @@ function print_out_class_sig_item(ppf, param) { } } } - }, - _1: "@[<2>val %s%s%s :@ %a@]" - }), param._1 ? "mutable " : "", param._2 ? "virtual " : "", param._0, out_type.contents, param._3); + } + }, + _1: "@[<2>val %s%s%s :@ %a@]" + }), param._1 ? "mutable " : "", param._2 ? "virtual " : "", param._0, out_type.contents, param._3); } } @@ -41386,126 +41386,126 @@ function print_out_module_type(ppf, t) { } switch (t.TAG) { case /* Omty_functor */ 0 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "functor", _1: { - TAG: /* String_literal */ 11, - _0: "functor", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<2>functor@ %a@]" - }), print_out_functor, t); + } + }, + _1: "@[<2>functor@ %a@]" + }), print_out_functor, t); case /* Omty_ident */ 1 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - }, - _1: "%a" - }), print_ident, t._0); + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + }, + _1: "%a" + }), print_ident, t._0); case /* Omty_signature */ 2 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "sig", _1: { - TAG: /* String_literal */ 11, - _0: "sig", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "end", _1: { - TAG: /* String_literal */ 11, - _0: "end", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[sig@ %a@;<1 -2>end@]" - }), out_signature.contents, t._0); + } + }, + _1: "@[sig@ %a@;<1 -2>end@]" + }), out_signature.contents, t._0); case /* Omty_alias */ 3 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "(module ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "(module ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "(module %a)" - }), print_ident, t._0); + } + }, + _1: "(module %a)" + }), print_ident, t._0); } } @@ -41734,87 +41734,87 @@ function print_out_signature(ppf, param) { const ext = item._0; switch (item._1) { case /* Oext_first */ 0 : - const gather_extensions = function (_acc, _items) { - while (true) { - const items = _items; - const acc = _acc; - if (!items) { - return [ - Stdlib__List.rev(acc), - items - ]; - } - const match = items.hd; - if (match.TAG !== /* Osig_typext */ 2) { + const gather_extensions = function (_acc, _items) { + while (true) { + const items = _items; + const acc = _acc; + if (!items) { + return [ + Stdlib__List.rev(acc), + items + ]; + } + const match = items.hd; + if (match.TAG !== /* Osig_typext */ 2) { + return [ + Stdlib__List.rev(acc), + items + ]; + } + const ext = match._0; + switch (match._1) { + case /* Oext_next */ 1 : + _items = items.tl; + _acc = { + hd: [ + ext.oext_name, + ext.oext_args, + ext.oext_ret_type + ], + tl: acc + }; + continue; + case /* Oext_first */ 0 : + case /* Oext_exception */ 2 : return [ Stdlib__List.rev(acc), items ]; - } - const ext = match._0; - switch (match._1) { - case /* Oext_next */ 1 : - _items = items.tl; - _acc = { - hd: [ - ext.oext_name, - ext.oext_args, - ext.oext_ret_type - ], - tl: acc - }; - continue; - case /* Oext_first */ 0 : - case /* Oext_exception */ 2 : - return [ - Stdlib__List.rev(acc), - items - ]; - - } - }; - }; - const match = gather_extensions({ - hd: [ - ext.oext_name, - ext.oext_args, - ext.oext_ret_type - ], - tl: /* [] */ 0 - }, param.tl); - const te_otyext_name = ext.oext_type_name; - const te_otyext_params = ext.oext_type_params; - const te_otyext_constructors = match[0]; - const te_otyext_private = ext.oext_private; - const te = { - otyext_name: te_otyext_name, - otyext_params: te_otyext_params, - otyext_constructors: te_otyext_constructors, - otyext_private: te_otyext_private + + } }; - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + }; + const match = gather_extensions({ + hd: [ + ext.oext_name, + ext.oext_args, + ext.oext_ret_type + ], + tl: /* [] */ 0 + }, param.tl); + const te_otyext_name = ext.oext_type_name; + const te_otyext_params = ext.oext_type_params; + const te_otyext_constructors = match[0]; + const te_otyext_private = ext.oext_private; + const te = { + otyext_name: te_otyext_name, + otyext_params: te_otyext_params, + otyext_constructors: te_otyext_constructors, + otyext_private: te_otyext_private + }; + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, - _1: "%a@ %a" - }), out_type_extension.contents, te, print_out_signature, match[1]); + } + }, + _1: "%a@ %a" + }), out_type_extension.contents, te, print_out_signature, match[1]); case /* Oext_next */ 1 : case /* Oext_exception */ 2 : - break; + break; } } @@ -41843,67 +41843,66 @@ function print_out_signature(ppf, param) { function print_out_sig_item(ppf, param) { switch (param.TAG) { case /* Osig_class */ 0 : - return Curry._7(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._7(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Char_literal */ 12, + _0: /* ':' */58, _1: { - TAG: /* Char_literal */ 12, - _0: /* ':' */58, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -41913,71 +41912,71 @@ function print_out_sig_item(ppf, param) { } } } - }, - _1: "@[<2>%s%s@ %a%s@ :@ %a@]" - }), param._4 === /* Orec_next */ 2 ? "and" : "class", param._0 ? " virtual" : "", print_out_class_params, param._2, param._1, out_class_type.contents, param._3); + } + }, + _1: "@[<2>%s%s@ %a%s@ :@ %a@]" + }), param._4 === /* Orec_next */ 2 ? "and" : "class", param._0 ? " virtual" : "", print_out_class_params, param._2, param._1, out_class_type.contents, param._3); case /* Osig_class_type */ 1 : - return Curry._7(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._7(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Char_literal */ 12, + _0: /* '=' */61, _1: { - TAG: /* Char_literal */ 12, - _0: /* '=' */61, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -41987,32 +41986,46 @@ function print_out_sig_item(ppf, param) { } } } - }, - _1: "@[<2>%s%s@ %a%s@ =@ %a@]" - }), param._4 === /* Orec_next */ 2 ? "and" : "class type", param._0 ? " virtual" : "", print_out_class_params, param._2, param._1, out_class_type.contents, param._3); + } + }, + _1: "@[<2>%s%s@ %a%s@ =@ %a@]" + }), param._4 === /* Orec_next */ 2 ? "and" : "class type", param._0 ? " virtual" : "", print_out_class_params, param._2, param._1, out_class_type.contents, param._3); case /* Osig_typext */ 2 : - const ext = param._0; - switch (param._1) { - case /* Oext_first */ 0 : - case /* Oext_next */ 1 : - const print_extended_type = function (ppf) { - const print_type_parameter = function (ppf, ty) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const ext = param._0; + switch (param._1) { + case /* Oext_first */ 0 : + case /* Oext_next */ 1 : + const print_extended_type = function (ppf) { + const print_type_parameter = function (ppf, ty) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%s" + }), ty === "_" ? ty : "'" + ty); + }; + const match = ext.oext_type_params; + if (match) { + if (match.tl) { + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%s" - }), ty === "_" ? ty : "'" + ty); - }; - const match = ext.oext_type_params; - if (match) { - if (match.tl) { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + TAG: /* Open_box */ 1, _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -42023,221 +42036,111 @@ function print_out_sig_item(ppf, param) { } }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[(@[%a)@]@ %s@]" - }), (function (param, param$1) { - return print_list(print_type_parameter, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + } + }, + _1: "@[(@[%a)@]@ %s@]" + }), (function (param, param$1) { + return print_list(print_type_parameter, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, - _1: ",@ " - }); - }), param, param$1); - }), ext.oext_type_params, ext.oext_type_name); - } else { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: ",@ " + }); + }), param, param$1); + }), ext.oext_type_params, ext.oext_type_name); + } else { + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "@[%a@ %s@]" - }), print_type_parameter, match.hd, ext.oext_type_name); - } - } else { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%s" - }), ext.oext_type_name); - } - }; - return Curry._4(Stdlib__Format.fprintf(ppf)({ + } + } + }, + _1: "@[%a@ %s@]" + }), print_type_parameter, match.hd, ext.oext_type_name); + } + } else { + return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "type ", - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* String_literal */ 11, - _0: " +=", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - }, - _1: "@[type %t +=%s@;<1 2>%a@]" - }), print_extended_type, ext.oext_private === /* Private */ 0 ? " private" : "", print_out_constr, [ - ext.oext_name, - ext.oext_args, - ext.oext_ret_type - ]); - case /* Oext_exception */ 2 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "exception ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 }, - _1: "@[<2>exception %a@]" - }), print_out_constr, [ - ext.oext_name, - ext.oext_args, - ext.oext_ret_type - ]); - - } - case /* Osig_modtype */ 3 : - const name = param._0; - let tmp = param._1; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - return Curry._1(Stdlib__Format.fprintf(ppf)({ + _1: "%s" + }), ext.oext_type_name); + } + }; + return Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -42247,30 +42150,53 @@ function print_out_sig_item(ppf, param) { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "<2>", + _0: "", _1: /* End_of_format */ 0 }, - _1: "<2>" + _1: "" } }, _1: { TAG: /* String_literal */ 11, - _0: "module type ", + _0: "type ", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* Theta */ 16, + _0: { + TAG: /* String_literal */ 11, + _0: " +=", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } } }, - _1: "@[<2>module type %s@]" - }), name); - } else { - return Curry._3(Stdlib__Format.fprintf(ppf)({ + _1: "@[type %t +=%s@;<1 2>%a@]" + }), print_extended_type, ext.oext_private === /* Private */ 0 ? " private" : "", print_out_constr, [ + ext.oext_name, + ext.oext_args, + ext.oext_ret_type + ]); + case /* Oext_exception */ 2 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -42288,104 +42214,116 @@ function print_out_sig_item(ppf, param) { }, _1: { TAG: /* String_literal */ 11, - _0: "module type ", + _0: "exception ", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " =", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } }, - _1: "@[<2>module type %s =@ %a@]" - }), name, out_module_type.contents, param._1); - } - case /* Osig_module */ 4 : - const name$1 = param._0; - const id = param._1; - if (!/* tag */ (typeof id === "number" || typeof id === "string") && id.TAG === /* Omty_alias */ 3) { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: "@[<2>exception %a@]" + }), print_out_constr, [ + ext.oext_name, + ext.oext_args, + ext.oext_ret_type + ]); + + } + case /* Osig_modtype */ 3 : + const name = param._0; + let tmp = param._1; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "module type ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } - }, + } + } + }, + _1: "@[<2>module type %s@]" + }), name); + } else { + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "module type ", _1: { - TAG: /* String_literal */ 11, - _0: "module ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " =", _1: { - TAG: /* String_literal */ 11, - _0: " =", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[<2>module %s =@ %a@]" - }), name$1, print_ident, id._0); - } - let tmp$1; - switch (param._2) { - case /* Orec_not */ 0 : - tmp$1 = "module"; - break; - case /* Orec_first */ 1 : - tmp$1 = "module rec"; - break; - case /* Orec_next */ 2 : - tmp$1 = "and"; - break; - - } - return Curry._4(Stdlib__Format.fprintf(ppf)({ + } + }, + _1: "@[<2>module type %s =@ %a@]" + }), name, out_module_type.contents, param._1); + } + case /* Osig_module */ 4 : + const name$1 = param._0; + const id = param._1; + if (!/* tag */ (typeof id === "number" || typeof id === "string") && id.TAG === /* Omty_alias */ 3) { + return Curry._3(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -42402,32 +42340,28 @@ function print_out_sig_item(ppf, param) { } }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "module ", _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " =", _1: { - TAG: /* String_literal */ 11, - _0: " :", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -42435,28 +42369,51 @@ function print_out_sig_item(ppf, param) { } } }, - _1: "@[<2>%s %s :@ %a@]" - }), tmp$1, name$1, out_module_type.contents, param._1); - case /* Osig_type */ 5 : - let tmp$2; - switch (param._1) { - case /* Orec_not */ 0 : - tmp$2 = "type nonrec"; - break; - case /* Orec_first */ 1 : - tmp$2 = "type"; - break; - case /* Orec_next */ 2 : - tmp$2 = "and"; - break; - - } - let td = param._0; - const print_constraints = function (ppf) { - Stdlib__List.iter((function (param) { - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: "@[<2>module %s =@ %a@]" + }), name$1, print_ident, id._0); + } + let tmp$1; + switch (param._2) { + case /* Orec_not */ 0 : + tmp$1 = "module"; + break; + case /* Orec_first */ 1 : + tmp$1 = "module rec"; + break; + case /* Orec_next */ 2 : + tmp$1 = "and"; + break; + + } + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " :", + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -42465,106 +42422,84 @@ function print_out_sig_item(ppf, param) { _2: 0 }, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "constraint ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " =", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "@ @[<2>constraint %a =@ %a@]" - }), out_type.contents, param[0], out_type.contents, param[1]); - }), td.otype_cstrs); - }; - const type_defined = function (ppf) { - const match = td.otype_params; - if (match) { - if (match.tl) { - return Curry._3(Stdlib__Format.fprintf(ppf)({ + } + } + } + } + } + }, + _1: "@[<2>%s %s :@ %a@]" + }), tmp$1, name$1, out_module_type.contents, param._1); + case /* Osig_type */ 5 : + let tmp$2; + switch (param._1) { + case /* Orec_not */ 0 : + tmp$2 = "type nonrec"; + break; + case /* Orec_first */ 1 : + tmp$2 = "type"; + break; + case /* Orec_next */ 2 : + tmp$2 = "and"; + break; + + } + let td = param._0; + const print_constraints = function (ppf) { + Stdlib__List.iter((function (param) { + Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "constraint ", _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, + TAG: /* String_literal */ 11, + _0: " =", _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -42573,14 +42508,47 @@ function print_out_sig_item(ppf, param) { } } }, - _1: "@[(@[%a)@]@ %s@]" - }), (function (param, param$1) { - return print_list(type_parameter, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ + _1: "@ @[<2>constraint %a =@ %a@]" + }), out_type.contents, param[0], out_type.contents, param[1]); + }), td.otype_cstrs); + }; + const type_defined = function (ppf) { + const match = td.otype_params; + if (match) { + if (match.tl) { + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -42589,377 +42557,257 @@ function print_out_sig_item(ppf, param) { _1: 1, _2: 0 }, - _1: /* End_of_format */ 0 + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } - }, - _1: ",@ " - }); - }), param, param$1); - }), td.otype_params, td.otype_name); - } else { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + } + } } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + } + } + }, + _1: "@[(@[%a)@]@ %s@]" + }), (function (param, param$1) { + return print_list(type_parameter, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: /* End_of_format */ 0 } - } - } - } - }, - _1: "@[%a@ %s@]" - }), type_parameter, match.hd, td.otype_name); - } - } else { - return Stdlib__Format.pp_print_string(ppf, td.otype_name); - } - }; - const print_manifest = function (ppf, param) { - if (/* tag */ typeof param === "number" || typeof param === "string" || param.TAG !== /* Otyp_manifest */ 4) { - return; + }, + _1: ",@ " + }); + }), param, param$1); + }), td.otype_params, td.otype_name); } else { - return Curry._2(Stdlib__Format.fprintf(ppf)({ + return Curry._3(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* String_literal */ 11, - _0: " =", + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } }, - _1: " =@ %a" - }), out_type.contents, param._0); + _1: "@[%a@ %s@]" + }), type_parameter, match.hd, td.otype_name); } - }; - const print_name_params = function (ppf) { - Curry._4(Stdlib__Format.fprintf(ppf)({ + } else { + return Stdlib__Format.pp_print_string(ppf, td.otype_name); + } + }; + const print_manifest = function (ppf, param) { + if (/* tag */ typeof param === "number" || typeof param === "string" || param.TAG !== /* Otyp_manifest */ 4) { + return; + } else { + return Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " =", _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } }, - _1: "%s %t%a" - }), tmp$2, type_defined, print_manifest, td.otype_type); - }; - const match = td.otype_type; - let ty; - ty = /* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Otyp_manifest */ 4 ? td.otype_type : match._1; - const print_private = function (ppf, param) { - if (param === /* Private */ 0) { + _1: " =@ %a" + }), out_type.contents, param._0); + } + }; + const print_name_params = function (ppf) { + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* Theta */ 16, + _0: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + } + }, + _1: "%s %t%a" + }), tmp$2, type_defined, print_manifest, td.otype_type); + }; + const match = td.otype_type; + let ty; + ty = /* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Otyp_manifest */ 4 ? td.otype_type : match._1; + const print_private = function (ppf, param) { + if (param === /* Private */ 0) { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: " private", + _1: /* End_of_format */ 0 + }, + _1: " private" + }); + } + + }; + const print_out_tkind = function (ppf, lbls) { + if (/* tag */ typeof lbls === "number" || typeof lbls === "string") { + if (lbls === /* Otyp_abstract */ 0) { + return; + } else { return Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: " private", + _0: " = ..", _1: /* End_of_format */ 0 }, - _1: " private" + _1: " = .." }); } - - }; - const print_out_tkind = function (ppf, lbls) { - if (/* tag */ typeof lbls === "number" || typeof lbls === "string") { - if (lbls === /* Otyp_abstract */ 0) { - return; - } else { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: " = ..", - _1: /* End_of_format */ 0 - }, - _1: " = .." - }); - } - } - switch (lbls.TAG) { - case /* Otyp_record */ 6 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: " =", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " {", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '}' */125, - _1: /* End_of_format */ 0 - } - } - } - } - } - }, - _1: " =%a {%a@;<1 -2>}" - }), print_private, td.otype_private, (function (param, param$1) { - const sep = function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - }, - _1: "@ " - }); - }; - let _param = param$1; - while (true) { - const param$2 = _param; - if (!param$2) { - return; - } - Curry._1(sep, param); - Curry._2(print_out_label, param, param$2.hd); - _param = param$2.tl; - continue; - }; - }), lbls._0); - case /* Otyp_sum */ 8 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + switch (lbls.TAG) { + case /* Otyp_record */ 6 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: " =", + _1: { + TAG: /* Alpha */ 15, _0: { TAG: /* String_literal */ 11, - _0: " =", + _0: " {", _1: { TAG: /* Alpha */ 15, _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@;<1 2>", + _0: "@;<1 -2>", _1: 1, - _2: 2 + _2: -2 }, _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + TAG: /* Char_literal */ 12, + _0: /* '}' */125, + _1: /* End_of_format */ 0 } } } - }, - _1: " =%a@;<1 2>%a" - }), print_private, td.otype_private, (function (param, param$1) { - return print_list(print_out_constr, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "| ", - _1: /* End_of_format */ 0 - } - }, - _1: "@ | " - }); - }), param, param$1); - }), lbls._0); - default: - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: " =", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - } } - }, - _1: " =%a@;<1 2>%a" - }), print_private, td.otype_private, out_type.contents, lbls); - } - }; - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" } }, - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Alpha */ 15, + _1: " =%a {%a@;<1 -2>}" + }), print_private, td.otype_private, (function (param, param$1) { + const sep = function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: /* End_of_format */ 0 + }, + _1: "@ " + }); + }; + let _param = param$1; + while (true) { + const param$2 = _param; + if (!param$2) { + return; } - }, - _1: "@[<2>@[%t%a@]%t@]" - }), print_name_params, print_out_tkind, ty, print_constraints); - case /* Osig_value */ 6 : - const prims = param._2; - const kwd = Caml_obj.caml_equal(prims, /* [] */ 0) ? "val" : "external"; - const pr_prims = function (ppf, param) { - if (param) { - Curry._1(Stdlib__Format.fprintf(ppf)({ + Curry._1(sep, param); + Curry._2(print_out_label, param, param$2.hd); + _param = param$2.tl; + continue; + }; + }), lbls._0); + case /* Otyp_sum */ 8 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: " =", _1: { - TAG: /* String_literal */ 11, - _0: "= \"", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "@ = \"%s\"" - }), param.hd); - return Stdlib__List.iter((function (s) { - const len = s.length; - if (len >= 3 && Caml_string.get(s, 0) === /* 'B' */66 && Caml_string.get(s, 1) === /* 'S' */83 && Caml_string.get(s, 2) === /* ':' */58) { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + TAG: /* Alpha */ 15, _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", + _0: "@;<1 2>", _1: 1, - _2: 0 + _2: 2 }, _1: { - TAG: /* String_literal */ 11, - _0: "\"BS-EXTERNAL\"", - _1: /* End_of_format */ 0 + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, - _1: "@ \"BS-EXTERNAL\"" - }); - } else { - return Curry._1(Stdlib__Format.fprintf(ppf)({ + } + } + }, + _1: " =%a@;<1 2>%a" + }), print_private, td.otype_private, (function (param, param$1) { + return print_list(print_out_constr, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, @@ -42970,29 +42818,59 @@ function print_out_sig_item(ppf, param) { _2: 0 }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '"' */34, - _1: /* End_of_format */ 0 - } - } + TAG: /* String_literal */ 11, + _0: "| ", + _1: /* End_of_format */ 0 } }, - _1: "@ \"%s\"" - }), s); - } - }), param.tl); - } - - }; - return Curry._7(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: "@ | " + }); + }), param, param$1); + }), lbls._0); + default: + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: " =", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + } + }, + _1: " =%a@;<1 2>%a" + }), print_private, td.otype_private, out_type.contents, lbls); + } + }; + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -43000,24 +42878,90 @@ function print_out_sig_item(ppf, param) { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "<2>", + _0: "", _1: /* End_of_format */ 0 }, - _1: "<2>" + _1: "" } }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Theta */ 16, + _0: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Theta */ 16, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + }, + _1: "@[<2>@[%t%a@]%t@]" + }), print_name_params, print_out_tkind, ty, print_constraints); + case /* Osig_value */ 6 : + const prims = param._2; + const kwd = Caml_obj.caml_equal(prims, /* [] */ 0) ? "val" : "external"; + const pr_prims = function (ppf, param) { + if (param) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String_literal */ 11, + _0: "= \"", _1: { - TAG: /* Alpha */ 15, + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '"' */34, + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "@ = \"%s\"" + }), param.hd); + return Stdlib__List.iter((function (s) { + const len = s.length; + if (len >= 3 && Caml_string.get(s, 0) === /* 'B' */66 && Caml_string.get(s, 1) === /* 'S' */83 && Caml_string.get(s, 2) === /* ':' */58) { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { TAG: /* String_literal */ 11, - _0: " :", - _1: { + _0: "\"BS-EXTERNAL\"", + _1: /* End_of_format */ 0 + } + }, + _1: "@ \"BS-EXTERNAL\"" + }); + } else { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -43026,38 +42970,94 @@ function print_out_sig_item(ppf, param) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Char_literal */ 12, + _0: /* '"' */34, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '"' */34, _1: /* End_of_format */ 0 } } } - } - } - } - } - } - }, - _1: "@[<2>%s %a :@ %a%a@]" - }), kwd, value_ident, param._0, out_type.contents, param._1, pr_prims, prims); - - } -} - -function print_out_type_extension(ppf, te) { - const print_extended_type = function (ppf) { - const print_type_parameter = function (ppf, ty) { - Curry._1(Stdlib__Format.fprintf(ppf)({ + }, + _1: "@ \"%s\"" + }), s); + } + }), param.tl); + } + + }; + return Curry._7(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " :", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } + }, + _1: "@[<2>%s %a :@ %a%a@]" + }), kwd, value_ident, param._0, out_type.contents, param._1, pr_prims, prims); + + } +} + +function print_out_type_extension(ppf, te) { + const print_extended_type = function (ppf) { + const print_type_parameter = function (ppf, ty) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, _1: "%s" }), ty === "_" ? ty : "'" + ty); }; @@ -43279,44 +43279,44 @@ out_type_extension.contents = print_out_type_extension; function longident(ppf, s) { switch (s.TAG) { case /* Lident */ 0 : - return Stdlib__Format.pp_print_string(ppf, s._0); + return Stdlib__Format.pp_print_string(ppf, s._0); case /* Ldot */ 1 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } - }, - _1: "%a.%s" - }), longident, s._0, s._1); + } + }, + _1: "%a.%s" + }), longident, s._0, s._1); case /* Lapply */ 2 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } - }, - _1: "%a(%a)" - }), longident, s._0, longident, s._1); + } + }, + _1: "%a(%a)" + }), longident, s._0, longident, s._1); } } @@ -43366,37 +43366,37 @@ const ident_pervasive = { function tree_of_path(id) { switch (id.TAG) { case /* Pident */ 0 : - return { - TAG: /* Oide_ident */ 2, - _0: ident_name(id._0) - }; + return { + TAG: /* Oide_ident */ 2, + _0: ident_name(id._0) + }; case /* Pdot */ 1 : - const id$1 = id._0; - switch (id$1.TAG) { - case /* Pident */ 0 : - if (Caml_obj.caml_equal(id$1._0, ident_pervasive)) { - return { - TAG: /* Oide_ident */ 2, - _0: id._1 - }; - } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - break; - - } - return { - TAG: /* Oide_dot */ 1, - _0: tree_of_path(id$1), - _1: id._1 - }; + const id$1 = id._0; + switch (id$1.TAG) { + case /* Pident */ 0 : + if (Caml_obj.caml_equal(id$1._0, ident_pervasive)) { + return { + TAG: /* Oide_ident */ 2, + _0: id._1 + }; + } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + break; + + } + return { + TAG: /* Oide_dot */ 1, + _0: tree_of_path(id$1), + _1: id._1 + }; case /* Papply */ 2 : - return { - TAG: /* Oide_apply */ 0, - _0: tree_of_path(id._0), - _1: tree_of_path(id._1) - }; + return { + TAG: /* Oide_apply */ 0, + _0: tree_of_path(id._0), + _1: tree_of_path(id._1) + }; } } @@ -43404,43 +43404,43 @@ function tree_of_path(id) { function path(ppf, id) { switch (id.TAG) { case /* Pident */ 0 : - return Stdlib__Format.pp_print_string(ppf, ident_name(id._0)); + return Stdlib__Format.pp_print_string(ppf, ident_name(id._0)); case /* Pdot */ 1 : - const id$1 = id._0; - switch (id$1.TAG) { - case /* Pident */ 0 : - if (Caml_obj.caml_equal(id$1._0, ident_pervasive)) { - return Stdlib__Format.pp_print_string(ppf, id._1); - } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - break; - - } - path(ppf, id$1); - Stdlib__Format.pp_print_char(ppf, /* '.' */46); - return Stdlib__Format.pp_print_string(ppf, id._1); + const id$1 = id._0; + switch (id$1.TAG) { + case /* Pident */ 0 : + if (Caml_obj.caml_equal(id$1._0, ident_pervasive)) { + return Stdlib__Format.pp_print_string(ppf, id._1); + } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + break; + + } + path(ppf, id$1); + Stdlib__Format.pp_print_char(ppf, /* '.' */46); + return Stdlib__Format.pp_print_string(ppf, id._1); case /* Papply */ 2 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } - }, - _1: "%a(%a)" - }), path, id._0, path, id._1); + } + }, + _1: "%a(%a)" + }), path, id._0, path, id._1); } } @@ -43448,29 +43448,29 @@ function path(ppf, id) { function string_of_out_ident(s) { switch (s.TAG) { case /* Oide_apply */ 0 : - return Stdlib__String.concat("", { - hd: string_of_out_ident(s._0), + return Stdlib__String.concat("", { + hd: string_of_out_ident(s._0), + tl: { + hd: "(", tl: { - hd: "(", + hd: string_of_out_ident(s._1), tl: { - hd: string_of_out_ident(s._1), - tl: { - hd: ")", - tl: /* [] */ 0 - } + hd: ")", + tl: /* [] */ 0 } } - }); + } + }); case /* Oide_dot */ 1 : - return Stdlib__String.concat(".", { - hd: string_of_out_ident(s._0), - tl: { - hd: s._1, - tl: /* [] */ 0 - } - }); + return Stdlib__String.concat(".", { + hd: string_of_out_ident(s._0), + tl: { + hd: s._1, + tl: /* [] */ 0 + } + }); case /* Oide_ident */ 2 : - return s._0; + return s._0; } } @@ -43482,11 +43482,11 @@ function string_of_path(p) { function tree_of_rec(param) { switch (param) { case /* Trec_not */ 0 : - return /* Orec_not */ 0; + return /* Orec_not */ 0; case /* Trec_first */ 1 : - return /* Orec_first */ 1; + return /* Orec_first */ 1; case /* Trec_next */ 2 : - return /* Orec_next */ 2; + return /* Orec_next */ 2; } } @@ -43810,42 +43810,176 @@ function raw_type_desc(ppf, name) { } switch (name.TAG) { case /* Tvar */ 0 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Tvar ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Tvar %a" + }), print_name, name._0); + case /* Tarrow */ 1 : + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "Tvar ", + _0: "Tarrow(", _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } + } + } + } } - }, - _1: "Tvar %a" - }), print_name, name._0); - case /* Tarrow */ 1 : - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[Tarrow(%s,@,%a,@,%a,@,%s)@]" + }), name._0, raw_type, name._1, raw_type, name._2, safe_commu_repr(/* [] */ 0, name._3)); + case /* Ttuple */ 2 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Ttuple", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: "", + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: /* End_of_format */ 0 - }, - _1: "" + } } - }, + } + } + }, + _1: "@[<1>Ttuple@,%a@]" + }), raw_type_list, name._0); + case /* Tconstr */ 3 : + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tconstr(", _1: { - TAG: /* String_literal */ 11, - _0: "Tarrow(", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Char_literal */ 12, _0: /* ',' */44, _1: { @@ -43873,28 +44007,11 @@ function raw_type_desc(ppf, name) { TAG: /* Alpha */ 15, _0: { TAG: /* Char_literal */ 12, - _0: /* ',' */44, + _0: /* ')' */41, _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -43905,114 +44022,83 @@ function raw_type_desc(ppf, name) { } } } - }, - _1: "@[Tarrow(%s,@,%a,@,%a,@,%s)@]" - }), name._0, raw_type, name._1, raw_type, name._2, safe_commu_repr(/* [] */ 0, name._3)); - case /* Ttuple */ 2 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[Tconstr(@,%a,@,%a,@,%a)@]" + }), path, name._0, raw_type_list, name._1, (function (param, param$1) { + return raw_list(path, param, param$1); + }), list_of_memo(name._2.contents)); + case /* Tobject */ 4 : + const nm = name._1; + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Ttuple", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, - _1: "@[<1>Ttuple@,%a@]" - }), raw_type_list, name._0); - case /* Tconstr */ 3 : - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tobject(", _1: { - TAG: /* String_literal */ 11, - _0: "Tconstr(", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } }, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { + TAG: /* String_literal */ 11, + _0: "ref", + _1: { + TAG: /* Theta */ 16, + _0: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + _0: /* Close_box */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -44023,230 +44109,143 @@ function raw_type_desc(ppf, name) { } } } - }, - _1: "@[Tconstr(@,%a,@,%a,@,%a)@]" - }), path, name._0, raw_type_list, name._1, (function (param, param$1) { - return raw_list(path, param, param$1); - }), list_of_memo(name._2.contents)); - case /* Tobject */ 4 : - const nm = name._1; - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { + } + }, + _1: "@[Tobject(@,%a,@,@[<1>ref%t@])@]" + }), raw_type, name._0, (function (ppf) { + const match = nm.contents; + if (match !== undefined) { + return Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Tobject(", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + _0: "(Some(", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Format */ 0, + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, _0: { TAG: /* String_literal */ 11, - _0: "<1>", + _0: "))", _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "ref", - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } } } } } } } - } - } - } - }, - _1: "@[Tobject(@,%a,@,@[<1>ref%t@])@]" - }), raw_type, name._0, (function (ppf) { - const match = nm.contents; - if (match !== undefined) { - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "(Some(", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "))", - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "(Some(@,%a,@,%a))" - }), path, match[0], raw_type_list, match[1]); - } else { - return Stdlib__Format.fprintf(ppf)({ + }, + _1: "(Some(@,%a,@,%a))" + }), path, match[0], raw_type_list, match[1]); + } else { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: " None", + _1: /* End_of_format */ 0 + }, + _1: " None" + }); + } + })); + case /* Tfield */ 5 : + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: " None", + _0: "", _1: /* End_of_format */ 0 }, - _1: " None" - }); - } - })); - case /* Tfield */ 5 : - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tfield(", _1: { - TAG: /* String_literal */ 11, - _0: "Tfield(", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<0 -1>", + _1: 0, + _2: -1 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<0 -1>", - _1: 0, - _2: -1 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -44260,250 +44259,250 @@ function raw_type_desc(ppf, name) { } } } - }, - _1: "@[Tfield(@,%s,@,%s,@,%a,@;<0 -1>%a)@]" - }), name._0, safe_kind_repr(/* [] */ 0, name._1), raw_type, name._2, raw_type, name._3); + } + }, + _1: "@[Tfield(@,%s,@,%s,@,%a,@;<0 -1>%a)@]" + }), name._0, safe_kind_repr(/* [] */ 0, name._1), raw_type, name._2, raw_type, name._3); case /* Tlink */ 6 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tlink", _1: { - TAG: /* String_literal */ 11, - _0: "Tlink", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<1>Tlink@,%a@]" - }), raw_type, name._0); + } + }, + _1: "@[<1>Tlink@,%a@]" + }), raw_type, name._0); case /* Tsubst */ 7 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tsubst", _1: { - TAG: /* String_literal */ 11, - _0: "Tsubst", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<1>Tsubst@,%a@]" - }), raw_type, name._0); + } + }, + _1: "@[<1>Tsubst@,%a@]" + }), raw_type, name._0); case /* Tvariant */ 8 : - const row = name._0; - return Curry.app(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const row = name._0; + return Curry.app(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '{' */123, _1: { - TAG: /* Char_literal */ 12, - _0: /* '{' */123, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* Char_literal */ 12, + _0: /* ';' */59, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, + TAG: /* Bool */ 9, _0: /* No_padding */ 0, _1: { - TAG: /* Bool */ 9, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ';' */59, _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, + TAG: /* Bool */ 9, _0: /* No_padding */ 0, _1: { - TAG: /* Bool */ 9, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ';' */59, _1: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<1>", - _1: /* End_of_format */ 0 - }, - _1: "<1>" - } - }, + TAG: /* String_literal */ 11, + _0: "<1>", + _1: /* End_of_format */ 0 + }, + _1: "<1>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Theta */ 16, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '}' */125, _1: { - TAG: /* Char_literal */ 12, - _0: /* '}' */125, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -44532,166 +44531,72 @@ function raw_type_desc(ppf, name) { } } } - }, - _1: "@[{@[%s@,%a;@]@ @[%s@,%a;@]@ %s%b;@ %s%b;@ @[<1>%s%t@]}@]" - }), [ - "row_fields=", - (function (param, param$1) { - return raw_list((function (ppf, param) { - Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[{@[%s@,%a;@]@ @[%s@,%a;@]@ %s%b;@ %s%b;@ @[<1>%s%t@]}@]" + }), [ + "row_fields=", + (function (param, param$1) { + return raw_list((function (ppf, param) { + Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[%s,@ %a@]" - }), param[0], raw_field, param[1]); - }), param, param$1); - }), - row.row_fields, - "row_more=", - raw_type, - row.row_more, - "row_closed=", - row.row_closed, - "row_fixed=", - row.row_fixed, - "row_name=", - (function (ppf) { - const match = row.row_name; - if (match !== undefined) { - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Some(", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Char_literal */ 12, _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@,", - _1: 0, + _0: "@ ", + _1: 1, _2: 0 }, _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: /* End_of_format */ 0 } } } } } - } - }, - _1: "Some(@,%a,@,%a)" - }), path, match[0], raw_type_list, match[1]); - } else { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "None", - _1: /* End_of_format */ 0 - }, - _1: "None" - }); - } - }) - ]); - case /* Tunivar */ 9 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Tunivar ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Tunivar %a" - }), print_name, name._0); - case /* Tpoly */ 10 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Tpoly(", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + }, + _1: "@[%s,@ %a@]" + }), param[0], raw_field, param[1]); + }), param, param$1); + }), + row.row_fields, + "row_more=", + raw_type, + row.row_more, + "row_closed=", + row.row_closed, + "row_fixed=", + row.row_fixed, + "row_name=", + (function (ppf) { + const match = row.row_name; + if (match !== undefined) { + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* String_literal */ 11, + _0: "Some(", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -44704,53 +44609,90 @@ function raw_type_desc(ppf, name) { TAG: /* Alpha */ 15, _0: { TAG: /* Char_literal */ 12, - _0: /* ')' */41, + _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 + } + } } } } } - } - } - } - } - }, - _1: "@[Tpoly(@,%a,@,%a)@]" - }), raw_type, name._0, raw_type_list, name._1); - case /* Tpackage */ 11 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + }, + _1: "Some(@,%a,@,%a)" + }), path, match[0], raw_type_list, match[1]); + } else { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "None", + _1: /* End_of_format */ 0 + }, + _1: "None" + }); + } + }) + ]); + case /* Tunivar */ 9 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Tunivar ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Tunivar %a" + }), print_name, name._0); + case /* Tpoly */ 10 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Tpoly(", _1: { - TAG: /* String_literal */ 11, - _0: "Tpackage(", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -44774,9 +44716,67 @@ function raw_type_desc(ppf, name) { } } } + } + }, + _1: "@[Tpoly(@,%a,@,%a)@]" + }), raw_type, name._0, raw_type_list, name._1); + case /* Tpackage */ 11 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } }, - _1: "@[Tpackage(@,%a@,%a)@]" - }), path, name._0, raw_type_list, name._2); + _1: { + TAG: /* String_literal */ 11, + _0: "Tpackage(", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + }, + _1: "@[Tpackage(@,%a@,%a)@]" + }), path, name._0, raw_type_list, name._2); } } @@ -45099,36 +45099,36 @@ function compare$4(_p1, _p2) { const p1 = _p1; switch (p1.TAG) { case /* Pident */ 0 : - return Caml_obj.caml_compare(p1, p2); + return Caml_obj.caml_compare(p1, p2); case /* Pdot */ 1 : - switch (p2.TAG) { - case /* Pdot */ 1 : - const c = compare$4(p1._0, p2._0); - if (c !== 0) { - return c; - } else { - return Caml.caml_string_compare(p1._1, p2._1); - } - case /* Pident */ 0 : - case /* Papply */ 2 : - return Caml_obj.caml_compare(p1, p2); - - } + switch (p2.TAG) { + case /* Pdot */ 1 : + const c = compare$4(p1._0, p2._0); + if (c !== 0) { + return c; + } else { + return Caml.caml_string_compare(p1._1, p2._1); + } + case /* Pident */ 0 : + case /* Papply */ 2 : + return Caml_obj.caml_compare(p1, p2); + + } case /* Papply */ 2 : - switch (p2.TAG) { - case /* Pident */ 0 : - case /* Pdot */ 1 : - return Caml_obj.caml_compare(p1, p2); - case /* Papply */ 2 : - const c$1 = compare$4(p1._0, p2._0); - if (c$1 !== 0) { - return c$1; - } - _p2 = p2._1; - _p1 = p1._1; - continue; - - } + switch (p2.TAG) { + case /* Pident */ 0 : + case /* Pdot */ 1 : + return Caml_obj.caml_compare(p1, p2); + case /* Papply */ 2 : + const c$1 = compare$4(p1._0, p2._0); + if (c$1 !== 0) { + return c$1; + } + _p2 = p2._1; + _p1 = p1._1; + continue; + + } } }; @@ -45379,24 +45379,24 @@ function normalize_type_path(cacheOpt, env, p) { function path_size(id) { switch (id.TAG) { case /* Pident */ 0 : - const id$1 = id._0; - const s = id$1.name; - return [ - s !== "" && Caml_string.get(s, 0) === /* '_' */95 ? 10 : 1, - -id$1.stamp | 0 - ]; + const id$1 = id._0; + const s = id$1.name; + return [ + s !== "" && Caml_string.get(s, 0) === /* '_' */95 ? 10 : 1, + -id$1.stamp | 0 + ]; case /* Pdot */ 1 : - const match = path_size(id._0); - return [ - 1 + match[0] | 0, - match[1] - ]; + const match = path_size(id._0); + return [ + 1 + match[0] | 0, + match[1] + ]; case /* Papply */ 2 : - const match$1 = path_size(id._0); - return [ - match$1[0] + path_size(id._1)[0] | 0, - match$1[1] - ]; + const match$1 = path_size(id._0); + return [ + match$1[0] + path_size(id._1)[0] | 0, + match$1[1] + ]; } } @@ -45626,7 +45626,7 @@ function add_named_var(ty) { switch (match.TAG) { case /* Tvar */ 0 : case /* Tunivar */ 9 : - break; + break; default: return; } @@ -45678,8 +45678,8 @@ function name_of_type(t) { switch (match.TAG) { case /* Tvar */ 0 : case /* Tunivar */ 9 : - exit = 1; - break; + exit = 1; + break; default: name = new_name(undefined); } @@ -45774,11 +45774,11 @@ function aliasable(ty) { } switch (match.TAG) { case /* Tconstr */ 3 : - return !is_nth(best_type_path(match._0)[1]); + return !is_nth(best_type_path(match._0)[1]); case /* Tvar */ 0 : case /* Tunivar */ 9 : case /* Tpoly */ 10 : - return false; + return false; default: return true; } @@ -45829,97 +45829,97 @@ function mark_loops_rec(_visited, _ty) { } switch (tyl.TAG) { case /* Tarrow */ 1 : - mark_loops_rec(visited$1, tyl._1); - _ty = tyl._2; - _visited = visited$1; - continue; + mark_loops_rec(visited$1, tyl._1); + _ty = tyl._2; + _visited = visited$1; + continue; case /* Ttuple */ 2 : - return Stdlib__List.iter((function (param) { - return mark_loops_rec(visited$1, param); - }), tyl._0); + return Stdlib__List.iter((function (param) { + return mark_loops_rec(visited$1, param); + }), tyl._0); case /* Tconstr */ 3 : - const match = best_type_path(tyl._0); - return Stdlib__List.iter((function (param) { - return mark_loops_rec(visited$1, param); - }), apply_subst(match[1], tyl._1)); + const match = best_type_path(tyl._0); + return Stdlib__List.iter((function (param) { + return mark_loops_rec(visited$1, param); + }), apply_subst(match[1], tyl._1)); case /* Tobject */ 4 : - if (Stdlib__List.memq(px, visited_objects.contents)) { - return add_alias(px); - } - if (opened_object(ty$1)) { - visited_objects.contents = { - hd: px, - tl: visited_objects.contents - }; - } - const match$1 = tyl._1.contents; - if (match$1 !== undefined) { - return Stdlib__List.iter((function (param) { - return mark_loops_rec(visited$1, param); - }), Stdlib__List.tl(match$1[1])); - } - const match$2 = flatten_fields(tyl._0); + if (Stdlib__List.memq(px, visited_objects.contents)) { + return add_alias(px); + } + if (opened_object(ty$1)) { + visited_objects.contents = { + hd: px, + tl: visited_objects.contents + }; + } + const match$1 = tyl._1.contents; + if (match$1 !== undefined) { return Stdlib__List.iter((function (param) { - if (Caml_obj.caml_equal(field_kind_repr(param[1]), /* Fpresent */ 0)) { - return mark_loops_rec(visited$1, param[2]); - } - - }), match$2[0]); + return mark_loops_rec(visited$1, param); + }), Stdlib__List.tl(match$1[1])); + } + const match$2 = flatten_fields(tyl._0); + return Stdlib__List.iter((function (param) { + if (Caml_obj.caml_equal(field_kind_repr(param[1]), /* Fpresent */ 0)) { + return mark_loops_rec(visited$1, param[2]); + } + + }), match$2[0]); case /* Tfield */ 5 : - if (Caml_obj.caml_equal(field_kind_repr(tyl._1), /* Fpresent */ 0)) { - mark_loops_rec(visited$1, tyl._2); - _ty = tyl._3; - _visited = visited$1; - continue; - } + if (Caml_obj.caml_equal(field_kind_repr(tyl._1), /* Fpresent */ 0)) { + mark_loops_rec(visited$1, tyl._2); _ty = tyl._3; _visited = visited$1; continue; + } + _ty = tyl._3; + _visited = visited$1; + continue; case /* Tlink */ 6 : - return fatal_error("Printtyp.mark_loops_rec (2)"); + return fatal_error("Printtyp.mark_loops_rec (2)"); case /* Tsubst */ 7 : - _ty = tyl._0; - _visited = visited$1; - continue; + _ty = tyl._0; + _visited = visited$1; + continue; case /* Tvariant */ 8 : - if (Stdlib__List.memq(px, visited_objects.contents)) { - return add_alias(px); - } - const row = row_repr_aux(/* [] */ 0, tyl._0); - if (!static_row(row)) { - visited_objects.contents = { - hd: px, - tl: visited_objects.contents - }; - } - const match$3 = row.row_name; - if (match$3 !== undefined) { - if (namable_row(row)) { - return Stdlib__List.iter((function (param) { - return mark_loops_rec(visited$1, param); - }), match$3[1]); - } else { - return iter_row((function (param) { - return mark_loops_rec(visited$1, param); - }), row); - } + if (Stdlib__List.memq(px, visited_objects.contents)) { + return add_alias(px); + } + const row = row_repr_aux(/* [] */ 0, tyl._0); + if (!static_row(row)) { + visited_objects.contents = { + hd: px, + tl: visited_objects.contents + }; + } + const match$3 = row.row_name; + if (match$3 !== undefined) { + if (namable_row(row)) { + return Stdlib__List.iter((function (param) { + return mark_loops_rec(visited$1, param); + }), match$3[1]); } else { return iter_row((function (param) { return mark_loops_rec(visited$1, param); }), row); } + } else { + return iter_row((function (param) { + return mark_loops_rec(visited$1, param); + }), row); + } case /* Tvar */ 0 : case /* Tunivar */ 9 : - return add_named_var(ty$1); + return add_named_var(ty$1); case /* Tpoly */ 10 : - Stdlib__List.iter(add_alias, tyl._1); - _ty = tyl._0; - _visited = visited$1; - continue; + Stdlib__List.iter(add_alias, tyl._1); + _ty = tyl._0; + _visited = visited$1; + continue; case /* Tpackage */ 11 : - return Stdlib__List.iter((function (param) { - return mark_loops_rec(visited$1, param); - }), tyl._2); + return Stdlib__List.iter((function (param) { + return mark_loops_rec(visited$1, param); + }), tyl._2); } }; @@ -45965,255 +45965,255 @@ function tree_of_typexp(sch, ty) { } switch (tyl.TAG) { case /* Tvar */ 0 : - return { - TAG: /* Otyp_var */ 10, - _0: is_non_gen(sch, ty$1), - _1: name_of_type(ty$1) - }; + return { + TAG: /* Otyp_var */ 10, + _0: is_non_gen(sch, ty$1), + _1: name_of_type(ty$1) + }; case /* Tarrow */ 1 : - let l = tyl._0; - let ty1 = tyl._1; - let ty2 = tyl._2; - const lab = print_labels.contents && l !== "" || is_optional(l) ? l : ""; - let t1; - if (is_optional(l)) { - const match = repr(ty1).desc; - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tconstr */ 3) { - t1 = { + let l = tyl._0; + let ty1 = tyl._1; + let ty2 = tyl._2; + const lab = print_labels.contents && l !== "" || is_optional(l) ? l : ""; + let t1; + if (is_optional(l)) { + const match = repr(ty1).desc; + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tconstr */ 3) { + t1 = { + TAG: /* Otyp_stuff */ 7, + _0: "" + }; + } else { + const match$1 = match._1; + t1 = match$1 && !(match$1.tl || !same(match._0, path_option)) ? tree_of_typexp(sch, match$1.hd) : ({ TAG: /* Otyp_stuff */ 7, _0: "" - }; - } else { - const match$1 = match._1; - t1 = match$1 && !(match$1.tl || !same(match._0, path_option)) ? tree_of_typexp(sch, match$1.hd) : ({ - TAG: /* Otyp_stuff */ 7, - _0: "" - }); - } - } else { - t1 = tree_of_typexp(sch, ty1); + }); } - return { - TAG: /* Otyp_arrow */ 1, - _0: lab, - _1: t1, - _2: tree_of_typexp(sch, ty2) - }; + } else { + t1 = tree_of_typexp(sch, ty1); + } + return { + TAG: /* Otyp_arrow */ 1, + _0: lab, + _1: t1, + _2: tree_of_typexp(sch, ty2) + }; case /* Ttuple */ 2 : + return { + TAG: /* Otyp_tuple */ 9, + _0: Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl._0) + }; + case /* Tconstr */ 3 : + const match$2 = best_type_path(tyl._0); + const s = match$2[1]; + const tyl$p = apply_subst(s, tyl._1); + if (is_nth(s)) { + return tree_of_typexp(sch, Stdlib__List.hd(tyl$p)); + } else { return { - TAG: /* Otyp_tuple */ 9, - _0: Stdlib__List.map((function (param) { + TAG: /* Otyp_constr */ 3, + _0: tree_of_path(match$2[0]), + _1: Stdlib__List.map((function (param) { return tree_of_typexp(sch, param); - }), tyl._0) + }), tyl$p) }; - case /* Tconstr */ 3 : - const match$2 = best_type_path(tyl._0); - const s = match$2[1]; - const tyl$p = apply_subst(s, tyl._1); - if (is_nth(s)) { - return tree_of_typexp(sch, Stdlib__List.hd(tyl$p)); - } else { - return { - TAG: /* Otyp_constr */ 3, - _0: tree_of_path(match$2[0]), - _1: Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl$p) - }; - } + } case /* Tobject */ 4 : - return tree_of_typobject(sch, tyl._0, tyl._1.contents); + return tree_of_typobject(sch, tyl._0, tyl._1.contents); case /* Tfield */ 5 : - return tree_of_typobject(sch, ty$1, undefined); + return tree_of_typobject(sch, ty$1, undefined); case /* Tlink */ 6 : - return fatal_error("Printtyp.tree_of_typexp"); + return fatal_error("Printtyp.tree_of_typexp"); case /* Tsubst */ 7 : - return tree_of_typexp(sch, tyl._0); + return tree_of_typexp(sch, tyl._0); case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, tyl._0); - const fields = row.row_closed ? Stdlib__List.filter((function (param) { - return Caml_obj.caml_notequal(row_field_repr_aux(/* [] */ 0, param[1]), /* Rabsent */ 0); - }), row.row_fields) : row.row_fields; - const present = Stdlib__List.filter((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { - return false; - } else { - return true; - } - }), fields); - const all_present = Stdlib__List.length(present) === Stdlib__List.length(fields); - const match$3 = row.row_name; - if (match$3 !== undefined) { - const tyl$1 = match$3[1]; - const p = match$3[0]; - if (namable_row(row)) { - const match$4 = best_type_path(p); - const s$1 = match$4[1]; - const id = tree_of_path(match$4[0]); - const tyl$2 = apply_subst(s$1, tyl$1); - const args = Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl$2); - if (row.row_closed && all_present) { - if (is_nth(s$1)) { - return Stdlib__List.hd(args); - } else { - return { - TAG: /* Otyp_constr */ 3, - _0: id, - _1: args - }; - } + const row = row_repr_aux(/* [] */ 0, tyl._0); + const fields = row.row_closed ? Stdlib__List.filter((function (param) { + return Caml_obj.caml_notequal(row_field_repr_aux(/* [] */ 0, param[1]), /* Rabsent */ 0); + }), row.row_fields) : row.row_fields; + const present = Stdlib__List.filter((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { + return false; + } else { + return true; } - const non_gen = is_non_gen(sch, px); - const tags = all_present ? undefined : Stdlib__List.map((function (prim) { - return prim[0]; - }), present); - let inh; - let exit = 0; - if (args) { - const match$5 = args.hd; - if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string" || !(match$5.TAG === /* Otyp_constr */ 3 && !(args.tl || !is_nth(s$1)))) { - exit = 2; - } else { - inh = { - TAG: /* Ovar_name */ 1, - _0: match$5._0, - _1: match$5._1 - }; - } + }), fields); + const all_present = Stdlib__List.length(present) === Stdlib__List.length(fields); + const match$3 = row.row_name; + if (match$3 !== undefined) { + const tyl$1 = match$3[1]; + const p = match$3[0]; + if (namable_row(row)) { + const match$4 = best_type_path(p); + const s$1 = match$4[1]; + const id = tree_of_path(match$4[0]); + const tyl$2 = apply_subst(s$1, tyl$1); + const args = Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl$2); + if (row.row_closed && all_present) { + if (is_nth(s$1)) { + return Stdlib__List.hd(args); } else { - exit = 2; + return { + TAG: /* Otyp_constr */ 3, + _0: id, + _1: args + }; } - if (exit === 2) { + } + const non_gen = is_non_gen(sch, px); + const tags = all_present ? undefined : Stdlib__List.map((function (prim) { + return prim[0]; + }), present); + let inh; + let exit = 0; + if (args) { + const match$5 = args.hd; + if (/* tag */ typeof match$5 === "number" || typeof match$5 === "string" || !(match$5.TAG === /* Otyp_constr */ 3 && !(args.tl || !is_nth(s$1)))) { + exit = 2; + } else { inh = { TAG: /* Ovar_name */ 1, - _0: tree_of_path(p), - _1: Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl$1) + _0: match$5._0, + _1: match$5._1 }; } - return { - TAG: /* Otyp_variant */ 11, - _0: non_gen, - _1: inh, - _2: row.row_closed, - _3: tags + } else { + exit = 2; + } + if (exit === 2) { + inh = { + TAG: /* Ovar_name */ 1, + _0: tree_of_path(p), + _1: Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl$1) }; } - + return { + TAG: /* Otyp_variant */ 11, + _0: non_gen, + _1: inh, + _2: row.row_closed, + _3: tags + }; } - const non_gen$1 = !(row.row_closed && all_present) && is_non_gen(sch, px); - const fields$1 = Stdlib__List.map((function (param) { - const l = param[0]; - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string") { - return [ - l, - false, - /* [] */ 0 - ]; - } - if (match.TAG === /* Rpresent */ 0) { - const ty = match._0; - if (ty !== undefined) { - return [ - l, - false, - { - hd: tree_of_typexp(sch, ty), - tl: /* [] */ 0 - } - ]; - } else { - return [ - l, - false, - /* [] */ 0 - ]; - } - } - const c = match._0; - if (c && !match._1) { + + } + const non_gen$1 = !(row.row_closed && all_present) && is_non_gen(sch, px); + const fields$1 = Stdlib__List.map((function (param) { + const l = param[0]; + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + return [ + l, + false, + /* [] */ 0 + ]; + } + if (match.TAG === /* Rpresent */ 0) { + const ty = match._0; + if (ty !== undefined) { return [ l, false, - /* [] */ 0 - ]; - } - const tyl = match._1; - if (c) { - return [ - l, - true, - Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl) + { + hd: tree_of_typexp(sch, ty), + tl: /* [] */ 0 + } ]; } else { return [ l, false, - Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl) + /* [] */ 0 ]; } - }), fields); - const tags$1 = all_present ? undefined : Stdlib__List.map((function (prim) { - return prim[0]; - }), present); - return { - TAG: /* Otyp_variant */ 11, - _0: non_gen$1, - _1: { - TAG: /* Ovar_fields */ 0, - _0: fields$1 - }, - _2: row.row_closed, - _3: tags$1 - }; + } + const c = match._0; + if (c && !match._1) { + return [ + l, + false, + /* [] */ 0 + ]; + } + const tyl = match._1; + if (c) { + return [ + l, + true, + Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl) + ]; + } else { + return [ + l, + false, + Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl) + ]; + } + }), fields); + const tags$1 = all_present ? undefined : Stdlib__List.map((function (prim) { + return prim[0]; + }), present); + return { + TAG: /* Otyp_variant */ 11, + _0: non_gen$1, + _1: { + TAG: /* Ovar_fields */ 0, + _0: fields$1 + }, + _2: row.row_closed, + _3: tags$1 + }; case /* Tunivar */ 9 : - return { - TAG: /* Otyp_var */ 10, - _0: false, - _1: name_of_type(ty$1) - }; + return { + TAG: /* Otyp_var */ 10, + _0: false, + _1: name_of_type(ty$1) + }; case /* Tpoly */ 10 : - const ty$2 = tyl._0; - if (!tyl._1) { - return tree_of_typexp(sch, ty$2); - } - const tyl$3 = Stdlib__List.map(repr, tyl._1); - if (Caml_obj.caml_equal(tyl$3, /* [] */ 0)) { - return tree_of_typexp(sch, ty$2); - } - const old_delayed = delayed.contents; - Stdlib__List.iter(add_delayed, tyl$3); - const tl = Stdlib__List.map(name_of_type, tyl$3); - const tr_1 = tree_of_typexp(sch, ty$2); - const tr = { - TAG: /* Otyp_poly */ 12, - _0: tl, - _1: tr_1 - }; - remove_names(tyl$3); - delayed.contents = old_delayed; - return tr; + const ty$2 = tyl._0; + if (!tyl._1) { + return tree_of_typexp(sch, ty$2); + } + const tyl$3 = Stdlib__List.map(repr, tyl._1); + if (Caml_obj.caml_equal(tyl$3, /* [] */ 0)) { + return tree_of_typexp(sch, ty$2); + } + const old_delayed = delayed.contents; + Stdlib__List.iter(add_delayed, tyl$3); + const tl = Stdlib__List.map(name_of_type, tyl$3); + const tr_1 = tree_of_typexp(sch, ty$2); + const tr = { + TAG: /* Otyp_poly */ 12, + _0: tl, + _1: tr_1 + }; + remove_names(tyl$3); + delayed.contents = old_delayed; + return tr; case /* Tpackage */ 11 : - const n = Stdlib__List.map((function (li) { - return Stdlib__String.concat(".", flat(/* [] */ 0, li)); - }), tyl._1); - return { - TAG: /* Otyp_module */ 13, - _0: name(undefined, tyl._0), - _1: n, - _2: Stdlib__List.map((function (param) { - return tree_of_typexp(sch, param); - }), tyl._2) - }; + const n = Stdlib__List.map((function (li) { + return Stdlib__String.concat(".", flat(/* [] */ 0, li)); + }), tyl._1); + return { + TAG: /* Otyp_module */ 13, + _0: name(undefined, tyl._0), + _1: n, + _2: Stdlib__List.map((function (param) { + return tree_of_typexp(sch, param); + }), tyl._2) + }; } }; @@ -46324,12 +46324,12 @@ function tree_of_typfields(sch, rest, param) { } else { switch (match$2.TAG) { case /* Tconstr */ 3 : - rest$1 = false; - break; + rest$1 = false; + break; case /* Tvar */ 0 : case /* Tunivar */ 9 : - rest$1 = is_non_gen(sch, rest); - break; + rest$1 = is_non_gen(sch, rest); + break; default: rest$1 = fatal_error("typfields (1)"); } @@ -46474,22 +46474,22 @@ function tree_of_type_decl(id, decl) { const id$p = match$1[0]; switch (id$p.TAG) { case /* Pident */ 0 : - ty$2 = Caml_obj.caml_equal(id, id$p._0) ? newty2(100000000, { - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$1.row_fields, - row_more: row$1.row_more, - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: row$1.row_fixed, - row_name: undefined - } - }) : ty$1; - break; + ty$2 = Caml_obj.caml_equal(id, id$p._0) ? newty2(100000000, { + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$1.row_fields, + row_more: row$1.row_more, + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: row$1.row_fixed, + row_name: undefined + } + }) : ty$1; + break; case /* Pdot */ 1 : case /* Papply */ 2 : - ty$2 = ty$1; - break; + ty$2 = ty$1; + break; } } else { @@ -46669,14 +46669,14 @@ function tree_of_extension_constructor(id, ext, es) { let es$1; switch (es) { case /* Text_first */ 0 : - es$1 = /* Oext_first */ 0; - break; + es$1 = /* Oext_first */ 0; + break; case /* Text_next */ 1 : - es$1 = /* Oext_next */ 1; - break; + es$1 = /* Oext_next */ 1; + break; case /* Text_exception */ 2 : - es$1 = /* Oext_exception */ 2; - break; + es$1 = /* Oext_exception */ 2; + break; } return { @@ -46742,39 +46742,39 @@ function prepare_class_type(params, _sign) { const sign = _sign; switch (sign.TAG) { case /* Cty_constr */ 0 : - const cty = sign._2; - const tyl = sign._1; - const sty = repr(signature_of_class_type(cty).csig_self); - if (!(Stdlib__List.memq(proxy(sty), visited_objects.contents) || !Stdlib__List.for_all(is_Tvar, params) || Stdlib__List.exists((function (param) { - return deep_occur(sty, param); - }), tyl))) { - return Stdlib__List.iter(mark_loops, tyl); - } - _sign = cty; - continue; + const cty = sign._2; + const tyl = sign._1; + const sty = repr(signature_of_class_type(cty).csig_self); + if (!(Stdlib__List.memq(proxy(sty), visited_objects.contents) || !Stdlib__List.for_all(is_Tvar, params) || Stdlib__List.exists((function (param) { + return deep_occur(sty, param); + }), tyl))) { + return Stdlib__List.iter(mark_loops, tyl); + } + _sign = cty; + continue; case /* Cty_signature */ 1 : - const sign$1 = sign._0; - const sty$1 = repr(sign$1.csig_self); - const px = proxy(sty$1); - if (Stdlib__List.memq(px, visited_objects.contents)) { - add_alias(sty$1); - } else { - visited_objects.contents = { - hd: px, - tl: visited_objects.contents - }; - } - const match = flatten_fields(object_fields(sign$1.csig_self)); - Stdlib__List.iter((function (met) { - mark_loops(method_type(met)[0]); - }), match[0]); - return Curry._2(Meths.iter, (function (param, param$1) { - mark_loops(param$1[2]); - }), sign$1.csig_vars); + const sign$1 = sign._0; + const sty$1 = repr(sign$1.csig_self); + const px = proxy(sty$1); + if (Stdlib__List.memq(px, visited_objects.contents)) { + add_alias(sty$1); + } else { + visited_objects.contents = { + hd: px, + tl: visited_objects.contents + }; + } + const match = flatten_fields(object_fields(sign$1.csig_self)); + Stdlib__List.iter((function (met) { + mark_loops(method_type(met)[0]); + }), match[0]); + return Curry._2(Meths.iter, (function (param, param$1) { + mark_loops(param$1[2]); + }), sign$1.csig_vars); case /* Cty_arrow */ 2 : - mark_loops(sign._1); - _sign = sign._2; - continue; + mark_loops(sign._1); + _sign = sign._2; + continue; } }; @@ -46785,129 +46785,129 @@ function tree_of_class_type(sch, params, _sign) { const sign = _sign; switch (sign.TAG) { case /* Cty_constr */ 0 : - const cty = sign._2; - const sty = repr(signature_of_class_type(cty).csig_self); - if (!(Stdlib__List.memq(proxy(sty), visited_objects.contents) || !Stdlib__List.for_all(is_Tvar, params))) { - return { - TAG: /* Octy_constr */ 0, - _0: tree_of_path(sign._0), - _1: Stdlib__List.map((function (param) { - return tree_of_typexp(true, param); - }), sign._1) - }; - } - _sign = cty; - continue; - case /* Cty_signature */ 1 : - const sign$1 = sign._0; - const sty$1 = repr(sign$1.csig_self); - const self_ty = is_aliased(sty$1) ? ({ - TAG: /* Otyp_var */ 10, - _0: false, - _1: name_of_type(proxy(sty$1)) - }) : undefined; - const match = flatten_fields(object_fields(sign$1.csig_self)); - const csil = Stdlib__List.fold_left((function (csil, param) { - return { - hd: { - TAG: /* Ocsg_constraint */ 0, - _0: param[0], - _1: param[1] - }, - tl: csil - }; - }), /* [] */ 0, tree_of_constraints(params)); - const all_vars = Curry._3(Meths.fold, (function (l, param, all) { - return { - hd: [ - l, - param[0], - param[1], - param[2] - ], - tl: all - }; - }), sign$1.csig_vars, /* [] */ 0); - const all_vars$1 = Stdlib__List.rev(all_vars); - const csil$1 = Stdlib__List.fold_left((function (csil, param) { - return { - hd: { - TAG: /* Ocsg_value */ 2, - _0: param[0], - _1: param[1] === /* Mutable */ 1, - _2: param[2] === /* Virtual */ 0, - _3: tree_of_typexp(sch, param[3]) - }, - tl: csil - }; - }), csil, all_vars$1); - const partial_arg = sign$1.csig_concr; - const csil$2 = Stdlib__List.fold_left((function (param, param$1) { - const lab = param$1[0]; - if (lab === dummy_method) { - return param; - } - const kind = field_kind_repr(param$1[1]); - const priv = Caml_obj.caml_notequal(kind, /* Fpresent */ 0); - const virt = !Curry._2(mem$2, lab, partial_arg); - const match = method_type([ - lab, - kind, - param$1[2] - ]); - const tty = tree_of_typexp(sch, match[0]); - remove_names(match[1]); - return { - hd: { - TAG: /* Ocsg_method */ 1, - _0: lab, - _1: priv, - _2: virt, - _3: tty - }, - tl: param - }; - }), csil$1, match[0]); + const cty = sign._2; + const sty = repr(signature_of_class_type(cty).csig_self); + if (!(Stdlib__List.memq(proxy(sty), visited_objects.contents) || !Stdlib__List.for_all(is_Tvar, params))) { return { - TAG: /* Octy_signature */ 2, - _0: self_ty, - _1: Stdlib__List.rev(csil$2) + TAG: /* Octy_constr */ 0, + _0: tree_of_path(sign._0), + _1: Stdlib__List.map((function (param) { + return tree_of_typexp(true, param); + }), sign._1) }; + } + _sign = cty; + continue; + case /* Cty_signature */ 1 : + const sign$1 = sign._0; + const sty$1 = repr(sign$1.csig_self); + const self_ty = is_aliased(sty$1) ? ({ + TAG: /* Otyp_var */ 10, + _0: false, + _1: name_of_type(proxy(sty$1)) + }) : undefined; + const match = flatten_fields(object_fields(sign$1.csig_self)); + const csil = Stdlib__List.fold_left((function (csil, param) { + return { + hd: { + TAG: /* Ocsg_constraint */ 0, + _0: param[0], + _1: param[1] + }, + tl: csil + }; + }), /* [] */ 0, tree_of_constraints(params)); + const all_vars = Curry._3(Meths.fold, (function (l, param, all) { + return { + hd: [ + l, + param[0], + param[1], + param[2] + ], + tl: all + }; + }), sign$1.csig_vars, /* [] */ 0); + const all_vars$1 = Stdlib__List.rev(all_vars); + const csil$1 = Stdlib__List.fold_left((function (csil, param) { + return { + hd: { + TAG: /* Ocsg_value */ 2, + _0: param[0], + _1: param[1] === /* Mutable */ 1, + _2: param[2] === /* Virtual */ 0, + _3: tree_of_typexp(sch, param[3]) + }, + tl: csil + }; + }), csil, all_vars$1); + const partial_arg = sign$1.csig_concr; + const csil$2 = Stdlib__List.fold_left((function (param, param$1) { + const lab = param$1[0]; + if (lab === dummy_method) { + return param; + } + const kind = field_kind_repr(param$1[1]); + const priv = Caml_obj.caml_notequal(kind, /* Fpresent */ 0); + const virt = !Curry._2(mem$2, lab, partial_arg); + const match = method_type([ + lab, + kind, + param$1[2] + ]); + const tty = tree_of_typexp(sch, match[0]); + remove_names(match[1]); + return { + hd: { + TAG: /* Ocsg_method */ 1, + _0: lab, + _1: priv, + _2: virt, + _3: tty + }, + tl: param + }; + }), csil$1, match[0]); + return { + TAG: /* Octy_signature */ 2, + _0: self_ty, + _1: Stdlib__List.rev(csil$2) + }; case /* Cty_arrow */ 2 : - const ty = sign._1; - const l = sign._0; - const lab = print_labels.contents && l !== "" || is_optional(l) ? l : ""; - let ty$1; - if (is_optional(l)) { - const match$1 = repr(ty).desc; - let exit = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tconstr */ 3) { - exit = 1; + const ty = sign._1; + const l = sign._0; + const lab = print_labels.contents && l !== "" || is_optional(l) ? l : ""; + let ty$1; + if (is_optional(l)) { + const match$1 = repr(ty).desc; + let exit = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tconstr */ 3) { + exit = 1; + } else { + const match$2 = match$1._1; + if (match$2 && !(match$2.tl || !same(match$1._0, path_option))) { + ty$1 = match$2.hd; } else { - const match$2 = match$1._1; - if (match$2 && !(match$2.tl || !same(match$1._0, path_option))) { - ty$1 = match$2.hd; - } else { - exit = 1; - } - } - if (exit === 1) { - ty$1 = newconstr({ - TAG: /* Pident */ 0, - _0: create("") - }, /* [] */ 0); + exit = 1; } - - } else { - ty$1 = ty; } - const tr = tree_of_typexp(sch, ty$1); - return { - TAG: /* Octy_arrow */ 1, - _0: lab, - _1: tr, - _2: tree_of_class_type(sch, params, sign._2) - }; + if (exit === 1) { + ty$1 = newconstr({ + TAG: /* Pident */ 0, + _0: create("") + }, /* [] */ 0); + } + + } else { + ty$1 = ty; + } + const tr = tree_of_typexp(sch, ty$1); + return { + TAG: /* Octy_arrow */ 1, + _0: lab, + _1: tr, + _2: tree_of_class_type(sch, params, sign._2) + }; } }; @@ -47017,65 +47017,65 @@ function wrap_env(fenv, ftree, arg) { function filter_rem_sig(item, rem) { switch (item.TAG) { case /* Sig_class */ 5 : - if (!rem) { - return [ - /* [] */ 0, - rem - ]; - } - const match = rem.tl; - if (!match) { - return [ - /* [] */ 0, - rem - ]; - } - const match$1 = match.tl; - if (match$1) { - return [ - { - hd: rem.hd, - tl: { - hd: match.hd, - tl: { - hd: match$1.hd, - tl: /* [] */ 0 - } - } - }, - match$1.tl - ]; - } else { - return [ - /* [] */ 0, - rem - ]; - } - case /* Sig_class_type */ 6 : - if (!rem) { - return [ - /* [] */ 0, - rem - ]; - } - const match$2 = rem.tl; - if (match$2) { - return [ - { - hd: rem.hd, + if (!rem) { + return [ + /* [] */ 0, + rem + ]; + } + const match = rem.tl; + if (!match) { + return [ + /* [] */ 0, + rem + ]; + } + const match$1 = match.tl; + if (match$1) { + return [ + { + hd: rem.hd, + tl: { + hd: match.hd, tl: { - hd: match$2.hd, + hd: match$1.hd, tl: /* [] */ 0 } - }, - match$2.tl - ]; - } else { - return [ - /* [] */ 0, - rem - ]; - } + } + }, + match$1.tl + ]; + } else { + return [ + /* [] */ 0, + rem + ]; + } + case /* Sig_class_type */ 6 : + if (!rem) { + return [ + /* [] */ 0, + rem + ]; + } + const match$2 = rem.tl; + if (match$2) { + return [ + { + hd: rem.hd, + tl: { + hd: match$2.hd, + tl: /* [] */ 0 + } + }, + match$2.tl + ]; + } else { + return [ + /* [] */ 0, + rem + ]; + } default: return [ /* [] */ 0, @@ -47118,12 +47118,12 @@ function hide_rec_items(param) { switch (match._2) { case /* Trec_not */ 0 : case /* Trec_first */ 1 : - return /* [] */ 0; + return /* [] */ 0; case /* Trec_next */ 2 : - return { - hd: match._0, - tl: get_ids(param.tl) - }; + return { + hd: match._0, + tl: get_ids(param.tl) + }; } }; @@ -47144,39 +47144,39 @@ function hide_rec_items(param) { function tree_of_modtype(p) { switch (p.TAG) { case /* Mty_ident */ 0 : - return { - TAG: /* Omty_ident */ 1, - _0: tree_of_path(p._0) - }; + return { + TAG: /* Omty_ident */ 1, + _0: tree_of_path(p._0) + }; case /* Mty_signature */ 1 : - return { - TAG: /* Omty_signature */ 2, - _0: tree_of_signature(p._0) - }; + return { + TAG: /* Omty_signature */ 2, + _0: tree_of_signature(p._0) + }; case /* Mty_functor */ 2 : - const ty_res = p._2; - const ty_arg = p._1; - const param = p._0; - let res; - if (ty_arg !== undefined) { - const partial_arg = true; - res = wrap_env((function (param$1) { - return add_module$1(partial_arg, param, ty_arg, param$1); - }), tree_of_modtype, ty_res); - } else { - res = tree_of_modtype(ty_res); - } - return { - TAG: /* Omty_functor */ 0, - _0: param.name, - _1: may_map(tree_of_modtype, ty_arg), - _2: res - }; + const ty_res = p._2; + const ty_arg = p._1; + const param = p._0; + let res; + if (ty_arg !== undefined) { + const partial_arg = true; + res = wrap_env((function (param$1) { + return add_module$1(partial_arg, param, ty_arg, param$1); + }), tree_of_modtype, ty_res); + } else { + res = tree_of_modtype(ty_res); + } + return { + TAG: /* Omty_functor */ 0, + _0: param.name, + _1: may_map(tree_of_modtype, ty_arg), + _2: res + }; case /* Mty_alias */ 3 : - return { - TAG: /* Omty_alias */ 3, - _0: tree_of_path(p._0) - }; + return { + TAG: /* Omty_alias */ 3, + _0: tree_of_path(p._0) + }; } } @@ -47202,11 +47202,11 @@ function tree_of_signature_rec(env$p, in_type_group, param) { switch (item._2) { case /* Trec_not */ 0 : case /* Trec_first */ 1 : - exit = 1; - break; + exit = 1; + break; case /* Trec_next */ 2 : - in_type_group$1 = true; - break; + in_type_group$1 = true; + break; } } else { @@ -47221,13 +47221,13 @@ function tree_of_signature_rec(env$p, in_type_group, param) { switch (item._2) { case /* Trec_not */ 0 : case /* Trec_first */ 1 : - set_printing_env(env$p); - in_type_group$1 = true; - break; + set_printing_env(env$p); + in_type_group$1 = true; + break; case /* Trec_next */ 2 : - set_printing_env(env$p); - in_type_group$1 = false; - break; + set_printing_env(env$p); + in_type_group$1 = false; + break; } } else { @@ -47240,65 +47240,65 @@ function tree_of_signature_rec(env$p, in_type_group, param) { let trees; switch (item.TAG) { case /* Sig_value */ 0 : - trees = { - hd: tree_of_value_description(item._0, item._1), - tl: /* [] */ 0 - }; - break; + trees = { + hd: tree_of_value_description(item._0, item._1), + tl: /* [] */ 0 + }; + break; case /* Sig_type */ 1 : - const id = item._0; - if (is_row_name(id.name)) { - trees = /* [] */ 0; - } else { - hide_rec_items({ - hd: item, - tl: rem - }); - trees = { - hd: { - TAG: /* Osig_type */ 5, - _0: tree_of_type_decl(id, item._1), - _1: tree_of_rec(item._2) - }, - tl: /* [] */ 0 - }; - } - break; - case /* Sig_typext */ 2 : - trees = { - hd: tree_of_extension_constructor(item._0, item._1, item._2), - tl: /* [] */ 0 - }; - break; - case /* Sig_module */ 3 : + const id = item._0; + if (is_row_name(id.name)) { + trees = /* [] */ 0; + } else { + hide_rec_items({ + hd: item, + tl: rem + }); trees = { hd: { - TAG: /* Osig_module */ 4, - _0: item._0.name, - _1: tree_of_modtype(item._1.md_type), - _2: tree_of_rec(item._2) + TAG: /* Osig_type */ 5, + _0: tree_of_type_decl(id, item._1), + _1: tree_of_rec(item._2) }, tl: /* [] */ 0 }; - break; + } + break; + case /* Sig_typext */ 2 : + trees = { + hd: tree_of_extension_constructor(item._0, item._1, item._2), + tl: /* [] */ 0 + }; + break; + case /* Sig_module */ 3 : + trees = { + hd: { + TAG: /* Osig_module */ 4, + _0: item._0.name, + _1: tree_of_modtype(item._1.md_type), + _2: tree_of_rec(item._2) + }, + tl: /* [] */ 0 + }; + break; case /* Sig_modtype */ 4 : - trees = { - hd: tree_of_modtype_declaration(item._0, item._1), - tl: /* [] */ 0 - }; - break; + trees = { + hd: tree_of_modtype_declaration(item._0, item._1), + tl: /* [] */ 0 + }; + break; case /* Sig_class */ 5 : - trees = { - hd: tree_of_class_declaration(item._0, item._1, item._2), - tl: /* [] */ 0 - }; - break; + trees = { + hd: tree_of_class_declaration(item._0, item._1, item._2), + tl: /* [] */ 0 + }; + break; case /* Sig_class_type */ 6 : - trees = { - hd: tree_of_cltype_declaration(item._0, item._1, item._2), - tl: /* [] */ 0 - }; - break; + trees = { + hd: tree_of_cltype_declaration(item._0, item._1, item._2), + tl: /* [] */ 0 + }; + break; } const env$p$1 = add_signature({ @@ -47781,7 +47781,7 @@ function may_prepare_expansion(compact, param) { switch (match.TAG) { case /* Tobject */ 4 : case /* Tvariant */ 8 : - break; + break; default: return prepare_expansion([ t, @@ -47860,10 +47860,10 @@ function has_explanation(unif, t3, t4) { } else { switch (match$1.TAG) { case /* Tvar */ 0 : - exit$1 = 3; - break; + exit$1 = 3; + break; case /* Tconstr */ 3 : - return true; + return true; default: exit = 2; } @@ -47871,70 +47871,70 @@ function has_explanation(unif, t3, t4) { } else { switch (match.TAG) { case /* Tvar */ 0 : - return true; + return true; case /* Tconstr */ 3 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return true; - } - if (match$1.TAG === /* Tvar */ 0) { - exit$1 = 3; - } else { - exit = 2; - } - break; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return true; + } + if (match$1.TAG === /* Tvar */ 0) { + exit$1 = 3; + } else { + exit = 2; + } + break; case /* Tfield */ 5 : - const match$2 = match._3.desc; - let exit$2 = 0; - if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && !/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$1 = 3; - break; - case /* Tconstr */ 3 : - exit$2 = 4; - break; - case /* Tfield */ 5 : - const match$3 = match$1._3.desc; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - return match._0 === match$1._0; - } else { - return false; - } - default: - return false; - } - } else { - exit$2 = 4; - } - if (exit$2 === 4) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return true; - } - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$1 = 3; - break; - case /* Tconstr */ 3 : - return true; - default: + const match$2 = match._3.desc; + let exit$2 = 0; + if (/* tag */ (typeof match$2 === "number" || typeof match$2 === "string") && !/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$1 = 3; + break; + case /* Tconstr */ 3 : + exit$2 = 4; + break; + case /* Tfield */ 5 : + const match$3 = match$1._3.desc; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + return match._0 === match$1._0; + } else { return false; - } + } + default: + return false; } - break; - case /* Tvariant */ 8 : + } else { + exit$2 = 4; + } + if (exit$2 === 4) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return false; + return true; } switch (match$1.TAG) { case /* Tvar */ 0 : - exit$1 = 3; - break; - case /* Tvariant */ 8 : - return true; + exit$1 = 3; + break; + case /* Tconstr */ 3 : + return true; default: return false; } - break; + } + break; + case /* Tvariant */ 8 : + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return false; + } + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$1 = 3; + break; + case /* Tvariant */ 8 : + return true; + default: + return false; + } + break; default: exit$1 = 3; } @@ -48007,288 +48007,228 @@ function explanation(unif, mis, ppf) { } switch (match$1.TAG) { case /* Tvar */ 0 : - exit$4 = 9; - break; + exit$4 = 9; + break; case /* Tconstr */ 3 : - exit = 1; - break; + exit = 1; + break; case /* Tfield */ 5 : - exit$2 = 7; - break; + exit$2 = 7; + break; default: return; } } else { switch (match.TAG) { case /* Tvar */ 0 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit$1 = 5; - } else { - switch (match$1.TAG) { - case /* Ttuple */ 2 : - exit$1 = match$1._0 ? 5 : 3; - break; - case /* Tconstr */ 3 : - const p = match$1._0; - if (unif && t3.level < binding_time(p)) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit$1 = 5; + } else { + switch (match$1.TAG) { + case /* Ttuple */ 2 : + exit$1 = match$1._0 ? 5 : 3; + break; + case /* Tconstr */ 3 : + const p = match$1._0; + if (unif && t3.level < binding_time(p)) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Open_box */ 1, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type constructor", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 }, _1: { - TAG: /* String_literal */ 11, - _0: "The type constructor", - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@;<1 2>", + _0: "@ ", _1: 1, - _2: 2 + _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String_literal */ 11, + _0: "would escape its scope", + _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "would escape its scope", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" - }), path, p); - } - exit$1 = 5; - break; - case /* Tunivar */ 9 : - exit$1 = 4; - break; - default: - exit$1 = 5; - } + } + } + }, + _1: "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" + }), path, p); + } + exit$1 = 5; + break; + case /* Tunivar */ 9 : + exit$1 = 4; + break; + default: + exit$1 = 5; } - break; + } + break; case /* Ttuple */ 2 : - if (match._0) { - exit$4 = 9; - } else { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + if (match._0) { + exit$4 = 9; + } else { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return; + } + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$1 = 3; + break; + case /* Tfield */ 5 : + exit$2 = 7; + break; + default: return; - } - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$1 = 3; - break; - case /* Tfield */ 5 : - exit$2 = 7; - break; - default: - return; - } } - break; + } + break; case /* Tconstr */ 3 : - const p$1 = match._0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tvar */ 0 : - if (unif && t4.level < binding_time(p$1)) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const p$1 = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tvar */ 0 : + if (unif && t4.level < binding_time(p$1)) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Open_box */ 1, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type constructor", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 }, _1: { - TAG: /* String_literal */ 11, - _0: "The type constructor", - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@;<1 2>", + _0: "@ ", _1: 1, - _2: 2 + _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String_literal */ 11, + _0: "would escape its scope", + _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "would escape its scope", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" - }), path, p$1); - } - exit$4 = 9; - break; - case /* Tfield */ 5 : - exit$2 = 7; - break; - default: - return; - } + } + } + }, + _1: "@,@[The type constructor@;<1 2>%a@ would escape its scope@]" + }), path, p$1); + } + exit$4 = 9; + break; + case /* Tfield */ 5 : + exit$2 = 7; + break; + default: + return; } - break; + } + break; case /* Tvariant */ 8 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return; - } - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$4 = 9; - break; - case /* Tfield */ 5 : - exit$2 = 7; - break; - case /* Tvariant */ 8 : - const row1 = row_repr_aux(/* [] */ 0, match._0); - const row2 = row_repr_aux(/* [] */ 0, match$1._0); - const match$2 = row1.row_fields; - const match$3 = row1.row_closed; - const match$4 = row2.row_fields; - const match$5 = row2.row_closed; - let exit$5 = 0; - if (match$2) { - if (match$2.tl || !match$3) { - exit$5 = 10; - } else { - if (match$4) { - if (match$4.tl) { - return; - } - if (!match$5) { - return; - } - const l1 = match$2.hd[0]; - if (l1 === match$4.hd[0]) { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Types for tag `", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " are incompatible", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "@,Types for tag `%s are incompatible" - }), l1); - } else { - return; - } - } - exit$5 = 10; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return; + } + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$4 = 9; + break; + case /* Tfield */ 5 : + exit$2 = 7; + break; + case /* Tvariant */ 8 : + const row1 = row_repr_aux(/* [] */ 0, match._0); + const row2 = row_repr_aux(/* [] */ 0, match$1._0); + const match$2 = row1.row_fields; + const match$3 = row1.row_closed; + const match$4 = row2.row_fields; + const match$5 = row2.row_closed; + let exit$5 = 0; + if (match$2) { + if (match$2.tl || !match$3) { + exit$5 = 10; + } else { + if (match$4) { + if (match$4.tl) { + return; } - } else if (match$3) { - let exit$6 = 0; - if (match$4) { - exit$6 = 11; - } else { - if (match$5) { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "These two variant types have no intersection", - _1: /* End_of_format */ 0 - } - }, - _1: "@,These two variant types have no intersection" - }); - } - exit$6 = 11; + if (!match$5) { + return; } - if (exit$6 === 11) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ + const l1 = match$2.hd[0]; + if (l1 === match$4.hd[0]) { + return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, @@ -48299,156 +48239,216 @@ function explanation(unif, mis, ppf) { _2: 0 }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "Types for tag `", _1: { - TAG: /* String_literal */ 11, - _0: "The first variant type does not allow tag(s)", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } + TAG: /* String_literal */ 11, + _0: " are incompatible", + _1: /* End_of_format */ 0 } } } }, - _1: "@,@[The first variant type does not allow tag(s)@ @[%a@]@]" - }), print_tags, match$4); + _1: "@,Types for tag `%s are incompatible" + }), l1); + } else { + return; } - - } else { - exit$5 = 10; } - if (exit$5 === 10) { - if (match$4 || !match$5) { - return; - } else { - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + exit$5 = 10; + } + } else if (match$3) { + let exit$6 = 0; + if (match$4) { + exit$6 = 11; + } else { + if (match$5) { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "These two variant types have no intersection", + _1: /* End_of_format */ 0 + } + }, + _1: "@,These two variant types have no intersection" + }); + } + exit$6 = 11; + } + if (exit$6 === 11) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Open_box */ 1, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The first variant type does not allow tag(s)", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "The second variant type does not allow tag(s)", - _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 }, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } + } + } + }, + _1: "@,@[The first variant type does not allow tag(s)@ @[%a@]@]" + }), print_tags, match$4); + } + + } else { + exit$5 = 10; + } + if (exit$5 === 10) { + if (match$4 || !match$5) { + return; + } else { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, - _1: "@,@[The second variant type does not allow tag(s)@ @[%a@]@]" - }), print_tags, match$2); - } - } - break; - default: - return; - } - break; - case /* Tunivar */ 9 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return; - } - switch (match$1.TAG) { - case /* Tvar */ 0 : - exit$1 = 4; - break; - case /* Tfield */ 5 : - exit$2 = 7; - break; - default: - return; - } - break; - default: - exit$4 = 9; + _1: { + TAG: /* String_literal */ 11, + _0: "The second variant type does not allow tag(s)", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + }, + _1: "@,@[The second variant type does not allow tag(s)@ @[%a@]@]" + }), print_tags, match$2); + } + } + break; + default: + return; + } + break; + case /* Tunivar */ 9 : + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return; + } + switch (match$1.TAG) { + case /* Tvar */ 0 : + exit$1 = 4; + break; + case /* Tfield */ 5 : + exit$2 = 7; + break; + default: + return; + } + break; + default: + exit$4 = 9; } } if (exit$4 === 9) { @@ -48472,12 +48472,12 @@ function explanation(unif, mis, ppf) { } else { switch (match$1.TAG) { case /* Tconstr */ 3 : - exit = 2; - break; + exit = 2; + break; case /* Tfield */ 5 : - lab = match$1._0; - exit$1 = 6; - break; + lab = match$1._0; + exit$1 = 6; + break; default: return; } @@ -48485,26 +48485,62 @@ function explanation(unif, mis, ppf) { } switch (exit$1) { case 3 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Self type cannot escape its class", - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 }, - _1: "@,Self type cannot escape its class" - }); + _1: { + TAG: /* String_literal */ 11, + _0: "Self type cannot escape its class", + _1: /* End_of_format */ 0 + } + }, + _1: "@,Self type cannot escape its class" + }); case 4 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The universal variable ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " would escape its scope", + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "@,The universal variable %a would escape its scope" + }), type_expr$1, is_Tunivar(t3) ? t3 : t4); + case 5 : + const match$6 = is_Tvar(t3) ? [ + t3, + t4 + ] : [ + t4, + t3 + ]; + const t$p = match$6[1]; + const t = match$6[0]; + if (occur_in(empty, t, t$p)) { + return Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, @@ -48515,149 +48551,138 @@ function explanation(unif, mis, ppf) { _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "The universal variable ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* String_literal */ 11, - _0: " would escape its scope", - _1: /* End_of_format */ 0 + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } - } - } - }, - _1: "@,The universal variable %a would escape its scope" - }), type_expr$1, is_Tunivar(t3) ? t3 : t4); - case 5 : - const match$6 = is_Tvar(t3) ? [ - t3, - t4 - ] : [ - t4, - t3 - ]; - const t$p = match$6[1]; - const t = match$6[0]; - if (occur_in(empty, t, t$p)) { - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "The type variable ", _1: { - TAG: /* String_literal */ 11, - _0: "The type variable ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " occurs inside", + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " occurs inside", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@,@[The type variable %a occurs inside@ %a@]" - }), type_expr$1, t, type_expr$1, t$p); - } else { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@,@[The type variable %a occurs inside@ %a@]" + }), type_expr$1, t, type_expr$1, t$p); + } else { + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "This instance of ", _1: { - TAG: /* String_literal */ 11, - _0: "This instance of ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " is ambiguous:", + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " is ambiguous:", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@,@[This instance of %a is ambiguous:@ %s@]" - }), type_expr$1, t$p, "it would escape the scope of its equation"); - } + } + }, + _1: "@,@[This instance of %a is ambiguous:@ %s@]" + }), type_expr$1, t$p, "it would escape the scope of its equation"); + } case 6 : - if (lab === dummy_method) { - return Stdlib__Format.fprintf(ppf)({ + if (lab === dummy_method) { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Self type cannot be unified with a closed object type", + _1: /* End_of_format */ 0 + } + }, + _1: "@,Self type cannot be unified with a closed object type" + }); + } + exit = 2; + break; + + } + switch (exit) { + case 1 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_lit */ 17, @@ -48668,128 +48693,57 @@ function explanation(unif, mis, ppf) { _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "Self type cannot be unified with a closed object type", - _1: /* End_of_format */ 0 - } - }, - _1: "@,Self type cannot be unified with a closed object type" - }); - } - exit = 2; - break; - - } - switch (exit) { - case 1 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "The ", _1: { - TAG: /* String_literal */ 11, - _0: "The ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " object type has an abstract row, it cannot be closed", _1: { - TAG: /* String_literal */ 11, - _0: " object type has an abstract row, it cannot be closed", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@,@[The %s object type has an abstract row, it cannot be closed@]" - }), Caml_obj.caml_equal(t4.desc, /* Tnil */ 0) ? "first" : "second"); - case 2 : - let exit$7 = 0; - if (/* tag */ typeof match === "number" || typeof match === "string") { - exit$7 = 3; - } else { - switch (match.TAG) { - case /* Tconstr */ 3 : - exit$7 = 3; - break; - case /* Tfield */ 5 : - const l = match._0; - const match$7 = match._3.desc; - let exit$8 = 0; - if (/* tag */ (typeof match$7 === "number" || typeof match$7 === "string") && !/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tconstr */ 3 : - exit$8 = 4; - break; - case /* Tfield */ 5 : - const match$8 = match$1._3.desc; - if (/* tag */ (typeof match$8 === "number" || typeof match$8 === "string") && l === match$1._0) { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Types for method ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " are incompatible", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "@,Types for method %s are incompatible" - }), l); - } else { - return; - } - default: - return; } - } else { + }, + _1: "@,@[The %s object type has an abstract row, it cannot be closed@]" + }), Caml_obj.caml_equal(t4.desc, /* Tnil */ 0) ? "first" : "second"); + case 2 : + let exit$7 = 0; + if (/* tag */ typeof match === "number" || typeof match === "string") { + exit$7 = 3; + } else { + switch (match.TAG) { + case /* Tconstr */ 3 : + exit$7 = 3; + break; + case /* Tfield */ 5 : + const l = match._0; + const match$7 = match._3.desc; + let exit$8 = 0; + if (/* tag */ (typeof match$7 === "number" || typeof match$7 === "string") && !/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tconstr */ 3 : exit$8 = 4; - } - if (exit$8 === 4) { - let exit$9 = 0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit$9 = 5; - } else { - if (match$1.TAG !== /* Tconstr */ 3) { - return; - } - exit$9 = 5; - } - if (exit$9 === 5) { + break; + case /* Tfield */ 5 : + const match$8 = match$1._3.desc; + if (/* tag */ (typeof match$8 === "number" || typeof match$8 === "string") && l === match$1._0) { return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { @@ -48801,80 +48755,126 @@ function explanation(unif, mis, ppf) { _2: 0 }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "Types for method ", _1: { - TAG: /* String_literal */ 11, - _0: "The second object type has no method ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " are incompatible", + _1: /* End_of_format */ 0 } } } }, - _1: "@,@[The second object type has no method %s@]" + _1: "@,Types for method %s are incompatible" }), l); + } else { + return; } - + default: + return; + } + } else { + exit$8 = 4; + } + if (exit$8 === 4) { + let exit$9 = 0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit$9 = 5; + } else { + if (match$1.TAG !== /* Tconstr */ 3) { + return; } - break; - default: - return; - } + exit$9 = 5; + } + if (exit$9 === 5) { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The second object type has no method ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "@,@[The second object type has no method %s@]" + }), l); + } + + } + break; + default: + return; } - if (exit$7 === 3) { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + if (exit$7 === 3) { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The first object type has no method ", _1: { - TAG: /* String_literal */ 11, - _0: "The first object type has no method ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@,@[The first object type has no method %s@]" - }), match$1._0); - } - break; + } + }, + _1: "@,@[The first object type has no method %s@]" + }), match$1._0); + } + break; } } @@ -48887,47 +48887,47 @@ function path_same_name(_p1, _p2) { const p1 = _p1; switch (p1.TAG) { case /* Pident */ 0 : - switch (p2.TAG) { - case /* Pident */ 0 : - let id1 = p1._0; - let id2 = p2._0; - if (equal(id1, id2) && !Caml_obj.caml_equal(id1, id2)) { - add_unique(id1); - return add_unique(id2); - } else { - return; - } - case /* Pdot */ 1 : - case /* Papply */ 2 : - return; - - } + switch (p2.TAG) { + case /* Pident */ 0 : + let id1 = p1._0; + let id2 = p2._0; + if (equal(id1, id2) && !Caml_obj.caml_equal(id1, id2)) { + add_unique(id1); + return add_unique(id2); + } else { + return; + } + case /* Pdot */ 1 : + case /* Papply */ 2 : + return; + + } case /* Pdot */ 1 : - switch (p2.TAG) { - case /* Pdot */ 1 : - if (p1._1 !== p2._1) { - return; - } - _p2 = p2._0; - _p1 = p1._0; - continue; - case /* Pident */ 0 : - case /* Papply */ 2 : - return; - - } + switch (p2.TAG) { + case /* Pdot */ 1 : + if (p1._1 !== p2._1) { + return; + } + _p2 = p2._0; + _p1 = p1._0; + continue; + case /* Pident */ 0 : + case /* Papply */ 2 : + return; + + } case /* Papply */ 2 : - switch (p2.TAG) { - case /* Pident */ 0 : - case /* Pdot */ 1 : - return; - case /* Papply */ 2 : - path_same_name(p1._0, p2._0); - _p2 = p2._1; - _p1 = p1._1; - continue; - - } + switch (p2.TAG) { + case /* Pident */ 0 : + case /* Pdot */ 1 : + return; + case /* Papply */ 2 : + path_same_name(p1._0, p2._0); + _p2 = p2._1; + _p1 = p1._1; + continue; + + } } }; @@ -49183,92 +49183,91 @@ function include_err(ppf, lab) { } switch (lab.TAG) { case /* CM_Parameter_arity_mismatch */ 0 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The classes do not have the same number of type parameters", - _1: /* End_of_format */ 0 - }, - _1: "The classes do not have the same number of type parameters" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The classes do not have the same number of type parameters", + _1: /* End_of_format */ 0 + }, + _1: "The classes do not have the same number of type parameters" + }); case /* CM_Type_parameter_mismatch */ 1 : - return report_unification_error(ppf, lab._0, false, lab._1, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A type parameter has type", - _1: /* End_of_format */ 0 - }, - _1: "A type parameter has type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "but is expected to have type" - }); - })); + return report_unification_error(ppf, lab._0, false, lab._1, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A type parameter has type", + _1: /* End_of_format */ 0 + }, + _1: "A type parameter has type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but is expected to have type", + _1: /* End_of_format */ 0 + }, + _1: "but is expected to have type" + }); + })); case /* CM_Class_type_mismatch */ 2 : - const cty2 = lab._2; - const cty1 = lab._1; - return wrap_printing_env(lab._0, (function (param) { - Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const cty2 = lab._2; + const cty1 = lab._1; + return wrap_printing_env(lab._0, (function (param) { + Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The class type", _1: { - TAG: /* String_literal */ 11, - _0: "The class type", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -49276,226 +49275,259 @@ function include_err(ppf, lab) { } } } - }, - _1: "@[The class type@;<1 2>%a@ %s@;<1 2>%a@]" - }), class_type$2, cty1, "is not matched by the class type", class_type$2, cty2); - })); + } + }, + _1: "@[The class type@;<1 2>%a@ %s@;<1 2>%a@]" + }), class_type$2, cty1, "is not matched by the class type", class_type$2, cty2); + })); case /* CM_Parameter_mismatch */ 3 : - return report_unification_error(ppf, lab._0, false, lab._1, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A parameter has type", - _1: /* End_of_format */ 0 - }, - _1: "A parameter has type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "but is expected to have type" - }); - })); + return report_unification_error(ppf, lab._0, false, lab._1, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A parameter has type", + _1: /* End_of_format */ 0 + }, + _1: "A parameter has type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but is expected to have type", + _1: /* End_of_format */ 0 + }, + _1: "but is expected to have type" + }); + })); case /* CM_Val_type_mismatch */ 4 : - const lab$1 = lab._0; - return report_unification_error(ppf, lab._1, false, lab._2, (function (ppf) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The instance variable ", + const lab$1 = lab._0; + return report_unification_error(ppf, lab._1, false, lab._2, (function (ppf) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The instance variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "has type", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "has type", + _1: /* End_of_format */ 0 } } - }, - _1: "The instance variable %s@ has type" - }), lab$1); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "but is expected to have type" - }); - })); + } + }, + _1: "The instance variable %s@ has type" + }), lab$1); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but is expected to have type", + _1: /* End_of_format */ 0 + }, + _1: "but is expected to have type" + }); + })); case /* CM_Meth_type_mismatch */ 5 : - const lab$2 = lab._0; - return report_unification_error(ppf, lab._1, false, lab._2, (function (ppf) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The method ", + const lab$2 = lab._0; + return report_unification_error(ppf, lab._1, false, lab._2, (function (ppf) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The method ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "has type", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "has type", + _1: /* End_of_format */ 0 } } - }, - _1: "The method %s@ has type" - }), lab$2); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "but is expected to have type" - }); - })); - case /* CM_Non_mutable_value */ 6 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ + } + }, + _1: "The method %s@ has type" + }), lab$2); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* String_literal */ 11, + _0: "but is expected to have type", + _1: /* End_of_format */ 0 + }, + _1: "but is expected to have type" + }); + })); + case /* CM_Non_mutable_value */ 6 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The non-mutable instance variable ", _1: { - TAG: /* String_literal */ 11, - _0: "The non-mutable instance variable ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " cannot become mutable", _1: { - TAG: /* String_literal */ 11, - _0: " cannot become mutable", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[The non-mutable instance variable %s cannot become mutable@]" - }), lab._0); + } + }, + _1: "@[The non-mutable instance variable %s cannot become mutable@]" + }), lab._0); case /* CM_Non_concrete_value */ 7 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The virtual instance variable ", _1: { - TAG: /* String_literal */ 11, - _0: "The virtual instance variable ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " cannot become concrete", _1: { - TAG: /* String_literal */ 11, - _0: " cannot become concrete", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[The virtual instance variable %s cannot become concrete@]" - }), lab._0); + } + }, + _1: "@[The virtual instance variable %s cannot become concrete@]" + }), lab._0); case /* CM_Missing_value */ 8 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The first class type has no instance variable ", _1: { - TAG: /* String_literal */ 11, - _0: "The first class type has no instance variable ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "@[The first class type has no instance variable %s@]" - }), lab._0); + } + }, + _1: "@[The first class type has no instance variable %s@]" + }), lab._0); case /* CM_Missing_method */ 9 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The first class type has no method ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } - }, + } + } + }, + _1: "@[The first class type has no method %s@]" + }), lab._0); + case /* CM_Hide_public */ 10 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The public method ", _1: { - TAG: /* String_literal */ 11, - _0: "The first class type has no method ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " cannot be hidden", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, @@ -49503,159 +49535,127 @@ function include_err(ppf, lab) { } } } - }, - _1: "@[The first class type has no method %s@]" - }), lab._0); - case /* CM_Hide_public */ 10 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The public method %s cannot be hidden@]" + }), lab._0); + case /* CM_Hide_virtual */ 11 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "The public method ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " cannot be hidden", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[The public method %s cannot be hidden@]" - }), lab._0); - case /* CM_Hide_virtual */ 11 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "The virtual ", _1: { - TAG: /* String_literal */ 11, - _0: "The virtual ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " cannot be hidden", _1: { - TAG: /* String_literal */ 11, - _0: " cannot be hidden", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[The virtual %s %s cannot be hidden@]" - }), lab._0, lab._1); + } + }, + _1: "@[The virtual %s %s cannot be hidden@]" + }), lab._0, lab._1); case /* CM_Public_method */ 12 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "The public method ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " cannot become private", - _1: /* End_of_format */ 0 - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[The public method %s cannot become private" - }), lab._0); - case /* CM_Private_method */ 13 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "The private method ", + _0: "The public method ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " cannot become public", + _0: " cannot become private", _1: /* End_of_format */ 0 } } - }, - _1: "The private method %s cannot become public" - }), lab._0); + } + }, + _1: "@[The public method %s cannot become private" + }), lab._0); + case /* CM_Private_method */ 13 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The private method ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " cannot become public", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The private method %s cannot become public" + }), lab._0); case /* CM_Virtual_method */ 14 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The virtual method ", _1: { - TAG: /* String_literal */ 11, - _0: "The virtual method ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " cannot become concrete", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " cannot become concrete", + _1: /* End_of_format */ 0 } } - }, - _1: "@[The virtual method %s cannot become concrete" - }), lab._0); + } + }, + _1: "@[The virtual method %s cannot become concrete" + }), lab._0); } } @@ -49747,21 +49747,21 @@ function is_absrow(env, ty) { } switch (match._0.TAG) { case /* Pident */ 0 : - const match$1 = expand_head(env, ty); - const match$2 = match$1.desc; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + const match$1 = expand_head(env, ty); + const match$2 = match$1.desc; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + return false; + } + switch (match$2.TAG) { + case /* Tobject */ 4 : + case /* Tvariant */ 8 : + return true; + default: return false; - } - switch (match$2.TAG) { - case /* Tobject */ 4 : - case /* Tvariant */ 8 : - return true; - default: - return false; - } + } case /* Pdot */ 1 : case /* Papply */ 2 : - return false; + return false; } } @@ -49774,180 +49774,180 @@ function type_manifest(env, ty1, params1, ty2, params2, priv2) { if (!/* tag */ (typeof match === "number" || typeof match === "string")) { switch (match.TAG) { case /* Tobject */ 4 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1.TAG === /* Tobject */ 4) { - const fi2 = match$1._0; - if (is_absrow(env, flatten_fields(fi2)[1])) { - const match$2 = flatten_fields(fi2); - if (!equal$5(env, true, { - hd: ty1, - tl: params1 - }, { - hd: match$2[1], - tl: params2 - })) { - return false; - } - const match$3 = flatten_fields(match._0); - const match$4 = match$3[1].desc; - let tmp; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - tmp = true; - } else { - switch (match$4.TAG) { - case /* Tvar */ 0 : - case /* Tconstr */ 3 : - tmp = true; - break; - default: - tmp = false; - } - } - if (!tmp) { - return false; - } - const match$5 = associate_fields(match$3[0], match$2[0]); - if (!Caml_obj.caml_equal(match$5[2], /* [] */ 0)) { - return false; + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1.TAG === /* Tobject */ 4) { + const fi2 = match$1._0; + if (is_absrow(env, flatten_fields(fi2)[1])) { + const match$2 = flatten_fields(fi2); + if (!equal$5(env, true, { + hd: ty1, + tl: params1 + }, { + hd: match$2[1], + tl: params2 + })) { + return false; + } + const match$3 = flatten_fields(match._0); + const match$4 = match$3[1].desc; + let tmp; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + tmp = true; + } else { + switch (match$4.TAG) { + case /* Tvar */ 0 : + case /* Tconstr */ 3 : + tmp = true; + break; + default: + tmp = false; } - const match$6 = Stdlib__List.split(Stdlib__List.map((function (param) { - return [ - param[2], - param[4] - ]; - }), match$5[0])); - return equal$5(env, true, Stdlib.$at(params1, match$6[0]), Stdlib.$at(params2, match$6[1])); } - + if (!tmp) { + return false; + } + const match$5 = associate_fields(match$3[0], match$2[0]); + if (!Caml_obj.caml_equal(match$5[2], /* [] */ 0)) { + return false; + } + const match$6 = Stdlib__List.split(Stdlib__List.map((function (param) { + return [ + param[2], + param[4] + ]; + }), match$5[0])); + return equal$5(env, true, Stdlib.$at(params1, match$6[0]), Stdlib.$at(params2, match$6[1])); } - break; + + } + break; case /* Tvariant */ 8 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1.TAG === /* Tvariant */ 8) { - const row2 = match$1._0; - if (is_absrow(env, row_more(row2))) { - const row1 = row_repr_aux(/* [] */ 0, match._0); - const row2$1 = row_repr_aux(/* [] */ 0, row2); - if (!equal$5(env, true, { - hd: ty1, - tl: params1 - }, { - hd: row2$1.row_more, - tl: params2 - })) { - return false; - } - const match$7 = row1.row_more; - const match$8 = match$7.desc; - let tmp$1; - if (/* tag */ typeof match$8 === "number" || typeof match$8 === "string") { - tmp$1 = true; - } else { - switch (match$8.TAG) { - case /* Tvar */ 0 : - case /* Tconstr */ 3 : - tmp$1 = true; - break; - default: - tmp$1 = false; - } - } - if (!tmp$1) { - return false; - } - const match$9 = merge_row_fields(row1.row_fields, row2$1.row_fields); - if (!(!row2$1.row_closed || row1.row_closed && Caml_obj.caml_equal(filter_row_fields(false, match$9[0]), /* [] */ 0))) { - return false; + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1.TAG === /* Tvariant */ 8) { + const row2 = match$1._0; + if (is_absrow(env, row_more(row2))) { + const row1 = row_repr_aux(/* [] */ 0, match._0); + const row2$1 = row_repr_aux(/* [] */ 0, row2); + if (!equal$5(env, true, { + hd: ty1, + tl: params1 + }, { + hd: row2$1.row_more, + tl: params2 + })) { + return false; + } + const match$7 = row1.row_more; + const match$8 = match$7.desc; + let tmp$1; + if (/* tag */ typeof match$8 === "number" || typeof match$8 === "string") { + tmp$1 = true; + } else { + switch (match$8.TAG) { + case /* Tvar */ 0 : + case /* Tconstr */ 3 : + tmp$1 = true; + break; + default: + tmp$1 = false; } - if (!Stdlib__List.for_all((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { + } + if (!tmp$1) { + return false; + } + const match$9 = merge_row_fields(row1.row_fields, row2$1.row_fields); + if (!(!row2$1.row_closed || row1.row_closed && Caml_obj.caml_equal(filter_row_fields(false, match$9[0]), /* [] */ 0))) { + return false; + } + if (!Stdlib__List.for_all((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { + return true; + } else { + return false; + } + }), match$9[1])) { + return false; + } + const to_equal = { + contents: Stdlib__List.combine(params1, params2) + }; + if (!Stdlib__List.for_all((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Rpresent */ 0) { return true; } else { return false; } - }), match$9[1])) { - return false; - } - const to_equal = { - contents: Stdlib__List.combine(params1, params2) - }; - if (!Stdlib__List.for_all((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - const match$1 = row_field_repr_aux(/* [] */ 0, param[2]); - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Rpresent */ 0) { - return true; - } else { - return false; - } - } - if (match.TAG === /* Rpresent */ 0) { - const t1 = match._0; - if (t1 === undefined) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return false; - } else if (match$1.TAG === /* Rpresent */ 0) { - return match$1._0 === undefined; - } else if (match$1._0 && !match$1._1) { - return true; - } else { - return false; - } - } - let t2; + } + if (match.TAG === /* Rpresent */ 0) { + const t1 = match._0; + if (t1 === undefined) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { return false; - } - if (match$1.TAG === /* Rpresent */ 0) { - const t2$1 = match$1._0; - if (t2$1 === undefined) { - return false; - } - t2 = t2$1; + } else if (match$1.TAG === /* Rpresent */ 0) { + return match$1._0 === undefined; + } else if (match$1._0 && !match$1._1) { + return true; } else { - if (match$1._0) { - return false; - } - const match$2 = match$1._1; - if (!match$2) { - return false; - } - if (match$2.tl) { - return false; - } - t2 = match$2.hd; + return false; } - to_equal.contents = { - hd: [ - t1, - t2 - ], - tl: to_equal.contents - }; - return true; } - const tl1 = match._1; + let t2; if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { return false; } if (match$1.TAG === /* Rpresent */ 0) { - return false; - } - const tl2 = match$1._1; - if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2) && match._0 === match$1._0) { - to_equal.contents = Stdlib.$at(Stdlib__List.combine(tl1, tl2), to_equal.contents); - return true; + const t2$1 = match$1._0; + if (t2$1 === undefined) { + return false; + } + t2 = t2$1; } else { - return false; + if (match$1._0) { + return false; + } + const match$2 = match$1._1; + if (!match$2) { + return false; + } + if (match$2.tl) { + return false; + } + t2 = match$2.hd; } - }), match$9[2])) { - return false; - } - const match$10 = Stdlib__List.split(to_equal.contents); - return equal$5(env, true, match$10[0], match$10[1]); + to_equal.contents = { + hd: [ + t1, + t2 + ], + tl: to_equal.contents + }; + return true; + } + const tl1 = match._1; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return false; + } + if (match$1.TAG === /* Rpresent */ 0) { + return false; + } + const tl2 = match$1._1; + if (Stdlib__List.length(tl1) === Stdlib__List.length(tl2) && match._0 === match$1._0) { + to_equal.contents = Stdlib.$at(Stdlib__List.combine(tl1, tl2), to_equal.contents); + return true; + } else { + return false; + } + }), match$9[2])) { + return false; } - + const match$10 = Stdlib__List.split(to_equal.contents); + return equal$5(env, true, match$10[0], match$10[1]); } - break; + + } + break; } } @@ -50008,216 +50008,216 @@ function report_type_mismatch(first, second, decl, ppf) { if (/* tag */ typeof param$1 === "number" || typeof param$1 === "string") { switch (param$1) { case /* Arity */ 0 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "They have different arities", - _1: /* End_of_format */ 0 - }, - _1: "They have different arities" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "They have different arities", + _1: /* End_of_format */ 0 + }, + _1: "They have different arities" + }); case /* Privacy */ 1 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A private type would be revealed", - _1: /* End_of_format */ 0 - }, - _1: "A private type would be revealed" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A private type would be revealed", + _1: /* End_of_format */ 0 + }, + _1: "A private type would be revealed" + }); case /* Kind */ 2 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Their kinds differ", - _1: /* End_of_format */ 0 - }, - _1: "Their kinds differ" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Their kinds differ", + _1: /* End_of_format */ 0 + }, + _1: "Their kinds differ" + }); case /* Constraint */ 3 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Their constraints differ", - _1: /* End_of_format */ 0 - }, - _1: "Their constraints differ" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Their constraints differ", + _1: /* End_of_format */ 0 + }, + _1: "Their constraints differ" + }); case /* Manifest */ 4 : - return; + return; case /* Variance */ 5 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Their variances do not agree", - _1: /* End_of_format */ 0 - }, - _1: "Their variances do not agree" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Their variances do not agree", + _1: /* End_of_format */ 0 + }, + _1: "Their variances do not agree" + }); } } else { switch (param$1.TAG) { case /* Field_type */ 0 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The types for field ", + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The types for field ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " are not equal", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " are not equal", + _1: /* End_of_format */ 0 } - }, - _1: "The types for field %s are not equal" - }), param$1._0.name); + } + }, + _1: "The types for field %s are not equal" + }), param$1._0.name); case /* Field_mutable */ 1 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The mutability of field ", + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The mutability of field ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is different", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " is different", + _1: /* End_of_format */ 0 } - }, - _1: "The mutability of field %s is different" - }), param$1._0.name); + } + }, + _1: "The mutability of field %s is different" + }), param$1._0.name); case /* Field_arity */ 2 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The arities for field ", + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The arities for field ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " differ", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " differ", + _1: /* End_of_format */ 0 } - }, - _1: "The arities for field %s differ" - }), param$1._0.name); + } + }, + _1: "The arities for field %s differ" + }), param$1._0.name); case /* Field_names */ 3 : - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Fields number ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " have different names, ", + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Fields number ", + _1: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " have different names, ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "Fields number %i have different names, %s and %s" - }), param$1._0, param$1._1.name, param$1._2.name); + } + }, + _1: "Fields number %i have different names, %s and %s" + }), param$1._0, param$1._1.name, param$1._2.name); case /* Field_missing */ 4 : - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The field ", + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The field ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is only present in ", _1: { - TAG: /* String_literal */ 11, - _0: " is only present in ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "The field %s is only present in %s %s" - }), param$1._1.name, param$1._0 ? second : first, decl); - case /* Record_representation */ 5 : - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Their internal representations differ:", + } + }, + _1: "The field %s is only present in %s %s" + }), param$1._1.name, param$1._0 ? second : first, decl); + case /* Record_representation */ 5 : + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Their internal representations differ:", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "Their internal representations differ:@ %s %s %s" - }), param$1._0 ? second : first, decl, "uses unboxed float representation"); + } + }, + _1: "Their internal representations differ:@ %s %s %s" + }), param$1._0 ? second : first, decl, "uses unboxed float representation"); } } @@ -50666,32 +50666,32 @@ function strengthen$1(env, mty, p) { const sg = scrape(env, mty); switch (sg.TAG) { case /* Mty_signature */ 1 : + return { + TAG: /* Mty_signature */ 1, + _0: strengthen_sig(env, sg._0, p) + }; + case /* Mty_functor */ 2 : + const param = sg._0; + if (applicative_functors.contents && param.name !== "*") { return { - TAG: /* Mty_signature */ 1, - _0: strengthen_sig(env, sg._0, p) + TAG: /* Mty_functor */ 2, + _0: param, + _1: sg._1, + _2: strengthen$1(env, sg._2, { + TAG: /* Papply */ 2, + _0: p, + _1: { + TAG: /* Pident */ 0, + _0: param + } + }) }; - case /* Mty_functor */ 2 : - const param = sg._0; - if (applicative_functors.contents && param.name !== "*") { - return { - TAG: /* Mty_functor */ 2, - _0: param, - _1: sg._1, - _2: strengthen$1(env, sg._2, { - TAG: /* Papply */ 2, - _0: p, - _1: { - TAG: /* Pident */ 0, - _0: param - } - }) - }; - } else { - return sg; - } + } else { + return sg; + } case /* Mty_ident */ 0 : case /* Mty_alias */ 3 : - return sg; + return sg; } } @@ -50703,106 +50703,106 @@ function strengthen_sig(env, sg, p) { const sigelt = sg.hd; switch (sigelt.TAG) { case /* Sig_type */ 1 : - const decl = sigelt._1; - const id = sigelt._0; - const match = decl.type_manifest; - const match$1 = decl.type_private; - const match$2 = decl.type_kind; - let newdecl; - let exit = 0; - if (match !== undefined && !(match$1 === /* Private */ 0 && /* tag */ (typeof match$2 === "number" || typeof match$2 === "string"))) { - newdecl = decl; - } else { - exit = 1; - } - if (exit === 1) { - const manif = newty2(100000000, { - TAG: /* Tconstr */ 3, - _0: { - TAG: /* Pdot */ 1, - _0: p, - _1: id.name, - _2: -1 - }, - _1: decl.type_params, - _2: { - contents: /* Mnil */ 0 - } - }); - newdecl = Caml_obj.caml_equal(decl.type_kind, /* Type_abstract */ 0) ? ({ - type_params: decl.type_params, - type_arity: decl.type_arity, - type_kind: decl.type_kind, - type_private: /* Public */ 1, - type_manifest: manif, - type_variance: decl.type_variance, - type_newtype_level: decl.type_newtype_level, - type_loc: decl.type_loc, - type_attributes: decl.type_attributes - }) : ({ - type_params: decl.type_params, - type_arity: decl.type_arity, - type_kind: decl.type_kind, - type_private: decl.type_private, - type_manifest: manif, - type_variance: decl.type_variance, - type_newtype_level: decl.type_newtype_level, - type_loc: decl.type_loc, - type_attributes: decl.type_attributes - }); - } - return { - hd: { - TAG: /* Sig_type */ 1, - _0: id, - _1: newdecl, - _2: sigelt._2 - }, - tl: strengthen_sig(env, sg.tl, p) - }; - case /* Sig_module */ 3 : - const md = sigelt._1; - const id$1 = sigelt._0; - const str = strengthen_decl(env, md, { - TAG: /* Pdot */ 1, - _0: p, - _1: id$1.name, - _2: -1 - }); - return { - hd: { - TAG: /* Sig_module */ 3, - _0: id$1, - _1: str, - _2: sigelt._2 - }, - tl: strengthen_sig(add_module_declaration(undefined, id$1, md, env), sg.tl, p) - }; - case /* Sig_modtype */ 4 : - const decl$1 = sigelt._1; - const id$2 = sigelt._0; - const match$3 = decl$1.mtd_type; - const newdecl$1 = match$3 !== undefined ? decl$1 : ({ - mtd_type: { - TAG: /* Mty_ident */ 0, + const decl = sigelt._1; + const id = sigelt._0; + const match = decl.type_manifest; + const match$1 = decl.type_private; + const match$2 = decl.type_kind; + let newdecl; + let exit = 0; + if (match !== undefined && !(match$1 === /* Private */ 0 && /* tag */ (typeof match$2 === "number" || typeof match$2 === "string"))) { + newdecl = decl; + } else { + exit = 1; + } + if (exit === 1) { + const manif = newty2(100000000, { + TAG: /* Tconstr */ 3, _0: { TAG: /* Pdot */ 1, _0: p, - _1: id$2.name, + _1: id.name, _2: -1 + }, + _1: decl.type_params, + _2: { + contents: /* Mnil */ 0 } - }, - mtd_attributes: decl$1.mtd_attributes, - mtd_loc: decl$1.mtd_loc + }); + newdecl = Caml_obj.caml_equal(decl.type_kind, /* Type_abstract */ 0) ? ({ + type_params: decl.type_params, + type_arity: decl.type_arity, + type_kind: decl.type_kind, + type_private: /* Public */ 1, + type_manifest: manif, + type_variance: decl.type_variance, + type_newtype_level: decl.type_newtype_level, + type_loc: decl.type_loc, + type_attributes: decl.type_attributes + }) : ({ + type_params: decl.type_params, + type_arity: decl.type_arity, + type_kind: decl.type_kind, + type_private: decl.type_private, + type_manifest: manif, + type_variance: decl.type_variance, + type_newtype_level: decl.type_newtype_level, + type_loc: decl.type_loc, + type_attributes: decl.type_attributes }); - return { - hd: { - TAG: /* Sig_modtype */ 4, - _0: id$2, - _1: newdecl$1 + } + return { + hd: { + TAG: /* Sig_type */ 1, + _0: id, + _1: newdecl, + _2: sigelt._2 + }, + tl: strengthen_sig(env, sg.tl, p) + }; + case /* Sig_module */ 3 : + const md = sigelt._1; + const id$1 = sigelt._0; + const str = strengthen_decl(env, md, { + TAG: /* Pdot */ 1, + _0: p, + _1: id$1.name, + _2: -1 + }); + return { + hd: { + TAG: /* Sig_module */ 3, + _0: id$1, + _1: str, + _2: sigelt._2 + }, + tl: strengthen_sig(add_module_declaration(undefined, id$1, md, env), sg.tl, p) + }; + case /* Sig_modtype */ 4 : + const decl$1 = sigelt._1; + const id$2 = sigelt._0; + const match$3 = decl$1.mtd_type; + const newdecl$1 = match$3 !== undefined ? decl$1 : ({ + mtd_type: { + TAG: /* Mty_ident */ 0, + _0: { + TAG: /* Pdot */ 1, + _0: p, + _1: id$2.name, + _2: -1 + } }, - tl: strengthen_sig(add_modtype$1(id$2, decl$1, env), sg.tl, p) - }; + mtd_attributes: decl$1.mtd_attributes, + mtd_loc: decl$1.mtd_loc + }); + return { + hd: { + TAG: /* Sig_modtype */ 4, + _0: id$2, + _1: newdecl$1 + }, + tl: strengthen_sig(add_modtype$1(id$2, decl$1, env), sg.tl, p) + }; default: return { hd: sigelt, @@ -50827,51 +50827,51 @@ function nondep_supertype(env, mid, mty) { const mty = _mty; switch (mty.TAG) { case /* Mty_ident */ 0 : - const p = mty._0; - if (!isfree(mid, p)) { - return mty; - } - _mty = find_modtype_expansion(p, env); - continue; + const p = mty._0; + if (!isfree(mid, p)) { + return mty; + } + _mty = find_modtype_expansion(p, env); + continue; case /* Mty_signature */ 1 : - return { - TAG: /* Mty_signature */ 1, - _0: nondep_sig(env, va, mty._0) - }; + return { + TAG: /* Mty_signature */ 1, + _0: nondep_sig(env, va, mty._0) + }; case /* Mty_functor */ 2 : - const arg = mty._1; - const param = mty._0; - let var_inv; - switch (va) { - case /* Co */ 0 : - var_inv = /* Contra */ 1; - break; - case /* Contra */ 1 : - var_inv = /* Co */ 0; - break; - case /* Strict */ 2 : - var_inv = /* Strict */ 2; - break; - - } - return { - TAG: /* Mty_functor */ 2, - _0: param, - _1: may_map((function (param) { - return nondep_mty(env, var_inv, param); - }), arg), - _2: nondep_mty(add_module$1(true, param, arg !== undefined ? arg : ({ - TAG: /* Mty_signature */ 1, - _0: /* [] */ 0 - }), env), va, mty._2) - }; + const arg = mty._1; + const param = mty._0; + let var_inv; + switch (va) { + case /* Co */ 0 : + var_inv = /* Contra */ 1; + break; + case /* Contra */ 1 : + var_inv = /* Co */ 0; + break; + case /* Strict */ 2 : + var_inv = /* Strict */ 2; + break; + + } + return { + TAG: /* Mty_functor */ 2, + _0: param, + _1: may_map((function (param) { + return nondep_mty(env, var_inv, param); + }), arg), + _2: nondep_mty(add_module$1(true, param, arg !== undefined ? arg : ({ + TAG: /* Mty_signature */ 1, + _0: /* [] */ 0 + }), env), va, mty._2) + }; case /* Mty_alias */ 3 : - const p$1 = mty._0; - if (!isfree(mid, p$1)) { - return mty; - } - _mty = find_module(false, p$1, env).md_type; - continue; + const p$1 = mty._0; + if (!isfree(mid, p$1)) { + return mty; + } + _mty = find_module(false, p$1, env).md_type; + continue; } }; @@ -50884,116 +50884,116 @@ function nondep_supertype(env, mid, mty) { const rem$p = nondep_sig(env, va, param.tl); switch (item.TAG) { case /* Sig_value */ 0 : - const d = item._1; - return { - hd: { - TAG: /* Sig_value */ 0, - _0: item._0, - _1: { - val_type: nondep_type(env, mid, d.val_type), - val_kind: d.val_kind, - val_loc: d.val_loc, - val_attributes: d.val_attributes - } - }, - tl: rem$p - }; + const d = item._1; + return { + hd: { + TAG: /* Sig_value */ 0, + _0: item._0, + _1: { + val_type: nondep_type(env, mid, d.val_type), + val_kind: d.val_kind, + val_loc: d.val_loc, + val_attributes: d.val_attributes + } + }, + tl: rem$p + }; case /* Sig_type */ 1 : - const id = item._0; - return { - hd: { - TAG: /* Sig_type */ 1, - _0: id, - _1: nondep_type_decl(env, mid, id, va === /* Co */ 0, item._1), - _2: item._2 - }, - tl: rem$p - }; + const id = item._0; + return { + hd: { + TAG: /* Sig_type */ 1, + _0: id, + _1: nondep_type_decl(env, mid, id, va === /* Co */ 0, item._1), + _2: item._2 + }, + tl: rem$p + }; case /* Sig_typext */ 2 : - return { - hd: { - TAG: /* Sig_typext */ 2, - _0: item._0, - _1: nondep_extension_constructor(env, mid, item._1), - _2: item._2 - }, - tl: rem$p - }; + return { + hd: { + TAG: /* Sig_typext */ 2, + _0: item._0, + _1: nondep_extension_constructor(env, mid, item._1), + _2: item._2 + }, + tl: rem$p + }; case /* Sig_module */ 3 : - const md = item._1; + const md = item._1; + return { + hd: { + TAG: /* Sig_module */ 3, + _0: item._0, + _1: { + md_type: nondep_mty(env, va, md.md_type), + md_attributes: md.md_attributes, + md_loc: md.md_loc + }, + _2: item._2 + }, + tl: rem$p + }; + case /* Sig_modtype */ 4 : + const id$1 = item._0; + try { return { hd: { - TAG: /* Sig_module */ 3, - _0: item._0, - _1: { - md_type: nondep_mty(env, va, md.md_type), - md_attributes: md.md_attributes, - md_loc: md.md_loc - }, - _2: item._2 + TAG: /* Sig_modtype */ 4, + _0: id$1, + _1: nondep_modtype_decl(env, item._1) }, tl: rem$p }; - case /* Sig_modtype */ 4 : - const id$1 = item._0; - try { - return { - hd: { - TAG: /* Sig_modtype */ 4, - _0: id$1, - _1: nondep_modtype_decl(env, item._1) - }, - tl: rem$p - }; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - switch (va) { - case /* Co */ 0 : - return { - hd: { - TAG: /* Sig_modtype */ 4, - _0: id$1, - _1: { - mtd_type: undefined, - mtd_attributes: /* [] */ 0, - mtd_loc: none - } - }, - tl: rem$p - }; - case /* Contra */ 1 : - case /* Strict */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - - } - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + switch (va) { + case /* Co */ 0 : + return { + hd: { + TAG: /* Sig_modtype */ 4, + _0: id$1, + _1: { + mtd_type: undefined, + mtd_attributes: /* [] */ 0, + mtd_loc: none + } + }, + tl: rem$p + }; + case /* Contra */ 1 : + case /* Strict */ 2 : + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } case /* Sig_class */ 5 : - return { - hd: { - TAG: /* Sig_class */ 5, - _0: item._0, - _1: nondep_class_declaration(env, mid, item._1), - _2: item._2 - }, - tl: rem$p - }; + return { + hd: { + TAG: /* Sig_class */ 5, + _0: item._0, + _1: nondep_class_declaration(env, mid, item._1), + _2: item._2 + }, + tl: rem$p + }; case /* Sig_class_type */ 6 : - return { - hd: { - TAG: /* Sig_class_type */ 6, - _0: item._0, - _1: nondep_cltype_declaration(env, mid, item._1), - _2: item._2 - }, - tl: rem$p - }; + return { + hd: { + TAG: /* Sig_class_type */ 6, + _0: item._0, + _1: nondep_cltype_declaration(env, mid, item._1), + _2: item._2 + }, + tl: rem$p + }; } }; @@ -51055,36 +51055,36 @@ function enrich_modtype(env, p, mty) { _0: Stdlib__List.map((function (param) { switch (param.TAG) { case /* Sig_type */ 1 : - const id = param._0; - return { - TAG: /* Sig_type */ 1, - _0: id, - _1: enrich_typedecl(env, { + const id = param._0; + return { + TAG: /* Sig_type */ 1, + _0: id, + _1: enrich_typedecl(env, { + TAG: /* Pdot */ 1, + _0: p, + _1: id.name, + _2: -1 + }, param._1), + _2: param._2 + }; + case /* Sig_module */ 3 : + const md = param._1; + const id$1 = param._0; + return { + TAG: /* Sig_module */ 3, + _0: id$1, + _1: { + md_type: enrich_modtype(env, { TAG: /* Pdot */ 1, _0: p, - _1: id.name, + _1: id$1.name, _2: -1 - }, param._1), - _2: param._2 - }; - case /* Sig_module */ 3 : - const md = param._1; - const id$1 = param._0; - return { - TAG: /* Sig_module */ 3, - _0: id$1, - _1: { - md_type: enrich_modtype(env, { - TAG: /* Pdot */ 1, - _0: p, - _1: id$1.name, - _2: -1 - }, md.md_type), - md_attributes: md.md_attributes, - md_loc: md.md_loc - }, - _2: param._2 - }; + }, md.md_type), + md_attributes: md.md_attributes, + md_loc: md.md_loc + }, + _2: param._2 + }; default: return param; } @@ -51115,41 +51115,41 @@ function type_paths_sig(_env, p, _pos, _sg) { const match = sg.hd; switch (match.TAG) { case /* Sig_value */ 0 : - const match$1 = match._1.val_kind; - let pos$p; - pos$p = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Val_prim */ 0 ? pos + 1 | 0 : pos; - _sg = sg.tl; - _pos = pos$p; - continue; + const match$1 = match._1.val_kind; + let pos$p; + pos$p = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Val_prim */ 0 ? pos + 1 | 0 : pos; + _sg = sg.tl; + _pos = pos$p; + continue; case /* Sig_type */ 1 : - return { - hd: { - TAG: /* Pdot */ 1, - _0: p, - _1: match._0.name, - _2: -1 - }, - tl: type_paths_sig(env, p, pos, sg.tl) - }; + return { + hd: { + TAG: /* Pdot */ 1, + _0: p, + _1: match._0.name, + _2: -1 + }, + tl: type_paths_sig(env, p, pos, sg.tl) + }; case /* Sig_module */ 3 : - const md = match._1; - const id = match._0; - return Stdlib.$at(type_paths(env, { - TAG: /* Pdot */ 1, - _0: p, - _1: id.name, - _2: pos - }, md.md_type), type_paths_sig(add_module_declaration(undefined, id, md, env), p, pos + 1 | 0, sg.tl)); + const md = match._1; + const id = match._0; + return Stdlib.$at(type_paths(env, { + TAG: /* Pdot */ 1, + _0: p, + _1: id.name, + _2: pos + }, md.md_type), type_paths_sig(add_module_declaration(undefined, id, md, env), p, pos + 1 | 0, sg.tl)); case /* Sig_modtype */ 4 : - _sg = sg.tl; - _env = add_modtype$1(match._0, match._1, env); - continue; + _sg = sg.tl; + _env = add_modtype$1(match._0, match._1, env); + continue; case /* Sig_typext */ 2 : case /* Sig_class */ 5 : - break; + break; case /* Sig_class_type */ 6 : - _sg = sg.tl; - continue; + _sg = sg.tl; + continue; } _sg = sg.tl; @@ -51163,31 +51163,31 @@ function contains_type(env, _path) { const path = _path; switch (path.TAG) { case /* Mty_ident */ 0 : - try { - const mty = find_modtype(path._0, env).mtd_type; - if (mty !== undefined) { - return contains_type(env, mty); - } + try { + const mty = find_modtype(path._0, env).mtd_type; + if (mty !== undefined) { + return contains_type(env, mty); + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Mty_signature */ 1 : - return contains_type_sig(env)(path._0); + return contains_type_sig(env)(path._0); case /* Mty_functor */ 2 : - _path = path._2; - continue; + _path = path._2; + continue; case /* Mty_alias */ 3 : - return; + return; } }; @@ -51198,32 +51198,32 @@ function contains_type_sig(env) { return Stdlib__List.iter((function (param) { switch (param.TAG) { case /* Sig_type */ 1 : - const match = param._1; - if (match.type_manifest !== undefined) { - let tmp = match.type_kind; - if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { - return; - } - if (tmp !== /* Type_abstract */ 0) { - return; - } - if (match.type_private !== /* Private */ 0) { - return; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); + const match = param._1; + if (match.type_manifest !== undefined) { + let tmp = match.type_kind; + if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { + return; } - case /* Sig_module */ 3 : - return contains_type(env, param._1.md_type); - case /* Sig_modtype */ 4 : + if (tmp !== /* Type_abstract */ 0) { + return; + } + if (match.type_private !== /* Private */ 0) { + return; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); + } + case /* Sig_module */ 3 : + return contains_type(env, param._1.md_type); + case /* Sig_modtype */ 4 : + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); default: return; } @@ -51867,10 +51867,10 @@ function union$5(s1, s2) { function get_prefixes(param) { switch (param.TAG) { case /* Pident */ 0 : - return /* Empty */ 0; + return /* Empty */ 0; case /* Pdot */ 1 : case /* Papply */ 2 : - break; + break; } const p = param._0; @@ -51882,13 +51882,13 @@ function get_arg_paths(_param) { const param = _param; switch (param.TAG) { case /* Pident */ 0 : - return /* Empty */ 0; + return /* Empty */ 0; case /* Pdot */ 1 : - _param = param._0; - continue; + _param = param._0; + continue; case /* Papply */ 2 : - const p2 = param._1; - return Curry._2(add$9, p2, Curry._2(union$4, get_prefixes(p2), Curry._2(union$4, get_arg_paths(param._0), get_arg_paths(p2)))); + const p2 = param._1; + return Curry._2(add$9, p2, Curry._2(union$4, get_prefixes(p2), Curry._2(union$4, get_arg_paths(param._0), get_arg_paths(p2)))); } }; @@ -51908,21 +51908,21 @@ function rollback_path(subst, _p) { if (exn.MEL_EXN_ID === Stdlib.Not_found) { switch (p.TAG) { case /* Pdot */ 1 : - const p1 = p._0; - const p1$p = rollback_path(subst, p1); - if (same(p1, p1$p)) { - return p; - } - _p = { - TAG: /* Pdot */ 1, - _0: p1$p, - _1: p._1, - _2: p._2 - }; - continue; + const p1 = p._0; + const p1$p = rollback_path(subst, p1); + if (same(p1, p1$p)) { + return p; + } + _p = { + TAG: /* Pdot */ 1, + _0: p1$p, + _1: p._1, + _2: p._2 + }; + continue; case /* Pident */ 0 : case /* Papply */ 2 : - return p; + return p; } } else { @@ -51936,23 +51936,23 @@ function collect_ids(subst, bindings, p) { const id = rollback_path(subst, p); switch (id.TAG) { case /* Pident */ 0 : - const id$1 = id._0; - let ids; - try { - ids = collect_ids(subst, bindings, find_same(id$1, bindings)); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - ids = /* Empty */ 0; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + const id$1 = id._0; + let ids; + try { + ids = collect_ids(subst, bindings, find_same(id$1, bindings)); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + ids = /* Empty */ 0; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - return Curry._2(add$11, id$1, ids); + } + return Curry._2(add$11, id$1, ids); case /* Pdot */ 1 : case /* Papply */ 2 : - return /* Empty */ 0; + return /* Empty */ 0; } } @@ -51979,27 +51979,27 @@ function collect_arg_paths(mty) { const id = si._0; switch (p.TAG) { case /* Mty_signature */ 1 : - return Stdlib__List.iter((function (param) { - if (param.TAG !== /* Sig_module */ 3) { - return; - } - const id$p = param._0; - subst.contents = Curry._3(add$10, { - TAG: /* Pdot */ 1, - _0: { - TAG: /* Pident */ 0, - _0: id - }, - _1: id$p.name, - _2: -1 - }, id$p, subst.contents); - }), p._0); + return Stdlib__List.iter((function (param) { + if (param.TAG !== /* Sig_module */ 3) { + return; + } + const id$p = param._0; + subst.contents = Curry._3(add$10, { + TAG: /* Pdot */ 1, + _0: { + TAG: /* Pident */ 0, + _0: id + }, + _1: id$p.name, + _2: -1 + }, id$p, subst.contents); + }), p._0); case /* Mty_ident */ 0 : case /* Mty_functor */ 2 : - return; + return; case /* Mty_alias */ 3 : - bindings.contents = add(id, p._0, bindings.contents); - return; + bindings.contents = add(id, p._0, bindings.contents); + return; } }; @@ -52032,20 +52032,20 @@ function remove_aliases(env, excl, _mty) { const mty = _mty; switch (mty.TAG) { case /* Mty_signature */ 1 : - return { - TAG: /* Mty_signature */ 1, - _0: remove_aliases_sig(env, excl, mty._0) - }; + return { + TAG: /* Mty_signature */ 1, + _0: remove_aliases_sig(env, excl, mty._0) + }; case /* Mty_ident */ 0 : case /* Mty_functor */ 2 : - return mty; + return mty; case /* Mty_alias */ 3 : - const mty$p = scrape_alias(env, undefined, mty); - if (Caml_obj.caml_equal(mty$p, mty)) { - return mty; - } - _mty = mty$p; - continue; + const mty$p = scrape_alias(env, undefined, mty); + if (Caml_obj.caml_equal(mty$p, mty)) { + return mty; + } + _mty = mty$p; + continue; } }; @@ -52058,35 +52058,35 @@ function remove_aliases_sig(env, excl, sg) { const it = sg.hd; switch (it.TAG) { case /* Sig_module */ 3 : - const md = it._1; - const id = it._0; - const mty = md.md_type; - let mty$1; - mty$1 = mty.TAG === /* Mty_alias */ 3 && Curry._2(mem$5, id, excl) ? md.md_type : remove_aliases(env, excl, mty); - return { - hd: { - TAG: /* Sig_module */ 3, - _0: id, - _1: { - md_type: mty$1, - md_attributes: md.md_attributes, - md_loc: md.md_loc - }, - _2: it._2 + const md = it._1; + const id = it._0; + const mty = md.md_type; + let mty$1; + mty$1 = mty.TAG === /* Mty_alias */ 3 && Curry._2(mem$5, id, excl) ? md.md_type : remove_aliases(env, excl, mty); + return { + hd: { + TAG: /* Sig_module */ 3, + _0: id, + _1: { + md_type: mty$1, + md_attributes: md.md_attributes, + md_loc: md.md_loc }, - tl: remove_aliases_sig(add_module$1(undefined, id, mty$1, env), excl, sg.tl) - }; + _2: it._2 + }, + tl: remove_aliases_sig(add_module$1(undefined, id, mty$1, env), excl, sg.tl) + }; case /* Sig_modtype */ 4 : - const mtd = it._1; - const id$1 = it._0; - return { - hd: { - TAG: /* Sig_modtype */ 4, - _0: id$1, - _1: mtd - }, - tl: remove_aliases_sig(add_modtype$1(id$1, mtd, env), excl, sg.tl) - }; + const mtd = it._1; + const id$1 = it._0; + return { + hd: { + TAG: /* Sig_modtype */ 4, + _0: id$1, + _1: mtd + }, + tl: remove_aliases_sig(add_modtype$1(id$1, mtd, env), excl, sg.tl) + }; default: return { hd: it, @@ -52343,19 +52343,19 @@ function expand_module_alias(env, cxt, path) { function kind_of_field_desc(param) { switch (param.TAG) { case /* Field_value */ 0 : - return "value"; + return "value"; case /* Field_type */ 1 : - return "type"; + return "type"; case /* Field_typext */ 2 : - return "extension constructor"; + return "extension constructor"; case /* Field_module */ 3 : - return "module"; + return "module"; case /* Field_modtype */ 4 : - return "module type"; + return "module type"; case /* Field_class */ 5 : - return "class"; + return "class"; case /* Field_classtype */ 6 : - return "class type"; + return "class type"; } } @@ -52363,75 +52363,75 @@ function kind_of_field_desc(param) { function item_ident_name(param) { switch (param.TAG) { case /* Sig_value */ 0 : - const id = param._0; - return [ - id, - param._1.val_loc, - { - TAG: /* Field_value */ 0, - _0: id.name - } - ]; + const id = param._0; + return [ + id, + param._1.val_loc, + { + TAG: /* Field_value */ 0, + _0: id.name + } + ]; case /* Sig_type */ 1 : - const id$1 = param._0; - return [ - id$1, - param._1.type_loc, - { - TAG: /* Field_type */ 1, - _0: id$1.name - } - ]; + const id$1 = param._0; + return [ + id$1, + param._1.type_loc, + { + TAG: /* Field_type */ 1, + _0: id$1.name + } + ]; case /* Sig_typext */ 2 : - const id$2 = param._0; - return [ - id$2, - param._1.ext_loc, - { - TAG: /* Field_typext */ 2, - _0: id$2.name - } - ]; + const id$2 = param._0; + return [ + id$2, + param._1.ext_loc, + { + TAG: /* Field_typext */ 2, + _0: id$2.name + } + ]; case /* Sig_module */ 3 : - const id$3 = param._0; - return [ - id$3, - param._1.md_loc, - { - TAG: /* Field_module */ 3, - _0: id$3.name - } - ]; + const id$3 = param._0; + return [ + id$3, + param._1.md_loc, + { + TAG: /* Field_module */ 3, + _0: id$3.name + } + ]; case /* Sig_modtype */ 4 : - const id$4 = param._0; - return [ - id$4, - param._1.mtd_loc, - { - TAG: /* Field_modtype */ 4, - _0: id$4.name - } - ]; + const id$4 = param._0; + return [ + id$4, + param._1.mtd_loc, + { + TAG: /* Field_modtype */ 4, + _0: id$4.name + } + ]; case /* Sig_class */ 5 : - const id$5 = param._0; - return [ - id$5, - param._1.cty_loc, - { - TAG: /* Field_class */ 5, - _0: id$5.name - } - ]; + const id$5 = param._0; + return [ + id$5, + param._1.cty_loc, + { + TAG: /* Field_class */ 5, + _0: id$5.name + } + ]; case /* Sig_class_type */ 6 : - const id$6 = param._0; - return [ - id$6, - param._1.clty_loc, - { - TAG: /* Field_classtype */ 6, - _0: id$6.name - } - ]; + const id$6 = param._0; + return [ + id$6, + param._1.clty_loc, + { + TAG: /* Field_classtype */ 6, + _0: id$6.name + } + ]; } } @@ -52439,16 +52439,16 @@ function item_ident_name(param) { function is_runtime_component(param) { switch (param.TAG) { case /* Sig_value */ 0 : - let tmp = param._1.val_kind; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string" || tmp.TAG !== /* Val_prim */ 0) { - return true; - } else { - return false; - } + let tmp = param._1.val_kind; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string" || tmp.TAG !== /* Val_prim */ 0) { + return true; + } else { + return false; + } case /* Sig_typext */ 2 : case /* Sig_module */ 3 : case /* Sig_class */ 5 : - return true; + return true; default: return false; } @@ -52509,114 +52509,150 @@ function try_modtypes(env, cxt, subst, _mty1, mty2) { const mty1 = _mty1; switch (mty1.TAG) { case /* Mty_ident */ 0 : - const p1 = mty1._0; - if (may_expand_module_path(env, p1)) { - _mty1 = expand_module_path(env, cxt, p1); - continue; - } - break; + const p1 = mty1._0; + if (may_expand_module_path(env, p1)) { + _mty1 = expand_module_path(env, cxt, p1); + continue; + } + break; case /* Mty_signature */ 1 : + switch (mty2.TAG) { + case /* Mty_ident */ 0 : + break; + case /* Mty_signature */ 1 : + return signatures(env, cxt, subst, mty1._0, mty2._0); + case /* Mty_functor */ 2 : + case /* Mty_alias */ 3 : + throw new Caml_js_exceptions.MelangeError(Dont_match$1, { + MEL_EXN_ID: Dont_match$1 + }); + + } + break; + case /* Mty_functor */ 2 : + const arg1 = mty1._1; + const param1 = mty1._0; + if (arg1 !== undefined) { switch (mty2.TAG) { case /* Mty_ident */ 0 : - break; - case /* Mty_signature */ 1 : - return signatures(env, cxt, subst, mty1._0, mty2._0); + break; case /* Mty_functor */ 2 : + const arg2 = mty2._1; + if (arg2 !== undefined) { + const arg2$p = modtype(subst, arg2); + const cc_arg = modtypes(env, { + hd: { + TAG: /* Arg */ 2, + _0: param1 + }, + tl: cxt + }, identity, arg2$p, arg1); + const cc_res = modtypes(add_module$1(undefined, param1, arg2$p, env), { + hd: { + TAG: /* Body */ 3, + _0: param1 + }, + tl: cxt + }, add_module(mty2._0, { + TAG: /* Pident */ 0, + _0: param1 + }, subst), mty1._2, mty2._2); + if (/* tag */ (typeof cc_arg === "number" || typeof cc_arg === "string") && /* tag */ (typeof cc_res === "number" || typeof cc_res === "string")) { + return /* Tcoerce_none */ 0; + } else { + return { + TAG: /* Tcoerce_functor */ 1, + _0: cc_arg, + _1: cc_res + }; + } + } + throw new Caml_js_exceptions.MelangeError(Dont_match$1, { + MEL_EXN_ID: Dont_match$1 + }); + case /* Mty_signature */ 1 : case /* Mty_alias */ 3 : + throw new Caml_js_exceptions.MelangeError(Dont_match$1, { + MEL_EXN_ID: Dont_match$1 + }); + + } + } else { + switch (mty2.TAG) { + case /* Mty_ident */ 0 : + break; + case /* Mty_functor */ 2 : + if (mty2._1 !== undefined) { throw new Caml_js_exceptions.MelangeError(Dont_match$1, { MEL_EXN_ID: Dont_match$1 }); + } + const cc = modtypes(env, { + hd: { + TAG: /* Body */ 3, + _0: param1 + }, + tl: cxt + }, subst, mty1._2, mty2._2); + if (/* tag */ typeof cc === "number" || typeof cc === "string") { + return /* Tcoerce_none */ 0; + } else { + return { + TAG: /* Tcoerce_functor */ 1, + _0: /* Tcoerce_none */ 0, + _1: cc + }; + } + case /* Mty_signature */ 1 : + case /* Mty_alias */ 3 : + throw new Caml_js_exceptions.MelangeError(Dont_match$1, { + MEL_EXN_ID: Dont_match$1 + }); } - break; - case /* Mty_functor */ 2 : - const arg1 = mty1._1; - const param1 = mty1._0; - if (arg1 !== undefined) { - switch (mty2.TAG) { - case /* Mty_ident */ 0 : - break; - case /* Mty_functor */ 2 : - const arg2 = mty2._1; - if (arg2 !== undefined) { - const arg2$p = modtype(subst, arg2); - const cc_arg = modtypes(env, { - hd: { - TAG: /* Arg */ 2, - _0: param1 - }, - tl: cxt - }, identity, arg2$p, arg1); - const cc_res = modtypes(add_module$1(undefined, param1, arg2$p, env), { - hd: { - TAG: /* Body */ 3, - _0: param1 - }, - tl: cxt - }, add_module(mty2._0, { - TAG: /* Pident */ 0, - _0: param1 - }, subst), mty1._2, mty2._2); - if (/* tag */ (typeof cc_arg === "number" || typeof cc_arg === "string") && /* tag */ (typeof cc_res === "number" || typeof cc_res === "string")) { - return /* Tcoerce_none */ 0; - } else { - return { - TAG: /* Tcoerce_functor */ 1, - _0: cc_arg, - _1: cc_res - }; - } - } - throw new Caml_js_exceptions.MelangeError(Dont_match$1, { - MEL_EXN_ID: Dont_match$1 - }); - case /* Mty_signature */ 1 : - case /* Mty_alias */ 3 : - throw new Caml_js_exceptions.MelangeError(Dont_match$1, { - MEL_EXN_ID: Dont_match$1 - }); - - } - } else { - switch (mty2.TAG) { - case /* Mty_ident */ 0 : - break; - case /* Mty_functor */ 2 : - if (mty2._1 !== undefined) { - throw new Caml_js_exceptions.MelangeError(Dont_match$1, { - MEL_EXN_ID: Dont_match$1 - }); - } - const cc = modtypes(env, { - hd: { - TAG: /* Body */ 3, - _0: param1 - }, - tl: cxt - }, subst, mty1._2, mty2._2); - if (/* tag */ typeof cc === "number" || typeof cc === "string") { - return /* Tcoerce_none */ 0; - } else { - return { - TAG: /* Tcoerce_functor */ 1, - _0: /* Tcoerce_none */ 0, - _1: cc - }; + } + break; + case /* Mty_alias */ 3 : + const p1$1 = mty1._0; + if (mty2.TAG === /* Mty_alias */ 3) { + const p2 = mty2._0; + if (is_functor_arg(p2, env)) { + throw new Caml_js_exceptions.MelangeError($$Error$5, { + MEL_EXN_ID: $$Error$5, + _1: { + hd: [ + cxt, + env, + { + TAG: /* Invalid_module_alias */ 11, + _0: p2 + } + ], + tl: /* [] */ 0 } - case /* Mty_signature */ 1 : - case /* Mty_alias */ 3 : - throw new Caml_js_exceptions.MelangeError(Dont_match$1, { - MEL_EXN_ID: Dont_match$1 - }); - - } + }); } - break; - case /* Mty_alias */ 3 : - const p1$1 = mty1._0; - if (mty2.TAG === /* Mty_alias */ 3) { - const p2 = mty2._0; - if (is_functor_arg(p2, env)) { + if (same(p1$1, p2)) { + return /* Tcoerce_none */ 0; + } + const p1$2 = normalize_path$1(undefined, env, p1$1); + const p2$1 = normalize_path$1(undefined, env, module_path(subst, p2)); + if (same(p1$2, p2$1)) { + return /* Tcoerce_none */ 0; + } + throw new Caml_js_exceptions.MelangeError(Dont_match$1, { + MEL_EXN_ID: Dont_match$1 + }); + } + let p1$3; + try { + p1$3 = normalize_path$1(none, env, p1$1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === $$Error$2) { + const match = exn._1; + if (match.TAG === /* Missing_module */ 3) { throw new Caml_js_exceptions.MelangeError($$Error$5, { MEL_EXN_ID: $$Error$5, _1: { @@ -52624,60 +52660,24 @@ function try_modtypes(env, cxt, subst, _mty1, mty2) { cxt, env, { - TAG: /* Invalid_module_alias */ 11, - _0: p2 + TAG: /* Unbound_module_path */ 10, + _0: match._2 } ], tl: /* [] */ 0 } }); } - if (same(p1$1, p2)) { - return /* Tcoerce_none */ 0; - } - const p1$2 = normalize_path$1(undefined, env, p1$1); - const p2$1 = normalize_path$1(undefined, env, module_path(subst, p2)); - if (same(p1$2, p2$1)) { - return /* Tcoerce_none */ 0; - } - throw new Caml_js_exceptions.MelangeError(Dont_match$1, { - MEL_EXN_ID: Dont_match$1 - }); - } - let p1$3; - try { - p1$3 = normalize_path$1(none, env, p1$1); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === $$Error$2) { - const match = exn._1; - if (match.TAG === /* Missing_module */ 3) { - throw new Caml_js_exceptions.MelangeError($$Error$5, { - MEL_EXN_ID: $$Error$5, - _1: { - hd: [ - cxt, - env, - { - TAG: /* Unbound_module_path */ 10, - _0: match._2 - } - ], - tl: /* [] */ 0 - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const mty1$1 = strengthen$1(env, expand_module_alias(env, cxt, p1$3), p1$3); - return { - TAG: /* Tcoerce_alias */ 3, - _0: p1$3, - _1: modtypes(env, cxt, subst, mty1$1, mty2) - }; + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + const mty1$1 = strengthen$1(env, expand_module_alias(env, cxt, p1$3), p1$3); + return { + TAG: /* Tcoerce_alias */ 3, + _0: p1$3, + _1: modtypes(env, cxt, subst, mty1$1, mty2) + }; } if (mty2.TAG === /* Mty_ident */ 0) { @@ -52816,26 +52816,26 @@ function signatures(env, cxt, subst, sig1, sig2) { let new_subst; switch (item2.TAG) { case /* Sig_type */ 1 : - new_subst = add_type(id2, { - TAG: /* Pident */ 0, - _0: id1 - }, subst); - break; + new_subst = add_type(id2, { + TAG: /* Pident */ 0, + _0: id1 + }, subst); + break; case /* Sig_module */ 3 : - new_subst = add_module(id2, { + new_subst = add_module(id2, { + TAG: /* Pident */ 0, + _0: id1 + }, subst); + break; + case /* Sig_modtype */ 4 : + new_subst = add_modtype(id2, { + TAG: /* Mty_ident */ 0, + _0: { TAG: /* Pident */ 0, _0: id1 - }, subst); - break; - case /* Sig_modtype */ 4 : - new_subst = add_modtype(id2, { - TAG: /* Mty_ident */ 0, - _0: { - TAG: /* Pident */ 0, - _0: id1 - } - }, subst); - break; + } + }, subst); + break; default: new_subst = subst; } @@ -52931,96 +52931,96 @@ function signature_components(old_env, env, cxt, subst, paired) { const match$1 = match[0]; switch (match$1.TAG) { case /* Sig_value */ 0 : - const match$2 = match[1]; - if (match$2.TAG === /* Sig_value */ 0) { - const rem = paired.tl; - const pos = match[2]; - const valdecl2 = match$2._1; - const cc = value_descriptions(env, cxt, subst, match$1._0, match$1._1, valdecl2); - const p = valdecl2.val_kind; - if (/* tag */ typeof p === "number" || typeof p === "string" || p.TAG !== /* Val_prim */ 0) { - return { - hd: [ - pos, - cc - ], - tl: comps_rec(rem) - }; - } else { - return comps_rec(rem); - } - } - break; - case /* Sig_type */ 1 : - const match$3 = match[1]; - if (match$3.TAG === /* Sig_type */ 1) { - type_declarations$2(env, Caml_option.some(old_env), cxt, subst, match$1._0, match$1._1, match$3._1); - return comps_rec(paired.tl); - } - break; - case /* Sig_typext */ 2 : - const match$4 = match[1]; - if (match$4.TAG === /* Sig_typext */ 2) { - extension_constructors$1(env, cxt, subst, match$1._0, match$1._1, match$4._1); + const match$2 = match[1]; + if (match$2.TAG === /* Sig_value */ 0) { + const rem = paired.tl; + const pos = match[2]; + const valdecl2 = match$2._1; + const cc = value_descriptions(env, cxt, subst, match$1._0, match$1._1, valdecl2); + const p = valdecl2.val_kind; + if (/* tag */ typeof p === "number" || typeof p === "string" || p.TAG !== /* Val_prim */ 0) { return { hd: [ - match[2], - /* Tcoerce_none */ 0 + pos, + cc ], - tl: comps_rec(paired.tl) + tl: comps_rec(rem) }; + } else { + return comps_rec(rem); } - break; + } + break; + case /* Sig_type */ 1 : + const match$3 = match[1]; + if (match$3.TAG === /* Sig_type */ 1) { + type_declarations$2(env, Caml_option.some(old_env), cxt, subst, match$1._0, match$1._1, match$3._1); + return comps_rec(paired.tl); + } + break; + case /* Sig_typext */ 2 : + const match$4 = match[1]; + if (match$4.TAG === /* Sig_typext */ 2) { + extension_constructors$1(env, cxt, subst, match$1._0, match$1._1, match$4._1); + return { + hd: [ + match[2], + /* Tcoerce_none */ 0 + ], + tl: comps_rec(paired.tl) + }; + } + break; case /* Sig_module */ 3 : - const match$5 = match[1]; - if (match$5.TAG === /* Sig_module */ 3) { - const id1 = match$1._0; - const cc$1 = modtypes(env, { - hd: { - TAG: /* Module */ 0, + const match$5 = match[1]; + if (match$5.TAG === /* Sig_module */ 3) { + const id1 = match$1._0; + const cc$1 = modtypes(env, { + hd: { + TAG: /* Module */ 0, + _0: id1 + }, + tl: cxt + }, subst, strengthen$1(env, match$1._1.md_type, { + TAG: /* Pident */ 0, _0: id1 - }, - tl: cxt - }, subst, strengthen$1(env, match$1._1.md_type, { - TAG: /* Pident */ 0, - _0: id1 - }), match$5._1.md_type); - return { - hd: [ - match[2], - cc$1 - ], - tl: comps_rec(paired.tl) - }; - } - break; + }), match$5._1.md_type); + return { + hd: [ + match[2], + cc$1 + ], + tl: comps_rec(paired.tl) + }; + } + break; case /* Sig_modtype */ 4 : - const match$6 = match[1]; - if (match$6.TAG === /* Sig_modtype */ 4) { - modtype_infos(env, cxt, subst, match$1._0, match$1._1, match$6._1); - return comps_rec(paired.tl); - } - break; + const match$6 = match[1]; + if (match$6.TAG === /* Sig_modtype */ 4) { + modtype_infos(env, cxt, subst, match$1._0, match$1._1, match$6._1); + return comps_rec(paired.tl); + } + break; case /* Sig_class */ 5 : - const match$7 = match[1]; - if (match$7.TAG === /* Sig_class */ 5) { - class_declarations$1(old_env, env, cxt, subst, match$1._0, match$1._1, match$7._1); - return { - hd: [ - match[2], - /* Tcoerce_none */ 0 - ], - tl: comps_rec(paired.tl) - }; - } - break; + const match$7 = match[1]; + if (match$7.TAG === /* Sig_class */ 5) { + class_declarations$1(old_env, env, cxt, subst, match$1._0, match$1._1, match$7._1); + return { + hd: [ + match[2], + /* Tcoerce_none */ 0 + ], + tl: comps_rec(paired.tl) + }; + } + break; case /* Sig_class_type */ 6 : - const match$8 = match[1]; - if (match$8.TAG === /* Sig_class_type */ 6) { - class_type_declarations$1(old_env, env, cxt, subst, match$1._0, match$1._1, match$8._1); - return comps_rec(paired.tl); - } - break; + const match$8 = match[1]; + if (match$8.TAG === /* Sig_class_type */ 6) { + class_type_declarations$1(old_env, env, cxt, subst, match$1._0, match$1._1, match$8._1); + return comps_rec(paired.tl); + } + break; } throw new Caml_js_exceptions.MelangeError("Assert_failure", { @@ -53244,90 +53244,89 @@ function include_err$1(ppf, path$1) { } switch (path$1.TAG) { case /* Missing_field */ 0 : - Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The ", + Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " `", _1: { - TAG: /* String_literal */ 11, - _0: " `", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "' is required but not provided", - _1: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: "' is required but not provided", + _1: /* End_of_format */ 0 } } } - }, - _1: "The %s `%a' is required but not provided" - }), path$1._2, ident$3, path$1._0); - return show_loc("Expected declaration", ppf, path$1._1); + } + }, + _1: "The %s `%a' is required but not provided" + }), path$1._2, ident$3, path$1._0); + return show_loc("Expected declaration", ppf, path$1._1); case /* Value_descriptions */ 1 : - const d2 = path$1._2; - const d1 = path$1._1; - const id = path$1._0; - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const d2 = path$1._2; + const d1 = path$1._1; + const id = path$1._0; + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Values do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Values do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not included in", _1: { - TAG: /* String_literal */ 11, - _0: "is not included in", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -53335,24 +53334,39 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Values do not match:@ %a@;<1 -2>is not included in@ %a@]" - }), (function (param, param$1) { - return value_description$1(id, param, param$1); - }), d1, (function (param, param$1) { - return value_description$1(id, param, param$1); - }), d2); - return show_locs(ppf, [ - d1.val_loc, - d2.val_loc - ]); + } + }, + _1: "@[Values do not match:@ %a@;<1 -2>is not included in@ %a@]" + }), (function (param, param$1) { + return value_description$1(id, param, param$1); + }), d1, (function (param, param$1) { + return value_description$1(id, param, param$1); + }), d2); + return show_locs(ppf, [ + d1.val_loc, + d2.val_loc + ]); case /* Type_declarations */ 2 : - const d2$1 = path$1._2; - const d1$1 = path$1._1; - const id$1 = path$1._0; - return Curry.app(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const d2$1 = path$1._2; + const d1$1 = path$1._1; + const id$1 = path$1._0; + return Curry.app(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -53360,75 +53374,60 @@ function include_err$1(ppf, path$1) { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "", + _0: "", _1: /* End_of_format */ 0 }, - _1: "" + _1: "" } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ':' */58, _1: { - TAG: /* Char_literal */ 12, - _0: /* ':' */58, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Alpha */ 15, _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -53441,88 +53440,88 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[@[%s:@;<1 2>%a@ %s@;<1 2>%a@]%a%a@]" - }), [ - "Type declarations do not match", - (function (param, param$1) { - return type_declaration$1(id$1, param, param$1); - }), - d1$1, - "is not included in", - (function (param, param$1) { - return type_declaration$1(id$1, param, param$1); - }), - d2$1, - show_locs, - [ - d1$1.type_loc, - d2$1.type_loc - ], - (function (param) { - return report_type_mismatch("the first", "the second", "declaration", param); - }), - path$1._3 - ]); + } + }, + _1: "@[@[%s:@;<1 2>%a@ %s@;<1 2>%a@]%a%a@]" + }), [ + "Type declarations do not match", + (function (param, param$1) { + return type_declaration$1(id$1, param, param$1); + }), + d1$1, + "is not included in", + (function (param, param$1) { + return type_declaration$1(id$1, param, param$1); + }), + d2$1, + show_locs, + [ + d1$1.type_loc, + d2$1.type_loc + ], + (function (param) { + return report_type_mismatch("the first", "the second", "declaration", param); + }), + path$1._3 + ]); case /* Extension_constructors */ 3 : - const x2 = path$1._2; - const x1 = path$1._1; - const id$2 = path$1._0; - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const x2 = path$1._2; + const x1 = path$1._1; + const id$2 = path$1._0; + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Extension declarations do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Extension declarations do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not included in", _1: { - TAG: /* String_literal */ 11, - _0: "is not included in", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -53530,73 +53529,73 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Extension declarations do not match:@ %a@;<1 -2>is not included in@ %a@]" - }), (function (param, param$1) { - return extension_constructor$1(id$2, param, param$1); - }), x1, (function (param, param$1) { - return extension_constructor$1(id$2, param, param$1); - }), x2); - return show_locs(ppf, [ - x1.ext_loc, - x2.ext_loc - ]); + } + }, + _1: "@[Extension declarations do not match:@ %a@;<1 -2>is not included in@ %a@]" + }), (function (param, param$1) { + return extension_constructor$1(id$2, param, param$1); + }), x1, (function (param, param$1) { + return extension_constructor$1(id$2, param, param$1); + }), x2); + return show_locs(ppf, [ + x1.ext_loc, + x2.ext_loc + ]); case /* Module_types */ 4 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Modules do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Modules do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not included in", _1: { - TAG: /* String_literal */ 11, - _0: "is not included in", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -53604,66 +53603,66 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Modules do not match:@ %a@;<1 -2>is not included in@ %a@]" - }), modtype$1, path$1._0, modtype$1, path$1._1); + } + }, + _1: "@[Modules do not match:@ %a@;<1 -2>is not included in@ %a@]" + }), modtype$1, path$1._0, modtype$1, path$1._1); case /* Modtype_infos */ 5 : - const id$3 = path$1._0; - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const id$3 = path$1._0; + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Module type declarations do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Module type declarations do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "does not match", _1: { - TAG: /* String_literal */ 11, - _0: "does not match", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -53671,126 +53670,126 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Module type declarations do not match:@ %a@;<1 -2>does not match@ %a@]" - }), (function (param, param$1) { - return modtype_declaration$1(id$3, param, param$1); - }), path$1._1, (function (param, param$1) { - return modtype_declaration$1(id$3, param, param$1); - }), path$1._2); + } + }, + _1: "@[Module type declarations do not match:@ %a@;<1 -2>does not match@ %a@]" + }), (function (param, param$1) { + return modtype_declaration$1(id$3, param, param$1); + }), path$1._1, (function (param, param$1) { + return modtype_declaration$1(id$3, param, param$1); + }), path$1._2); case /* Interface_mismatch */ 6 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The implementation ", _1: { - TAG: /* String_literal */ 11, - _0: "The implementation ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "does not match the interface ", _1: { - TAG: /* String_literal */ 11, - _0: "does not match the interface ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ':' */58, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ':' */58, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[The implementation %s@ does not match the interface %s:" - }), path$1._0, path$1._1); + } + }, + _1: "@[The implementation %s@ does not match the interface %s:" + }), path$1._0, path$1._1); case /* Class_type_declarations */ 7 : - const id$4 = path$1._0; - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const id$4 = path$1._0; + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Class type declarations do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Class type declarations do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "does not match", _1: { - TAG: /* String_literal */ 11, - _0: "does not match", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } } @@ -53800,80 +53799,80 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Class type declarations do not match:@ %a@;<1 -2>does not match@ %a@]@ %a" - }), (function (param, param$1) { - return cltype_declaration$1(id$4, param, param$1); - }), path$1._1, (function (param, param$1) { - return cltype_declaration$1(id$4, param, param$1); - }), path$1._2, report_error$3, path$1._3); + } + }, + _1: "@[Class type declarations do not match:@ %a@;<1 -2>does not match@ %a@]@ %a" + }), (function (param, param$1) { + return cltype_declaration$1(id$4, param, param$1); + }), path$1._1, (function (param, param$1) { + return cltype_declaration$1(id$4, param, param$1); + }), path$1._2, report_error$3, path$1._3); case /* Class_declarations */ 8 : - const id$5 = path$1._0; - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + const id$5 = path$1._0; + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Class declarations do not match:", _1: { - TAG: /* String_literal */ 11, - _0: "Class declarations do not match:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 -2>", - _1: 1, - _2: -2 - }, + TAG: /* Break */ 0, + _0: "@;<1 -2>", + _1: 1, + _2: -2 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "does not match", _1: { - TAG: /* String_literal */ 11, - _0: "does not match", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } } @@ -53883,56 +53882,57 @@ function include_err$1(ppf, path$1) { } } } - }, - _1: "@[Class declarations do not match:@ %a@;<1 -2>does not match@ %a@]@ %a" - }), (function (param, param$1) { - return class_declaration$1(id$5, param, param$1); - }), path$1._1, (function (param, param$1) { - return class_declaration$1(id$5, param, param$1); - }), path$1._2, report_error$3, path$1._3); + } + }, + _1: "@[Class declarations do not match:@ %a@;<1 -2>does not match@ %a@]@ %a" + }), (function (param, param$1) { + return class_declaration$1(id$5, param, param$1); + }), path$1._1, (function (param, param$1) { + return class_declaration$1(id$5, param, param$1); + }), path$1._2, report_error$3, path$1._3); case /* Unbound_modtype_path */ 9 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound module type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound module type %a" - }), path, path$1._0); + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound module type ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound module type %a" + }), path, path$1._0); case /* Unbound_module_path */ 10 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound module ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound module %a" - }), path, path$1._0); + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound module ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound module %a" + }), path, path$1._0); case /* Invalid_module_alias */ 11 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Module ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " cannot be aliased", - _1: /* End_of_format */ 0 - } + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Module ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " cannot be aliased", + _1: /* End_of_format */ 0 } - }, - _1: "Module %a cannot be aliased" - }), path, path$1._0); + } + }, + _1: "Module %a cannot be aliased" + }), path, path$1._0); } } @@ -53952,124 +53952,65 @@ function context(ppf, param) { const id = param.hd; switch (id.TAG) { case /* Module */ 0 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "module ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "module ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<2>module %a%a@]" - }), ident$3, id._0, args, param.tl); + } + }, + _1: "@[<2>module %a%a@]" + }), ident$3, id._0, args, param.tl); case /* Modtype */ 1 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "module type ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " =", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" } }, - _1: "@[<2>module type %a =@ %a@]" - }), ident$3, id._0, context_mty, param.tl); - case /* Arg */ 2 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "functor (", + _0: "module type ", _1: { TAG: /* Alpha */ 15, _0: { TAG: /* String_literal */ 11, - _0: " : ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: ") -> ...", - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "functor (%a : %a) -> ..." - }), ident$3, id._0, context_mty, param.tl); - case /* Body */ 3 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "functor (", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ") ->", + _0: " =", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -54080,14 +54021,73 @@ function context(ppf, param) { }, _1: { TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } - }, - _1: "functor (%s) ->@ %a" - }), argname(id._0), context_mty, param.tl); + } + }, + _1: "@[<2>module type %a =@ %a@]" + }), ident$3, id._0, context_mty, param.tl); + case /* Arg */ 2 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "functor (", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " : ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: ") -> ...", + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "functor (%a : %a) -> ..." + }), ident$3, id._0, context_mty, param.tl); + case /* Body */ 3 : + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "functor (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: ") ->", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + } + } + }, + _1: "functor (%s) ->@ %a" + }), argname(id._0), context_mty, param.tl); } } @@ -54099,10 +54099,10 @@ function context_mty(ppf, rem) { switch (rem.hd.TAG) { case /* Module */ 0 : case /* Modtype */ 1 : - break; + break; case /* Arg */ 2 : case /* Body */ 3 : - return context(ppf, rem); + return context(ppf, rem); } Curry._2(Stdlib__Format.fprintf(ppf)({ @@ -54166,61 +54166,61 @@ function args(ppf, cxt) { switch (x.TAG) { case /* Module */ 0 : case /* Modtype */ 1 : - break; + break; case /* Arg */ 2 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " :", + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " :", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: ") : ...", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: ") : ...", + _1: /* End_of_format */ 0 } } } } - }, - _1: "(%a :@ %a) : ..." - }), ident$3, x._0, context_mty, cxt.tl); + } + }, + _1: "(%a :@ %a) : ..." + }), ident$3, x._0, context_mty, cxt.tl); case /* Body */ 3 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ')' */41, _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } - }, - _1: "(%s)%a" - }), argname(x._0), args, cxt.tl); + } + }, + _1: "(%s)%a" + }), argname(x._0), args, cxt.tl); } } @@ -54553,16 +54553,16 @@ register_error_of_exn(function (err) { function get_location(ti) { switch (ti.TAG) { case /* Ti_pat */ 0 : - return ti._0.pat_loc; + return ti._0.pat_loc; case /* Ti_expr */ 1 : - return ti._0.exp_loc; + return ti._0.exp_loc; case /* Ti_class */ 2 : - return ti._0.cl_loc; + return ti._0.cl_loc; case /* Ti_mod */ 3 : - return ti._0.mod_loc; + return ti._0.mod_loc; case /* An_call */ 4 : case /* An_ident */ 5 : - return ti._0; + return ti._0; } } @@ -54643,17 +54643,17 @@ function is_absent_pat(p) { function const_compare(x, y) { switch (x.TAG) { case /* Const_string */ 2 : - if (y.TAG === /* Const_string */ 2) { - return Caml.caml_string_compare(x._0, y._0); - } else { - return Caml_obj.caml_compare(x, y); - } + if (y.TAG === /* Const_string */ 2) { + return Caml.caml_string_compare(x._0, y._0); + } else { + return Caml_obj.caml_compare(x, y); + } case /* Const_float */ 3 : - if (y.TAG === /* Const_float */ 3) { - return Caml.caml_float_compare(Caml_format.caml_float_of_string(x._0), Caml_format.caml_float_of_string(y._0)); - } else { - return Caml_obj.caml_compare(x, y); - } + if (y.TAG === /* Const_float */ 3) { + return Caml.caml_float_compare(Caml_format.caml_float_of_string(x._0), Caml_format.caml_float_of_string(y._0)); + } else { + return Caml_obj.caml_compare(x, y); + } default: return Caml_obj.caml_compare(x, y); } @@ -54759,230 +54759,230 @@ function compat(_p, _q) { } else { switch (match.TAG) { case /* Tpat_alias */ 1 : - _p = match._0; - continue; + _p = match._0; + continue; case /* Tpat_constant */ 2 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_constant */ 2 : - return const_compare(match._0, match$1._0) === 0; - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_constant */ 2 : + return const_compare(match._0, match$1._0) === 0; + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; } - break; + } + break; case /* Tpat_tuple */ 3 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_tuple */ 3 : - return compats(match._0, match$1._0); - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_tuple */ 3 : + return compats(match._0, match$1._0); + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; } - break; + } + break; case /* Tpat_construct */ 4 : + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_construct */ 4 : + if (equal_tag(match._1.cstr_tag, match$1._1.cstr_tag)) { + return compats(match._2, match$1._2); + } else { + return false; + } + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; + } + } + break; + case /* Tpat_variant */ 5 : + const p1 = match._1; + const l1 = match._0; + if (p1 !== undefined) { if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { exit = 1; } else { switch (match$1.TAG) { case /* Tpat_var */ 0 : case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_construct */ 4 : - if (equal_tag(match._1.cstr_tag, match$1._1.cstr_tag)) { - return compats(match._2, match$1._2); - } else { - return false; - } + exit = 1; + break; + case /* Tpat_variant */ 5 : + const p2 = match$1._1; + if (p2 === undefined) { + return false; + } + if (l1 !== match$1._0) { + return false; + } + _q = p2; + _p = p1; + continue; case /* Tpat_or */ 8 : - exit = 2; - break; + exit = 2; + break; default: exit = 3; } } - break; - case /* Tpat_variant */ 5 : - const p1 = match._1; - const l1 = match._0; - if (p1 !== undefined) { - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_variant */ 5 : - const p2 = match$1._1; - if (p2 === undefined) { - return false; - } - if (l1 !== match$1._0) { - return false; - } - _q = p2; - _p = p1; - continue; - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; + break; + case /* Tpat_variant */ 5 : + if (match$1._1 !== undefined) { + return false; + } else { + return l1 === match$1._0; } - } - } else if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_variant */ 5 : - if (match$1._1 !== undefined) { - return false; - } else { - return l1 === match$1._0; - } - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; - } + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; } - break; + } + break; case /* Tpat_record */ 6 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_record */ 6 : - const match$2 = records_args(match._0, match$1._0); - return compats(match$2[0], match$2[1]); - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_record */ 6 : + const match$2 = records_args(match._0, match$1._0); + return compats(match$2[0], match$2[1]); + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; } - break; + } + break; case /* Tpat_array */ 7 : - const ps = match._0; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_array */ 7 : - const qs = match$1._0; - if (Stdlib__List.length(ps) === Stdlib__List.length(qs)) { - return compats(ps, qs); - } else { - return false; - } - case /* Tpat_or */ 8 : - exit = 2; - break; - default: - exit = 3; - } + const ps = match._0; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_array */ 7 : + const qs = match$1._0; + if (Stdlib__List.length(ps) === Stdlib__List.length(qs)) { + return compats(ps, qs); + } else { + return false; + } + case /* Tpat_or */ 8 : + exit = 2; + break; + default: + exit = 3; } - break; + } + break; case /* Tpat_lazy */ 9 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - exit = 1; - } else { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - case /* Tpat_alias */ 1 : - exit = 1; - break; - case /* Tpat_or */ 8 : - exit = 2; - break; - case /* Tpat_lazy */ 9 : - _q = match$1._0; - _p = match._0; - continue; - default: - exit = 3; - } + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + exit = 1; + } else { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + case /* Tpat_alias */ 1 : + exit = 1; + break; + case /* Tpat_or */ 8 : + exit = 2; + break; + case /* Tpat_lazy */ 9 : + _q = match$1._0; + _p = match._0; + continue; + default: + exit = 3; } - break; + } + break; default: exit = 1; } } switch (exit) { case 1 : - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - return true; - } - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - return true; - case /* Tpat_alias */ 1 : - _q = match$1._0; - continue; - default: - if (/* tag */ typeof match === "number" || typeof match === "string") { - return true; - } - if (match.TAG === /* Tpat_var */ 0) { - return true; - } - if (compat(match._0, q)) { - return true; - } - _p = match._1; - continue; - } - case 2 : - if (compat(p, match$1._0)) { + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + return true; + } + switch (match$1.TAG) { + case /* Tpat_var */ 0 : return true; - } - _q = match$1._1; - continue; - case 3 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39141, - 6 - ] - }); + case /* Tpat_alias */ 1 : + _q = match$1._0; + continue; + default: + if (/* tag */ typeof match === "number" || typeof match === "string") { + return true; + } + if (match.TAG === /* Tpat_var */ 0) { + return true; + } + if (compat(match._0, q)) { + return true; + } + _p = match._1; + continue; + } + case 2 : + if (compat(p, match$1._0)) { + return true; + } + _q = match$1._1; + continue; + case 3 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39141, + 6 + ] + }); } }; @@ -55055,94 +55055,94 @@ function is_cons(param) { function pretty_const(c) { switch (c.TAG) { case /* Const_int */ 0 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Int */ 4, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: /* End_of_format */ 0 - }, - _1: "%d" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Int */ 4, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: /* End_of_format */ 0 + }, + _1: "%d" + }), c._0); case /* Const_char */ 1 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Caml_char */ 1, - _0: /* End_of_format */ 0 - }, - _1: "%C" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Caml_char */ 1, + _0: /* End_of_format */ 0 + }, + _1: "%C" + }), c._0); case /* Const_string */ 2 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Caml_string */ 3, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%S" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Caml_string */ 3, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%S" + }), c._0); case /* Const_float */ 3 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%s" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%s" + }), c._0); case /* Const_int32 */ 4 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Int32 */ 5, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* 'l' */108, - _1: /* End_of_format */ 0 - } - }, - _1: "%ldl" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Int32 */ 5, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* 'l' */108, + _1: /* End_of_format */ 0 + } + }, + _1: "%ldl" + }), c._0); case /* Const_int64 */ 5 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Int64 */ 7, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* 'L' */76, - _1: /* End_of_format */ 0 - } - }, - _1: "%LdL" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Int64 */ 7, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* 'L' */76, + _1: /* End_of_format */ 0 + } + }, + _1: "%LdL" + }), c._0); case /* Const_nativeint */ 6 : - return Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* Nativeint */ 6, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* 'n' */110, - _1: /* End_of_format */ 0 - } - }, - _1: "%ndn" - }), c._0); + return Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* Nativeint */ 6, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* 'n' */110, + _1: /* End_of_format */ 0 + } + }, + _1: "%ndn" + }), c._0); } } @@ -55285,56 +55285,103 @@ function pretty_val(ppf, v) { } switch (c.TAG) { case /* Tpat_var */ 0 : - return print$2(ppf, c._0); + return print$2(ppf, c._0); case /* Tpat_alias */ 1 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "as ", _1: { - TAG: /* String_literal */ 11, - _0: "as ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[(%a@ as %a)@]" - }), pretty_val, c._0, print$2, c._1); + } + }, + _1: "@[(%a@ as %a)@]" + }), pretty_val, c._0, print$2, c._1); case /* Tpat_constant */ 2 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%s" + }), pretty_const(c._0)); + case /* Tpat_tuple */ 3 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "@[(%a)@]" + }), (function (param, param$1) { + return pretty_vals(",", param, param$1); + }), c._0); + case /* Tpat_construct */ 4 : + const match$1 = c._2; + const cstr = c._1; + if (!match$1) { return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { @@ -55343,9 +55390,10 @@ function pretty_val(ppf, v) { _1: /* End_of_format */ 0 }, _1: "%s" - }), pretty_const(c._0)); - case /* Tpat_tuple */ 3 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ + }), cstr.cstr_name); + } + if (!match$1.tl) { + return Curry._3(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -55353,19 +55401,28 @@ function pretty_val(ppf, v) { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" } }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, _1: /* End_of_format */ 0 @@ -55374,26 +55431,15 @@ function pretty_val(ppf, v) { } } }, - _1: "@[(%a)@]" - }), (function (param, param$1) { - return pretty_vals(",", param, param$1); - }), c._0); - case /* Tpat_construct */ 4 : - const match$1 = c._2; - const cstr = c._1; - if (!match$1) { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%s" - }), cstr.cstr_name); - } - if (!match$1.tl) { - return Curry._3(Stdlib__Format.fprintf(ppf)({ + _1: "@[<2>%s@ %a@]" + }), cstr.cstr_name, pretty_arg, match$1.hd); + } + const vs = c._2; + const name = c._1.cstr_name; + if (name === "::" && vs) { + const match$2 = vs.tl; + if (match$2 && !match$2.tl) { + return Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -55401,47 +55447,68 @@ function pretty_val(ppf, v) { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" + _0: /* End_of_format */ 0, + _1: "" } }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: "::", _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } }, - _1: "@[<2>%s@ %a@]" - }), cstr.cstr_name, pretty_arg, match$1.hd); - } - const vs = c._2; - const name = c._1.cstr_name; - if (name === "::" && vs) { - const match$2 = vs.tl; - if (match$2 && !match$2.tl) { - return Curry._4(Stdlib__Format.fprintf(ppf)({ + _1: "@[%a::@,%a@]" + }), pretty_car, vs.hd, pretty_cdr, match$2.hd); + } + + } + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { TAG: /* Format */ 0, _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -55452,21 +55519,17 @@ function pretty_val(ppf, v) { } }, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "::", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, + TAG: /* Char_literal */ 12, + _0: /* '(' */40, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* ')' */41, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, _1: /* End_of_format */ 0 @@ -55475,12 +55538,19 @@ function pretty_val(ppf, v) { } } } - }, - _1: "@[%a::@,%a@]" - }), pretty_car, vs.hd, pretty_cdr, match$2.hd); - } - - } + } + } + } + }, + _1: "@[<2>%s@ @[(%a)@]@]" + }), name, (function (param, param$1) { + return pretty_vals(",", param, param$1); + }), vs); + break; + case /* Tpat_variant */ 5 : + const w = c._1; + const l = c._0; + if (w !== undefined) { return Curry._3(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { @@ -55498,280 +55568,210 @@ function pretty_val(ppf, v) { } }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* '`' */96, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } }, - _1: "@[<2>%s@ @[(%a)@]@]" - }), name, (function (param, param$1) { - return pretty_vals(",", param, param$1); - }), vs); - break; - case /* Tpat_variant */ 5 : - const w = c._1; - const l = c._0; - if (w !== undefined) { - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: "@[<2>`%s@ %a@]" + }), l, pretty_arg, w); + } else { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '`' */96, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "`%s" + }), l); + } + case /* Tpat_record */ 6 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '{' */123, + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, - _1: { TAG: /* Char_literal */ 12, - _0: /* '`' */96, + _0: /* '}' */125, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - }, - _1: "@[<2>`%s@ %a@]" - }), l, pretty_arg, w); - } else { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '`' */96, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "`%s" - }), l); - } - case /* Tpat_record */ 6 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '{' */123, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '}' */125, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[{%a}@]" - }), pretty_lvals, Stdlib__List.filter((function (param) { - let tmp = param[2].pat_desc; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - return false; - } else { - return true; } - }), c._0)); + }, + _1: "@[{%a}@]" + }), pretty_lvals, Stdlib__List.filter((function (param) { + let tmp = param[2].pat_desc; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + return false; + } else { + return true; + } + }), c._0)); case /* Tpat_array */ 7 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "[| ", _1: { - TAG: /* String_literal */ 11, - _0: "[| ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " |]", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " |]", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[[| %a |]@]" - }), (function (param, param$1) { - return pretty_vals(" ;", param, param$1); - }), c._0); + } + }, + _1: "@[[| %a |]@]" + }), (function (param, param$1) { + return pretty_vals(" ;", param, param$1); + }), c._0); case /* Tpat_or */ 8 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '(' */40, _1: { - TAG: /* Char_literal */ 12, - _0: /* '(' */40, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '|' */124, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '|' */124, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[(%a|@,%a)@]" - }), pretty_or, c._0, pretty_or, c._1); + } + }, + _1: "@[(%a|@,%a)@]" + }), pretty_or, c._0, pretty_or, c._1); case /* Tpat_lazy */ 9 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "lazy", _1: { - TAG: /* String_literal */ 11, - _0: "lazy", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[<2>lazy@ %a@]" - }), pretty_arg, c._0); + } + }, + _1: "@[<2>lazy@ %a@]" + }), pretty_arg, c._0); } } @@ -55861,15 +55861,15 @@ function pretty_arg(ppf, v) { } switch (match.TAG) { case /* Tpat_construct */ 4 : - if (!match._2) { - return pretty_val(ppf, v); - } - break; + if (!match._2) { + return pretty_val(ppf, v); + } + break; case /* Tpat_variant */ 5 : - if (match._1 === undefined) { - return pretty_val(ppf, v); - } - break; + if (match._1 === undefined) { + return pretty_val(ppf, v); + } + break; default: return pretty_val(ppf, v); } @@ -56054,89 +56054,89 @@ function simple_match(p1, p2) { if (!/* tag */ (typeof match === "number" || typeof match === "string")) { switch (match.TAG) { case /* Tpat_constant */ 2 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_constant */ 2 : - return const_compare(match._0, match$1._0) === 0; - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_constant */ 2 : + return const_compare(match._0, match$1._0) === 0; + default: + return false; } - break; + } + break; case /* Tpat_tuple */ 3 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_tuple */ 3 : - return true; - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_tuple */ 3 : + return true; + default: + return false; } - break; + } + break; case /* Tpat_construct */ 4 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_construct */ 4 : - return equal_tag(match._1.cstr_tag, match$1._1.cstr_tag); - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_construct */ 4 : + return equal_tag(match._1.cstr_tag, match$1._1.cstr_tag); + default: + return false; } - break; + } + break; case /* Tpat_variant */ 5 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_variant */ 5 : - return match._0 === match$1._0; - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_variant */ 5 : + return match._0 === match$1._0; + default: + return false; } - break; + } + break; case /* Tpat_record */ 6 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_record */ 6 : - return true; - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_record */ 6 : + return true; + default: + return false; } - break; + } + break; case /* Tpat_array */ 7 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_array */ 7 : - return Stdlib__List.length(match._0) === Stdlib__List.length(match$1._0); - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_array */ 7 : + return Stdlib__List.length(match._0) === Stdlib__List.length(match$1._0); + default: + return false; } - break; + } + break; case /* Tpat_lazy */ 9 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_var */ 0 : - break; - case /* Tpat_lazy */ 9 : - return true; - default: - return false; - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_var */ 0 : + break; + case /* Tpat_lazy */ 9 : + return true; + default: + return false; } - break; + } + break; } } @@ -56171,48 +56171,48 @@ function simple_match_args(p1, _p2) { if (!/* tag */ (typeof args === "number" || typeof args === "string")) { switch (args.TAG) { case /* Tpat_var */ 0 : - break; + break; case /* Tpat_alias */ 1 : - _p2 = args._0; - continue; + _p2 = args._0; + continue; case /* Tpat_construct */ 4 : - return args._2; + return args._2; case /* Tpat_variant */ 5 : - const arg = args._1; - if (arg !== undefined) { - return { - hd: arg, - tl: /* [] */ 0 - }; - } else { - return /* [] */ 0; - } + const arg = args._1; + if (arg !== undefined) { + return { + hd: arg, + tl: /* [] */ 0 + }; + } else { + return /* [] */ 0; + } case /* Tpat_record */ 6 : - let omegas = record_arg(p1); - let arg$1 = args._0; - return Stdlib__List.map((function (param) { - try { - return get_field(param[1].lbl_pos, arg$1); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return omega; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + let omegas = record_arg(p1); + let arg$1 = args._0; + return Stdlib__List.map((function (param) { + try { + return get_field(param[1].lbl_pos, arg$1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return omega; } - }), omegas); + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }), omegas); case /* Tpat_tuple */ 3 : case /* Tpat_array */ 7 : - return args._0; + return args._0; case /* Tpat_constant */ 2 : case /* Tpat_or */ 8 : - return /* [] */ 0; + return /* [] */ 0; case /* Tpat_lazy */ 9 : - return { - hd: args._0, - tl: /* [] */ 0 - }; + return { + hd: args._0, + tl: /* [] */ 0 + }; } } @@ -56222,35 +56222,35 @@ function simple_match_args(p1, _p2) { } switch (args$1.TAG) { case /* Tpat_tuple */ 3 : - return Stdlib__List.map((function (param) { - return omega; - }), args$1._0); + return Stdlib__List.map((function (param) { + return omega; + }), args$1._0); case /* Tpat_construct */ 4 : - return Stdlib__List.map((function (param) { - return omega; - }), args$1._2); + return Stdlib__List.map((function (param) { + return omega; + }), args$1._2); case /* Tpat_variant */ 5 : - if (args$1._1 !== undefined) { - return { - hd: omega, - tl: /* [] */ 0 - }; - } else { - return /* [] */ 0; - } - case /* Tpat_record */ 6 : - return Stdlib__List.map((function (param) { - return omega; - }), args$1._0); - case /* Tpat_array */ 7 : - return Stdlib__List.map((function (param) { - return omega; - }), args$1._0); - case /* Tpat_lazy */ 9 : + if (args$1._1 !== undefined) { return { hd: omega, tl: /* [] */ 0 }; + } else { + return /* [] */ 0; + } + case /* Tpat_record */ 6 : + return Stdlib__List.map((function (param) { + return omega; + }), args$1._0); + case /* Tpat_array */ 7 : + return Stdlib__List.map((function (param) { + return omega; + }), args$1._0); + case /* Tpat_lazy */ 9 : + return { + hd: omega, + tl: /* [] */ 0 + }; default: return /* [] */ 0; } @@ -56266,63 +56266,63 @@ function normalize_pat(_q) { } switch (args.TAG) { case /* Tpat_var */ 0 : - return make_pat(/* Tpat_any */ 0, q.pat_type, q.pat_env); + return make_pat(/* Tpat_any */ 0, q.pat_type, q.pat_env); case /* Tpat_alias */ 1 : - _q = args._0; - continue; + _q = args._0; + continue; case /* Tpat_constant */ 2 : - return q; + return q; case /* Tpat_tuple */ 3 : - return make_pat({ - TAG: /* Tpat_tuple */ 3, - _0: Stdlib__List.map((function (param) { - return omega; - }), args._0) - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_tuple */ 3, + _0: Stdlib__List.map((function (param) { + return omega; + }), args._0) + }, q.pat_type, q.pat_env); case /* Tpat_construct */ 4 : - return make_pat({ - TAG: /* Tpat_construct */ 4, - _0: args._0, - _1: args._1, - _2: Stdlib__List.map((function (param) { - return omega; - }), args._2) - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_construct */ 4, + _0: args._0, + _1: args._1, + _2: Stdlib__List.map((function (param) { + return omega; + }), args._2) + }, q.pat_type, q.pat_env); case /* Tpat_variant */ 5 : - return make_pat({ - TAG: /* Tpat_variant */ 5, - _0: args._0, - _1: may_map((function (param) { - return omega; - }), args._1), - _2: args._2 - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_variant */ 5, + _0: args._0, + _1: may_map((function (param) { + return omega; + }), args._1), + _2: args._2 + }, q.pat_type, q.pat_env); case /* Tpat_record */ 6 : - return make_pat({ - TAG: /* Tpat_record */ 6, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - omega - ]; - }), args._0), - _1: args._1 - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_record */ 6, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + omega + ]; + }), args._0), + _1: args._1 + }, q.pat_type, q.pat_env); case /* Tpat_array */ 7 : - return make_pat({ - TAG: /* Tpat_array */ 7, - _0: Stdlib__List.map((function (param) { - return omega; - }), args._0) - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_array */ 7, + _0: Stdlib__List.map((function (param) { + return omega; + }), args._0) + }, q.pat_type, q.pat_env); case /* Tpat_or */ 8 : - return fatal_error("Parmatch.normalize_pat"); + return fatal_error("Parmatch.normalize_pat"); case /* Tpat_lazy */ 9 : - return make_pat({ - TAG: /* Tpat_lazy */ 9, - _0: omega - }, q.pat_type, q.pat_env); + return make_pat({ + TAG: /* Tpat_lazy */ 9, + _0: omega + }, q.pat_type, q.pat_env); } }; @@ -56352,65 +56352,65 @@ function discr_pat(q, pss) { } switch (match$1.TAG) { case /* Tpat_var */ 0 : - _pss = pss$1.tl; - continue; + _pss = pss$1.tl; + continue; case /* Tpat_alias */ 1 : - _pss = { - hd: { - hd: match$1._0, - tl: match.tl - }, - tl: pss$1.tl - }; - continue; + _pss = { + hd: { + hd: match$1._0, + tl: match.tl + }, + tl: pss$1.tl + }; + continue; case /* Tpat_record */ 6 : - const new_omegas = Stdlib__List.fold_right((function (param, r) { - const lbl = param[1]; - try { - get_field(lbl.lbl_pos, r); - return r; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return { - hd: [ - param[0], - lbl, - omega - ], - tl: r - }; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const new_omegas = Stdlib__List.fold_right((function (param, r) { + const lbl = param[1]; + try { + get_field(lbl.lbl_pos, r); + return r; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return { + hd: [ + param[0], + lbl, + omega + ], + tl: r + }; } - }), match$1._0, record_arg(acc)); - _pss = pss$1.tl; - _acc = make_pat({ - TAG: /* Tpat_record */ 6, - _0: new_omegas, - _1: match$1._1 - }, p.pat_type, p.pat_env); - continue; + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }), match$1._0, record_arg(acc)); + _pss = pss$1.tl; + _acc = make_pat({ + TAG: /* Tpat_record */ 6, + _0: new_omegas, + _1: match$1._1 + }, p.pat_type, p.pat_env); + continue; case /* Tpat_or */ 8 : - const ps = match.tl; - _pss = { + const ps = match.tl; + _pss = { + hd: { + hd: match$1._0, + tl: ps + }, + tl: { hd: { - hd: match$1._0, + hd: match$1._1, tl: ps }, - tl: { - hd: { - hd: match$1._1, - tl: ps - }, - tl: pss$1.tl - } - }; - continue; + tl: pss$1.tl + } + }; + continue; case /* Tpat_tuple */ 3 : case /* Tpat_lazy */ 9 : - return normalize_pat(p); + return normalize_pat(p); default: return acc; } @@ -56450,118 +56450,118 @@ function do_set_args(erase_mutable, q, r) { } switch (omegas.TAG) { case /* Tpat_constant */ 2 : - return { - hd: q, - tl: r - }; + return { + hd: q, + tl: r + }; case /* Tpat_tuple */ 3 : - const match = read_args(omegas._0, r); - return { - hd: make_pat({ - TAG: /* Tpat_tuple */ 3, - _0: match[0] - }, q.pat_type, q.pat_env), - tl: match[1] - }; + const match = read_args(omegas._0, r); + return { + hd: make_pat({ + TAG: /* Tpat_tuple */ 3, + _0: match[0] + }, q.pat_type, q.pat_env), + tl: match[1] + }; case /* Tpat_construct */ 4 : - const match$1 = read_args(omegas._2, r); - return { - hd: make_pat({ - TAG: /* Tpat_construct */ 4, - _0: omegas._0, - _1: omegas._1, - _2: match$1[0] - }, q.pat_type, q.pat_env), - tl: match$1[1] - }; + const match$1 = read_args(omegas._2, r); + return { + hd: make_pat({ + TAG: /* Tpat_construct */ 4, + _0: omegas._0, + _1: omegas._1, + _2: match$1[0] + }, q.pat_type, q.pat_env), + tl: match$1[1] + }; case /* Tpat_variant */ 5 : - let match$2; - if (omegas._1 !== undefined) { - if (r) { - match$2 = [ - r.hd, - r.tl - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39485, - 13 - ] - }); - } - } else { + let match$2; + if (omegas._1 !== undefined) { + if (r) { match$2 = [ - undefined, - r + r.hd, + r.tl ]; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39485, + 13 + ] + }); } - return { - hd: make_pat({ - TAG: /* Tpat_variant */ 5, - _0: omegas._0, - _1: match$2[0], - _2: omegas._2 - }, q.pat_type, q.pat_env), - tl: match$2[1] - }; + } else { + match$2 = [ + undefined, + r + ]; + } + return { + hd: make_pat({ + TAG: /* Tpat_variant */ 5, + _0: omegas._0, + _1: match$2[0], + _2: omegas._2 + }, q.pat_type, q.pat_env), + tl: match$2[1] + }; case /* Tpat_record */ 6 : - const omegas$1 = omegas._0; - const match$3 = read_args(omegas$1, r); - return { - hd: make_pat({ - TAG: /* Tpat_record */ 6, - _0: Stdlib__List.map2((function (param, arg) { - const lbl = param[1]; - const lid = param[0]; - let tmp = false; - if (erase_mutable) { - const match = lbl.lbl_mut; - let tmp$1; - tmp$1 = match === /* Immutable */ 0 ? false : true; - tmp = tmp$1; - } - if (tmp) { - return [ - lid, - lbl, - omega - ]; - } else { - return [ - lid, - lbl, - arg - ]; - } - }), omegas$1, match$3[0]), - _1: omegas._1 - }, q.pat_type, q.pat_env), - tl: match$3[1] - }; + const omegas$1 = omegas._0; + const match$3 = read_args(omegas$1, r); + return { + hd: make_pat({ + TAG: /* Tpat_record */ 6, + _0: Stdlib__List.map2((function (param, arg) { + const lbl = param[1]; + const lid = param[0]; + let tmp = false; + if (erase_mutable) { + const match = lbl.lbl_mut; + let tmp$1; + tmp$1 = match === /* Immutable */ 0 ? false : true; + tmp = tmp$1; + } + if (tmp) { + return [ + lid, + lbl, + omega + ]; + } else { + return [ + lid, + lbl, + arg + ]; + } + }), omegas$1, match$3[0]), + _1: omegas._1 + }, q.pat_type, q.pat_env), + tl: match$3[1] + }; case /* Tpat_array */ 7 : - const match$4 = read_args(omegas._0, r); + const match$4 = read_args(omegas._0, r); + return { + hd: make_pat({ + TAG: /* Tpat_array */ 7, + _0: match$4[0] + }, q.pat_type, q.pat_env), + tl: match$4[1] + }; + case /* Tpat_lazy */ 9 : + if (r) { return { hd: make_pat({ - TAG: /* Tpat_array */ 7, - _0: match$4[0] + TAG: /* Tpat_lazy */ 9, + _0: r.hd }, q.pat_type, q.pat_env), - tl: match$4[1] + tl: r.tl }; - case /* Tpat_lazy */ 9 : - if (r) { - return { - hd: make_pat({ - TAG: /* Tpat_lazy */ 9, - _0: r.hd - }, q.pat_type, q.pat_env), - tl: r.tl - }; - } else { - return fatal_error("Parmatch.do_set_args (lazy)"); - } + } else { + return fatal_error("Parmatch.do_set_args (lazy)"); + } default: return fatal_error("Parmatch.set_args"); } @@ -56583,30 +56583,30 @@ function filter_one(q, pss) { if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { switch (match$1.TAG) { case /* Tpat_alias */ 1 : - _param = { - hd: { - hd: match$1._0, - tl: match.tl - }, - tl: param.tl - }; - continue; + _param = { + hd: { + hd: match$1._0, + tl: match.tl + }, + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const ps = match.tl; - _param = { + const ps = match.tl; + _param = { + hd: { + hd: match$1._0, + tl: ps + }, + tl: { hd: { - hd: match$1._0, + hd: match$1._1, tl: ps }, - tl: { - hd: { - hd: match$1._1, - tl: ps - }, - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; } } @@ -56642,35 +56642,35 @@ function filter_extra(pss) { } switch (match$1.TAG) { case /* Tpat_var */ 0 : - return { - hd: match.tl, - tl: filter_rec(param.tl) - }; + return { + hd: match.tl, + tl: filter_rec(param.tl) + }; case /* Tpat_alias */ 1 : - _param = { - hd: { - hd: match$1._0, - tl: match.tl - }, - tl: param.tl - }; - continue; + _param = { + hd: { + hd: match$1._0, + tl: match.tl + }, + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const ps = match.tl; - _param = { + const ps = match.tl; + _param = { + hd: { + hd: match$1._0, + tl: ps + }, + tl: { hd: { - hd: match$1._0, + hd: match$1._1, tl: ps }, - tl: { - hd: { - hd: match$1._1, - tl: ps - }, - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; default: _param = param.tl; continue; @@ -56739,33 +56739,33 @@ function filter_all(pat0, pss) { } switch (match$1.TAG) { case /* Tpat_var */ 0 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Tpat_alias */ 1 : - _param = { - hd: { - hd: match$1._0, - tl: match.tl - }, - tl: param.tl - }; - continue; + _param = { + hd: { + hd: match$1._0, + tl: match.tl + }, + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const ps = match.tl; - _param = { + const ps = match.tl; + _param = { + hd: { + hd: match$1._0, + tl: ps + }, + tl: { hd: { - hd: match$1._0, + hd: match$1._1, tl: ps }, - tl: { - hd: { - hd: match$1._1, - tl: ps - }, - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; default: _param = param.tl; _env = insert(p, match.tl, env); @@ -56783,8 +56783,8 @@ function filter_all(pat0, pss) { case /* Tpat_tuple */ 3 : case /* Tpat_record */ 6 : case /* Tpat_lazy */ 9 : - exit = 1; - break; + exit = 1; + break; default: tmp = /* [] */ 0; } @@ -56812,32 +56812,32 @@ function filter_all(pat0, pss) { if (!/* tag */ (typeof match$2 === "number" || typeof match$2 === "string")) { switch (match$2.TAG) { case /* Tpat_var */ 0 : - break; + break; case /* Tpat_alias */ 1 : - _param = { - hd: { - hd: match$2._0, - tl: match$1.tl - }, - tl: param.tl - }; - continue; + _param = { + hd: { + hd: match$2._0, + tl: match$1.tl + }, + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const ps = match$1.tl; - _param = { + const ps = match$1.tl; + _param = { + hd: { + hd: match$2._0, + tl: ps + }, + tl: { hd: { - hd: match$2._0, + hd: match$2._1, tl: ps }, - tl: { - hd: { - hd: match$2._1, - tl: ps - }, - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; default: _param = param.tl; continue; @@ -56897,35 +56897,35 @@ function mark_partial(_param) { } switch (match.TAG) { case /* Tpat_var */ 0 : - return { - hd: ps, - tl: mark_partial(param.tl) - }; + return { + hd: ps, + tl: mark_partial(param.tl) + }; case /* Tpat_alias */ 1 : - _param = { - hd: { - hd: match._0, - tl: ps.tl - }, - tl: param.tl - }; - continue; + _param = { + hd: { + hd: match._0, + tl: ps.tl + }, + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const ps$1 = ps.tl; - _param = { + const ps$1 = ps.tl; + _param = { + hd: { + hd: match._0, + tl: ps$1 + }, + tl: { hd: { - hd: match._0, + hd: match._1, tl: ps$1 }, - tl: { - hd: { - hd: match._1, - tl: ps$1 - }, - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; } } @@ -57050,37 +57050,25 @@ function full_match(ignore_generalized, closing, env) { } switch (match.TAG) { case /* Tpat_constant */ 2 : - if (match._0.TAG === /* Const_char */ 1) { - return Stdlib__List.length(env) === 256; - } else { - return false; - } + if (match._0.TAG === /* Const_char */ 1) { + return Stdlib__List.length(env) === 256; + } else { + return false; + } case /* Tpat_construct */ 4 : - const c = match._1; - if (c.cstr_consts < 0) { - return false; - } - if (!ignore_generalized) { - return Stdlib__List.length(env) === (c.cstr_consts + c.cstr_nonconsts | 0); - } - const env$1 = clean_env(env); - return Stdlib__List.length(env$1) === c.cstr_normal; + const c = match._1; + if (c.cstr_consts < 0) { + return false; + } + if (!ignore_generalized) { + return Stdlib__List.length(env) === (c.cstr_consts + c.cstr_nonconsts | 0); + } + const env$1 = clean_env(env); + return Stdlib__List.length(env$1) === c.cstr_normal; case /* Tpat_variant */ 5 : - const fields = Stdlib__List.map((function (param) { - const match = param[0].pat_desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39675, - 17 - ] - }); - } - if (match.TAG === /* Tpat_variant */ 5) { - return match._0; - } + const fields = Stdlib__List.map((function (param) { + const match = param[0].pat_desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ @@ -57089,35 +57077,47 @@ function full_match(ignore_generalized, closing, env) { 17 ] }); - }), env); - const row = row_of_pat(p); - if (closing && !row_fixed(row)) { - return Stdlib__List.for_all((function (param) { - const tag = param[0]; - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string" || !(match.TAG === /* Rpresent */ 0 || match._2)) { - return true; - } else { - return Stdlib__List.mem(tag, fields); - } - }), row.row_fields); - } else if (row.row_closed) { - return Stdlib__List.for_all((function (param) { - if (Caml_obj.caml_equal(row_field_repr_aux(/* [] */ 0, param[1]), /* Rabsent */ 0)) { - return true; - } else { - return Stdlib__List.mem(param[0], fields); - } - }), row.row_fields); - } else { - return false; - } - case /* Tpat_array */ 7 : + } + if (match.TAG === /* Tpat_variant */ 5) { + return match._0; + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39675, + 17 + ] + }); + }), env); + const row = row_of_pat(p); + if (closing && !row_fixed(row)) { + return Stdlib__List.for_all((function (param) { + const tag = param[0]; + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string" || !(match.TAG === /* Rpresent */ 0 || match._2)) { + return true; + } else { + return Stdlib__List.mem(tag, fields); + } + }), row.row_fields); + } else if (row.row_closed) { + return Stdlib__List.for_all((function (param) { + if (Caml_obj.caml_equal(row_field_repr_aux(/* [] */ 0, param[1]), /* Rabsent */ 0)) { + return true; + } else { + return Stdlib__List.mem(param[0], fields); + } + }), row.row_fields); + } else { return false; + } + case /* Tpat_array */ 7 : + return false; case /* Tpat_tuple */ 3 : case /* Tpat_record */ 6 : case /* Tpat_lazy */ 9 : - return true; + return true; default: return fatal_error("Parmatch.full_match"); } @@ -57156,9 +57156,9 @@ function should_extend(ext, env) { switch (match._1.cstr_tag.TAG) { case /* Cstr_constant */ 0 : case /* Cstr_block */ 1 : - break; + break; case /* Cstr_extension */ 2 : - return false; + return false; } const path = get_type_path(p.pat_type, p.pat_env); @@ -57171,18 +57171,18 @@ function complete_tags(nconsts, nconstrs, tags) { Stdlib__List.iter((function (i) { switch (i.TAG) { case /* Cstr_constant */ 0 : - return Caml_array.set(seen_const, i._0, true); + return Caml_array.set(seen_const, i._0, true); case /* Cstr_block */ 1 : - return Caml_array.set(seen_constr, i._0, true); + return Caml_array.set(seen_constr, i._0, true); case /* Cstr_extension */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39738, - 14 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39738, + 14 + ] + }); } }), tags); @@ -57352,397 +57352,385 @@ function build_other(ext, env) { } switch (args.TAG) { case /* Tpat_constant */ 2 : - switch (args._0.TAG) { - case /* Const_int */ 0 : - return build_other_constant((function (param) { - if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { - const i = param._0; - if (i.TAG === /* Const_int */ 0) { - return i._0; - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39892, - 55 - ] - }); - }), (function (i) { - return { - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_int */ 0, - _0: i - } - }; - }), 0, (function (prim) { - return prim + 1 | 0; - }), p, env); - case /* Const_char */ 1 : - const all_chars = Stdlib__List.map((function (param) { - const match = param[0].pat_desc; - if (!/* tag */ (typeof match === "number" || typeof match === "string") && match.TAG === /* Tpat_constant */ 2) { - const c = match._0; - if (c.TAG === /* Const_char */ 1) { - return c._0; - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39867, - 15 - ] - }); - }), env); - let _param = { + switch (args._0.TAG) { + case /* Const_int */ 0 : + return build_other_constant((function (param) { + if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { + const i = param._0; + if (i.TAG === /* Const_int */ 0) { + return i._0; + } + + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39892, + 55 + ] + }); + }), (function (i) { + return { + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_int */ 0, + _0: i + } + }; + }), 0, (function (prim) { + return prim + 1 | 0; + }), p, env); + case /* Const_char */ 1 : + const all_chars = Stdlib__List.map((function (param) { + const match = param[0].pat_desc; + if (!/* tag */ (typeof match === "number" || typeof match === "string") && match.TAG === /* Tpat_constant */ 2) { + const c = match._0; + if (c.TAG === /* Const_char */ 1) { + return c._0; + } + + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39867, + 15 + ] + }); + }), env); + let _param = { + hd: [ + /* 'a' */97, + /* 'z' */122 + ], + tl: { + hd: [ + /* 'A' */65, + /* 'Z' */90 + ], + tl: { hd: [ - /* 'a' */97, - /* 'z' */122 + /* '0' */48, + /* '9' */57 ], tl: { hd: [ - /* 'A' */65, - /* 'Z' */90 + /* ' ' */32, + /* '~' */126 ], tl: { hd: [ - /* '0' */48, - /* '9' */57 + Stdlib__Char.chr(0), + Stdlib__Char.chr(255) ], - tl: { - hd: [ - /* ' ' */32, - /* '~' */126 - ], - tl: { - hd: [ - Stdlib__Char.chr(0), - Stdlib__Char.chr(255) - ], - tl: /* [] */ 0 - } - } + tl: /* [] */ 0 } } - }; + } + } + }; + while (true) { + const param = _param; + if (!param) { + return omega; + } + const match = param.hd; + try { + let _i = match[0]; + let imax = match[1]; while (true) { - const param = _param; - if (!param) { - return omega; - } - const match = param.hd; - try { - let _i = match[0]; - let imax = match[1]; - while (true) { - const i = _i; - if (i > imax) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - const ci = Stdlib__Char.chr(i); - if (!Stdlib__List.mem(ci, all_chars)) { - return make_pat({ - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_char */ 1, - _0: ci - } - }, p.pat_type, p.pat_env); - } - _i = i + 1 | 0; - continue; - }; + const i = _i; + if (i > imax) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - _param = param.tl; - continue; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const ci = Stdlib__Char.chr(i); + if (!Stdlib__List.mem(ci, all_chars)) { + return make_pat({ + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_char */ 1, + _0: ci + } + }, p.pat_type, p.pat_env); } + _i = i + 1 | 0; + continue; }; - case /* Const_string */ 2 : - return build_other_constant((function (param) { - if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { - const match = param._0; - if (match.TAG === /* Const_string */ 2) { - return match._0.length; - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39913, - 21 - ] - }); - }), (function (i) { - return { - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_string */ 2, - _0: Caml_bytes.bytes_to_string(Stdlib__Bytes.make(i, /* '*' */42)), - _1: undefined - } - }; - }), 0, (function (prim) { - return prim + 1 | 0; - }), p, env); - case /* Const_float */ 3 : - return build_other_constant((function (param) { - if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { - const f = param._0; - if (f.TAG === /* Const_float */ 3) { - return Caml_format.caml_float_of_string(f._0); - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39919, - 21 - ] - }); - }), (function (f) { - return { - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_float */ 3, - _0: Stdlib.string_of_float(f) - } - }; - }), 0.0, (function (f) { - return f + 1.0; - }), p, env); - case /* Const_int32 */ 4 : - return build_other_constant((function (param) { - if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { - const i = param._0; - if (i.TAG === /* Const_int32 */ 4) { - return i._0; - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39897, - 57 - ] - }); - }), (function (i) { - return { - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_int32 */ 4, - _0: i - } - }; - }), 0, Stdlib__Int32.succ, p, env); - case /* Const_int64 */ 5 : - return build_other_constant((function (param) { - if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { - const i = param._0; - if (i.TAG === /* Const_int64 */ 5) { - return i._0; - } - - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39902, - 57 - ] - }); - }), (function (i) { - return { - TAG: /* Tpat_constant */ 2, - _0: { - TAG: /* Const_int64 */ 5, - _0: i - } - }; - }), Caml_int64.zero, Stdlib__Int64.succ, p, env); - case /* Const_nativeint */ 6 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39909, - 33 - ] - }); - - } - case /* Tpat_construct */ 4 : - let exit = 0; - const c = args._1; - switch (c.cstr_tag.TAG) { - case /* Cstr_constant */ 0 : - case /* Cstr_block */ 1 : - exit = 1; - break; - case /* Cstr_extension */ 2 : - const c_cstr_res = c.cstr_res; - const c_cstr_existentials = c.cstr_existentials; - const c_cstr_args = c.cstr_args; - const c_cstr_arity = c.cstr_arity; - const c_cstr_tag = c.cstr_tag; - const c_cstr_consts = c.cstr_consts; - const c_cstr_nonconsts = c.cstr_nonconsts; - const c_cstr_normal = c.cstr_normal; - const c_cstr_generalized = c.cstr_generalized; - const c_cstr_private = c.cstr_private; - const c_cstr_loc = c.cstr_loc; - const c_cstr_attributes = c.cstr_attributes; - const c$1 = { - cstr_name: "*extension*", - cstr_res: c_cstr_res, - cstr_existentials: c_cstr_existentials, - cstr_args: c_cstr_args, - cstr_arity: c_cstr_arity, - cstr_tag: c_cstr_tag, - cstr_consts: c_cstr_consts, - cstr_nonconsts: c_cstr_nonconsts, - cstr_normal: c_cstr_normal, - cstr_generalized: c_cstr_generalized, - cstr_private: c_cstr_private, - cstr_loc: c_cstr_loc, - cstr_attributes: c_cstr_attributes - }; - return make_pat({ - TAG: /* Tpat_construct */ 4, - _0: args._0, - _1: c$1, - _2: /* [] */ 0 - }, none$2, empty); - - } - if (exit === 1) { - let exit$1 = 0; - if (ext !== undefined) { - if (same(ext, get_type_path(p.pat_type, p.pat_env))) { - return extra_pat; } - exit$1 = 2; - } else { - exit$1 = 2; - } - if (exit$1 === 2) { - const all_tags = Stdlib__List.map((function (param) { - let param$1 = param[0]; - const match = param$1.pat_desc; - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tpat_construct */ 4) { - return fatal_error("Parmatch.get_tag"); - } else { - return match._1.cstr_tag; + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + _param = param.tl; + continue; + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }; + case /* Const_string */ 2 : + return build_other_constant((function (param) { + if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { + const match = param._0; + if (match.TAG === /* Const_string */ 2) { + return match._0.length; } - }), env); - return pat_of_constrs(p, complete_constrs(p, all_tags)); - } - - } - break; - case /* Tpat_variant */ 5 : - const r = args._2; - const tags = Stdlib__List.map((function (param) { - const match = param[0].pat_desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { + + } throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 39836, - 23 + 39913, + 21 ] }); - } - if (match.TAG === /* Tpat_variant */ 5) { - return match._0; - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 39836, - 23 - ] - }); - }), env); - const row = row_of_pat(p); - const make_other_pat = function (tag, $$const) { - const arg = $$const ? undefined : omega; - return make_pat({ - TAG: /* Tpat_variant */ 5, - _0: tag, - _1: arg, - _2: r - }, p.pat_type, p.pat_env); - }; - const match$1 = Stdlib__List.fold_left((function (others, param) { - const tag = param[0]; - if (Stdlib__List.mem(tag, tags)) { - return others; - } - const arg = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof arg === "number" || typeof arg === "string") { - return others; - } else if (arg.TAG === /* Rpresent */ 0) { + }), (function (i) { return { - hd: make_other_pat(tag, arg._0 === undefined), - tl: others + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_string */ 2, + _0: Caml_bytes.bytes_to_string(Stdlib__Bytes.make(i, /* '*' */42)), + _1: undefined + } }; - } else { + }), 0, (function (prim) { + return prim + 1 | 0; + }), p, env); + case /* Const_float */ 3 : + return build_other_constant((function (param) { + if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { + const f = param._0; + if (f.TAG === /* Const_float */ 3) { + return Caml_format.caml_float_of_string(f._0); + } + + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39919, + 21 + ] + }); + }), (function (f) { return { - hd: make_other_pat(tag, arg._0), - tl: others + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_float */ 3, + _0: Stdlib.string_of_float(f) + } }; - } - }), /* [] */ 0, row.row_fields); - if (match$1) { - return Stdlib__List.fold_left((function (p_res, pat) { - return make_pat({ - TAG: /* Tpat_or */ 8, - _0: pat, - _1: p_res, - _2: undefined - }, p.pat_type, p.pat_env); - }), match$1.hd, match$1.tl); - } else { - return make_other_pat("AnyExtraTag", true); - } - case /* Tpat_array */ 7 : - const all_lengths = Stdlib__List.map((function (param) { - const args = param[0].pat_desc; - if (/* tag */ typeof args === "number" || typeof args === "string") { + }), 0.0, (function (f) { + return f + 1.0; + }), p, env); + case /* Const_int32 */ 4 : + return build_other_constant((function (param) { + if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { + const i = param._0; + if (i.TAG === /* Const_int32 */ 4) { + return i._0; + } + + } throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 39928, - 15 + 39897, + 57 ] }); - } - if (args.TAG === /* Tpat_array */ 7) { - return Stdlib__List.length(args._0); - } + }), (function (i) { + return { + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_int32 */ 4, + _0: i + } + }; + }), 0, Stdlib__Int32.succ, p, env); + case /* Const_int64 */ 5 : + return build_other_constant((function (param) { + if (!/* tag */ (typeof param === "number" || typeof param === "string") && param.TAG === /* Tpat_constant */ 2) { + const i = param._0; + if (i.TAG === /* Const_int64 */ 5) { + return i._0; + } + + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39902, + 57 + ] + }); + }), (function (i) { + return { + TAG: /* Tpat_constant */ 2, + _0: { + TAG: /* Const_int64 */ 5, + _0: i + } + }; + }), Caml_int64.zero, Stdlib__Int64.succ, p, env); + case /* Const_nativeint */ 6 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39909, + 33 + ] + }); + + } + case /* Tpat_construct */ 4 : + let exit = 0; + const c = args._1; + switch (c.cstr_tag.TAG) { + case /* Cstr_constant */ 0 : + case /* Cstr_block */ 1 : + exit = 1; + break; + case /* Cstr_extension */ 2 : + const c_cstr_res = c.cstr_res; + const c_cstr_existentials = c.cstr_existentials; + const c_cstr_args = c.cstr_args; + const c_cstr_arity = c.cstr_arity; + const c_cstr_tag = c.cstr_tag; + const c_cstr_consts = c.cstr_consts; + const c_cstr_nonconsts = c.cstr_nonconsts; + const c_cstr_normal = c.cstr_normal; + const c_cstr_generalized = c.cstr_generalized; + const c_cstr_private = c.cstr_private; + const c_cstr_loc = c.cstr_loc; + const c_cstr_attributes = c.cstr_attributes; + const c$1 = { + cstr_name: "*extension*", + cstr_res: c_cstr_res, + cstr_existentials: c_cstr_existentials, + cstr_args: c_cstr_args, + cstr_arity: c_cstr_arity, + cstr_tag: c_cstr_tag, + cstr_consts: c_cstr_consts, + cstr_nonconsts: c_cstr_nonconsts, + cstr_normal: c_cstr_normal, + cstr_generalized: c_cstr_generalized, + cstr_private: c_cstr_private, + cstr_loc: c_cstr_loc, + cstr_attributes: c_cstr_attributes + }; + return make_pat({ + TAG: /* Tpat_construct */ 4, + _0: args._0, + _1: c$1, + _2: /* [] */ 0 + }, none$2, empty); + + } + if (exit === 1) { + let exit$1 = 0; + if (ext !== undefined) { + if (same(ext, get_type_path(p.pat_type, p.pat_env))) { + return extra_pat; + } + exit$1 = 2; + } else { + exit$1 = 2; + } + if (exit$1 === 2) { + const all_tags = Stdlib__List.map((function (param) { + let param$1 = param[0]; + const match = param$1.pat_desc; + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Tpat_construct */ 4) { + return fatal_error("Parmatch.get_tag"); + } else { + return match._1.cstr_tag; + } + }), env); + return pat_of_constrs(p, complete_constrs(p, all_tags)); + } + + } + break; + case /* Tpat_variant */ 5 : + const r = args._2; + const tags = Stdlib__List.map((function (param) { + const match = param[0].pat_desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39836, + 23 + ] + }); + } + if (match.TAG === /* Tpat_variant */ 5) { + return match._0; + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39836, + 23 + ] + }); + }), env); + const row = row_of_pat(p); + const make_other_pat = function (tag, $$const) { + const arg = $$const ? undefined : omega; + return make_pat({ + TAG: /* Tpat_variant */ 5, + _0: tag, + _1: arg, + _2: r + }, p.pat_type, p.pat_env); + }; + const match$1 = Stdlib__List.fold_left((function (others, param) { + const tag = param[0]; + if (Stdlib__List.mem(tag, tags)) { + return others; + } + const arg = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof arg === "number" || typeof arg === "string") { + return others; + } else if (arg.TAG === /* Rpresent */ 0) { + return { + hd: make_other_pat(tag, arg._0 === undefined), + tl: others + }; + } else { + return { + hd: make_other_pat(tag, arg._0), + tl: others + }; + } + }), /* [] */ 0, row.row_fields); + if (match$1) { + return Stdlib__List.fold_left((function (p_res, pat) { + return make_pat({ + TAG: /* Tpat_or */ 8, + _0: pat, + _1: p_res, + _2: undefined + }, p.pat_type, p.pat_env); + }), match$1.hd, match$1.tl); + } else { + return make_other_pat("AnyExtraTag", true); + } + case /* Tpat_array */ 7 : + const all_lengths = Stdlib__List.map((function (param) { + const args = param[0].pat_desc; + if (/* tag */ typeof args === "number" || typeof args === "string") { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ @@ -57751,19 +57739,31 @@ function build_other(ext, env) { 15 ] }); - }), env); - let _l = 0; - while (true) { - const l = _l; - if (!Stdlib__List.mem(l, all_lengths)) { - return make_pat({ - TAG: /* Tpat_array */ 7, - _0: omegas(l) - }, p.pat_type, p.pat_env); - } - _l = l + 1 | 0; - continue; - }; + } + if (args.TAG === /* Tpat_array */ 7) { + return Stdlib__List.length(args._0); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 39928, + 15 + ] + }); + }), env); + let _l = 0; + while (true) { + const l = _l; + if (!Stdlib__List.mem(l, all_lengths)) { + return make_pat({ + TAG: /* Tpat_array */ 7, + _0: omegas(l) + }, p.pat_type, p.pat_env); + } + _l = l + 1 | 0; + continue; + }; default: return omega; } @@ -57809,34 +57809,34 @@ function has_instance(_p) { } switch (p$1.TAG) { case /* Tpat_construct */ 4 : - return has_instances(p$1._2); + return has_instances(p$1._2); case /* Tpat_variant */ 5 : - const p$2 = p$1._1; - if (is_absent(p$1._0, p$1._2)) { - return false; - } - if (p$2 === undefined) { - return true; - } - _p = p$2; - continue; + const p$2 = p$1._1; + if (is_absent(p$1._0, p$1._2)) { + return false; + } + if (p$2 === undefined) { + return true; + } + _p = p$2; + continue; case /* Tpat_record */ 6 : - return has_instances(Stdlib__List.map((function (param) { - return param[2]; - }), p$1._0)); + return has_instances(Stdlib__List.map((function (param) { + return param[2]; + }), p$1._0)); case /* Tpat_tuple */ 3 : case /* Tpat_array */ 7 : - return has_instances(p$1._0); + return has_instances(p$1._0); case /* Tpat_or */ 8 : - if (has_instance(p$1._0)) { - return true; - } - _p = p$1._1; - continue; + if (has_instance(p$1._0)) { + return true; + } + _p = p$1._1; + continue; case /* Tpat_alias */ 1 : case /* Tpat_lazy */ 9 : - _p = p$1._0; - continue; + _p = p$1._0; + continue; default: return true; } @@ -57875,32 +57875,32 @@ function satisfiable(_pss, _qs) { } else { switch (match.TAG) { case /* Tpat_var */ 0 : - exit = 2; - break; + exit = 2; + break; case /* Tpat_alias */ 1 : - _qs = { - hd: match._0, - tl: qs.tl - }; - continue; + _qs = { + hd: match._0, + tl: qs.tl + }; + continue; case /* Tpat_variant */ 5 : - if (is_absent(match._0, match._2)) { - return false; - } - break; + if (is_absent(match._0, match._2)) { + return false; + } + break; case /* Tpat_or */ 8 : - const qs$1 = qs.tl; - if (satisfiable(pss, { - hd: match._0, - tl: qs$1 - })) { - return true; - } - _qs = { - hd: match._1, - tl: qs$1 - }; - continue; + const qs$1 = qs.tl; + if (satisfiable(pss, { + hd: match._0, + tl: qs$1 + })) { + return true; + } + _qs = { + hd: match._1, + tl: qs$1 + }; + continue; } } @@ -58331,13 +58331,13 @@ function or_args(_p) { } switch (match.TAG) { case /* Tpat_alias */ 1 : - _p = match._0; - continue; + _p = match._0; + continue; case /* Tpat_or */ 8 : - return [ - match._0, - match._1 - ]; + return [ + match._0, + match._1 + ]; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -58436,42 +58436,42 @@ function filter_one$1(q, rs) { if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { switch (match$1.TAG) { case /* Tpat_alias */ 1 : - _rs = { - hd: { - no_ors: r.no_ors, - ors: r.ors, - active: { - hd: match$1._0, - tl: match.tl - } - }, - tl: rem - }; - continue; + _rs = { + hd: { + no_ors: r.no_ors, + ors: r.ors, + active: { + hd: match$1._0, + tl: match.tl + } + }, + tl: rem + }; + continue; case /* Tpat_or */ 8 : - const ps = match.tl; - _rs = { + const ps = match.tl; + _rs = { + hd: { + no_ors: r.no_ors, + ors: r.ors, + active: { + hd: match$1._0, + tl: ps + } + }, + tl: { hd: { no_ors: r.no_ors, ors: r.ors, active: { - hd: match$1._0, + hd: match$1._1, tl: ps } }, - tl: { - hd: { - no_ors: r.no_ors, - ors: r.ors, - active: { - hd: match$1._1, - tl: ps - } - }, - tl: rem - } - }; - continue; + tl: rem + } + }; + continue; } } @@ -58579,46 +58579,46 @@ function every_satisfiables(_pss, _qs) { } else { switch (match$1.TAG) { case /* Tpat_var */ 0 : - exit = 2; - break; + exit = 2; + break; case /* Tpat_variant */ 5 : - if (is_absent(match$1._0, match$1._2)) { - return /* Unused */ 1; - } - exit = 1; - break; + if (is_absent(match$1._0, match$1._2)) { + return /* Unused */ 1; + } + exit = 1; + break; case /* Tpat_or */ 8 : - if (match$1._0.pat_loc.loc_ghost && match$1._1.pat_loc.loc_ghost) { - _qs = push_no_or(qs); - _pss = Stdlib__List.map(push_no_or, pss); - continue; - } - _qs = push_or(qs); - _pss = Stdlib__List.map(push_or, pss); + if (match$1._0.pat_loc.loc_ghost && match$1._1.pat_loc.loc_ghost) { + _qs = push_no_or(qs); + _pss = Stdlib__List.map(push_no_or, pss); continue; + } + _qs = push_or(qs); + _pss = Stdlib__List.map(push_or, pss); + continue; default: exit = 1; } } switch (exit) { case 1 : - const q0 = discr_pat$1(q, pss); - _qs = { - no_ors: qs.no_ors, - ors: qs.ors, - active: Stdlib.$at(simple_match_args(q0, q), match.tl) - }; - _pss = filter_one$1(q0, pss); - continue; + const q0 = discr_pat$1(q, pss); + _qs = { + no_ors: qs.no_ors, + ors: qs.ors, + active: Stdlib.$at(simple_match_args(q0, q), match.tl) + }; + _pss = filter_one$1(q0, pss); + continue; case 2 : - if (is_var_column(pss)) { - _qs = remove$1(qs); - _pss = Stdlib__List.map(remove$1, pss); - continue; - } - _qs = push_no_or(qs); - _pss = Stdlib__List.map(push_no_or, pss); + if (is_var_column(pss)) { + _qs = remove$1(qs); + _pss = Stdlib__List.map(remove$1, pss); continue; + } + _qs = push_no_or(qs); + _pss = Stdlib__List.map(push_no_or, pss); + continue; } } else { @@ -58779,137 +58779,137 @@ function le_pat(_p, _q) { } switch (match.TAG) { case /* Tpat_var */ 0 : - return true; + return true; case /* Tpat_alias */ 1 : - _p = match._0; - continue; + _p = match._0; + continue; case /* Tpat_constant */ 2 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_constant */ 2 : - return const_compare(match._0, match$1._0) === 0; - - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_constant */ 2 : + return const_compare(match._0, match$1._0) === 0; + } - break; + } + break; case /* Tpat_tuple */ 3 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_tuple */ 3 : - return le_pats(match._0, match$1._0); - - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_tuple */ 3 : + return le_pats(match._0, match$1._0); + } - break; + } + break; case /* Tpat_construct */ 4 : + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_construct */ 4 : + if (equal_tag(match._1.cstr_tag, match$1._1.cstr_tag)) { + return le_pats(match._2, match$1._2); + } else { + return false; + } + + } + } + break; + case /* Tpat_variant */ 5 : + const p1 = match._1; + const l1 = match._0; + if (p1 !== undefined) { if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { switch (match$1.TAG) { case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_construct */ 4 : - if (equal_tag(match._1.cstr_tag, match$1._1.cstr_tag)) { - return le_pats(match._2, match$1._2); - } else { - return false; - } + exit = 2; + break; + case /* Tpat_variant */ 5 : + const p2 = match$1._1; + if (p2 === undefined) { + return false; + } + if (l1 !== match$1._0) { + return false; + } + _q = p2; + _p = p1; + continue; } } - break; - case /* Tpat_variant */ 5 : - const p1 = match._1; - const l1 = match._0; - if (p1 !== undefined) { - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_variant */ 5 : - const p2 = match$1._1; - if (p2 === undefined) { - return false; - } - if (l1 !== match$1._0) { - return false; - } - _q = p2; - _p = p1; - continue; - + + } else if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_variant */ 5 : + if (match$1._1 !== undefined) { + return false; + } else { + return l1 === match$1._0; } - } - } else if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_variant */ 5 : - if (match$1._1 !== undefined) { - return false; - } else { - return l1 === match$1._0; - } - - } } - break; + } + break; case /* Tpat_record */ 6 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_record */ 6 : - const match$2 = records_args(match._0, match$1._0); - return le_pats(match$2[0], match$2[1]); - - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_record */ 6 : + const match$2 = records_args(match._0, match$1._0); + return le_pats(match$2[0], match$2[1]); + } - break; + } + break; case /* Tpat_array */ 7 : - const ps = match._0; - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_array */ 7 : - const qs = match$1._0; - if (Stdlib__List.length(ps) === Stdlib__List.length(qs)) { - return le_pats(ps, qs); - } else { - return false; - } - - } + const ps = match._0; + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_array */ 7 : + const qs = match$1._0; + if (Stdlib__List.length(ps) === Stdlib__List.length(qs)) { + return le_pats(ps, qs); + } else { + return false; + } + } - break; + } + break; case /* Tpat_or */ 8 : - exit = 2; - break; + exit = 2; + break; case /* Tpat_lazy */ 9 : - if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { - switch (match$1.TAG) { - case /* Tpat_alias */ 1 : - exit = 2; - break; - case /* Tpat_lazy */ 9 : - _q = match$1._0; - _p = match._0; - continue; - - } + if (!/* tag */ (typeof match$1 === "number" || typeof match$1 === "string")) { + switch (match$1.TAG) { + case /* Tpat_alias */ 1 : + exit = 2; + break; + case /* Tpat_lazy */ 9 : + _q = match$1._0; + _p = match._0; + continue; + } - break; + } + break; } if (exit === 2 && !/* tag */ (typeof match$1 === "number" || typeof match$1 === "string") && match$1.TAG === /* Tpat_alias */ 1) { @@ -59070,40 +59070,40 @@ function do_filter_one(q, pss) { if (!/* tag */ (typeof match$2 === "number" || typeof match$2 === "string")) { switch (match$2.TAG) { case /* Tpat_alias */ 1 : - _param = { - hd: [ - { - hd: match$2._0, - tl: match$1.tl - }, - match[1] - ], - tl: param.tl - }; - continue; + _param = { + hd: [ + { + hd: match$2._0, + tl: match$1.tl + }, + match[1] + ], + tl: param.tl + }; + continue; case /* Tpat_or */ 8 : - const loc = match[1]; - const ps = match$1.tl; - _param = { + const loc = match[1]; + const ps = match$1.tl; + _param = { + hd: [ + { + hd: match$2._0, + tl: ps + }, + loc + ], + tl: { hd: [ { - hd: match$2._0, + hd: match$2._1, tl: ps }, loc ], - tl: { - hd: [ - { - hd: match$2._1, - tl: ps - }, - loc - ], - tl: param.tl - } - }; - continue; + tl: param.tl + } + }; + continue; } } @@ -59255,134 +59255,134 @@ function conv(typed) { } switch (lst.TAG) { case /* Tpat_alias */ 1 : - _pat = lst._0; - continue; + _pat = lst._0; + continue; case /* Tpat_tuple */ 3 : - const results = select(Stdlib__List.map(loop, lst._0)); + const results = select(Stdlib__List.map(loop, lst._0)); + return Stdlib__List.map((function (lst) { + return mk$1(undefined, undefined, { + TAG: /* Ppat_tuple */ 4, + _0: lst + }); + }), results); + case /* Tpat_construct */ 4 : + const lst$1 = lst._2; + const cstr = lst._1; + const id = fresh(cstr.cstr_name); + const lid_txt = { + TAG: /* Lident */ 0, + _0: id + }; + const lid_loc = lst._0.loc; + const lid = { + txt: lid_txt, + loc: lid_loc + }; + Stdlib__Hashtbl.add(constrs, id, cstr); + const results$1 = select(Stdlib__List.map(loop, lst$1)); + if (lst$1) { return Stdlib__List.map((function (lst) { + let arg; + if (lst) { + arg = lst.tl ? mk$1(undefined, undefined, { + TAG: /* Ppat_tuple */ 4, + _0: lst + }) : lst.hd; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 40764, + 28 + ] + }); + } return mk$1(undefined, undefined, { - TAG: /* Ppat_tuple */ 4, - _0: lst + TAG: /* Ppat_construct */ 5, + _0: lid, + _1: arg }); - }), results); - case /* Tpat_construct */ 4 : - const lst$1 = lst._2; - const cstr = lst._1; - const id = fresh(cstr.cstr_name); - const lid_txt = { - TAG: /* Lident */ 0, - _0: id - }; - const lid_loc = lst._0.loc; - const lid = { - txt: lid_txt, - loc: lid_loc + }), results$1); + } else { + return { + hd: mk$1(undefined, undefined, { + TAG: /* Ppat_construct */ 5, + _0: lid, + _1: undefined + }), + tl: /* [] */ 0 }; - Stdlib__Hashtbl.add(constrs, id, cstr); - const results$1 = select(Stdlib__List.map(loop, lst$1)); - if (lst$1) { - return Stdlib__List.map((function (lst) { - let arg; - if (lst) { - arg = lst.tl ? mk$1(undefined, undefined, { - TAG: /* Ppat_tuple */ 4, - _0: lst - }) : lst.hd; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 40764, - 28 - ] - }); - } - return mk$1(undefined, undefined, { - TAG: /* Ppat_construct */ 5, - _0: lid, - _1: arg - }); - }), results$1); - } else { - return { - hd: mk$1(undefined, undefined, { - TAG: /* Ppat_construct */ 5, - _0: lid, - _1: undefined - }), - tl: /* [] */ 0 - }; - } + } case /* Tpat_variant */ 5 : - const p_opt = lst._1; - const label = lst._0; - if (p_opt === undefined) { - return { - hd: mk$1(undefined, undefined, { + const p_opt = lst._1; + const label = lst._0; + if (p_opt === undefined) { + return { + hd: mk$1(undefined, undefined, { + TAG: /* Ppat_variant */ 6, + _0: label, + _1: undefined + }), + tl: /* [] */ 0 + }; + } + const results$2 = loop(p_opt); + return Stdlib__List.map((function (p) { + return mk$1(undefined, undefined, { TAG: /* Ppat_variant */ 6, _0: label, - _1: undefined - }), - tl: /* [] */ 0 - }; - } - const results$2 = loop(p_opt); - return Stdlib__List.map((function (p) { - return mk$1(undefined, undefined, { - TAG: /* Ppat_variant */ 6, - _0: label, - _1: p - }); - }), results$2); + _1: p + }); + }), results$2); case /* Tpat_record */ 6 : - const subpatterns = lst._0; - const pats = select(Stdlib__List.map((function (param) { - return loop(param[2]); - }), subpatterns)); - const label_idents = Stdlib__List.map((function (param) { - const lbl = param[1]; - const id = fresh(lbl.lbl_name); - Stdlib__Hashtbl.add(labels, id, lbl); - return { - TAG: /* Lident */ 0, - _0: id - }; - }), subpatterns); - return Stdlib__List.map((function (lst) { - const lst$1 = Stdlib__List.map2((function (lid, pat) { - return [ - { - txt: lid, - loc: none - }, - pat - ]; - }), label_idents, lst); - return mk$1(undefined, undefined, { - TAG: /* Ppat_record */ 7, - _0: lst$1, - _1: /* Open */ 1 - }); - }), pats); + const subpatterns = lst._0; + const pats = select(Stdlib__List.map((function (param) { + return loop(param[2]); + }), subpatterns)); + const label_idents = Stdlib__List.map((function (param) { + const lbl = param[1]; + const id = fresh(lbl.lbl_name); + Stdlib__Hashtbl.add(labels, id, lbl); + return { + TAG: /* Lident */ 0, + _0: id + }; + }), subpatterns); + return Stdlib__List.map((function (lst) { + const lst$1 = Stdlib__List.map2((function (lid, pat) { + return [ + { + txt: lid, + loc: none + }, + pat + ]; + }), label_idents, lst); + return mk$1(undefined, undefined, { + TAG: /* Ppat_record */ 7, + _0: lst$1, + _1: /* Open */ 1 + }); + }), pats); case /* Tpat_array */ 7 : - const results$3 = select(Stdlib__List.map(loop, lst._0)); - return Stdlib__List.map((function (lst) { - return mk$1(undefined, undefined, { - TAG: /* Ppat_array */ 8, - _0: lst - }); - }), results$3); + const results$3 = select(Stdlib__List.map(loop, lst._0)); + return Stdlib__List.map((function (lst) { + return mk$1(undefined, undefined, { + TAG: /* Ppat_array */ 8, + _0: lst + }); + }), results$3); case /* Tpat_or */ 8 : - return Stdlib.$at(loop(lst._0), loop(lst._1)); + return Stdlib.$at(loop(lst._0), loop(lst._1)); case /* Tpat_lazy */ 9 : - const results$4 = loop(lst._0); - return Stdlib__List.map((function (p) { - return mk$1(undefined, undefined, { - TAG: /* Ppat_lazy */ 12, - _0: p - }); - }), results$4); + const results$4 = loop(lst._0); + return Stdlib__List.map((function (p) { + return mk$1(undefined, undefined, { + TAG: /* Ppat_lazy */ 12, + _0: p + }); + }), results$4); default: return { hd: mk$1(undefined, undefined, /* Ppat_any */ 0), @@ -59494,38 +59494,38 @@ function collect_paths_from_pat(_r, _p) { } switch (p$1.TAG) { case /* Tpat_construct */ 4 : - switch (p$1._1.cstr_tag.TAG) { - case /* Cstr_constant */ 0 : - case /* Cstr_block */ 1 : - break; - case /* Cstr_extension */ 2 : - return Stdlib__List.fold_left(collect_paths_from_pat, r, p$1._2); - - } - const path = get_type_path(p.pat_type, p.pat_env); - return Stdlib__List.fold_left(collect_paths_from_pat, extendable_path(path) ? add_path(path, r) : r, p$1._2); + switch (p$1._1.cstr_tag.TAG) { + case /* Cstr_constant */ 0 : + case /* Cstr_block */ 1 : + break; + case /* Cstr_extension */ 2 : + return Stdlib__List.fold_left(collect_paths_from_pat, r, p$1._2); + + } + const path = get_type_path(p.pat_type, p.pat_env); + return Stdlib__List.fold_left(collect_paths_from_pat, extendable_path(path) ? add_path(path, r) : r, p$1._2); case /* Tpat_variant */ 5 : - const p$2 = p$1._1; - if (p$2 === undefined) { - return r; - } - _p = p$2; - continue; + const p$2 = p$1._1; + if (p$2 === undefined) { + return r; + } + _p = p$2; + continue; case /* Tpat_record */ 6 : - return Stdlib__List.fold_left((function (r, param) { - return collect_paths_from_pat(r, param[2]); - }), r, p$1._0); + return Stdlib__List.fold_left((function (r, param) { + return collect_paths_from_pat(r, param[2]); + }), r, p$1._0); case /* Tpat_tuple */ 3 : case /* Tpat_array */ 7 : - return Stdlib__List.fold_left(collect_paths_from_pat, r, p$1._0); + return Stdlib__List.fold_left(collect_paths_from_pat, r, p$1._0); case /* Tpat_or */ 8 : - _p = p$1._1; - _r = collect_paths_from_pat(r, p$1._0); - continue; + _p = p$1._1; + _r = collect_paths_from_pat(r, p$1._0); + continue; case /* Tpat_alias */ 1 : case /* Tpat_lazy */ 9 : - _p = p$1._0; - continue; + _p = p$1._0; + continue; default: return r; } @@ -59595,28 +59595,28 @@ const Error_forward = /* @__PURE__ */ Caml_exceptions.create("Ocaml_typedtree_te function string_of_payload(param) { switch (param.TAG) { case /* PStr */ 0 : - const match = param._0; - if (!match) { - return; - } - const match$1 = match.hd.pstr_desc; - if (match$1.TAG !== /* Pstr_eval */ 0) { - return; - } - const c = match$1._0.pexp_desc; - if (c.TAG === /* Pexp_constant */ 1 && !match.tl) { - let param$1 = c._0; - if (param$1.TAG === /* Const_string */ 2) { - return param$1._0; - } else { - return; - } + const match = param._0; + if (!match) { + return; + } + const match$1 = match.hd.pstr_desc; + if (match$1.TAG !== /* Pstr_eval */ 0) { + return; + } + const c = match$1._0.pexp_desc; + if (c.TAG === /* Pexp_constant */ 1 && !match.tl) { + let param$1 = c._0; + if (param$1.TAG === /* Const_string */ 2) { + return param$1._0; } else { return; } + } else { + return; + } case /* PTyp */ 1 : case /* PPat */ 2 : - return; + return; } } @@ -59628,8 +59628,8 @@ function error_of_extension(ext) { switch (txt) { case "error" : case "ocaml.error" : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(errorf(match.loc, undefined, undefined, { TAG: /* Format */ 0, @@ -59688,43 +59688,40 @@ function error_of_extension(ext) { let exit$1 = 0; switch (p.TAG) { case /* PStr */ 0 : - const match$1 = p._0; - if (match$1) { - const match$2 = match$1.hd.pstr_desc; - if (match$2.TAG === /* Pstr_eval */ 0) { - const match$3 = match$2._0.pexp_desc; - if (match$3.TAG === /* Pexp_constant */ 1) { - const match$4 = match$3._0; - if (match$4.TAG === /* Const_string */ 2) { - const msg = match$4._0; - let exit$2 = 0; - const match$5 = match$1.tl; - if (match$5) { - const match$6 = match$5.hd.pstr_desc; - if (match$6.TAG === /* Pstr_eval */ 0) { - const match$7 = match$6._0.pexp_desc; - if (match$7.TAG === /* Pexp_constant */ 1) { - const match$8 = match$7._0; - if (match$8.TAG === /* Const_string */ 2) { - return error(loc, sub_from(match$5.tl), match$8._0, msg); - } - exit$2 = 3; - } else { - exit$2 = 3; + const match$1 = p._0; + if (match$1) { + const match$2 = match$1.hd.pstr_desc; + if (match$2.TAG === /* Pstr_eval */ 0) { + const match$3 = match$2._0.pexp_desc; + if (match$3.TAG === /* Pexp_constant */ 1) { + const match$4 = match$3._0; + if (match$4.TAG === /* Const_string */ 2) { + const msg = match$4._0; + let exit$2 = 0; + const match$5 = match$1.tl; + if (match$5) { + const match$6 = match$5.hd.pstr_desc; + if (match$6.TAG === /* Pstr_eval */ 0) { + const match$7 = match$6._0.pexp_desc; + if (match$7.TAG === /* Pexp_constant */ 1) { + const match$8 = match$7._0; + if (match$8.TAG === /* Const_string */ 2) { + return error(loc, sub_from(match$5.tl), match$8._0, msg); } + exit$2 = 3; } else { exit$2 = 3; } } else { exit$2 = 3; } - if (exit$2 === 3) { - return error(loc, sub_from(match$1.tl), undefined, msg); - } - } else { - exit$1 = 2; + exit$2 = 3; } + if (exit$2 === 3) { + return error(loc, sub_from(match$1.tl), undefined, msg); + } + } else { exit$1 = 2; } @@ -59734,11 +59731,14 @@ function error_of_extension(ext) { } else { exit$1 = 2; } - break; + } else { + exit$1 = 2; + } + break; case /* PTyp */ 1 : case /* PPat */ 2 : - exit$1 = 2; - break; + exit$1 = 2; + break; } if (exit$1 === 2) { @@ -59770,7 +59770,7 @@ function check_deprecated(loc, attrs, s) { switch (param[0].txt) { case "deprecated" : case "ocaml.deprecated" : - break; + break; default: return; } @@ -59803,42 +59803,42 @@ newrecord$1.attribute = (function (param, a) { switch (a[0].txt) { case "ocaml.ppwarning" : case "ppwarning" : - exit = 1; - break; + exit = 1; + break; } if (exit === 1) { const match = a[1]; switch (match.TAG) { case /* PStr */ 0 : - const match$1 = match._0; - if (match$1) { - const match$2 = match$1.hd; - const match$3 = match$2.pstr_desc; - if (match$3.TAG === /* Pstr_eval */ 0) { - const match$4 = match$3._0.pexp_desc; - if (match$4.TAG === /* Pexp_constant */ 1) { - const match$5 = match$4._0; - if (match$5.TAG === /* Const_string */ 2) { - if (match$1.tl) { - - } else { - prerr_warning(match$2.pstr_loc, { - TAG: /* Preprocessor */ 10, - _0: match$5._0 - }); - } + const match$1 = match._0; + if (match$1) { + const match$2 = match$1.hd; + const match$3 = match$2.pstr_desc; + if (match$3.TAG === /* Pstr_eval */ 0) { + const match$4 = match$3._0.pexp_desc; + if (match$4.TAG === /* Pexp_constant */ 1) { + const match$5 = match$4._0; + if (match$5.TAG === /* Const_string */ 2) { + if (match$1.tl) { + + } else { + prerr_warning(match$2.pstr_loc, { + TAG: /* Preprocessor */ 10, + _0: match$5._0 + }); } - } } } - break; + + } + break; case /* PTyp */ 1 : case /* PPat */ 2 : - break; + break; } } @@ -59905,20 +59905,20 @@ function warning_attribute(attrs) { switch (txt) { case "ocaml.warnerror" : case "warnerror" : - exit = 2; - break; + exit = 2; + break; case "ocaml.warning" : case "warning" : - exit = 1; - break; + exit = 1; + break; default: return; } switch (exit) { case 1 : - return $$process(match.loc, txt, false, param[1]); + return $$process(match.loc, txt, false, param[1]); case 2 : - return $$process(match.loc, txt, true, param[1]); + return $$process(match.loc, txt, true, param[1]); } }), attrs); @@ -59953,36 +59953,36 @@ function narrow_unbound_lid_error(env, loc, lid, make_error) { }; switch (lid.TAG) { case /* Lident */ 0 : - break; + break; case /* Ldot */ 1 : - const mlid = lid._0; - check_module(mlid); - const md = find_module(false, lookup_module(true, mlid, env), env); - const match = scrape_alias(env, undefined, md.md_type); - if (match.TAG === /* Mty_functor */ 2) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: loc, - _2: env, - _3: { - TAG: /* Access_functor_as_structure */ 25, - _0: mlid - } - }); - } - break; - case /* Lapply */ 2 : - check_module(lid._0); - check_module(lid._1); + const mlid = lid._0; + check_module(mlid); + const md = find_module(false, lookup_module(true, mlid, env), env); + const match = scrape_alias(env, undefined, md.md_type); + if (match.TAG === /* Mty_functor */ 2) { throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, _1: loc, _2: env, _3: { - TAG: /* Ill_typed_functor_application */ 24, - _0: lid + TAG: /* Access_functor_as_structure */ 25, + _0: mlid } }); + } + break; + case /* Lapply */ 2 : + check_module(lid._0); + check_module(lid._1); + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: loc, + _2: env, + _3: { + TAG: /* Ill_typed_functor_application */ 24, + _0: lid + } + }); } throw new Caml_js_exceptions.MelangeError($$Error$6, { @@ -59997,25 +59997,25 @@ function find_component(lookup, make_error, env, loc, lid) { try { switch (lid.TAG) { case /* Ldot */ 1 : - const match = lid._0; - switch (match.TAG) { - case /* Lident */ 0 : - if (match._0 === "*predef*") { - return Curry._2(lookup, { - TAG: /* Lident */ 0, - _0: lid._1 - }, initial_safe_string); - } else { - return Curry._2(lookup, lid, env); - } - case /* Ldot */ 1 : - case /* Lapply */ 2 : - return Curry._2(lookup, lid, env); - - } + const match = lid._0; + switch (match.TAG) { + case /* Lident */ 0 : + if (match._0 === "*predef*") { + return Curry._2(lookup, { + TAG: /* Lident */ 0, + _0: lid._1 + }, initial_safe_string); + } else { + return Curry._2(lookup, lid, env); + } + case /* Ldot */ 1 : + case /* Lapply */ 2 : + return Curry._2(lookup, lid, env); + + } case /* Lident */ 0 : case /* Lapply */ 2 : - return Curry._2(lookup, lid, env); + return Curry._2(lookup, lid, env); } } @@ -60421,349 +60421,442 @@ function transl_type(env, policy, styp) { } switch (name.TAG) { case /* Ptyp_var */ 0 : - const name$1 = name._0; - if (name$1 !== "" && Caml_string.get(name$1, 0) === /* '_' */95) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, - _2: env, - _3: { - TAG: /* Invalid_variable_name */ 13, - _0: "'" + name$1 - } - }); - } - let ty$1; - try { - ty$1 = instance(undefined, env, Stdlib__List.assoc(name$1, univars.contents)); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - try { - ty$1 = instance(undefined, env, find$2(name$1, used_variables.contents)[0]); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - const v = policy === /* Univars */ 2 ? new_pre_univar(name$1, undefined) : newvar(validate_name(name$1), undefined); - used_variables.contents = add$5(name$1, [ - v, - styp.ptyp_loc - ], used_variables.contents); - ty$1 = v; - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + const name$1 = name._0; + if (name$1 !== "" && Caml_string.get(name$1, 0) === /* '_' */95) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Invalid_variable_name */ 13, + _0: "'" + name$1 } + }); + } + let ty$1; + try { + ty$1 = instance(undefined, env, Stdlib__List.assoc(name$1, univars.contents)); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + try { + ty$1 = instance(undefined, env, find$2(name$1, used_variables.contents)[0]); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + const v = policy === /* Univars */ 2 ? new_pre_univar(name$1, undefined) : newvar(validate_name(name$1), undefined); + used_variables.contents = add$5(name$1, [ + v, + styp.ptyp_loc + ], used_variables.contents); + ty$1 = v; + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - return ctyp({ - TAG: /* Ttyp_var */ 0, - _0: name$1 - }, ty$1); + } + return ctyp({ + TAG: /* Ttyp_var */ 0, + _0: name$1 + }, ty$1); case /* Ptyp_arrow */ 1 : - const l = name._0; - const cty1 = transl_type(env, policy, name._1); - const cty2 = transl_type(env, policy, name._2); - const ty$2 = newty2(current_level.contents, { - TAG: /* Tarrow */ 1, - _0: l, - _1: cty1.ctyp_type, - _2: cty2.ctyp_type, - _3: /* Cok */ 0 - }); - return ctyp({ - TAG: /* Ttyp_arrow */ 1, - _0: l, - _1: cty1, - _2: cty2 - }, ty$2); + const l = name._0; + const cty1 = transl_type(env, policy, name._1); + const cty2 = transl_type(env, policy, name._2); + const ty$2 = newty2(current_level.contents, { + TAG: /* Tarrow */ 1, + _0: l, + _1: cty1.ctyp_type, + _2: cty2.ctyp_type, + _3: /* Cok */ 0 + }); + return ctyp({ + TAG: /* Ttyp_arrow */ 1, + _0: l, + _1: cty1, + _2: cty2 + }, ty$2); case /* Ptyp_tuple */ 2 : - const stl = name._0; - if (Stdlib__List.length(stl) < 2) { - ill_formed_ast(loc, "Tuples must have at least 2 components."); - } - const ctys = Stdlib__List.map((function (param) { - return transl_type(env, policy, param); - }), stl); - const desc = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (ctyp) { - return ctyp.ctyp_type; - }), ctys) - }; - const ty$3 = newty2(current_level.contents, desc); - return ctyp({ - TAG: /* Ttyp_tuple */ 2, - _0: ctys - }, ty$3); + const stl = name._0; + if (Stdlib__List.length(stl) < 2) { + ill_formed_ast(loc, "Tuples must have at least 2 components."); + } + const ctys = Stdlib__List.map((function (param) { + return transl_type(env, policy, param); + }), stl); + const desc = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (ctyp) { + return ctyp.ctyp_type; + }), ctys) + }; + const ty$3 = newty2(current_level.contents, desc); + return ctyp({ + TAG: /* Ttyp_tuple */ 2, + _0: ctys + }, ty$3); case /* Ptyp_constr */ 3 : - const stl$1 = name._1; - const lid = name._0; - const match = find_type(env, styp.ptyp_loc, lid.txt); - const decl = match[1]; - const path = match[0]; - let stl$2; - if (stl$1) { - const t = stl$1.hd; - let tmp = t.ptyp_desc; - stl$2 = /* tag */ (typeof tmp === "number" || typeof tmp === "string") && !(stl$1.tl || decl.type_arity <= 1) ? Stdlib__List.map((function (param) { - return t; - }), decl.type_params) : stl$1; - } else { - stl$2 = stl$1; - } - if (Stdlib__List.length(stl$2) !== decl.type_arity) { + const stl$1 = name._1; + const lid = name._0; + const match = find_type(env, styp.ptyp_loc, lid.txt); + const decl = match[1]; + const path = match[0]; + let stl$2; + if (stl$1) { + const t = stl$1.hd; + let tmp = t.ptyp_desc; + stl$2 = /* tag */ (typeof tmp === "number" || typeof tmp === "string") && !(stl$1.tl || decl.type_arity <= 1) ? Stdlib__List.map((function (param) { + return t; + }), decl.type_params) : stl$1; + } else { + stl$2 = stl$1; + } + if (Stdlib__List.length(stl$2) !== decl.type_arity) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Type_arity_mismatch */ 3, + _0: lid.txt, + _1: decl.type_arity, + _2: Stdlib__List.length(stl$2) + } + }); + } + const args = Stdlib__List.map((function (param) { + return transl_type(env, policy, param); + }), stl$2); + const params = instance_list(empty, decl.type_params); + const ty$4 = decl.type_manifest; + const unify_param = ty$4 !== undefined && repr(ty$4).level !== 100000000 ? unify$2 : unify_var; + Stdlib__List.iter2((function (param, ty$p) { + try { + return Curry._3(unify_param, env, ty$p, param[1].ctyp_type); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: param[0].ptyp_loc, + _2: env, + _3: { + TAG: /* Type_mismatch */ 6, + _0: swap_list(trace._1) + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + }), Stdlib__List.combine(stl$2, args), params); + const constr = newconstr(path, Stdlib__List.map((function (ctyp) { + return ctyp.ctyp_type; + }), args)); + try { + enforce_constraints(env, constr); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, _1: styp.ptyp_loc, _2: env, _3: { - TAG: /* Type_arity_mismatch */ 3, - _0: lid.txt, - _1: decl.type_arity, - _2: Stdlib__List.length(stl$2) + TAG: /* Type_mismatch */ 6, + _0: trace._1 } }); } - const args = Stdlib__List.map((function (param) { - return transl_type(env, policy, param); - }), stl$2); - const params = instance_list(empty, decl.type_params); - const ty$4 = decl.type_manifest; - const unify_param = ty$4 !== undefined && repr(ty$4).level !== 100000000 ? unify$2 : unify_var; - Stdlib__List.iter2((function (param, ty$p) { - try { - return Curry._3(unify_param, env, ty$p, param[1].ctyp_type); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: param[0].ptyp_loc, - _2: env, - _3: { - TAG: /* Type_mismatch */ 6, - _0: swap_list(trace._1) - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), Stdlib__List.combine(stl$2, args), params); - const constr = newconstr(path, Stdlib__List.map((function (ctyp) { - return ctyp.ctyp_type; - }), args)); - try { - enforce_constraints(env, constr); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, - _2: env, - _3: { - TAG: /* Type_mismatch */ 6, - _0: trace._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - return ctyp({ - TAG: /* Ttyp_constr */ 3, - _0: path, - _1: lid, - _2: args - }, constr); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + return ctyp({ + TAG: /* Ttyp_constr */ 3, + _0: path, + _1: lid, + _2: args + }, constr); case /* Ptyp_object */ 4 : - const o = name._1; - const fields = Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - transl_poly_type(env, policy, param[2]) - ]; - }), name._0); - const ty$5 = newobj(transl_fields(loc, env, policy, /* [] */ 0, o, fields)); - return ctyp({ - TAG: /* Ttyp_object */ 4, - _0: fields, - _1: o - }, ty$5); + const o = name._1; + const fields = Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + transl_poly_type(env, policy, param[2]) + ]; + }), name._0); + const ty$5 = newobj(transl_fields(loc, env, policy, /* [] */ 0, o, fields)); + return ctyp({ + TAG: /* Ttyp_object */ 4, + _0: fields, + _1: o + }, ty$5); case /* Ptyp_class */ 5 : - const stl$3 = name._1; - const lid$1 = name._0; - let match$1; - try { - const match$2 = lookup_type$1(lid$1.txt, env); - const decl$1 = match$2[1]; - const check = function (_decl) { - while (true) { - const decl = _decl; - const ty = decl.type_manifest; - if (ty !== undefined) { - const row = repr(ty).desc; - if (/* tag */ typeof row === "number" || typeof row === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - switch (row.TAG) { - case /* Tconstr */ 3 : - _decl = find_type_full(row._0, env)[0]; - continue; - case /* Tvariant */ 8 : - if (static_row(row._0)) { - return; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - default: - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - } else { + const stl$3 = name._1; + const lid$1 = name._0; + let match$1; + try { + const match$2 = lookup_type$1(lid$1.txt, env); + const decl$1 = match$2[1]; + const check = function (_decl) { + while (true) { + const decl = _decl; + const ty = decl.type_manifest; + if (ty !== undefined) { + const row = repr(ty).desc; + if (/* tag */ typeof row === "number" || typeof row === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - }; + switch (row.TAG) { + case /* Tconstr */ 3 : + _decl = find_type_full(row._0, env)[0]; + continue; + case /* Tvariant */ 8 : + if (static_row(row._0)) { + return; + } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + default: + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } }; - check(decl$1); - prerr_warning(styp.ptyp_loc, { - TAG: /* Deprecated */ 0, - _0: "old syntax for polymorphic variant type" - }); - match$1 = [ - match$2[0], - decl$1, - true - ]; + }; + check(decl$1); + prerr_warning(styp.ptyp_loc, { + TAG: /* Deprecated */ 0, + _0: "old syntax for polymorphic variant type" + }); + match$1 = [ + match$2[0], + decl$1, + true + ]; + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { + try { + const s = lid$1.txt; + let lid2; + switch (s.TAG) { + case /* Lident */ 0 : + lid2 = { + TAG: /* Lident */ 0, + _0: "#" + s._0 + }; + break; + case /* Ldot */ 1 : + lid2 = { + TAG: /* Ldot */ 1, + _0: s._0, + _1: "#" + s._1 + }; + break; + case /* Lapply */ 2 : + lid2 = fatal_error("Typetexp.transl_type"); + break; + + } + const match$3 = lookup_type$1(lid2, env); + match$1 = [ + match$3[0], + match$3[1], + false + ]; + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { + find_class$1(env, styp.ptyp_loc, lid$1.txt); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 41701, + 57 + ] + }); + } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } + } else { + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Not_found) { - try { - const s = lid$1.txt; - let lid2; - switch (s.TAG) { - case /* Lident */ 0 : - lid2 = { - TAG: /* Lident */ 0, - _0: "#" + s._0 - }; - break; - case /* Ldot */ 1 : - lid2 = { - TAG: /* Ldot */ 1, - _0: s._0, - _1: "#" + s._1 - }; - break; - case /* Lapply */ 2 : - lid2 = fatal_error("Typetexp.transl_type"); - break; - + } + const decl$2 = match$1[1]; + const path$1 = match$1[0]; + if (Stdlib__List.length(stl$3) !== decl$2.type_arity) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Type_arity_mismatch */ 3, + _0: lid$1.txt, + _1: decl$2.type_arity, + _2: Stdlib__List.length(stl$3) } - const match$3 = lookup_type$1(lid2, env); - match$1 = [ - match$3[0], - match$3[1], - false - ]; + }); + } + const args$1 = Stdlib__List.map((function (param) { + return transl_type(env, policy, param); + }), stl$3); + const params$1 = instance_list(empty, decl$2.type_params); + Stdlib__List.iter2((function (param, ty$p) { + try { + return unify_var(env, ty$p, param[1].ctyp_type); } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Not_found) { - find_class$1(env, styp.ptyp_loc, lid$1.txt); - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 41701, - 57 - ] + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: param[0].ptyp_loc, + _2: env, + _3: { + TAG: /* Type_mismatch */ 6, + _0: swap_list(trace._1) + } }); } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); } - } else { - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - } - const decl$2 = match$1[1]; - const path$1 = match$1[0]; - if (Stdlib__List.length(stl$3) !== decl$2.type_arity) { + }), Stdlib__List.combine(stl$3, args$1), params$1); + const ty_args = Stdlib__List.map((function (ctyp) { + return ctyp.ctyp_type; + }), args$1); + let ty$6; + try { + ty$6 = expand_head(env, newconstr(path$1, ty_args)); + } + catch (raw_trace$1){ + const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace$1); + if (trace$1.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, _1: styp.ptyp_loc, _2: env, _3: { - TAG: /* Type_arity_mismatch */ 3, - _0: lid$1.txt, - _1: decl$2.type_arity, - _2: Stdlib__List.length(stl$3) + TAG: /* Type_mismatch */ 6, + _0: trace$1._1 } }); } - const args$1 = Stdlib__List.map((function (param) { - return transl_type(env, policy, param); - }), stl$3); - const params$1 = instance_list(empty, decl$2.type_params); - Stdlib__List.iter2((function (param, ty$p) { - try { - return unify_var(env, ty$p, param[1].ctyp_type); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: param[0].ptyp_loc, - _2: env, - _3: { - TAG: /* Type_mismatch */ 6, - _0: swap_list(trace._1) - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - }), Stdlib__List.combine(stl$3, args$1), params$1); - const ty_args = Stdlib__List.map((function (ctyp) { - return ctyp.ctyp_type; - }), args$1); - let ty$6; - try { - ty$6 = expand_head(env, newconstr(path$1, ty_args)); - } - catch (raw_trace$1){ - const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace$1); - if (trace$1.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, - _2: env, - _3: { - TAG: /* Type_mismatch */ 6, - _0: trace$1._1 - } - }); + throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + } + const row = ty$6.desc; + let ty$7; + if (/* tag */ typeof row === "number" || typeof row === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 41749, + 10 + ] + }); + } + switch (row.TAG) { + case /* Tobject */ 4 : + const match$4 = flatten_fields(row._0); + if (policy === /* Univars */ 2) { + pre_univars.contents = { + hd: match$4[1], + tl: pre_univars.contents + }; } - throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); - } - const row = ty$6.desc; - let ty$7; - if (/* tag */ typeof row === "number" || typeof row === "string") { + ty$7 = ty$6; + break; + case /* Tvariant */ 8 : + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const fields$1 = Stdlib__List.map((function (param) { + const f = param[1]; + const match = row_field_repr_aux(/* [] */ 0, f); + let tmp; + if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { + tmp = f; + } else { + const ty = match._0; + tmp = ty !== undefined ? ({ + TAG: /* Reither */ 1, + _0: false, + _1: { + hd: ty, + tl: /* [] */ 0 + }, + _2: false, + _3: { + contents: undefined + } + }) : ({ + TAG: /* Reither */ 1, + _0: true, + _1: /* [] */ 0, + _2: false, + _3: { + contents: undefined + } + }); + } + return [ + param[0], + tmp + ]; + }), row$1.row_fields); + const row_row_more = newvar(validate_name(undefined), undefined); + const row_row_name = [ + path$1, + ty_args + ]; + const row$2 = { + row_fields: fields$1, + row_more: row_row_more, + row_bound: undefined, + row_closed: true, + row_fixed: false, + row_name: row_row_name + }; + const $$static = static_row(row$2); + const row$3 = $$static ? ({ + row_fields: fields$1, + row_more: newty2(current_level.contents, /* Tnil */ 0), + row_bound: undefined, + row_closed: true, + row_fixed: false, + row_name: row_row_name + }) : ( + policy !== /* Univars */ 2 ? row$2 : ({ + row_fields: fields$1, + row_more: new_pre_univar(undefined, undefined), + row_bound: undefined, + row_closed: true, + row_fixed: false, + row_name: row_row_name + }) + ); + ty$7 = newty2(current_level.contents, { + TAG: /* Tvariant */ 8, + _0: row$3 + }); + break; + default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ @@ -60772,661 +60865,568 @@ function transl_type(env, policy, styp) { 10 ] }); + } + return ctyp({ + TAG: /* Ttyp_class */ 5, + _0: path$1, + _1: lid$1, + _2: args$1 + }, ty$7); + case /* Ptyp_alias */ 6 : + const alias = name._1; + const st = name._0; + let cty; + try { + let t$1; + try { + t$1 = Stdlib__List.assoc(alias, univars.contents); } - switch (row.TAG) { - case /* Tobject */ 4 : - const match$4 = flatten_fields(row._0); - if (policy === /* Univars */ 2) { - pre_univars.contents = { - hd: match$4[1], - tl: pre_univars.contents - }; - } - ty$7 = ty$6; - break; - case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const fields$1 = Stdlib__List.map((function (param) { - const f = param[1]; - const match = row_field_repr_aux(/* [] */ 0, f); - let tmp; - if (/* tag */ typeof match === "number" || typeof match === "string" || match.TAG !== /* Rpresent */ 0) { - tmp = f; - } else { - const ty = match._0; - tmp = ty !== undefined ? ({ - TAG: /* Reither */ 1, - _0: false, - _1: { - hd: ty, - tl: /* [] */ 0 - }, - _2: false, - _3: { - contents: undefined - } - }) : ({ - TAG: /* Reither */ 1, - _0: true, - _1: /* [] */ 0, - _2: false, - _3: { - contents: undefined - } - }); - } - return [ - param[0], - tmp - ]; - }), row$1.row_fields); - const row_row_more = newvar(validate_name(undefined), undefined); - const row_row_name = [ - path$1, - ty_args - ]; - const row$2 = { - row_fields: fields$1, - row_more: row_row_more, - row_bound: undefined, - row_closed: true, - row_fixed: false, - row_name: row_row_name - }; - const $$static = static_row(row$2); - const row$3 = $$static ? ({ - row_fields: fields$1, - row_more: newty2(current_level.contents, /* Tnil */ 0), - row_bound: undefined, - row_closed: true, - row_fixed: false, - row_name: row_row_name - }) : ( - policy !== /* Univars */ 2 ? row$2 : ({ - row_fields: fields$1, - row_more: new_pre_univar(undefined, undefined), - row_bound: undefined, - row_closed: true, - row_fixed: false, - row_name: row_row_name - }) - ); - ty$7 = newty2(current_level.contents, { - TAG: /* Tvariant */ 8, - _0: row$3 - }); - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 41749, - 10 - ] - }); + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Stdlib.Not_found) { + t$1 = instance(undefined, env, find$2(alias, used_variables.contents)[0]); + } else { + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } } - return ctyp({ - TAG: /* Ttyp_class */ 5, - _0: path$1, - _1: lid$1, - _2: args$1 - }, ty$7); - case /* Ptyp_alias */ 6 : - const alias = name._1; - const st = name._0; - let cty; + const ty$8 = transl_type(env, policy, st); try { - let t$1; - try { - t$1 = Stdlib__List.assoc(alias, univars.contents); + unify_var(env, t$1, ty$8.ctyp_type); + } + catch (raw_trace$2){ + const trace$2 = Caml_js_exceptions.internalToOCamlException(raw_trace$2); + if (trace$2.MEL_EXN_ID === Unify) { + const trace$3 = swap_list(trace$2._1); + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Alias_type_mismatch */ 7, + _0: trace$3 + } + }); } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Stdlib.Not_found) { - t$1 = instance(undefined, env, find$2(alias, used_variables.contents)[0]); - } else { - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); - } + throw new Caml_js_exceptions.MelangeError(trace$2.MEL_EXN_ID, trace$2); + } + cty = ty$8; + } + catch (raw_exn$5){ + const exn$5 = Caml_js_exceptions.internalToOCamlException(raw_exn$5); + if (exn$5.MEL_EXN_ID === Stdlib.Not_found) { + if (principal.contents) { + begin_def(undefined); } - const ty$8 = transl_type(env, policy, st); + const t$2 = newvar(validate_name(undefined), undefined); + used_variables.contents = add$5(alias, [ + t$2, + styp.ptyp_loc + ], used_variables.contents); + const ty$9 = transl_type(env, policy, st); try { - unify_var(env, t$1, ty$8.ctyp_type); + unify_var(env, t$2, ty$9.ctyp_type); } - catch (raw_trace$2){ - const trace$2 = Caml_js_exceptions.internalToOCamlException(raw_trace$2); - if (trace$2.MEL_EXN_ID === Unify) { - const trace$3 = swap_list(trace$2._1); + catch (raw_trace$3){ + const trace$4 = Caml_js_exceptions.internalToOCamlException(raw_trace$3); + if (trace$4.MEL_EXN_ID === Unify) { + const trace$5 = swap_list(trace$4._1); throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, _1: styp.ptyp_loc, _2: env, _3: { TAG: /* Alias_type_mismatch */ 7, - _0: trace$3 + _0: trace$5 } }); } - throw new Caml_js_exceptions.MelangeError(trace$2.MEL_EXN_ID, trace$2); + throw new Caml_js_exceptions.MelangeError(trace$4.MEL_EXN_ID, trace$4); } - cty = ty$8; - } - catch (raw_exn$5){ - const exn$5 = Caml_js_exceptions.internalToOCamlException(raw_exn$5); - if (exn$5.MEL_EXN_ID === Stdlib.Not_found) { - if (principal.contents) { - begin_def(undefined); - } - const t$2 = newvar(validate_name(undefined), undefined); - used_variables.contents = add$5(alias, [ - t$2, - styp.ptyp_loc - ], used_variables.contents); - const ty$9 = transl_type(env, policy, st); - try { - unify_var(env, t$2, ty$9.ctyp_type); - } - catch (raw_trace$3){ - const trace$4 = Caml_js_exceptions.internalToOCamlException(raw_trace$3); - if (trace$4.MEL_EXN_ID === Unify) { - const trace$5 = swap_list(trace$4._1); - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, - _2: env, - _3: { - TAG: /* Alias_type_mismatch */ 7, - _0: trace$5 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace$4.MEL_EXN_ID, trace$4); - } - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, t$2); - } - const t$3 = instance(undefined, env, t$2); - const px = proxy(t$3); - const match$5 = px.desc; - if (!/* tag */ (typeof match$5 === "number" || typeof match$5 === "string")) { - switch (match$5.TAG) { - case /* Tvar */ 0 : - if (match$5._0 !== undefined) { - - } else { - log_type(px); - px.desc = { - TAG: /* Tvar */ 0, - _0: alias - }; - } - break; - case /* Tunivar */ 9 : - if (match$5._0 !== undefined) { - - } else { - log_type(px); - px.desc = { - TAG: /* Tunivar */ 9, - _0: alias - }; - } - break; - - } + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, t$2); + } + const t$3 = instance(undefined, env, t$2); + const px = proxy(t$3); + const match$5 = px.desc; + if (!/* tag */ (typeof match$5 === "number" || typeof match$5 === "string")) { + switch (match$5.TAG) { + case /* Tvar */ 0 : + if (match$5._0 !== undefined) { + + } else { + log_type(px); + px.desc = { + TAG: /* Tvar */ 0, + _0: alias + }; + } + break; + case /* Tunivar */ 9 : + if (match$5._0 !== undefined) { + + } else { + log_type(px); + px.desc = { + TAG: /* Tunivar */ 9, + _0: alias + }; + } + break; + } - cty = { - ctyp_desc: ty$9.ctyp_desc, - ctyp_type: t$3, - ctyp_env: ty$9.ctyp_env, - ctyp_loc: ty$9.ctyp_loc, - ctyp_attributes: ty$9.ctyp_attributes - }; - } else { - throw new Caml_js_exceptions.MelangeError(exn$5.MEL_EXN_ID, exn$5); } + cty = { + ctyp_desc: ty$9.ctyp_desc, + ctyp_type: t$3, + ctyp_env: ty$9.ctyp_env, + ctyp_loc: ty$9.ctyp_loc, + ctyp_attributes: ty$9.ctyp_attributes + }; + } else { + throw new Caml_js_exceptions.MelangeError(exn$5.MEL_EXN_ID, exn$5); } - return ctyp({ - TAG: /* Ttyp_alias */ 6, - _0: cty, - _1: alias - }, cty.ctyp_type); + } + return ctyp({ + TAG: /* Ttyp_alias */ 6, + _0: cty, + _1: alias + }, cty.ctyp_type); case /* Ptyp_variant */ 7 : - const present = name._2; - const closed = name._1; - const name$2 = { - contents: undefined - }; - const mkfield = function (l, f) { - const desc = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: { - hd: [ - l, - f - ], - tl: /* [] */ 0 - }, - row_more: newvar(validate_name(undefined), undefined), - row_bound: undefined, - row_closed: true, - row_fixed: false, - row_name: undefined - } - }; - return newty2(current_level.contents, desc); + const present = name._2; + const closed = name._1; + const name$2 = { + contents: undefined + }; + const mkfield = function (l, f) { + const desc = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: { + hd: [ + l, + f + ], + tl: /* [] */ 0 + }, + row_more: newvar(validate_name(undefined), undefined), + row_bound: undefined, + row_closed: true, + row_fixed: false, + row_name: undefined + } }; - const hfields = Stdlib__Hashtbl.create(undefined, 17); - const add_typed_field = function (loc, l, f) { - const h = hash_variant(l); + return newty2(current_level.contents, desc); + }; + const hfields = Stdlib__Hashtbl.create(undefined, 17); + const add_typed_field = function (loc, l, f) { + const h = hash_variant(l); + try { + const match = Stdlib__Hashtbl.find(hfields, h); + const l$p = match[0]; + if (l !== l$p) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Variant_tags */ 12, + _0: l, + _1: l$p + } + }); + } + const ty = mkfield(l, f); + const ty$p = mkfield(l, match[1]); + if (equal$5(env, false, { + hd: ty, + tl: /* [] */ 0 + }, { + hd: ty$p, + tl: /* [] */ 0 + })) { + return; + } try { - const match = Stdlib__Hashtbl.find(hfields, h); - const l$p = match[0]; - if (l !== l$p) { + return unify$2(env, ty, ty$p); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, + _1: loc, _2: env, _3: { - TAG: /* Variant_tags */ 12, - _0: l, - _1: l$p + TAG: /* Constructor_mismatch */ 10, + _0: ty, + _1: ty$p } }); } - const ty = mkfield(l, f); - const ty$p = mkfield(l, match[1]); - if (equal$5(env, false, { - hd: ty, - tl: /* [] */ 0 - }, { - hd: ty$p, - tl: /* [] */ 0 - })) { - return; - } - try { - return unify$2(env, ty, ty$p); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: loc, - _2: env, - _3: { - TAG: /* Constructor_mismatch */ 10, - _0: ty, - _1: ty$p - } - }); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return Stdlib__Hashtbl.add(hfields, h, [ + l, + f + ]); + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }; + const add_field = function (sty) { + if (sty.TAG === /* Rtag */ 0) { + const stl = sty._3; + const c = sty._2; + const l = sty._0; + name$2.contents = undefined; + const tl = Stdlib__List.map((function (param) { + return transl_type(env, policy, param); + }), stl); + let f; + let exit = 0; + if (present !== undefined && !Stdlib__List.mem(l, present)) { + const ty_tl = Stdlib__List.map((function (cty) { + return cty.ctyp_type; + }), tl); + f = { + TAG: /* Reither */ 1, + _0: c, + _1: ty_tl, + _2: false, + _3: { + contents: undefined } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } + }; + } else { + exit = 1; } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return Stdlib__Hashtbl.add(hfields, h, [ - l, - f - ]); + if (exit === 1) { + if (Stdlib__List.length(stl) > 1 || c && Caml_obj.caml_notequal(stl, /* [] */ 0)) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Present_has_conjunction */ 8, + _0: l + } + }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + f = tl ? ({ + TAG: /* Rpresent */ 0, + _0: tl.hd.ctyp_type + }) : ({ + TAG: /* Rpresent */ 0, + _0: undefined + }); } - }; - const add_field = function (sty) { - if (sty.TAG === /* Rtag */ 0) { - const stl = sty._3; - const c = sty._2; - const l = sty._0; + add_typed_field(styp.ptyp_loc, l, f); + return { + TAG: /* Ttag */ 0, + _0: l, + _1: sty._1, + _2: c, + _3: tl + }; + } + const sty$1 = sty._0; + const cty = transl_type(env, policy, sty$1); + const ty = cty.ctyp_type; + const match = repr(cty.ctyp_type); + const match$1 = match.desc; + let nm; + nm = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tconstr */ 3 ? undefined : [ + match$1._0, + match$1._1 + ]; + try { + Stdlib__Hashtbl.iter((function (param, param$1) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + }), hfields); + name$2.contents = nm; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Exit) { name$2.contents = undefined; - const tl = Stdlib__List.map((function (param) { - return transl_type(env, policy, param); - }), stl); - let f; - let exit = 0; - if (present !== undefined && !Stdlib__List.mem(l, present)) { - const ty_tl = Stdlib__List.map((function (cty) { - return cty.ctyp_type; - }), tl); - f = { - TAG: /* Reither */ 1, - _0: c, - _1: ty_tl, - _2: false, - _3: { - contents: undefined - } - }; - } else { - exit = 1; - } - if (exit === 1) { - if (Stdlib__List.length(stl) > 1 || c && Caml_obj.caml_notequal(stl, /* [] */ 0)) { + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + } + const match$2 = expand_head(env, cty.ctyp_type); + let fl; + let exit$1 = 0; + const row = match$2.desc; + if (/* tag */ typeof row === "number" || typeof row === "string") { + exit$1 = 1; + } else { + switch (row.TAG) { + case /* Tvar */ 0 : + if (nm !== undefined) { throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, + _1: sty$1.ptyp_loc, _2: env, _3: { - TAG: /* Present_has_conjunction */ 8, - _0: l + TAG: /* Unbound_type_constructor_2 */ 2, + _0: nm[0] } }); } - f = tl ? ({ - TAG: /* Rpresent */ 0, - _0: tl.hd.ctyp_type - }) : ({ - TAG: /* Rpresent */ 0, - _0: undefined - }); - } - add_typed_field(styp.ptyp_loc, l, f); - return { - TAG: /* Ttag */ 0, - _0: l, - _1: sty._1, - _2: c, - _3: tl - }; - } - const sty$1 = sty._0; - const cty = transl_type(env, policy, sty$1); - const ty = cty.ctyp_type; - const match = repr(cty.ctyp_type); - const match$1 = match.desc; - let nm; - nm = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tconstr */ 3 ? undefined : [ - match$1._0, - match$1._1 - ]; - try { - Stdlib__Hashtbl.iter((function (param, param$1) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - }), hfields); - name$2.contents = nm; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Exit) { - name$2.contents = undefined; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - } - const match$2 = expand_head(env, cty.ctyp_type); - let fl; - let exit$1 = 0; - const row = match$2.desc; - if (/* tag */ typeof row === "number" || typeof row === "string") { - exit$1 = 1; - } else { - switch (row.TAG) { - case /* Tvar */ 0 : - if (nm !== undefined) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: sty$1.ptyp_loc, - _2: env, - _3: { - TAG: /* Unbound_type_constructor_2 */ 2, - _0: nm[0] - } - }); - } - exit$1 = 1; - break; - case /* Tvariant */ 8 : - const row$1 = row._0; - if (static_row(row$1)) { - fl = row_repr_aux(/* [] */ 0, row$1).row_fields; - } else { - exit$1 = 1; - } - break; - default: + exit$1 = 1; + break; + case /* Tvariant */ 8 : + const row$1 = row._0; + if (static_row(row$1)) { + fl = row_repr_aux(/* [] */ 0, row$1).row_fields; + } else { exit$1 = 1; - } - } - if (exit$1 === 1) { - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: sty$1.ptyp_loc, - _2: env, - _3: { - TAG: /* Not_a_variant */ 11, - _0: ty - } - }); + } + break; + default: + exit$1 = 1; } - Stdlib__List.iter((function (param) { - const f = param[1]; - const l = param[0]; - let f$1; - if (present !== undefined && !Stdlib__List.mem(l, present)) { - if (/* tag */ typeof f === "number" || typeof f === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 41862, - 24 - ] - }); - } - if (f.TAG === /* Rpresent */ 0) { - const ty = f._0; - f$1 = ty !== undefined ? ({ - TAG: /* Reither */ 1, - _0: false, - _1: { - hd: ty, - tl: /* [] */ 0 - }, - _2: false, - _3: { - contents: undefined - } - }) : ({ - TAG: /* Reither */ 1, - _0: true, - _1: /* [] */ 0, - _2: false, - _3: { - contents: undefined - } - }); - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 41862, - 24 - ] - }); - } - } else { - f$1 = f; + } + if (exit$1 === 1) { + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: sty$1.ptyp_loc, + _2: env, + _3: { + TAG: /* Not_a_variant */ 11, + _0: ty } - add_typed_field(sty$1.ptyp_loc, l, f$1); - }), fl); - return { - TAG: /* Tinherit */ 1, - _0: cty - }; - }; - const tfields = Stdlib__List.map(add_field, name._0); - const fields$2 = Stdlib__Hashtbl.fold((function (param, p, l) { - return { - hd: p, - tl: l - }; - }), hfields, /* [] */ 0); - if (present !== undefined) { - Stdlib__List.iter((function (l) { - if (Stdlib__List.mem_assoc(l, fields$2)) { - return; + }); + } + Stdlib__List.iter((function (param) { + const f = param[1]; + const l = param[0]; + let f$1; + if (present !== undefined && !Stdlib__List.mem(l, present)) { + if (/* tag */ typeof f === "number" || typeof f === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 41862, + 24 + ] + }); } - throw new Caml_js_exceptions.MelangeError($$Error$6, { - MEL_EXN_ID: $$Error$6, - _1: styp.ptyp_loc, - _2: env, + if (f.TAG === /* Rpresent */ 0) { + const ty = f._0; + f$1 = ty !== undefined ? ({ + TAG: /* Reither */ 1, + _0: false, + _1: { + hd: ty, + tl: /* [] */ 0 + }, + _2: false, _3: { - TAG: /* Present_has_no_type */ 9, - _0: l + contents: undefined + } + }) : ({ + TAG: /* Reither */ 1, + _0: true, + _1: /* [] */ 0, + _2: false, + _3: { + contents: undefined } }); - }), present); - } - const row_row_fields = Stdlib__List.rev(fields$2); - const row_row_more$1 = newvar(validate_name(undefined), undefined); - const row_row_closed = closed === /* Closed */ 0; - const row_row_name$1 = name$2.contents; - const row$4 = { - row_fields: row_row_fields, - row_more: row_row_more$1, - row_bound: undefined, - row_closed: row_row_closed, - row_fixed: false, - row_name: row_row_name$1 - }; - const $$static$1 = static_row(row$4); - const row$5 = $$static$1 ? ({ - row_fields: row_row_fields, - row_more: newty2(current_level.contents, /* Tnil */ 0), - row_bound: undefined, - row_closed: row_row_closed, - row_fixed: false, - row_name: row_row_name$1 - }) : ( - policy !== /* Univars */ 2 ? row$4 : ({ - row_fields: row_row_fields, - row_more: new_pre_univar(undefined, undefined), - row_bound: undefined, - row_closed: row_row_closed, - row_fixed: false, - row_name: row_row_name$1 - }) - ); - const ty$10 = newty2(current_level.contents, { - TAG: /* Tvariant */ 8, - _0: row$5 - }); - return ctyp({ - TAG: /* Ttyp_variant */ 7, - _0: tfields, - _1: closed, - _2: present - }, ty$10); - case /* Ptyp_poly */ 8 : - const vars = name._0; - begin_def(undefined); - const new_univars = Stdlib__List.map((function (name) { - return [ - name, - newvar(validate_name(name), undefined) - ]; - }), vars); - const old_univars = univars.contents; - univars.contents = Stdlib.$at(new_univars, univars.contents); - const cty$1 = transl_type(env, policy, name._1); - const ty$11 = cty$1.ctyp_type; - univars.contents = old_univars; - end_def(undefined); - iter_generalize$1({ - contents: /* [] */ 0 - }, ty$11); - const ty_list = Stdlib__List.fold_left((function (tyl, param) { - const v = proxy(param[1]); - if (!deep_occur(v, ty$11)) { - return tyl; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 41862, + 24 + ] + }); + } + } else { + f$1 = f; } - const name = v.desc; - if (!/* tag */ (typeof name === "number" || typeof name === "string") && name.TAG === /* Tvar */ 0 && v.level === 100000000) { - v.desc = { - TAG: /* Tunivar */ 9, - _0: name._0 - }; - return { - hd: v, - tl: tyl - }; + add_typed_field(sty$1.ptyp_loc, l, f$1); + }), fl); + return { + TAG: /* Tinherit */ 1, + _0: cty + }; + }; + const tfields = Stdlib__List.map(add_field, name._0); + const fields$2 = Stdlib__Hashtbl.fold((function (param, p, l) { + return { + hd: p, + tl: l + }; + }), hfields, /* [] */ 0); + if (present !== undefined) { + Stdlib__List.iter((function (l) { + if (Stdlib__List.mem_assoc(l, fields$2)) { + return; } throw new Caml_js_exceptions.MelangeError($$Error$6, { MEL_EXN_ID: $$Error$6, _1: styp.ptyp_loc, _2: env, _3: { - TAG: /* Cannot_quantify */ 14, - _0: param[0], - _1: v + TAG: /* Present_has_no_type */ 9, + _0: l } }); - }), /* [] */ 0, new_univars); - const ty$p = newty2(100000000, { - TAG: /* Tpoly */ 10, - _0: ty$11, - _1: Stdlib__List.rev(ty_list) - }); - unify_var(env, newvar(validate_name(undefined), undefined), ty$p); - return ctyp({ - TAG: /* Ttyp_poly */ 8, - _0: vars, - _1: cty$1 - }, ty$p); - case /* Ptyp_package */ 9 : - const match$6 = name._0; - const p = match$6[0]; - const match$7 = create_package_mty(true, styp.ptyp_loc, env, [ - p, - match$6[1] - ]); - const l$1 = match$7[0]; - const z = narrow(undefined); - const mty = Curry._2(transl_modtype.contents, env, match$7[1]); - widen(z); - const ptys = Stdlib__List.map((function (param) { - return [ - param[0], - transl_type(env, policy, param[1]) - ]; - }), l$1); - const path$2 = Curry._3(transl_modtype_longident.contents, styp.ptyp_loc, env, p.txt); - const desc_1 = Stdlib__List.map((function (param) { - return param[0].txt; - }), l$1); - const desc_2 = Stdlib__List.map((function (param) { - return param[1].ctyp_type; - }), ptys); - const desc$1 = { - TAG: /* Tpackage */ 11, - _0: path$2, - _1: desc_1, - _2: desc_2 - }; - const ty$12 = newty2(current_level.contents, desc$1); - return ctyp({ - TAG: /* Ttyp_package */ 9, - _0: { - pack_path: path$2, - pack_fields: ptys, - pack_type: mty.mty_type, - pack_txt: p - } - }, ty$12); - case /* Ptyp_extension */ 10 : - throw new Caml_js_exceptions.MelangeError(Error_forward, { - MEL_EXN_ID: Error_forward, - _1: error_of_extension(name._0) - }); - + }), present); + } + const row_row_fields = Stdlib__List.rev(fields$2); + const row_row_more$1 = newvar(validate_name(undefined), undefined); + const row_row_closed = closed === /* Closed */ 0; + const row_row_name$1 = name$2.contents; + const row$4 = { + row_fields: row_row_fields, + row_more: row_row_more$1, + row_bound: undefined, + row_closed: row_row_closed, + row_fixed: false, + row_name: row_row_name$1 + }; + const $$static$1 = static_row(row$4); + const row$5 = $$static$1 ? ({ + row_fields: row_row_fields, + row_more: newty2(current_level.contents, /* Tnil */ 0), + row_bound: undefined, + row_closed: row_row_closed, + row_fixed: false, + row_name: row_row_name$1 + }) : ( + policy !== /* Univars */ 2 ? row$4 : ({ + row_fields: row_row_fields, + row_more: new_pre_univar(undefined, undefined), + row_bound: undefined, + row_closed: row_row_closed, + row_fixed: false, + row_name: row_row_name$1 + }) + ); + const ty$10 = newty2(current_level.contents, { + TAG: /* Tvariant */ 8, + _0: row$5 + }); + return ctyp({ + TAG: /* Ttyp_variant */ 7, + _0: tfields, + _1: closed, + _2: present + }, ty$10); + case /* Ptyp_poly */ 8 : + const vars = name._0; + begin_def(undefined); + const new_univars = Stdlib__List.map((function (name) { + return [ + name, + newvar(validate_name(name), undefined) + ]; + }), vars); + const old_univars = univars.contents; + univars.contents = Stdlib.$at(new_univars, univars.contents); + const cty$1 = transl_type(env, policy, name._1); + const ty$11 = cty$1.ctyp_type; + univars.contents = old_univars; + end_def(undefined); + iter_generalize$1({ + contents: /* [] */ 0 + }, ty$11); + const ty_list = Stdlib__List.fold_left((function (tyl, param) { + const v = proxy(param[1]); + if (!deep_occur(v, ty$11)) { + return tyl; + } + const name = v.desc; + if (!/* tag */ (typeof name === "number" || typeof name === "string") && name.TAG === /* Tvar */ 0 && v.level === 100000000) { + v.desc = { + TAG: /* Tunivar */ 9, + _0: name._0 + }; + return { + hd: v, + tl: tyl + }; + } + throw new Caml_js_exceptions.MelangeError($$Error$6, { + MEL_EXN_ID: $$Error$6, + _1: styp.ptyp_loc, + _2: env, + _3: { + TAG: /* Cannot_quantify */ 14, + _0: param[0], + _1: v + } + }); + }), /* [] */ 0, new_univars); + const ty$p = newty2(100000000, { + TAG: /* Tpoly */ 10, + _0: ty$11, + _1: Stdlib__List.rev(ty_list) + }); + unify_var(env, newvar(validate_name(undefined), undefined), ty$p); + return ctyp({ + TAG: /* Ttyp_poly */ 8, + _0: vars, + _1: cty$1 + }, ty$p); + case /* Ptyp_package */ 9 : + const match$6 = name._0; + const p = match$6[0]; + const match$7 = create_package_mty(true, styp.ptyp_loc, env, [ + p, + match$6[1] + ]); + const l$1 = match$7[0]; + const z = narrow(undefined); + const mty = Curry._2(transl_modtype.contents, env, match$7[1]); + widen(z); + const ptys = Stdlib__List.map((function (param) { + return [ + param[0], + transl_type(env, policy, param[1]) + ]; + }), l$1); + const path$2 = Curry._3(transl_modtype_longident.contents, styp.ptyp_loc, env, p.txt); + const desc_1 = Stdlib__List.map((function (param) { + return param[0].txt; + }), l$1); + const desc_2 = Stdlib__List.map((function (param) { + return param[1].ctyp_type; + }), ptys); + const desc$1 = { + TAG: /* Tpackage */ 11, + _0: path$2, + _1: desc_1, + _2: desc_2 + }; + const ty$12 = newty2(current_level.contents, desc$1); + return ctyp({ + TAG: /* Ttyp_package */ 9, + _0: { + pack_path: path$2, + pack_fields: ptys, + pack_type: mty.mty_type, + pack_txt: p + } + }, ty$12); + case /* Ptyp_extension */ 10 : + throw new Caml_js_exceptions.MelangeError(Error_forward, { + MEL_EXN_ID: Error_forward, + _1: error_of_extension(name._0) + }); + } } @@ -61467,9 +61467,9 @@ function transl_fields(loc, env, policy, seen, o, param) { switch (policy) { case /* Fixed */ 0 : case /* Extensible */ 1 : - return newvar(validate_name(undefined), undefined); + return newvar(validate_name(undefined), undefined); case /* Univars */ 2 : - return new_pre_univar(undefined, undefined); + return new_pre_univar(undefined, undefined); } } @@ -61775,17 +61775,17 @@ function spellcheck(ppf, fold, env, lid) { }); switch (lid.TAG) { case /* Lident */ 0 : - const s = lid._0; - return handle(Curry._4(fold, (function (param, param$1) { - return compare(s, param, param$1); - }), undefined, env, init)); + const s = lid._0; + return handle(Curry._4(fold, (function (param, param$1) { + return compare(s, param, param$1); + }), undefined, env, init)); case /* Ldot */ 1 : - const s$1 = lid._1; - return handle(Curry._4(fold, (function (param, param$1) { - return compare(s$1, param, param$1); - }), lid._0, env, init)); + const s$1 = lid._1; + return handle(Curry._4(fold, (function (param, param$1) { + return compare(s$1, param, param$1); + }), lid._0, env, init)); case /* Lapply */ 2 : - return; + return; } } @@ -61845,134 +61845,133 @@ register_error_of_exn(function (err) { } switch (param$1.TAG) { case /* Unbound_type_variable */ 0 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound type parameter ", + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound type parameter ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, + _1: /* End_of_format */ 0 } - }, - _1: "Unbound type parameter %s@." - }), param$1._0); + } + }, + _1: "Unbound type parameter %s@." + }), param$1._0); case /* Unbound_type_constructor */ 1 : - const lid = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound type constructor ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound type constructor %a" - }), longident, lid); - return spellcheck$1(param, fold_types)(env, lid); + const lid = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound type constructor ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound type constructor %a" + }), longident, lid); + return spellcheck$1(param, fold_types)(env, lid); case /* Unbound_type_constructor_2 */ 2 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The type constructor", + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type constructor", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is not yet completely defined", - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not yet completely defined", + _1: /* End_of_format */ 0 } } } - }, - _1: "The type constructor@ %a@ is not yet completely defined" - }), path, param$1._0); + } + }, + _1: "The type constructor@ %a@ is not yet completely defined" + }), path, param$1._0); case /* Type_arity_mismatch */ 3 : - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type constructor ", _1: { - TAG: /* String_literal */ 11, - _0: "The type constructor ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "expects ", _1: { - TAG: /* String_literal */ 11, - _0: "expects ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " argument(s),", + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " argument(s),", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "but is here applied to ", _1: { - TAG: /* String_literal */ 11, - _0: "but is here applied to ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " argument(s)", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " argument(s)", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -61983,177 +61982,177 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The type constructor %a@ expects %i argument(s),@ but is here applied to %i argument(s)@]" - }), longident, param$1._0, param$1._1, param$1._2); + } + }, + _1: "@[The type constructor %a@ expects %i argument(s),@ but is here applied to %i argument(s)@]" + }), longident, param$1._0, param$1._1, param$1._2); case /* Bound_type_variable */ 4 : - return Curry._1(Stdlib__Format.fprintf(param)({ + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Already bound type parameter '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Already bound type parameter '%s" + }), param$1._0); + case /* Unbound_row_variable */ 5 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound row variable in #", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound row variable in #%a" + }), longident, param$1._0); + case /* Type_mismatch */ 6 : + return report_unification_error(param, empty, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Already bound type parameter '", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + _0: "This type", + _1: /* End_of_format */ 0 }, - _1: "Already bound type parameter '%s" - }), param$1._0); - case /* Unbound_row_variable */ 5 : - return Curry._2(Stdlib__Format.fprintf(param)({ + _1: "This type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Unbound row variable in #", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + _0: "should be an instance of type", + _1: /* End_of_format */ 0 }, - _1: "Unbound row variable in #%a" - }), longident, param$1._0); - case /* Type_mismatch */ 6 : - return report_unification_error(param, empty, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This type", - _1: /* End_of_format */ 0 - }, - _1: "This type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "should be an instance of type", - _1: /* End_of_format */ 0 - }, - _1: "should be an instance of type" - }); - })); + _1: "should be an instance of type" + }); + })); case /* Alias_type_mismatch */ 7 : - return report_unification_error(param, empty, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This alias is bound to type", - _1: /* End_of_format */ 0 - }, - _1: "This alias is bound to type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is used as an instance of type", - _1: /* End_of_format */ 0 - }, - _1: "but is used as an instance of type" - }); - })); - case /* Present_has_conjunction */ 8 : - return Curry._1(Stdlib__Format.fprintf(param)({ + return report_unification_error(param, empty, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "The present constructor ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " has a conjunctive type", - _1: /* End_of_format */ 0 - } - } + _0: "This alias is bound to type", + _1: /* End_of_format */ 0 }, - _1: "The present constructor %s has a conjunctive type" - }), param$1._0); - case /* Present_has_no_type */ 9 : - return Curry._1(Stdlib__Format.fprintf(param)({ + _1: "This alias is bound to type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "The present constructor ", + _0: "but is used as an instance of type", + _1: /* End_of_format */ 0 + }, + _1: "but is used as an instance of type" + }); + })); + case /* Present_has_conjunction */ 8 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The present constructor ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " has no type", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " has a conjunctive type", + _1: /* End_of_format */ 0 } - }, - _1: "The present constructor %s has no type" - }), param$1._0); - case /* Constructor_mismatch */ 10 : - const ty$p = param$1._1; - const ty = param$1._0; - return wrap_printing_env(env, (function (param$2) { - reset_and_mark_loops_list({ - hd: ty, - tl: { - hd: ty$p, - tl: /* [] */ 0 + } + }, + _1: "The present constructor %s has a conjunctive type" + }), param$1._0); + case /* Present_has_no_type */ 9 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The present constructor ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " has no type", + _1: /* End_of_format */ 0 } - }); - Curry._6(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "The present constructor %s has no type" + }), param$1._0); + case /* Constructor_mismatch */ 10 : + const ty$p = param$1._1; + const ty = param$1._0; + return wrap_printing_env(env, (function (param$2) { + reset_and_mark_loops_list({ + hd: ty, + tl: { + hd: ty$p, + tl: /* [] */ 0 + } + }); + Curry._6(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -62161,106 +62160,106 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[%s %a@ %s@ %a@]" - }), "This variant type contains a constructor", type_expr$1, ty, "which should be", type_expr$1, ty$p); - })); + } + }, + _1: "@[%s %a@ %s@ %a@]" + }), "This variant type contains a constructor", type_expr$1, ty, "which should be", type_expr$1, ty$p); + })); case /* Not_a_variant */ 11 : - const ty$1 = param$1._0; - reset(undefined); - mark_loops(ty$1); - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + const ty$1 = param$1._0; + reset(undefined); + mark_loops(ty$1); + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type ", _1: { - TAG: /* String_literal */ 11, - _0: "The type ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not a polymorphic variant type", _1: { - TAG: /* String_literal */ 11, - _0: "is not a polymorphic variant type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "@[The type %a@ is not a polymorphic variant type@]" - }), type_expr$1, ty$1); + } + }, + _1: "@[The type %a@ is not a polymorphic variant type@]" + }), type_expr$1, ty$1); case /* Variant_tags */ 12 : - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Variant tags `", _1: { - TAG: /* String_literal */ 11, - _0: "Variant tags `", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "and `", _1: { - TAG: /* String_literal */ 11, - _0: "and `", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " have the same hash value.", _1: { - TAG: /* String_literal */ 11, - _0: " have the same hash value.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -62269,282 +62268,283 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[Variant tags `%s@ and `%s have the same hash value.@ %s@]" - }), param$1._0, param$1._1, "Change one of them."); + } + }, + _1: "@[Variant tags `%s@ and `%s have the same hash value.@ %s@]" + }), param$1._0, param$1._1, "Change one of them."); case /* Invalid_variable_name */ 13 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The type variable name ", + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type variable name ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is not allowed in programs", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " is not allowed in programs", + _1: /* End_of_format */ 0 } - }, - _1: "The type variable name %s is not allowed in programs" - }), param$1._0); + } + }, + _1: "The type variable name %s is not allowed in programs" + }), param$1._0); case /* Cannot_quantify */ 14 : - const v = param$1._1; - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + const v = param$1._1; + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The universal type variable '", _1: { - TAG: /* String_literal */ 11, - _0: "The universal type variable '", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " cannot be generalized:", _1: { - TAG: /* String_literal */ 11, - _0: " cannot be generalized:", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* '.' */46, _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[The universal type variable '%s cannot be generalized:@ %s.@]" - }), param$1._0, is_Tvar(v) ? "it escapes its scope" : ( - is_Tunivar(v) ? "it is already bound to another variable" : "it is not a variable" - )); + } + }, + _1: "@[The universal type variable '%s cannot be generalized:@ %s.@]" + }), param$1._0, is_Tvar(v) ? "it escapes its scope" : ( + is_Tunivar(v) ? "it is already bound to another variable" : "it is not a variable" + )); case /* Multiple_constraints_on_type */ 15 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Multiple constraints for type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Multiple constraints for type %a" - }), longident, param$1._0); + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Multiple constraints for type ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Multiple constraints for type %a" + }), longident, param$1._0); case /* Repeated_method_label */ 16 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "This is the second method `", _1: { - TAG: /* String_literal */ 11, - _0: "This is the second method `", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "' of this object type.", _1: { - TAG: /* String_literal */ 11, - _0: "' of this object type.", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[This is the second method `%s' of this object type.@ %s@]" - }), param$1._0, "Multiple occurences are not allowed."); + } + }, + _1: "@[This is the second method `%s' of this object type.@ %s@]" + }), param$1._0, "Multiple occurences are not allowed."); case /* Unbound_value */ 17 : - const lid$1 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound value ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound value %a" - }), longident, lid$1); - return spellcheck$1(param, fold_values)(env, lid$1); + const lid$1 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound value ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound value %a" + }), longident, lid$1); + return spellcheck$1(param, fold_values)(env, lid$1); case /* Unbound_constructor */ 18 : - const lid$2 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound constructor ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound constructor %a" - }), longident, lid$2); - return spellcheck_simple(param, fold_constructors, (function (d) { - return d.cstr_name; - }))(env, lid$2); + const lid$2 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound constructor ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound constructor %a" + }), longident, lid$2); + return spellcheck_simple(param, fold_constructors, (function (d) { + return d.cstr_name; + }))(env, lid$2); case /* Unbound_label */ 19 : - const lid$3 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound record field ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound record field %a" - }), longident, lid$3); - return spellcheck_simple(param, fold_labels, (function (d) { - return d.lbl_name; - }))(env, lid$3); + const lid$3 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound record field ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound record field %a" + }), longident, lid$3); + return spellcheck_simple(param, fold_labels, (function (d) { + return d.lbl_name; + }))(env, lid$3); case /* Unbound_module */ 20 : - const lid$4 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound module ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound module %a" - }), longident, lid$4); - return spellcheck$1(param, fold_modules)(env, lid$4); + const lid$4 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound module ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound module %a" + }), longident, lid$4); + return spellcheck$1(param, fold_modules)(env, lid$4); case /* Unbound_class */ 21 : - const lid$5 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound class ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound class %a" - }), longident, lid$5); - return spellcheck$1(param, fold_classs)(env, lid$5); + const lid$5 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound class ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound class %a" + }), longident, lid$5); + return spellcheck$1(param, fold_classs)(env, lid$5); case /* Unbound_modtype */ 22 : - const lid$6 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound module type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound module type %a" - }), longident, lid$6); - return spellcheck$1(param, fold_modtypes)(env, lid$6); + const lid$6 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound module type ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound module type %a" + }), longident, lid$6); + return spellcheck$1(param, fold_modtypes)(env, lid$6); case /* Unbound_cltype */ 23 : - const lid$7 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound class type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Unbound class type %a" - }), longident, lid$7); - return spellcheck$1(param, fold_cltypes)(env, lid$7); + const lid$7 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound class type ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Unbound class type %a" + }), longident, lid$7); + return spellcheck$1(param, fold_cltypes)(env, lid$7); case /* Ill_typed_functor_application */ 24 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Ill-typed functor application ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Ill-typed functor application %a" - }), longident, param$1._0); + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Ill-typed functor application ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Ill-typed functor application %a" + }), longident, param$1._0); case /* Access_functor_as_structure */ 25 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The module ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " is a functor, not a structure", - _1: /* End_of_format */ 0 - } + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The module ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " is a functor, not a structure", + _1: /* End_of_format */ 0 } - }, - _1: "The module %a is a functor, not a structure" - }), longident, param$1._0); + } + }, + _1: "The module %a is a functor, not a structure" + }), longident, param$1._0); } }), err._3); @@ -62642,74 +62642,74 @@ function iter_expression(f, e) { const pel = e.pexp_desc; switch (pel.TAG) { case /* Pexp_let */ 2 : - expr(pel._2); - return Stdlib__List.iter(binding, pel._1); + expr(pel._2); + return Stdlib__List.iter(binding, pel._1); case /* Pexp_function */ 3 : - return Stdlib__List.iter($$case, pel._0); + return Stdlib__List.iter($$case, pel._0); case /* Pexp_fun */ 4 : - may(expr, pel._1); - _e = pel._3; - continue; + may(expr, pel._1); + _e = pel._3; + continue; case /* Pexp_apply */ 5 : - expr(pel._0); - return Stdlib__List.iter((function (param) { - expr(param[1]); - }), pel._1); + expr(pel._0); + return Stdlib__List.iter((function (param) { + expr(param[1]); + }), pel._1); case /* Pexp_match */ 6 : case /* Pexp_try */ 7 : - break; + break; case /* Pexp_construct */ 9 : case /* Pexp_variant */ 10 : - return may(expr, pel._1); + return may(expr, pel._1); case /* Pexp_record */ 11 : - may(expr, pel._1); - return Stdlib__List.iter((function (param) { - expr(param[1]); - }), pel._0); + may(expr, pel._1); + return Stdlib__List.iter((function (param) { + expr(param[1]); + }), pel._0); case /* Pexp_setfield */ 13 : - expr(pel._0); - _e = pel._2; - continue; + expr(pel._0); + _e = pel._2; + continue; case /* Pexp_tuple */ 8 : case /* Pexp_array */ 14 : - return Stdlib__List.iter(expr, pel._0); + return Stdlib__List.iter(expr, pel._0); case /* Pexp_ifthenelse */ 15 : - expr(pel._0); - expr(pel._1); - return may(expr, pel._2); + expr(pel._0); + expr(pel._1); + return may(expr, pel._2); case /* Pexp_sequence */ 16 : case /* Pexp_while */ 17 : - expr(pel._0); - _e = pel._1; - continue; + expr(pel._0); + _e = pel._1; + continue; case /* Pexp_for */ 18 : - expr(pel._1); - expr(pel._2); - _e = pel._4; - continue; + expr(pel._1); + expr(pel._2); + _e = pel._4; + continue; case /* Pexp_override */ 24 : - return Stdlib__List.iter((function (param) { - expr(param[1]); - }), pel._0); + return Stdlib__List.iter((function (param) { + expr(param[1]); + }), pel._0); case /* Pexp_letmodule */ 25 : - expr(pel._2); - return module_expr(pel._1); + expr(pel._2); + return module_expr(pel._1); case /* Pexp_object */ 29 : - return Stdlib__List.iter(class_field, pel._0.pcstr_fields); + return Stdlib__List.iter(class_field, pel._0.pcstr_fields); case /* Pexp_setinstvar */ 23 : case /* Pexp_newtype */ 30 : - _e = pel._1; - continue; + _e = pel._1; + continue; case /* Pexp_pack */ 31 : - return module_expr(pel._0); + return module_expr(pel._0); case /* Pexp_open */ 32 : - _e = pel._2; - continue; + _e = pel._2; + continue; case /* Pexp_ident */ 0 : case /* Pexp_constant */ 1 : case /* Pexp_new */ 22 : case /* Pexp_extension */ 33 : - return; + return; default: _e = pel._0; continue; @@ -62731,22 +62731,22 @@ function iter_expression(f, e) { const str = me.pmod_desc; switch (str.TAG) { case /* Pmod_structure */ 1 : - return Stdlib__List.iter(structure_item, str._0); + return Stdlib__List.iter(structure_item, str._0); case /* Pmod_functor */ 2 : - _me = str._2; - continue; + _me = str._2; + continue; case /* Pmod_apply */ 3 : - module_expr(str._0); - _me = str._1; - continue; + module_expr(str._0); + _me = str._1; + continue; case /* Pmod_constraint */ 4 : - _me = str._0; - continue; + _me = str._0; + continue; case /* Pmod_unpack */ 5 : - return expr(str._0); + return expr(str._0); case /* Pmod_ident */ 0 : case /* Pmod_extension */ 6 : - return; + return; } }; @@ -62755,21 +62755,21 @@ function iter_expression(f, e) { const l = str.pstr_desc; switch (l.TAG) { case /* Pstr_eval */ 0 : - return expr(l._0); + return expr(l._0); case /* Pstr_value */ 1 : - return Stdlib__List.iter(binding, l._1); + return Stdlib__List.iter(binding, l._1); case /* Pstr_module */ 6 : - return module_expr(l._0.pmb_expr); + return module_expr(l._0.pmb_expr); case /* Pstr_recmodule */ 7 : - return Stdlib__List.iter((function (x) { - module_expr(x.pmb_expr); - }), l._0); + return Stdlib__List.iter((function (x) { + module_expr(x.pmb_expr); + }), l._0); case /* Pstr_class */ 10 : - return Stdlib__List.iter((function (c) { - class_expr(c.pci_expr); - }), l._0); + return Stdlib__List.iter((function (c) { + class_expr(c.pci_expr); + }), l._0); case /* Pstr_include */ 12 : - return module_expr(l._0.pincl_mod); + return module_expr(l._0.pincl_mod); default: return; } @@ -62780,26 +62780,26 @@ function iter_expression(f, e) { const match = ce.pcl_desc; switch (match.TAG) { case /* Pcl_structure */ 1 : - return Stdlib__List.iter(class_field, match._0.pcstr_fields); + return Stdlib__List.iter(class_field, match._0.pcstr_fields); case /* Pcl_fun */ 2 : - may(expr, match._1); - _ce = match._3; - continue; + may(expr, match._1); + _ce = match._3; + continue; case /* Pcl_apply */ 3 : - class_expr(match._0); - return Stdlib__List.iter((function (param) { - expr(param[1]); - }), match._1); + class_expr(match._0); + return Stdlib__List.iter((function (param) { + expr(param[1]); + }), match._1); case /* Pcl_let */ 4 : - Stdlib__List.iter(binding, match._1); - _ce = match._2; - continue; + Stdlib__List.iter(binding, match._1); + _ce = match._2; + continue; case /* Pcl_constraint */ 5 : - _ce = match._0; - continue; + _ce = match._0; + continue; case /* Pcl_constr */ 0 : case /* Pcl_extension */ 6 : - return; + return; } }; @@ -62808,27 +62808,27 @@ function iter_expression(f, e) { const e = cf.pcf_desc; switch (e.TAG) { case /* Pcf_inherit */ 0 : - return class_expr(e._1); + return class_expr(e._1); case /* Pcf_val */ 1 : - const match = e._0[2]; - if (match.TAG === /* Cfk_virtual */ 0) { - return; - } else { - return expr(match._1); - } + const match = e._0[2]; + if (match.TAG === /* Cfk_virtual */ 0) { + return; + } else { + return expr(match._1); + } case /* Pcf_method */ 2 : - const match$1 = e._0[2]; - if (match$1.TAG === /* Cfk_virtual */ 0) { - return; - } else { - return expr(match$1._1); - } + const match$1 = e._0[2]; + if (match$1.TAG === /* Cfk_virtual */ 0) { + return; + } else { + return expr(match$1._1); + } case /* Pcf_initializer */ 4 : - return expr(e._0); + return expr(e._0); case /* Pcf_constraint */ 3 : case /* Pcf_attribute */ 5 : case /* Pcf_extension */ 6 : - return; + return; } }; @@ -62845,10 +62845,10 @@ function all_idents_cases(el) { const id = match._0.txt; switch (id.TAG) { case /* Lident */ 0 : - return Stdlib__Hashtbl.replace(idents, id._0, undefined); + return Stdlib__Hashtbl.replace(idents, id._0, undefined); case /* Ldot */ 1 : case /* Lapply */ 2 : - return; + return; } }; @@ -62869,19 +62869,19 @@ function all_idents_cases(el) { function type_constant(param) { switch (param.TAG) { case /* Const_int */ 0 : - return instance_def(type_int); + return instance_def(type_int); case /* Const_char */ 1 : - return instance_def(type_char); + return instance_def(type_char); case /* Const_string */ 2 : - return instance_def(type_string); + return instance_def(type_string); case /* Const_float */ 3 : - return instance_def(type_float); + return instance_def(type_float); case /* Const_int32 */ 4 : - return instance_def(type_int32); + return instance_def(type_int32); case /* Const_int64 */ 5 : - return instance_def(type_int64); + return instance_def(type_int64); case /* Const_nativeint */ 6 : - return instance_def(type_nativeint); + return instance_def(type_nativeint); } } @@ -63046,7 +63046,7 @@ function explicit_arity(param) { switch (param[0].txt) { case "explicit_arity" : case "ocaml.explicit_arity" : - return true; + return true; default: return false; } @@ -63531,148 +63531,148 @@ function build_as_type(env, _p) { } switch (pl.TAG) { case /* Tpat_alias */ 1 : - _p = pl._0; - continue; + _p = pl._0; + continue; case /* Tpat_tuple */ 3 : - const tyl = Stdlib__List.map((function (param) { - return build_as_type(env, param); - }), pl._0); - return newty2(current_level.contents, { - TAG: /* Ttuple */ 2, - _0: tyl - }); + const tyl = Stdlib__List.map((function (param) { + return build_as_type(env, param); + }), pl._0); + return newty2(current_level.contents, { + TAG: /* Ttuple */ 2, + _0: tyl + }); case /* Tpat_construct */ 4 : - const pl$1 = pl._2; - const cstr = pl._1; - const keep = cstr.cstr_private === /* Private */ 0 || Caml_obj.caml_notequal(cstr.cstr_existentials, /* [] */ 0); - if (keep) { - return p.pat_type; - } - const tyl$1 = Stdlib__List.map((function (param) { - return build_as_type(env, param); - }), pl$1); - const match = instance_constructor(undefined, cstr); - Stdlib__List.iter2((function (param) { - const p = param[0]; - const partial_arg = { - pat_desc: p.pat_desc, - pat_loc: p.pat_loc, - pat_extra: p.pat_extra, - pat_type: param[1], - pat_env: p.pat_env, - pat_attributes: p.pat_attributes - }; - return function (param) { - return unify_pat(env, partial_arg, param); - }; - }), Stdlib__List.combine(pl$1, tyl$1), match[0]); - return match[1]; + const pl$1 = pl._2; + const cstr = pl._1; + const keep = cstr.cstr_private === /* Private */ 0 || Caml_obj.caml_notequal(cstr.cstr_existentials, /* [] */ 0); + if (keep) { + return p.pat_type; + } + const tyl$1 = Stdlib__List.map((function (param) { + return build_as_type(env, param); + }), pl$1); + const match = instance_constructor(undefined, cstr); + Stdlib__List.iter2((function (param) { + const p = param[0]; + const partial_arg = { + pat_desc: p.pat_desc, + pat_loc: p.pat_loc, + pat_extra: p.pat_extra, + pat_type: param[1], + pat_env: p.pat_env, + pat_attributes: p.pat_attributes + }; + return function (param) { + return unify_pat(env, partial_arg, param); + }; + }), Stdlib__List.combine(pl$1, tyl$1), match[0]); + return match[1]; case /* Tpat_variant */ 5 : - const ty = may_map((function (param) { - return build_as_type(env, param); - }), pl._1); - const desc = { + const ty = may_map((function (param) { + return build_as_type(env, param); + }), pl._1); + const desc = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: { + hd: [ + pl._0, + { + TAG: /* Rpresent */ 0, + _0: ty + } + ], + tl: /* [] */ 0 + }, + row_more: newvar(undefined, undefined), + row_bound: undefined, + row_closed: false, + row_fixed: false, + row_name: undefined + } + }; + return newty2(current_level.contents, desc); + case /* Tpat_record */ 6 : + const lpl = pl._0; + const lbl = snd3(Stdlib__List.hd(lpl)); + if (lbl.lbl_private === /* Private */ 0) { + return p.pat_type; + } + const ty$1 = newvar(undefined, undefined); + const ppl = Stdlib__List.map((function (param) { + return [ + param[1].lbl_pos, + param[2] + ]; + }), lpl); + const do_label = function (lbl) { + const match = instance_label(false, lbl); + const ty_arg = match[1]; + unify_pat(env, { + pat_desc: p.pat_desc, + pat_loc: p.pat_loc, + pat_extra: p.pat_extra, + pat_type: ty$1, + pat_env: p.pat_env, + pat_attributes: p.pat_attributes + }, match[2]); + let refinable = false; + if (lbl.lbl_mut === /* Immutable */ 0) { + let tmp = false; + if (Stdlib__List.mem_assoc(lbl.lbl_pos, ppl)) { + const match$1 = repr(lbl.lbl_arg).desc; + let tmp$1; + tmp$1 = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tpoly */ 10 ? true : false; + tmp = tmp$1; + } + refinable = tmp; + } + if (refinable) { + const arg = Stdlib__List.assoc(lbl.lbl_pos, ppl); + return unify_pat(env, { + pat_desc: arg.pat_desc, + pat_loc: arg.pat_loc, + pat_extra: arg.pat_extra, + pat_type: build_as_type(env, arg), + pat_env: arg.pat_env, + pat_attributes: arg.pat_attributes + }, ty_arg); + } + const match$2 = instance_label(false, lbl); + unify$2(env, ty_arg, match$2[1]); + unify_pat(env, p, match$2[2]); + }; + Stdlib__Array.iter(do_label, lbl.lbl_all); + return ty$1; + case /* Tpat_or */ 8 : + const row = pl._2; + const p2 = pl._1; + if (row !== undefined) { + const row$1 = row_repr_aux(/* [] */ 0, row); + const desc$1 = { TAG: /* Tvariant */ 8, _0: { - row_fields: { - hd: [ - pl._0, - { - TAG: /* Rpresent */ 0, - _0: ty - } - ], - tl: /* [] */ 0 - }, + row_fields: row$1.row_fields, row_more: newvar(undefined, undefined), - row_bound: undefined, + row_bound: row$1.row_bound, row_closed: false, - row_fixed: false, - row_name: undefined - } - }; - return newty2(current_level.contents, desc); - case /* Tpat_record */ 6 : - const lpl = pl._0; - const lbl = snd3(Stdlib__List.hd(lpl)); - if (lbl.lbl_private === /* Private */ 0) { - return p.pat_type; - } - const ty$1 = newvar(undefined, undefined); - const ppl = Stdlib__List.map((function (param) { - return [ - param[1].lbl_pos, - param[2] - ]; - }), lpl); - const do_label = function (lbl) { - const match = instance_label(false, lbl); - const ty_arg = match[1]; - unify_pat(env, { - pat_desc: p.pat_desc, - pat_loc: p.pat_loc, - pat_extra: p.pat_extra, - pat_type: ty$1, - pat_env: p.pat_env, - pat_attributes: p.pat_attributes - }, match[2]); - let refinable = false; - if (lbl.lbl_mut === /* Immutable */ 0) { - let tmp = false; - if (Stdlib__List.mem_assoc(lbl.lbl_pos, ppl)) { - const match$1 = repr(lbl.lbl_arg).desc; - let tmp$1; - tmp$1 = /* tag */ typeof match$1 === "number" || typeof match$1 === "string" || match$1.TAG !== /* Tpoly */ 10 ? true : false; - tmp = tmp$1; - } - refinable = tmp; - } - if (refinable) { - const arg = Stdlib__List.assoc(lbl.lbl_pos, ppl); - return unify_pat(env, { - pat_desc: arg.pat_desc, - pat_loc: arg.pat_loc, - pat_extra: arg.pat_extra, - pat_type: build_as_type(env, arg), - pat_env: arg.pat_env, - pat_attributes: arg.pat_attributes - }, ty_arg); + row_fixed: row$1.row_fixed, + row_name: row$1.row_name } - const match$2 = instance_label(false, lbl); - unify$2(env, ty_arg, match$2[1]); - unify_pat(env, p, match$2[2]); }; - Stdlib__Array.iter(do_label, lbl.lbl_all); - return ty$1; - case /* Tpat_or */ 8 : - const row = pl._2; - const p2 = pl._1; - if (row !== undefined) { - const row$1 = row_repr_aux(/* [] */ 0, row); - const desc$1 = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$1.row_fields, - row_more: newvar(undefined, undefined), - row_bound: row$1.row_bound, - row_closed: false, - row_fixed: row$1.row_fixed, - row_name: row$1.row_name - } - }; - return newty2(current_level.contents, desc$1); - } - const ty1 = build_as_type(env, pl._0); - const ty2 = build_as_type(env, p2); - unify_pat(env, { - pat_desc: p2.pat_desc, - pat_loc: p2.pat_loc, - pat_extra: p2.pat_extra, - pat_type: ty2, - pat_env: p2.pat_env, - pat_attributes: p2.pat_attributes - }, ty1); - return ty1; + return newty2(current_level.contents, desc$1); + } + const ty1 = build_as_type(env, pl._0); + const ty2 = build_as_type(env, p2); + unify_pat(env, { + pat_desc: p2.pat_desc, + pat_loc: p2.pat_loc, + pat_extra: p2.pat_extra, + pat_type: ty2, + pat_env: p2.pat_env, + pat_attributes: p2.pat_attributes + }, ty1); + return ty1; default: return p.pat_type; } @@ -64000,36 +64000,36 @@ function lookup_from_type(env, tpath, lid) { const s = lid.txt; switch (s.TAG) { case /* Lident */ 0 : - const s$1 = s._0; - try { - return Stdlib__List.find((function (nd) { - return nd.lbl_name === s$1; - }), descrs); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: lid.loc, - _2: env, - _3: { - TAG: /* Wrong_name */ 13, - _0: "", - _1: newvar(undefined, undefined), - _2: type_kind, - _3: tpath, - _4: lid.txt - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const s$1 = s._0; + try { + return Stdlib__List.find((function (nd) { + return nd.lbl_name === s$1; + }), descrs); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: lid.loc, + _2: env, + _3: { + TAG: /* Wrong_name */ 13, + _0: "", + _1: newvar(undefined, undefined), + _2: type_kind, + _3: tpath, + _4: lid.txt + } + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Ldot */ 1 : case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -64282,34 +64282,34 @@ function disambiguate_lid_a_list(loc, closed, env, opath, lid_a_list) { } switch (msg.TAG) { case /* Not_principal */ 8 : - w_pr.contents = true; - return; + w_pr.contents = true; + return; case /* Name_out_of_scope */ 23 : - const match = msg._1; - if (match && !match.tl) { - w_scope.contents = { - hd: match.hd, - tl: w_scope.contents - }; - w_scope_ty.contents = msg._0; - return; - } else { - return prerr_warning(loc, msg); - } + const match = msg._1; + if (match && !match.tl) { + w_scope.contents = { + hd: match.hd, + tl: w_scope.contents + }; + w_scope_ty.contents = msg._0; + return; + } else { + return prerr_warning(loc, msg); + } case /* Ambiguous_name */ 24 : - const match$1 = msg._0; - if (match$1 && !match$1.tl) { - w_amb.contents = { - hd: [ - match$1.hd, - msg._1 - ], - tl: w_amb.contents - }; - return; - } else { - return prerr_warning(loc, msg); - } + const match$1 = msg._0; + if (match$1 && !match$1.tl) { + w_amb.contents = { + hd: [ + match$1.hd, + msg._1 + ], + tl: w_amb.contents + }; + return; + } else { + return prerr_warning(loc, msg); + } default: return prerr_warning(loc, msg); } @@ -64406,11 +64406,11 @@ function find_record_qual(_param) { const match = param.hd[0].txt; switch (match.TAG) { case /* Ldot */ 1 : - return match._0; + return match._0; case /* Lident */ 0 : case /* Lapply */ 2 : - _param = param.tl; - continue; + _param = param.tl; + continue; } }; @@ -64423,43 +64423,43 @@ function type_label_a_list(labels, loc, closed, env, type_lbl_a, opath, lid_a_li const s = lid_a_list.hd[0].txt; switch (s.TAG) { case /* Lident */ 0 : - if (labels !== undefined) { - const labels$1 = Caml_option.valFromOption(labels); - if (Stdlib__Hashtbl.mem(labels$1, s._0)) { - lbl_a_list = Stdlib__List.map((function (param) { - const lid = param[0]; - const s = lid.txt; - switch (s.TAG) { - case /* Lident */ 0 : - return [ - lid, - Stdlib__Hashtbl.find(labels$1, s._0), - param[1] - ]; - case /* Ldot */ 1 : - case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 43182, - 17 - ] - }); - - } - }), lid_a_list); - } else { - exit = 1; - } + if (labels !== undefined) { + const labels$1 = Caml_option.valFromOption(labels); + if (Stdlib__Hashtbl.mem(labels$1, s._0)) { + lbl_a_list = Stdlib__List.map((function (param) { + const lid = param[0]; + const s = lid.txt; + switch (s.TAG) { + case /* Lident */ 0 : + return [ + lid, + Stdlib__Hashtbl.find(labels$1, s._0), + param[1] + ]; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 43182, + 17 + ] + }); + + } + }), lid_a_list); } else { exit = 1; } - break; + } else { + exit = 1; + } + break; case /* Ldot */ 1 : case /* Lapply */ 2 : - exit = 1; - break; + exit = 1; + break; } } else { @@ -64472,20 +64472,20 @@ function type_label_a_list(labels, loc, closed, env, type_lbl_a, opath, lid_a_li const s = lid.txt; switch (s.TAG) { case /* Lident */ 0 : - return [ - { - txt: { - TAG: /* Ldot */ 1, - _0: modname, - _1: s._0 - }, - loc: lid.loc + return [ + { + txt: { + TAG: /* Ldot */ 1, + _0: modname, + _1: s._0 }, - lid_a[1] - ]; + loc: lid.loc + }, + lid_a[1] + ]; case /* Ldot */ 1 : case /* Lapply */ 2 : - return lid_a; + return lid_a; } }), lid_a_list) : lid_a_list; @@ -64578,36 +64578,36 @@ function lookup_from_type$1(env, tpath, lid) { const s = lid.txt; switch (s.TAG) { case /* Lident */ 0 : - const s$1 = s._0; - try { - return Stdlib__List.find((function (nd) { - return nd.cstr_name === s$1; - }), descrs); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: lid.loc, - _2: env, - _3: { - TAG: /* Wrong_name */ 13, - _0: "", - _1: newvar(undefined, undefined), - _2: type_kind$1, - _3: tpath, - _4: lid.txt - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const s$1 = s._0; + try { + return Stdlib__List.find((function (nd) { + return nd.cstr_name === s$1; + }), descrs); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: lid.loc, + _2: env, + _3: { + TAG: /* Wrong_name */ 13, + _0: "", + _1: newvar(undefined, undefined), + _2: type_kind$1, + _3: tpath, + _4: lid.txt + } + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Ldot */ 1 : case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } } @@ -64858,100 +64858,93 @@ function type_pat(constrs, labels, no_existentials, mode, env, sp, expected_ty) } switch (name.TAG) { case /* Ppat_var */ 0 : - const name$1 = name._0; - const id = enter_variable(undefined, undefined, loc, name$1, expected_ty); - return rp({ - pat_desc: { - TAG: /* Tpat_var */ 0, - _0: id, - _1: name$1 - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const name$1 = name._0; + const id = enter_variable(undefined, undefined, loc, name$1, expected_ty); + return rp({ + pat_desc: { + TAG: /* Tpat_var */ 0, + _0: id, + _1: name$1 + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_alias */ 1 : - const name$2 = name._1; - const q = type_pat$1(undefined, undefined)(name._0, expected_ty); - begin_def(undefined); - const ty_var = build_as_type(env.contents, q); - end_def(undefined); - iter_generalize$1({ - contents: /* [] */ 0 - }, ty_var); - const id$1 = enter_variable(undefined, true, loc, name$2, ty_var); - return rp({ - pat_desc: { - TAG: /* Tpat_alias */ 1, - _0: q, - _1: id$1, - _2: name$2 - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: q.pat_type, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const name$2 = name._1; + const q = type_pat$1(undefined, undefined)(name._0, expected_ty); + begin_def(undefined); + const ty_var = build_as_type(env.contents, q); + end_def(undefined); + iter_generalize$1({ + contents: /* [] */ 0 + }, ty_var); + const id$1 = enter_variable(undefined, true, loc, name$2, ty_var); + return rp({ + pat_desc: { + TAG: /* Tpat_alias */ 1, + _0: q, + _1: id$1, + _2: name$2 + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: q.pat_type, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_constant */ 2 : - const cst = name._0; - unify_pat_types(loc, env.contents, type_constant(cst), expected_ty); - return rp({ - pat_desc: { - TAG: /* Tpat_constant */ 2, - _0: cst - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const cst = name._0; + unify_pat_types(loc, env.contents, type_constant(cst), expected_ty); + return rp({ + pat_desc: { + TAG: /* Tpat_constant */ 2, + _0: cst + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_interval */ 3 : - const c1 = name._0; - if (c1.TAG === /* Const_char */ 1) { - const c2 = name._1; - if (c2.TAG === /* Const_char */ 1) { - const c2$1 = c2._0; - const c1$1 = c1._0; - const gloc_loc_start = loc.loc_start; - const gloc_loc_end = loc.loc_end; - const gloc = { - loc_start: gloc_loc_start, - loc_end: gloc_loc_end, - loc_ghost: true - }; - const loop = function (c1, c2) { - if (c1 === c2) { - return constant(gloc, undefined, { - TAG: /* Const_char */ 1, - _0: c1 - }); - } else { - return or_(gloc, undefined, constant(gloc, undefined, { - TAG: /* Const_char */ 1, - _0: c1 - }), loop(Stdlib__Char.chr(c1 + 1 | 0), c2)); - } - }; - const p = c1$1 <= c2$1 ? loop(c1$1, c2$1) : loop(c2$1, c1$1); - const p_ppat_desc = p.ppat_desc; - const p_ppat_attributes = p.ppat_attributes; - const p$1 = { - ppat_desc: p_ppat_desc, - ppat_loc: loc, - ppat_attributes: p_ppat_attributes - }; - return type_pat$1(undefined, undefined)(p$1, expected_ty); - } - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env.contents, - _3: /* Invalid_interval */ 5 - }); + const c1 = name._0; + if (c1.TAG === /* Const_char */ 1) { + const c2 = name._1; + if (c2.TAG === /* Const_char */ 1) { + const c2$1 = c2._0; + const c1$1 = c1._0; + const gloc_loc_start = loc.loc_start; + const gloc_loc_end = loc.loc_end; + const gloc = { + loc_start: gloc_loc_start, + loc_end: gloc_loc_end, + loc_ghost: true + }; + const loop = function (c1, c2) { + if (c1 === c2) { + return constant(gloc, undefined, { + TAG: /* Const_char */ 1, + _0: c1 + }); + } else { + return or_(gloc, undefined, constant(gloc, undefined, { + TAG: /* Const_char */ 1, + _0: c1 + }), loop(Stdlib__Char.chr(c1 + 1 | 0), c2)); + } + }; + const p = c1$1 <= c2$1 ? loop(c1$1, c2$1) : loop(c2$1, c1$1); + const p_ppat_desc = p.ppat_desc; + const p_ppat_attributes = p.ppat_attributes; + const p$1 = { + ppat_desc: p_ppat_desc, + ppat_loc: loc, + ppat_attributes: p_ppat_attributes + }; + return type_pat$1(undefined, undefined)(p$1, expected_ty); } throw new Caml_js_exceptions.MelangeError($$Error$7, { MEL_EXN_ID: $$Error$7, @@ -64959,469 +64952,435 @@ function type_pat(constrs, labels, no_existentials, mode, env, sp, expected_ty) _2: env.contents, _3: /* Invalid_interval */ 5 }); + } + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env.contents, + _3: /* Invalid_interval */ 5 + }); case /* Ppat_tuple */ 4 : - const spl = name._0; - if (Stdlib__List.length(spl) < 2) { - ill_formed_ast(loc, "Tuples must have at least 2 components."); - } - const spl_ann = Stdlib__List.map((function (p) { - return [ - p, - newvar(undefined, undefined) - ]; - }), spl); - const desc = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (prim) { - return prim[1]; - }), spl_ann) - }; - const ty = newty2(current_level.contents, desc); - unify_pat_types(loc, env.contents, ty, expected_ty); - const pl = Stdlib__List.map((function (param) { - return type_pat$1(undefined, undefined)(param[0], param[1]); - }), spl_ann); - return rp({ - pat_desc: { - TAG: /* Tpat_tuple */ 3, - _0: pl - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const spl = name._0; + if (Stdlib__List.length(spl) < 2) { + ill_formed_ast(loc, "Tuples must have at least 2 components."); + } + const spl_ann = Stdlib__List.map((function (p) { + return [ + p, + newvar(undefined, undefined) + ]; + }), spl); + const desc = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (prim) { + return prim[1]; + }), spl_ann) + }; + const ty = newty2(current_level.contents, desc); + unify_pat_types(loc, env.contents, ty, expected_ty); + const pl = Stdlib__List.map((function (param) { + return type_pat$1(undefined, undefined)(param[0], param[1]); + }), spl_ann); + return rp({ + pat_desc: { + TAG: /* Tpat_tuple */ 3, + _0: pl + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_construct */ 5 : - const sarg = name._1; - const lid = name._0; - let opath; - try { - const match = extract_concrete_variant(env.contents, expected_ty); - opath = [ - match[0], - match[1], - true - ]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - opath = undefined; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + const sarg = name._1; + const lid = name._0; + let opath; + try { + const match = extract_concrete_variant(env.contents, expected_ty); + opath = [ + match[0], + match[1], + true + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + opath = undefined; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const match$1 = lid.txt; - let constrs$1; - let exit = 0; - switch (match$1.TAG) { - case /* Lident */ 0 : - if (constrs !== undefined) { - const constrs$2 = Caml_option.valFromOption(constrs); - const s = match$1._0; - if (Stdlib__Hashtbl.mem(constrs$2, s)) { - constrs$1 = { - hd: [ - Stdlib__Hashtbl.find(constrs$2, s), - (function (param) { - - }) - ], - tl: /* [] */ 0 - }; - } else { - exit = 1; - } - } else { - exit = 1; - } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } + const match$1 = lid.txt; + let constrs$1; + let exit = 0; + switch (match$1.TAG) { + case /* Lident */ 0 : + if (constrs !== undefined) { + const constrs$2 = Caml_option.valFromOption(constrs); + const s = match$1._0; + if (Stdlib__Hashtbl.mem(constrs$2, s)) { + constrs$1 = { + hd: [ + Stdlib__Hashtbl.find(constrs$2, s), + (function (param) { + + }) + ], + tl: /* [] */ 0 + }; + } else { exit = 1; - break; - - } - if (exit === 1) { - constrs$1 = find_all_constructors(env.contents, lid.loc, lid.txt); - } - const check_lk = function (tpath, constr) { - if (!constr.cstr_generalized) { - return; + } + } else { + exit = 1; } - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: lid.loc, - _2: env.contents, - _3: { - TAG: /* Unqualified_gadt_pattern */ 34, - _0: tpath, - _1: constr.cstr_name - } - }); - }; - const partial_arg = env.contents; - const partial_arg$1 = check_lk; - const constr = wrap_disambiguate("This variant pattern is expected to have", expected_ty, (function (param) { - return disambiguate$1(undefined, partial_arg$1, undefined, lid, partial_arg, opath, param); - }), constrs$1); - mark_constructor(/* Pattern */ 1, env.contents, last$1(lid.txt), constr); - check_deprecated(loc, constr.cstr_attributes, constr.cstr_name); - if (no_existentials && Caml_obj.caml_notequal(constr.cstr_existentials, /* [] */ 0)) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env.contents, - _3: /* Unexpected_existential */ 4 - }); - } - if (constr.cstr_generalized) { - unify_head_only(loc, env.contents, expected_ty, constr); + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + exit = 1; + break; + + } + if (exit === 1) { + constrs$1 = find_all_constructors(env.contents, lid.loc, lid.txt); + } + const check_lk = function (tpath, constr) { + if (!constr.cstr_generalized) { + return; } - let sargs; - if (sarg !== undefined) { - const spl$1 = sarg.ppat_desc; - if (/* tag */ typeof spl$1 === "number" || typeof spl$1 === "string") { - if (constr.cstr_arity !== 1) { - if (constr.cstr_arity === 0) { - prerr_warning(sarg.ppat_loc, /* Wildcard_arg_to_constant_constr */ 13); + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: lid.loc, + _2: env.contents, + _3: { + TAG: /* Unqualified_gadt_pattern */ 34, + _0: tpath, + _1: constr.cstr_name } - sargs = replicate_list(sarg, constr.cstr_arity); - } else { - sargs = { - hd: sarg, - tl: /* [] */ 0 - }; + }); + }; + const partial_arg = env.contents; + const partial_arg$1 = check_lk; + const constr = wrap_disambiguate("This variant pattern is expected to have", expected_ty, (function (param) { + return disambiguate$1(undefined, partial_arg$1, undefined, lid, partial_arg, opath, param); + }), constrs$1); + mark_constructor(/* Pattern */ 1, env.contents, last$1(lid.txt), constr); + check_deprecated(loc, constr.cstr_attributes, constr.cstr_name); + if (no_existentials && Caml_obj.caml_notequal(constr.cstr_existentials, /* [] */ 0)) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env.contents, + _3: /* Unexpected_existential */ 4 + }); + } + if (constr.cstr_generalized) { + unify_head_only(loc, env.contents, expected_ty, constr); + } + let sargs; + if (sarg !== undefined) { + const spl$1 = sarg.ppat_desc; + if (/* tag */ typeof spl$1 === "number" || typeof spl$1 === "string") { + if (constr.cstr_arity !== 1) { + if (constr.cstr_arity === 0) { + prerr_warning(sarg.ppat_loc, /* Wildcard_arg_to_constant_constr */ 13); } + sargs = replicate_list(sarg, constr.cstr_arity); } else { - sargs = spl$1.TAG === /* Ppat_tuple */ 4 && (constr.cstr_arity > 1 || explicit_arity(sp.ppat_attributes)) ? spl$1._0 : ({ - hd: sarg, - tl: /* [] */ 0 - }); + sargs = { + hd: sarg, + tl: /* [] */ 0 + }; } } else { - sargs = /* [] */ 0; - } - if (Stdlib__List.length(sargs) !== constr.cstr_arity) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env.contents, - _3: { - TAG: /* Constructor_arity_mismatch */ 1, - _0: lid.txt, - _1: constr.cstr_arity, - _2: Stdlib__List.length(sargs) - } - }); - } - const match$2 = instance_constructor([ - env, - get_newtype_level$1(undefined) - ], constr); - const ty_res = match$2[1]; - if (constr.cstr_generalized && mode === /* Normal */ 0) { - unify_pat_types_gadt(loc, env, ty_res, expected_ty); - } else { - unify_pat_types(loc, env.contents, ty_res, expected_ty); - } - const args = Stdlib__List.map2((function (p, t) { - return type_pat$1(undefined, undefined)(p, t); - }), sargs, match$2[0]); - return rp({ - pat_desc: { - TAG: /* Tpat_construct */ 4, - _0: lid, - _1: constr, - _2: args - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes + sargs = spl$1.TAG === /* Ppat_tuple */ 4 && (constr.cstr_arity > 1 || explicit_arity(sp.ppat_attributes)) ? spl$1._0 : ({ + hd: sarg, + tl: /* [] */ 0 }); - case /* Ppat_variant */ 6 : - const sarg$1 = name._1; - const l = name._0; - const arg_type = sarg$1 !== undefined ? ({ - hd: newvar(undefined, undefined), - tl: /* [] */ 0 - }) : /* [] */ 0; - const row_row_fields = { - hd: [ - l, - { - TAG: /* Reither */ 1, - _0: sarg$1 === undefined, - _1: arg_type, - _2: true, + } + } else { + sargs = /* [] */ 0; + } + if (Stdlib__List.length(sargs) !== constr.cstr_arity) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env.contents, _3: { - contents: undefined + TAG: /* Constructor_arity_mismatch */ 1, + _0: lid.txt, + _1: constr.cstr_arity, + _2: Stdlib__List.length(sargs) } - } - ], + }); + } + const match$2 = instance_constructor([ + env, + get_newtype_level$1(undefined) + ], constr); + const ty_res = match$2[1]; + if (constr.cstr_generalized && mode === /* Normal */ 0) { + unify_pat_types_gadt(loc, env, ty_res, expected_ty); + } else { + unify_pat_types(loc, env.contents, ty_res, expected_ty); + } + const args = Stdlib__List.map2((function (p, t) { + return type_pat$1(undefined, undefined)(p, t); + }), sargs, match$2[0]); + return rp({ + pat_desc: { + TAG: /* Tpat_construct */ 4, + _0: lid, + _1: constr, + _2: args + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); + case /* Ppat_variant */ 6 : + const sarg$1 = name._1; + const l = name._0; + const arg_type = sarg$1 !== undefined ? ({ + hd: newvar(undefined, undefined), tl: /* [] */ 0 - }; - const row_row_more = newvar(undefined, undefined); - const row = { - row_fields: row_row_fields, - row_more: row_row_more, - row_bound: undefined, - row_closed: false, - row_fixed: false, - row_name: undefined - }; - unify_pat_types(loc, env.contents, newty2(current_level.contents, { - TAG: /* Tvariant */ 8, - _0: row - }), expected_ty); - const arg = sarg$1 !== undefined && arg_type && !arg_type.tl ? type_pat$1(undefined, undefined)(sarg$1, arg_type.hd) : undefined; - return rp({ - pat_desc: { - TAG: /* Tpat_variant */ 5, - _0: l, - _1: arg, - _2: { - contents: { - row_fields: row_row_fields, - row_more: newvar(undefined, undefined), - row_bound: undefined, - row_closed: false, - row_fixed: false, - row_name: undefined - } + }) : /* [] */ 0; + const row_row_fields = { + hd: [ + l, + { + TAG: /* Reither */ 1, + _0: sarg$1 === undefined, + _1: arg_type, + _2: true, + _3: { + contents: undefined + } + } + ], + tl: /* [] */ 0 + }; + const row_row_more = newvar(undefined, undefined); + const row = { + row_fields: row_row_fields, + row_more: row_row_more, + row_bound: undefined, + row_closed: false, + row_fixed: false, + row_name: undefined + }; + unify_pat_types(loc, env.contents, newty2(current_level.contents, { + TAG: /* Tvariant */ 8, + _0: row + }), expected_ty); + const arg = sarg$1 !== undefined && arg_type && !arg_type.tl ? type_pat$1(undefined, undefined)(sarg$1, arg_type.hd) : undefined; + return rp({ + pat_desc: { + TAG: /* Tpat_variant */ 5, + _0: l, + _1: arg, + _2: { + contents: { + row_fields: row_row_fields, + row_more: newvar(undefined, undefined), + row_bound: undefined, + row_closed: false, + row_fixed: false, + row_name: undefined } - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + } + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_record */ 7 : - const closed = name._1; - const lid_sp_list = name._0; - if (Caml_obj.caml_equal(lid_sp_list, /* [] */ 0)) { - ill_formed_ast(loc, "Records cannot be empty."); - } - let match$3; - try { - const match$4 = extract_concrete_record(env.contents, expected_ty); - match$3 = [ - [ - match$4[0], - match$4[1], - true - ], - expected_ty + const closed = name._1; + const lid_sp_list = name._0; + if (Caml_obj.caml_equal(lid_sp_list, /* [] */ 0)) { + ill_formed_ast(loc, "Records cannot be empty."); + } + let match$3; + try { + const match$4 = extract_concrete_record(env.contents, expected_ty); + match$3 = [ + [ + match$4[0], + match$4[1], + true + ], + expected_ty + ]; + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + match$3 = [ + undefined, + newvar(undefined, undefined) ]; + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - match$3 = [ - undefined, - newvar(undefined, undefined) - ]; - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } + } + const record_ty = match$3[1]; + const opath$1 = match$3[0]; + const type_label_pat = function (param) { + const label = param[1]; + const label_lid = param[0]; + begin_def(undefined); + const match = instance_label(false, label); + const ty_arg = match[1]; + const vars = match[0]; + if (Caml_obj.caml_equal(vars, /* [] */ 0)) { + end_def(undefined); } - const record_ty = match$3[1]; - const opath$1 = match$3[0]; - const type_label_pat = function (param) { - const label = param[1]; - const label_lid = param[0]; - begin_def(undefined); - const match = instance_label(false, label); - const ty_arg = match[1]; - const vars = match[0]; - if (Caml_obj.caml_equal(vars, /* [] */ 0)) { - end_def(undefined); - } - try { - unify_pat_types(loc, env.contents, match[2], record_ty); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: label_lid.loc, - _2: env.contents, - _3: { - TAG: /* Label_mismatch */ 2, - _0: label_lid.txt, - _1: trace._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + try { + unify_pat_types(loc, env.contents, match[2], record_ty); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: label_lid.loc, + _2: env.contents, + _3: { + TAG: /* Label_mismatch */ 2, + _0: label_lid.txt, + _1: trace._1 + } + }); } - const arg = type_pat$1(undefined, undefined)(param[2], ty_arg); - if (Caml_obj.caml_notequal(vars, /* [] */ 0)) { - end_def(undefined); - iter_generalize$1({ - contents: /* [] */ 0 - }, ty_arg); - Stdlib__List.iter(generalize, vars); - const instantiated = function (tv) { - const tv$1 = expand_head(env.contents, tv); - if (is_Tvar(tv$1)) { - return tv$1.level !== 100000000; - } else { - return true; - } - }; - if (Stdlib__List.exists(instantiated, vars)) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: label_lid.loc, - _2: env.contents, - _3: { - TAG: /* Polymorphic_label */ 0, - _0: label_lid.txt - } - }); + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + const arg = type_pat$1(undefined, undefined)(param[2], ty_arg); + if (Caml_obj.caml_notequal(vars, /* [] */ 0)) { + end_def(undefined); + iter_generalize$1({ + contents: /* [] */ 0 + }, ty_arg); + Stdlib__List.iter(generalize, vars); + const instantiated = function (tv) { + const tv$1 = expand_head(env.contents, tv); + if (is_Tvar(tv$1)) { + return tv$1.level !== 100000000; + } else { + return true; } - + }; + if (Stdlib__List.exists(instantiated, vars)) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: label_lid.loc, + _2: env.contents, + _3: { + TAG: /* Polymorphic_label */ 0, + _0: label_lid.txt + } + }); } - return [ - label_lid, - label, - arg - ]; - }; - const partial_arg$2 = env.contents; - const lbl_pat_list = wrap_disambiguate("This record pattern is expected to have", expected_ty, (function (param) { - return type_label_a_list(labels, loc, false, partial_arg$2, type_label_pat, opath$1, param); - }), lid_sp_list); - check_recordpat_labels(loc, lbl_pat_list, closed); - unify_pat_types(loc, env.contents, record_ty, expected_ty); - return rp({ - pat_desc: { - TAG: /* Tpat_record */ 6, - _0: lbl_pat_list, - _1: closed - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + + } + return [ + label_lid, + label, + arg + ]; + }; + const partial_arg$2 = env.contents; + const lbl_pat_list = wrap_disambiguate("This record pattern is expected to have", expected_ty, (function (param) { + return type_label_a_list(labels, loc, false, partial_arg$2, type_label_pat, opath$1, param); + }), lid_sp_list); + check_recordpat_labels(loc, lbl_pat_list, closed); + unify_pat_types(loc, env.contents, record_ty, expected_ty); + return rp({ + pat_desc: { + TAG: /* Tpat_record */ 6, + _0: lbl_pat_list, + _1: closed + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_array */ 8 : - const ty_elt = newvar(undefined, undefined); - unify_pat_types(loc, env.contents, instance_def(type_array(ty_elt)), expected_ty); - const spl_ann$1 = Stdlib__List.map((function (p) { - return [ - p, - newvar(undefined, undefined) - ]; - }), name._0); - const pl$1 = Stdlib__List.map((function (param) { - return type_pat$1(undefined, undefined)(param[0], ty_elt); - }), spl_ann$1); - return rp({ - pat_desc: { - TAG: /* Tpat_array */ 7, - _0: pl$1 - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const ty_elt = newvar(undefined, undefined); + unify_pat_types(loc, env.contents, instance_def(type_array(ty_elt)), expected_ty); + const spl_ann$1 = Stdlib__List.map((function (p) { + return [ + p, + newvar(undefined, undefined) + ]; + }), name._0); + const pl$1 = Stdlib__List.map((function (param) { + return type_pat$1(undefined, undefined)(param[0], ty_elt); + }), spl_ann$1); + return rp({ + pat_desc: { + TAG: /* Tpat_array */ 7, + _0: pl$1 + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_or */ 9 : - const initial_pattern_variables = pattern_variables.contents; - const p1 = type_pat$1(/* Inside_or */ 1, undefined)(name._0, expected_ty); - const p1_variables = pattern_variables.contents; - pattern_variables.contents = initial_pattern_variables; - const p2 = type_pat$1(/* Inside_or */ 1, undefined)(name._1, expected_ty); - const p2_variables = pattern_variables.contents; - const alpha_env = enter_orpat_variables(loc, env.contents, p1_variables, p2_variables); - pattern_variables.contents = p1_variables; - return rp({ - pat_desc: { - TAG: /* Tpat_or */ 8, - _0: p1, - _1: alpha_pat(alpha_env, p2), - _2: undefined - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const initial_pattern_variables = pattern_variables.contents; + const p1 = type_pat$1(/* Inside_or */ 1, undefined)(name._0, expected_ty); + const p1_variables = pattern_variables.contents; + pattern_variables.contents = initial_pattern_variables; + const p2 = type_pat$1(/* Inside_or */ 1, undefined)(name._1, expected_ty); + const p2_variables = pattern_variables.contents; + const alpha_env = enter_orpat_variables(loc, env.contents, p1_variables, p2_variables); + pattern_variables.contents = p1_variables; + return rp({ + pat_desc: { + TAG: /* Tpat_or */ 8, + _0: p1, + _1: alpha_pat(alpha_env, p2), + _2: undefined + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_constraint */ 10 : - const sp$1 = name._0; - let exit$1 = 0; - const name$3 = sp$1.ppat_desc; - if (/* tag */ typeof name$3 === "number" || typeof name$3 === "string" || name$3.TAG !== /* Ppat_var */ 0) { + const sp$1 = name._0; + let exit$1 = 0; + const name$3 = sp$1.ppat_desc; + if (/* tag */ typeof name$3 === "number" || typeof name$3 === "string" || name$3.TAG !== /* Ppat_var */ 0) { + exit$1 = 1; + } else { + const sty = name._1; + let tmp = sty.ptyp_desc; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string" || tmp.TAG !== /* Ptyp_poly */ 8) { exit$1 = 1; } else { - const sty = name._1; - let tmp = sty.ptyp_desc; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string" || tmp.TAG !== /* Ptyp_poly */ 8) { - exit$1 = 1; - } else { - const lloc = sp$1.ppat_loc; - const name$4 = name$3._0; - const match$5 = transl_simple_type_delayed(env.contents, sty); - const cty = match$5[0]; - const ty$1 = cty.ctyp_type; - unify_pat_types(lloc, env.contents, ty$1, expected_ty); - pattern_force.contents = { - hd: match$5[1], - tl: pattern_force.contents - }; - const match$6 = ty$1.desc; - if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 43318, - 13 - ] - }); - } - if (match$6.TAG === /* Tpoly */ 10) { - begin_def(undefined); - const match$7 = instance_poly(true, false, match$6._1, match$6._0); - const ty$p = match$7[1]; - end_def(undefined); - iter_generalize$1({ - contents: /* [] */ 0 - }, ty$p); - const id$2 = enter_variable(undefined, undefined, lloc, name$4, ty$p); - return rp({ - pat_desc: { - TAG: /* Tpat_var */ 0, - _0: id$2, - _1: name$4 - }, - pat_loc: lloc, - pat_extra: { - hd: [ - { - TAG: /* Tpat_constraint */ 0, - _0: cty - }, - loc, - sp.ppat_attributes - ], - tl: /* [] */ 0 - }, - pat_type: ty$1, - pat_env: env.contents, - pat_attributes: /* [] */ 0 - }); - } + const lloc = sp$1.ppat_loc; + const name$4 = name$3._0; + const match$5 = transl_simple_type_delayed(env.contents, sty); + const cty = match$5[0]; + const ty$1 = cty.ctyp_type; + unify_pat_types(lloc, env.contents, ty$1, expected_ty); + pattern_force.contents = { + hd: match$5[1], + tl: pattern_force.contents + }; + const match$6 = ty$1.desc; + if (/* tag */ typeof match$6 === "number" || typeof match$6 === "string") { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ @@ -65431,153 +65390,194 @@ function type_pat(constrs, labels, no_existentials, mode, env, sp, expected_ty) ] }); } - } - if (exit$1 === 1) { - begin_def(undefined); - const match$8 = transl_simple_type_delayed(env.contents, name._1); - const cty$1 = match$8[0]; - const ty$2 = cty$1.ctyp_type; - end_def(undefined); - generalize_structure$1(current_level.contents, ty$2); - const ty$3 = instance(undefined, env.contents, ty$2); - const expected_ty$p = instance(undefined, env.contents, ty$2); - unify_pat_types(loc, env.contents, ty$3, expected_ty); - const p$2 = type_pat$1(undefined, undefined)(sp$1, expected_ty$p); - pattern_force.contents = { - hd: match$8[1], - tl: pattern_force.contents - }; - const extra_0 = { - TAG: /* Tpat_constraint */ 0, - _0: cty$1 - }; - const extra_2 = sp$1.ppat_attributes; - const extra = [ - extra_0, - loc, - extra_2 - ]; - const match$9 = p$2.pat_desc; - let exit$2 = 0; - if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { - exit$2 = 2; - } else { - if (match$9.TAG === /* Tpat_var */ 0) { - return { - pat_desc: { - TAG: /* Tpat_alias */ 1, - _0: { - pat_desc: /* Tpat_any */ 0, - pat_loc: p$2.pat_loc, - pat_extra: p$2.pat_extra, - pat_type: p$2.pat_type, - pat_env: p$2.pat_env, - pat_attributes: /* [] */ 0 + if (match$6.TAG === /* Tpoly */ 10) { + begin_def(undefined); + const match$7 = instance_poly(true, false, match$6._1, match$6._0); + const ty$p = match$7[1]; + end_def(undefined); + iter_generalize$1({ + contents: /* [] */ 0 + }, ty$p); + const id$2 = enter_variable(undefined, undefined, lloc, name$4, ty$p); + return rp({ + pat_desc: { + TAG: /* Tpat_var */ 0, + _0: id$2, + _1: name$4 }, - _1: match$9._0, - _2: match$9._1 - }, - pat_loc: p$2.pat_loc, - pat_extra: { - hd: extra, - tl: /* [] */ 0 - }, - pat_type: ty$3, - pat_env: p$2.pat_env, - pat_attributes: p$2.pat_attributes - }; - } - exit$2 = 2; + pat_loc: lloc, + pat_extra: { + hd: [ + { + TAG: /* Tpat_constraint */ 0, + _0: cty + }, + loc, + sp.ppat_attributes + ], + tl: /* [] */ 0 + }, + pat_type: ty$1, + pat_env: env.contents, + pat_attributes: /* [] */ 0 + }); } - if (exit$2 === 2) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 43318, + 13 + ] + }); + } + } + if (exit$1 === 1) { + begin_def(undefined); + const match$8 = transl_simple_type_delayed(env.contents, name._1); + const cty$1 = match$8[0]; + const ty$2 = cty$1.ctyp_type; + end_def(undefined); + generalize_structure$1(current_level.contents, ty$2); + const ty$3 = instance(undefined, env.contents, ty$2); + const expected_ty$p = instance(undefined, env.contents, ty$2); + unify_pat_types(loc, env.contents, ty$3, expected_ty); + const p$2 = type_pat$1(undefined, undefined)(sp$1, expected_ty$p); + pattern_force.contents = { + hd: match$8[1], + tl: pattern_force.contents + }; + const extra_0 = { + TAG: /* Tpat_constraint */ 0, + _0: cty$1 + }; + const extra_2 = sp$1.ppat_attributes; + const extra = [ + extra_0, + loc, + extra_2 + ]; + const match$9 = p$2.pat_desc; + let exit$2 = 0; + if (/* tag */ typeof match$9 === "number" || typeof match$9 === "string") { + exit$2 = 2; + } else { + if (match$9.TAG === /* Tpat_var */ 0) { return { - pat_desc: p$2.pat_desc, + pat_desc: { + TAG: /* Tpat_alias */ 1, + _0: { + pat_desc: /* Tpat_any */ 0, + pat_loc: p$2.pat_loc, + pat_extra: p$2.pat_extra, + pat_type: p$2.pat_type, + pat_env: p$2.pat_env, + pat_attributes: /* [] */ 0 + }, + _1: match$9._0, + _2: match$9._1 + }, pat_loc: p$2.pat_loc, pat_extra: { hd: extra, - tl: p$2.pat_extra + tl: /* [] */ 0 }, pat_type: ty$3, pat_env: p$2.pat_env, pat_attributes: p$2.pat_attributes }; } - + exit$2 = 2; } - break; + if (exit$2 === 2) { + return { + pat_desc: p$2.pat_desc, + pat_loc: p$2.pat_loc, + pat_extra: { + hd: extra, + tl: p$2.pat_extra + }, + pat_type: ty$3, + pat_env: p$2.pat_env, + pat_attributes: p$2.pat_attributes + }; + } + + } + break; case /* Ppat_type */ 11 : - const lid$1 = name._0; - const match$10 = build_or_pat(env.contents, loc, lid$1.txt); - const p$3 = match$10[1]; - unify_pat_types(loc, env.contents, match$10[2], expected_ty); - return { - pat_desc: p$3.pat_desc, - pat_loc: p$3.pat_loc, - pat_extra: { - hd: [ - { - TAG: /* Tpat_type */ 1, - _0: match$10[0], - _1: lid$1 - }, - loc, - sp.ppat_attributes - ], - tl: p$3.pat_extra - }, - pat_type: p$3.pat_type, - pat_env: p$3.pat_env, - pat_attributes: p$3.pat_attributes - }; + const lid$1 = name._0; + const match$10 = build_or_pat(env.contents, loc, lid$1.txt); + const p$3 = match$10[1]; + unify_pat_types(loc, env.contents, match$10[2], expected_ty); + return { + pat_desc: p$3.pat_desc, + pat_loc: p$3.pat_loc, + pat_extra: { + hd: [ + { + TAG: /* Tpat_type */ 1, + _0: match$10[0], + _1: lid$1 + }, + loc, + sp.ppat_attributes + ], + tl: p$3.pat_extra + }, + pat_type: p$3.pat_type, + pat_env: p$3.pat_env, + pat_attributes: p$3.pat_attributes + }; case /* Ppat_lazy */ 12 : - const nv = newvar(undefined, undefined); - unify_pat_types(loc, env.contents, instance_def(type_lazy_t(nv)), expected_ty); - const p1$1 = type_pat$1(undefined, undefined)(name._0, nv); - return rp({ - pat_desc: { - TAG: /* Tpat_lazy */ 9, - _0: p1$1 - }, - pat_loc: loc, - pat_extra: /* [] */ 0, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: sp.ppat_attributes - }); + const nv = newvar(undefined, undefined); + unify_pat_types(loc, env.contents, instance_def(type_lazy_t(nv)), expected_ty); + const p1$1 = type_pat$1(undefined, undefined)(name._0, nv); + return rp({ + pat_desc: { + TAG: /* Tpat_lazy */ 9, + _0: p1$1 + }, + pat_loc: loc, + pat_extra: /* [] */ 0, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: sp.ppat_attributes + }); case /* Ppat_unpack */ 13 : - const name$5 = name._0; - const id$3 = enter_variable(true, undefined, loc, name$5, expected_ty); - return rp({ - pat_desc: { - TAG: /* Tpat_var */ 0, - _0: id$3, - _1: name$5 - }, - pat_loc: sp.ppat_loc, - pat_extra: { - hd: [ - /* Tpat_unpack */ 0, - loc, - sp.ppat_attributes - ], - tl: /* [] */ 0 - }, - pat_type: expected_ty, - pat_env: env.contents, - pat_attributes: /* [] */ 0 - }); + const name$5 = name._0; + const id$3 = enter_variable(true, undefined, loc, name$5, expected_ty); + return rp({ + pat_desc: { + TAG: /* Tpat_var */ 0, + _0: id$3, + _1: name$5 + }, + pat_loc: sp.ppat_loc, + pat_extra: { + hd: [ + /* Tpat_unpack */ 0, + loc, + sp.ppat_attributes + ], + tl: /* [] */ 0 + }, + pat_type: expected_ty, + pat_env: env.contents, + pat_attributes: /* [] */ 0 + }); case /* Ppat_exception */ 14 : - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env.contents, - _3: /* Exception_pattern_below_toplevel */ 8 - }); + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env.contents, + _3: /* Exception_pattern_below_toplevel */ 8 + }); case /* Ppat_extension */ 15 : - throw new Caml_js_exceptions.MelangeError(Error_forward$1, { - MEL_EXN_ID: Error_forward$1, - _1: error_of_extension(name._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$1, { + MEL_EXN_ID: Error_forward$1, + _1: error_of_extension(name._0) + }); } } @@ -65884,22 +65884,22 @@ function final_subexpression(_sexp) { const match = sexp.pexp_desc; switch (match.TAG) { case /* Pexp_let */ 2 : - _sexp = match._2; - continue; + _sexp = match._2; + continue; case /* Pexp_match */ 6 : - const match$1 = match._1; - if (!match$1) { - return sexp; - } - _sexp = match$1.hd.pc_rhs; - continue; + const match$1 = match._1; + if (!match$1) { + return sexp; + } + _sexp = match$1.hd.pc_rhs; + continue; case /* Pexp_try */ 7 : - _sexp = match._0; - continue; + _sexp = match._0; + continue; case /* Pexp_ifthenelse */ 15 : case /* Pexp_sequence */ 16 : - _sexp = match._1; - continue; + _sexp = match._1; + continue; default: return sexp; } @@ -65912,110 +65912,110 @@ function is_nonexpansive(_exp) { const el = exp.exp_desc; switch (el.TAG) { case /* Texp_let */ 2 : - if (!Stdlib__List.for_all((function (vb) { - return is_nonexpansive(vb.vb_expr); - }), el._1)) { - return false; - } - _exp = el._2; - continue; + if (!Stdlib__List.for_all((function (vb) { + return is_nonexpansive(vb.vb_expr); + }), el._1)) { + return false; + } + _exp = el._2; + continue; case /* Texp_ident */ 0 : case /* Texp_constant */ 1 : case /* Texp_function */ 3 : - return true; + return true; case /* Texp_apply */ 4 : - const match = el._1; - if (match && !(match.hd[1] !== undefined || !is_nonexpansive(el._0))) { - return Stdlib__List.for_all(is_nonexpansive_opt, Stdlib__List.map(snd3, match.tl)); - } else { - return false; - } + const match = el._1; + if (match && !(match.hd[1] !== undefined || !is_nonexpansive(el._0))) { + return Stdlib__List.for_all(is_nonexpansive_opt, Stdlib__List.map(snd3, match.tl)); + } else { + return false; + } case /* Texp_match */ 5 : - if (el._2 || !is_nonexpansive(el._0)) { - return false; - } else { - return Stdlib__List.for_all((function (param) { - if (is_nonexpansive_opt(param.c_guard)) { - return is_nonexpansive(param.c_rhs); - } else { - return false; - } - }), el._1); - } + if (el._2 || !is_nonexpansive(el._0)) { + return false; + } else { + return Stdlib__List.for_all((function (param) { + if (is_nonexpansive_opt(param.c_guard)) { + return is_nonexpansive(param.c_rhs); + } else { + return false; + } + }), el._1); + } case /* Texp_tuple */ 7 : - return Stdlib__List.for_all(is_nonexpansive, el._0); + return Stdlib__List.for_all(is_nonexpansive, el._0); case /* Texp_construct */ 8 : - return Stdlib__List.for_all(is_nonexpansive, el._2); + return Stdlib__List.for_all(is_nonexpansive, el._2); case /* Texp_variant */ 9 : - return is_nonexpansive_opt(el._1); + return is_nonexpansive_opt(el._1); case /* Texp_record */ 10 : - if (Stdlib__List.for_all((function (param) { - return param[1].lbl_mut === /* Immutable */ 0 ? is_nonexpansive(param[2]) : false; - }), el._0)) { - return is_nonexpansive_opt(el._1); - } else { - return false; - } + if (Stdlib__List.for_all((function (param) { + return param[1].lbl_mut === /* Immutable */ 0 ? is_nonexpansive(param[2]) : false; + }), el._0)) { + return is_nonexpansive_opt(el._1); + } else { + return false; + } case /* Texp_array */ 13 : - if (el._0) { - return false; - } else { - return true; - } + if (el._0) { + return false; + } else { + return true; + } case /* Texp_ifthenelse */ 14 : - if (is_nonexpansive(el._1)) { - return is_nonexpansive_opt(el._2); - } else { - return false; - } + if (is_nonexpansive(el._1)) { + return is_nonexpansive_opt(el._2); + } else { + return false; + } case /* Texp_sequence */ 15 : - _exp = el._1; - continue; + _exp = el._1; + continue; case /* Texp_new */ 19 : - return class_type_arity(el._2.cty_type) > 0; + return class_type_arity(el._2.cty_type) > 0; case /* Texp_letmodule */ 23 : - if (!is_nonexpansive_mod(el._2)) { - return false; - } - _exp = el._3; - continue; + if (!is_nonexpansive_mod(el._2)) { + return false; + } + _exp = el._3; + continue; case /* Texp_field */ 11 : case /* Texp_lazy */ 25 : - _exp = el._0; - continue; + _exp = el._0; + continue; case /* Texp_object */ 26 : - const match$1 = el._0; - const count = { - contents: 0 - }; - if (Stdlib__List.for_all((function (field) { - const e = field.cf_desc; - switch (e.TAG) { - case /* Tcf_inherit */ 0 : - return false; - case /* Tcf_val */ 1 : - const match = e._3; - if (match.TAG === /* Tcfk_virtual */ 0) { - count.contents = count.contents + 1 | 0; - return true; - } - count.contents = count.contents + 1 | 0; - return is_nonexpansive(match._1); - case /* Tcf_initializer */ 4 : - return is_nonexpansive(e._0); - default: + const match$1 = el._0; + const count = { + contents: 0 + }; + if (Stdlib__List.for_all((function (field) { + const e = field.cf_desc; + switch (e.TAG) { + case /* Tcf_inherit */ 0 : + return false; + case /* Tcf_val */ 1 : + const match = e._3; + if (match.TAG === /* Tcfk_virtual */ 0) { + count.contents = count.contents + 1 | 0; return true; - } - }), match$1.cstr_fields) && Curry._3(Meths.fold, (function (param, param$1, b) { - count.contents = count.contents - 1 | 0; - return b ? param$1[0] === /* Immutable */ 0 : false; - }), match$1.cstr_type.csig_vars, true)) { - return count.contents === 0; - } else { - return false; - } + } + count.contents = count.contents + 1 | 0; + return is_nonexpansive(match._1); + case /* Tcf_initializer */ 4 : + return is_nonexpansive(e._0); + default: + return true; + } + }), match$1.cstr_fields) && Curry._3(Meths.fold, (function (param, param$1, b) { + count.contents = count.contents - 1 | 0; + return b ? param$1[0] === /* Immutable */ 0 : false; + }), match$1.cstr_type.csig_vars, true)) { + return count.contents === 0; + } else { + return false; + } case /* Texp_pack */ 27 : - return is_nonexpansive_mod(el._0); + return is_nonexpansive_mod(el._0); default: return false; } @@ -66028,51 +66028,51 @@ function is_nonexpansive_mod(_mexp) { const str = mexp.mod_desc; switch (str.TAG) { case /* Tmod_structure */ 1 : - return Stdlib__List.for_all((function (item) { - const id_mod_list = item.str_desc; - switch (id_mod_list.TAG) { - case /* Tstr_value */ 1 : - return Stdlib__List.for_all((function (vb) { - return is_nonexpansive(vb.vb_expr); - }), id_mod_list._1); - case /* Tstr_typext */ 4 : - return Stdlib__List.for_all((function (param) { - if (param.ext_kind.TAG === /* Text_decl */ 0) { - return false; - } else { - return true; - } - }), id_mod_list._0.tyext_constructors); - case /* Tstr_exception */ 5 : - if (id_mod_list._0.ext_kind.TAG === /* Text_decl */ 0) { - return false; - } else { - return true; - } - case /* Tstr_module */ 6 : - return is_nonexpansive_mod(id_mod_list._0.mb_expr); - case /* Tstr_recmodule */ 7 : - return Stdlib__List.for_all((function (param) { - return is_nonexpansive_mod(param.mb_expr); - }), id_mod_list._0); - case /* Tstr_class */ 10 : - return false; - case /* Tstr_include */ 12 : - return is_nonexpansive_mod(id_mod_list._0.incl_mod); - default: + return Stdlib__List.for_all((function (item) { + const id_mod_list = item.str_desc; + switch (id_mod_list.TAG) { + case /* Tstr_value */ 1 : + return Stdlib__List.for_all((function (vb) { + return is_nonexpansive(vb.vb_expr); + }), id_mod_list._1); + case /* Tstr_typext */ 4 : + return Stdlib__List.for_all((function (param) { + if (param.ext_kind.TAG === /* Text_decl */ 0) { + return false; + } else { + return true; + } + }), id_mod_list._0.tyext_constructors); + case /* Tstr_exception */ 5 : + if (id_mod_list._0.ext_kind.TAG === /* Text_decl */ 0) { + return false; + } else { return true; - } - }), str._0.str_items); + } + case /* Tstr_module */ 6 : + return is_nonexpansive_mod(id_mod_list._0.mb_expr); + case /* Tstr_recmodule */ 7 : + return Stdlib__List.for_all((function (param) { + return is_nonexpansive_mod(param.mb_expr); + }), id_mod_list._0); + case /* Tstr_class */ 10 : + return false; + case /* Tstr_include */ 12 : + return is_nonexpansive_mod(id_mod_list._0.incl_mod); + default: + return true; + } + }), str._0.str_items); case /* Tmod_ident */ 0 : case /* Tmod_functor */ 2 : - return true; + return true; case /* Tmod_apply */ 3 : - return false; + return false; case /* Tmod_constraint */ 4 : - _mexp = str._0; - continue; + _mexp = str._0; + continue; case /* Tmod_unpack */ 5 : - return is_nonexpansive(str._0); + return is_nonexpansive(str._0); } }; @@ -66095,49 +66095,49 @@ function approx_type(env, _sty) { } switch (args.TAG) { case /* Ptyp_arrow */ 1 : - const p = args._0; - const ty1 = is_optional(p) ? type_option$1(newvar(undefined, undefined)) : newvar(undefined, undefined); - const desc_2 = approx_type(env, args._2); - const desc = { - TAG: /* Tarrow */ 1, - _0: p, - _1: ty1, - _2: desc_2, - _3: /* Cok */ 0 - }; - return newty2(current_level.contents, desc); + const p = args._0; + const ty1 = is_optional(p) ? type_option$1(newvar(undefined, undefined)) : newvar(undefined, undefined); + const desc_2 = approx_type(env, args._2); + const desc = { + TAG: /* Tarrow */ 1, + _0: p, + _1: ty1, + _2: desc_2, + _3: /* Cok */ 0 + }; + return newty2(current_level.contents, desc); case /* Ptyp_tuple */ 2 : - const desc$1 = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (param) { - return approx_type(env, param); - }), args._0) - }; - return newty2(current_level.contents, desc$1); + const desc$1 = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (param) { + return approx_type(env, param); + }), args._0) + }; + return newty2(current_level.contents, desc$1); case /* Ptyp_constr */ 3 : - const ctl = args._1; - try { - const match = lookup_type$1(args._0.txt, env); - if (Stdlib__List.length(ctl) !== match[1].type_arity) { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - const tyl = Stdlib__List.map((function (param) { - return approx_type(env, param); - }), ctl); - return newconstr(match[0], tyl); + const ctl = args._1; + try { + const match = lookup_type$1(args._0.txt, env); + if (Stdlib__List.length(ctl) !== match[1].type_arity) { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return newvar(undefined, undefined); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const tyl = Stdlib__List.map((function (param) { + return approx_type(env, param); + }), ctl); + return newconstr(match[0], tyl); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return newvar(undefined, undefined); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Ptyp_poly */ 8 : - _sty = args._1; - continue; + _sty = args._1; + continue; default: return newvar(undefined, undefined); } @@ -66150,121 +66150,121 @@ function type_approx(env, _sexp) { const l = sexp.pexp_desc; switch (l.TAG) { case /* Pexp_let */ 2 : - _sexp = l._2; - continue; + _sexp = l._2; + continue; case /* Pexp_function */ 3 : - const match = l._0; - if (!match) { - return newvar(undefined, undefined); - } - const desc_1 = newvar(undefined, undefined); - const desc_2 = type_approx(env, match.hd.pc_rhs); - const desc = { - TAG: /* Tarrow */ 1, - _0: "", - _1: desc_1, - _2: desc_2, - _3: /* Cok */ 0 - }; - return newty2(current_level.contents, desc); + const match = l._0; + if (!match) { + return newvar(undefined, undefined); + } + const desc_1 = newvar(undefined, undefined); + const desc_2 = type_approx(env, match.hd.pc_rhs); + const desc = { + TAG: /* Tarrow */ 1, + _0: "", + _1: desc_1, + _2: desc_2, + _3: /* Cok */ 0 + }; + return newty2(current_level.contents, desc); case /* Pexp_fun */ 4 : - const p = l._0; - if (is_optional(p)) { - const desc_1$1 = type_option$1(newvar(undefined, undefined)); - const desc_2$1 = type_approx(env, l._3); - const desc$1 = { - TAG: /* Tarrow */ 1, - _0: p, - _1: desc_1$1, - _2: desc_2$1, - _3: /* Cok */ 0 - }; - return newty2(current_level.contents, desc$1); - } - const desc_1$2 = newvar(undefined, undefined); - const desc_2$2 = type_approx(env, l._3); - const desc$2 = { + const p = l._0; + if (is_optional(p)) { + const desc_1$1 = type_option$1(newvar(undefined, undefined)); + const desc_2$1 = type_approx(env, l._3); + const desc$1 = { TAG: /* Tarrow */ 1, _0: p, - _1: desc_1$2, - _2: desc_2$2, + _1: desc_1$1, + _2: desc_2$1, _3: /* Cok */ 0 }; - return newty2(current_level.contents, desc$2); + return newty2(current_level.contents, desc$1); + } + const desc_1$2 = newvar(undefined, undefined); + const desc_2$2 = type_approx(env, l._3); + const desc$2 = { + TAG: /* Tarrow */ 1, + _0: p, + _1: desc_1$2, + _2: desc_2$2, + _3: /* Cok */ 0 + }; + return newty2(current_level.contents, desc$2); case /* Pexp_match */ 6 : - const match$1 = l._1; - if (!match$1) { - return newvar(undefined, undefined); - } - _sexp = match$1.hd.pc_rhs; - continue; + const match$1 = l._1; + if (!match$1) { + return newvar(undefined, undefined); + } + _sexp = match$1.hd.pc_rhs; + continue; case /* Pexp_try */ 7 : - _sexp = l._0; - continue; + _sexp = l._0; + continue; case /* Pexp_tuple */ 8 : - const desc$3 = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (param) { - return type_approx(env, param); - }), l._0) - }; - return newty2(current_level.contents, desc$3); + const desc$3 = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (param) { + return type_approx(env, param); + }), l._0) + }; + return newty2(current_level.contents, desc$3); case /* Pexp_ifthenelse */ 15 : case /* Pexp_sequence */ 16 : - _sexp = l._1; - continue; + _sexp = l._1; + continue; case /* Pexp_constraint */ 19 : - const ty = type_approx(env, l._0); - const ty1 = approx_type(env, l._1); - try { - unify$2(env, ty, ty1); + const ty = type_approx(env, l._0); + const ty1 = approx_type(env, l._1); + try { + unify$2(env, ty, ty1); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: sexp.pexp_loc, + _2: env, + _3: { + TAG: /* Expr_type_clash */ 7, + _0: trace._1 + } + }); } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: sexp.pexp_loc, - _2: env, - _3: { - TAG: /* Expr_type_clash */ 7, - _0: trace._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); - } - return ty1; + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + return ty1; case /* Pexp_coerce */ 20 : - const approx_ty_opt = function (sty) { - if (sty !== undefined) { - return approx_type(env, sty); - } else { - return newvar(undefined, undefined); - } - }; - const ty$1 = type_approx(env, l._0); - const ty1$1 = approx_ty_opt(l._1); - const ty2 = approx_type(env, l._2); - try { - unify$2(env, ty$1, ty1$1); + const approx_ty_opt = function (sty) { + if (sty !== undefined) { + return approx_type(env, sty); + } else { + return newvar(undefined, undefined); } - catch (raw_trace$1){ - const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace$1); - if (trace$1.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: sexp.pexp_loc, - _2: env, - _3: { - TAG: /* Expr_type_clash */ 7, - _0: trace$1._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + }; + const ty$1 = type_approx(env, l._0); + const ty1$1 = approx_ty_opt(l._1); + const ty2 = approx_type(env, l._2); + try { + unify$2(env, ty$1, ty1$1); + } + catch (raw_trace$1){ + const trace$1 = Caml_js_exceptions.internalToOCamlException(raw_trace$1); + if (trace$1.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: sexp.pexp_loc, + _2: env, + _3: { + TAG: /* Expr_type_clash */ 7, + _0: trace$1._1 + } + }); } - return ty2; + throw new Caml_js_exceptions.MelangeError(trace$1.MEL_EXN_ID, trace$1); + } + return ty2; default: return newvar(undefined, undefined); } @@ -66380,14 +66380,14 @@ function check_application_result(env, statement, exp) { if (!/* tag */ (typeof match === "number" || typeof match === "string")) { switch (match.TAG) { case /* Tvar */ 0 : - return; + return; case /* Tarrow */ 1 : - return prerr_warning(exp.exp_loc, /* Partial_application */ 2); + return prerr_warning(exp.exp_loc, /* Partial_application */ 2); case /* Tconstr */ 3 : - if (same(match._0, path_unit)) { - return; - } - break; + if (same(match._0, path_unit)) { + return; + } + break; } } @@ -66497,22 +66497,22 @@ function iter_ppat(f, p) { switch (pats.TAG) { case /* Ppat_construct */ 5 : case /* Ppat_variant */ 6 : - return may(f, pats._1); + return may(f, pats._1); case /* Ppat_record */ 7 : - return Stdlib__List.iter((function (param) { - Curry._1(f, param[1]); - }), pats._0); + return Stdlib__List.iter((function (param) { + Curry._1(f, param[1]); + }), pats._0); case /* Ppat_tuple */ 4 : case /* Ppat_array */ 8 : - return Stdlib__List.iter(f, pats._0); + return Stdlib__List.iter(f, pats._0); case /* Ppat_or */ 9 : - Curry._1(f, pats._0); - return Curry._1(f, pats._1); + Curry._1(f, pats._0); + return Curry._1(f, pats._1); case /* Ppat_alias */ 1 : case /* Ppat_constraint */ 10 : case /* Ppat_lazy */ 12 : case /* Ppat_exception */ 14 : - return Curry._1(f, pats._0); + return Curry._1(f, pats._0); default: return; } @@ -66527,9 +66527,9 @@ function contains_polymorphic_variant(p) { switch (match.TAG) { case /* Ppat_variant */ 6 : case /* Ppat_type */ 11 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); default: return iter_ppat(loop, p); } @@ -66669,20 +66669,20 @@ function duplicate_ident_types(loc, caselist, env) { const path = match[0]; switch (path.TAG) { case /* Pident */ 0 : - const desc_val_type = type_expr(identity, desc.val_type); - const desc_val_kind = desc.val_kind; - const desc_val_loc = desc.val_loc; - const desc_val_attributes = desc.val_attributes; - const desc$1 = { - val_type: desc_val_type, - val_kind: desc_val_kind, - val_loc: desc_val_loc, - val_attributes: desc_val_attributes - }; - return add_value(undefined, path._0, desc$1, env); + const desc_val_type = type_expr(identity, desc.val_type); + const desc_val_kind = desc.val_kind; + const desc_val_loc = desc.val_loc; + const desc_val_attributes = desc.val_attributes; + const desc$1 = { + val_type: desc_val_type, + val_kind: desc_val_kind, + val_loc: desc_val_loc, + val_attributes: desc_val_attributes + }; + return add_value(undefined, path._0, desc$1, env); case /* Pdot */ 1 : case /* Papply */ 2 : - return env; + return env; } } @@ -66729,748 +66729,743 @@ function type_expect_(in_function, env, sexp, ty_expected) { const lid = sexp.pexp_desc; switch (lid.TAG) { case /* Pexp_ident */ 0 : - const lid$1 = lid._0; - const match = find_value$1(env, loc, lid$1.txt); - const desc = match[1]; - const path = match[0]; - if (annotations.contents) { - const dloc = desc.val_loc; - const annot = dloc.loc_ghost ? /* Iref_external */ 0 : ({ - TAG: /* Iref_internal */ 0, - _0: dloc + const lid$1 = lid._0; + const match = find_value$1(env, loc, lid$1.txt); + const desc = match[1]; + const path = match[0]; + if (annotations.contents) { + const dloc = desc.val_loc; + const annot = dloc.loc_ghost ? /* Iref_external */ 0 : ({ + TAG: /* Iref_internal */ 0, + _0: dloc + }); + const name$1 = name(parenthesized_ident, path); + record$2({ + TAG: /* An_ident */ 5, + _0: loc, + _1: name$1, + _2: annot }); - const name$1 = name(parenthesized_ident, path); - record$2({ - TAG: /* An_ident */ 5, - _0: loc, - _1: name$1, - _2: annot + } + const match$1 = desc.val_kind; + let tmp; + if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { + if (match$1 === /* Val_unbound */ 1) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Masked_instance_variable */ 29, + _0: lid$1.txt + } }); } - const match$1 = desc.val_kind; - let tmp; - if (/* tag */ typeof match$1 === "number" || typeof match$1 === "string") { - if (match$1 === /* Val_unbound */ 1) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Masked_instance_variable */ 29, - _0: lid$1.txt - } - }); - } - tmp = { - TAG: /* Texp_ident */ 0, - _0: path, - _1: lid$1, - _2: desc - }; - } else { - switch (match$1.TAG) { - case /* Val_ivar */ 1 : - const match$2 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: "self-" + match$1._1 - }, env); - const txt = lid$1.txt; - let tmp$1; - switch (txt.TAG) { - case /* Lident */ 0 : - tmp$1 = { - txt: txt._0, - loc: lid$1.loc - }; - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44136, - 38 - ] - }); - - } - tmp = { - TAG: /* Texp_instvar */ 20, - _0: match$2[0], - _1: path, - _2: tmp$1 - }; - break; - case /* Val_self */ 2 : - const match$3 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: "self-" + match$1._2 - }, env); - tmp = { - TAG: /* Texp_ident */ 0, - _0: match$3[0], - _1: lid$1, - _2: desc + tmp = { + TAG: /* Texp_ident */ 0, + _0: path, + _1: lid$1, + _2: desc + }; + } else { + switch (match$1.TAG) { + case /* Val_ivar */ 1 : + const match$2 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: "self-" + match$1._1 + }, env); + const txt = lid$1.txt; + let tmp$1; + switch (txt.TAG) { + case /* Lident */ 0 : + tmp$1 = { + txt: txt._0, + loc: lid$1.loc }; break; - default: - tmp = { - TAG: /* Texp_ident */ 0, - _0: path, - _1: lid$1, - _2: desc - }; - } + case /* Ldot */ 1 : + case /* Lapply */ 2 : + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44136, + 38 + ] + }); + + } + tmp = { + TAG: /* Texp_instvar */ 20, + _0: match$2[0], + _1: path, + _2: tmp$1 + }; + break; + case /* Val_self */ 2 : + const match$3 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: "self-" + match$1._2 + }, env); + tmp = { + TAG: /* Texp_ident */ 0, + _0: match$3[0], + _1: lid$1, + _2: desc + }; + break; + default: + tmp = { + TAG: /* Texp_ident */ 0, + _0: path, + _1: lid$1, + _2: desc + }; } + } + return rue({ + exp_desc: tmp, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, env, desc.val_type), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_constant */ 1 : + const cst = lid._0; + if (cst.TAG !== /* Const_string */ 2) { return rue({ - exp_desc: tmp, + exp_desc: { + TAG: /* Texp_constant */ 1, + _0: cst + }, exp_loc: loc, exp_extra: /* [] */ 0, - exp_type: instance(undefined, env, desc.val_type), + exp_type: type_constant(cst), exp_env: env, exp_attributes: sexp.pexp_attributes }); - case /* Pexp_constant */ 1 : - const cst = lid._0; - if (cst.TAG !== /* Const_string */ 2) { - return rue({ - exp_desc: { - TAG: /* Texp_constant */ 1, - _0: cst - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: type_constant(cst), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - const ty_exp = expand_head(env, ty_expected); - const fmt6_path_0 = { - TAG: /* Pident */ 0, - _0: { - stamp: 0, - name: "CamlinternalFormatBasics", - flags: 1 - } - }; - const fmt6_path = { - TAG: /* Pdot */ 1, - _0: fmt6_path_0, - _1: "format6", - _2: 0 - }; - const match$4 = ty_exp.desc; - let is_format; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string" || !(match$4.TAG === /* Tconstr */ 3 && same(match$4._0, fmt6_path))) { - is_format = false; - } else { - if (principal.contents && ty_exp.level !== 100000000) { - prerr_warning(loc, { - TAG: /* Not_principal */ 8, - _0: "this coercion to format6" - }); - } - is_format = true; + } + const ty_exp = expand_head(env, ty_expected); + const fmt6_path_0 = { + TAG: /* Pident */ 0, + _0: { + stamp: 0, + name: "CamlinternalFormatBasics", + flags: 1 } - if (!is_format) { - return rue({ - exp_desc: { - TAG: /* Texp_constant */ 1, - _0: cst - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(type_string), - exp_env: env, - exp_attributes: sexp.pexp_attributes + }; + const fmt6_path = { + TAG: /* Pdot */ 1, + _0: fmt6_path_0, + _1: "format6", + _2: 0 + }; + const match$4 = ty_exp.desc; + let is_format; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string" || !(match$4.TAG === /* Tconstr */ 3 && same(match$4._0, fmt6_path))) { + is_format = false; + } else { + if (principal.contents && ty_exp.level !== 100000000) { + prerr_warning(loc, { + TAG: /* Not_principal */ 8, + _0: "this coercion to format6" }); } - const init = type_format(loc, cst._0, env); - const format_parsetree_pexp_desc = init.pexp_desc; - const format_parsetree_pexp_loc = sexp.pexp_loc; - const format_parsetree_pexp_attributes = init.pexp_attributes; - const format_parsetree = { - pexp_desc: format_parsetree_pexp_desc, - pexp_loc: format_parsetree_pexp_loc, - pexp_attributes: format_parsetree_pexp_attributes - }; - return type_expect(in_function, env, format_parsetree, ty_expected); + is_format = true; + } + if (!is_format) { + return rue({ + exp_desc: { + TAG: /* Texp_constant */ 1, + _0: cst + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance_def(type_string), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + } + const init = type_format(loc, cst._0, env); + const format_parsetree_pexp_desc = init.pexp_desc; + const format_parsetree_pexp_loc = sexp.pexp_loc; + const format_parsetree_pexp_attributes = init.pexp_attributes; + const format_parsetree = { + pexp_desc: format_parsetree_pexp_desc, + pexp_loc: format_parsetree_pexp_loc, + pexp_attributes: format_parsetree_pexp_attributes + }; + return type_expect(in_function, env, format_parsetree, ty_expected); case /* Pexp_let */ 2 : - const rec_flag = lid._0; - let exit = 0; - if (rec_flag === /* Nonrecursive */ 0) { - const match$5 = lid._1; - if (match$5) { - const match$6 = match$5.hd; - if (match$6.pvb_attributes || match$5.tl) { - exit = 1; - } else { - const spat = match$6.pvb_pat; - if (contains_gadt(env, spat)) { - return type_expect(in_function, env, { - pexp_desc: { - TAG: /* Pexp_match */ 6, - _0: match$6.pvb_expr, - _1: { - hd: Curry._3(Ast_helper_Exp.$$case, spat, undefined, lid._2), - tl: /* [] */ 0 - } - }, - pexp_loc: sexp.pexp_loc, - pexp_attributes: sexp.pexp_attributes - }, ty_expected); - } - exit = 1; - } + const rec_flag = lid._0; + let exit = 0; + if (rec_flag === /* Nonrecursive */ 0) { + const match$5 = lid._1; + if (match$5) { + const match$6 = match$5.hd; + if (match$6.pvb_attributes || match$5.tl) { + exit = 1; } else { + const spat = match$6.pvb_pat; + if (contains_gadt(env, spat)) { + return type_expect(in_function, env, { + pexp_desc: { + TAG: /* Pexp_match */ 6, + _0: match$6.pvb_expr, + _1: { + hd: Curry._3(Ast_helper_Exp.$$case, spat, undefined, lid._2), + tl: /* [] */ 0 + } + }, + pexp_loc: sexp.pexp_loc, + pexp_attributes: sexp.pexp_attributes + }, ty_expected); + } exit = 1; } } else { exit = 1; } - if (exit === 1) { - const sbody = lid._2; - const match$7 = sexp.pexp_attributes; - let scp; - let exit$1 = 0; - if (match$7 && match$7.hd[0].txt === "#default" && !match$7.tl) { - scp = undefined; - } else { - exit$1 = 2; - } - if (exit$1 === 2) { - scp = rec_flag === /* Nonrecursive */ 0 ? ({ - TAG: /* Idef */ 1, - _0: sbody.pexp_loc - }) : ({ - TAG: /* Idef */ 1, - _0: loc - }); - } - const match$8 = type_let(undefined, undefined, env, rec_flag, lid._1, scp, true); - const body = type_expect(undefined, match$8[1], wrap_unpacks(sbody, match$8[2]), ty_expected); - return re({ - exp_desc: { - TAG: /* Texp_let */ 2, - _0: rec_flag, - _1: match$8[0], - _2: body - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: body.exp_type, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + } else { + exit = 1; + } + if (exit === 1) { + const sbody = lid._2; + const match$7 = sexp.pexp_attributes; + let scp; + let exit$1 = 0; + if (match$7 && match$7.hd[0].txt === "#default" && !match$7.tl) { + scp = undefined; + } else { + exit$1 = 2; } - break; + if (exit$1 === 2) { + scp = rec_flag === /* Nonrecursive */ 0 ? ({ + TAG: /* Idef */ 1, + _0: sbody.pexp_loc + }) : ({ + TAG: /* Idef */ 1, + _0: loc + }); + } + const match$8 = type_let(undefined, undefined, env, rec_flag, lid._1, scp, true); + const body = type_expect(undefined, match$8[1], wrap_unpacks(sbody, match$8[2]), ty_expected); + return re({ + exp_desc: { + TAG: /* Texp_let */ 2, + _0: rec_flag, + _1: match$8[0], + _2: body + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: body.exp_type, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + } + break; case /* Pexp_function */ 3 : - return type_function(in_function, loc, sexp.pexp_attributes, env, ty_expected, "", lid._0); + return type_function(in_function, loc, sexp.pexp_attributes, env, ty_expected, "", lid._0); case /* Pexp_fun */ 4 : - const $$default = lid._1; - const l = lid._0; - if ($$default !== undefined) { - if (!is_optional(l)) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44215, - 6 - ] - }); - } - const default_loc = $$default.pexp_loc; - const scases_0 = Curry._3(Ast_helper_Exp.$$case, construct(default_loc, undefined, { + const $$default = lid._1; + const l = lid._0; + if ($$default !== undefined) { + if (!is_optional(l)) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44215, + 6 + ] + }); + } + const default_loc = $$default.pexp_loc; + const scases_0 = Curry._3(Ast_helper_Exp.$$case, construct(default_loc, undefined, { + txt: { + TAG: /* Ldot */ 1, + _0: { + TAG: /* Lident */ 0, + _0: "*predef*" + }, + _1: "Some" + }, + loc: none + }, $$var$1(default_loc, undefined, { + txt: "*sth*", + loc: none + })), undefined, Curry._3(Ast_helper_Exp.ident, default_loc, undefined, { + txt: { + TAG: /* Lident */ 0, + _0: "*sth*" + }, + loc: none + })); + const scases_1 = { + hd: Curry._3(Ast_helper_Exp.$$case, construct(default_loc, undefined, { txt: { TAG: /* Ldot */ 1, _0: { TAG: /* Lident */ 0, _0: "*predef*" }, - _1: "Some" - }, - loc: none - }, $$var$1(default_loc, undefined, { - txt: "*sth*", - loc: none - })), undefined, Curry._3(Ast_helper_Exp.ident, default_loc, undefined, { - txt: { - TAG: /* Lident */ 0, - _0: "*sth*" + _1: "None" }, loc: none - })); - const scases_1 = { - hd: Curry._3(Ast_helper_Exp.$$case, construct(default_loc, undefined, { - txt: { - TAG: /* Ldot */ 1, - _0: { - TAG: /* Lident */ 0, - _0: "*predef*" - }, - _1: "None" - }, + }, undefined), undefined, $$default), + tl: /* [] */ 0 + }; + const scases = { + hd: scases_0, + tl: scases_1 + }; + const smatch = Curry._4(Ast_helper_Exp.match_, loc, undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { + txt: { + TAG: /* Lident */ 0, + _0: "*opt*" + }, + loc: none + }), scases); + const sfun = Curry._6(Ast_helper_Exp.fun_, loc, undefined, l, undefined, $$var$1(loc, undefined, { + txt: "*opt*", + loc: none + }), Curry._5(Ast_helper_Exp.let_, loc, { + hd: [ + { + txt: "#default", loc: none - }, undefined), undefined, $$default), - tl: /* [] */ 0 - }; - const scases = { - hd: scases_0, - tl: scases_1 - }; - const smatch = Curry._4(Ast_helper_Exp.match_, loc, undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { - txt: { - TAG: /* Lident */ 0, - _0: "*opt*" }, - loc: none - }), scases); - const sfun = Curry._6(Ast_helper_Exp.fun_, loc, undefined, l, undefined, $$var$1(loc, undefined, { - txt: "*opt*", - loc: none - }), Curry._5(Ast_helper_Exp.let_, loc, { - hd: [ - { - txt: "#default", - loc: none - }, - { - TAG: /* PStr */ 0, - _0: /* [] */ 0 - } - ], - tl: /* [] */ 0 - }, /* Nonrecursive */ 0, { - hd: mk$17(undefined, undefined, undefined, undefined, lid._2, smatch), - tl: /* [] */ 0 - }, lid._3)); - return type_expect(in_function, env, sfun, ty_expected); - } - const sexp$1 = lid._3; - return type_function(in_function, loc, sexp$1.pexp_attributes, env, ty_expected, l, { - hd: { - pc_lhs: lid._2, - pc_guard: undefined, - pc_rhs: sexp$1 - }, - tl: /* [] */ 0 - }); + { + TAG: /* PStr */ 0, + _0: /* [] */ 0 + } + ], + tl: /* [] */ 0 + }, /* Nonrecursive */ 0, { + hd: mk$17(undefined, undefined, undefined, undefined, lid._2, smatch), + tl: /* [] */ 0 + }, lid._3)); + return type_expect(in_function, env, sfun, ty_expected); + } + const sexp$1 = lid._3; + return type_function(in_function, loc, sexp$1.pexp_attributes, env, ty_expected, l, { + hd: { + pc_lhs: lid._2, + pc_guard: undefined, + pc_rhs: sexp$1 + }, + tl: /* [] */ 0 + }); case /* Pexp_apply */ 5 : - const sargs = lid._1; - if (Caml_obj.caml_equal(sargs, /* [] */ 0)) { - ill_formed_ast(loc, "Function application with no argument."); - } + const sargs = lid._1; + if (Caml_obj.caml_equal(sargs, /* [] */ 0)) { + ill_formed_ast(loc, "Function application with no argument."); + } + begin_def(undefined); + if (principal.contents) { begin_def(undefined); - if (principal.contents) { - begin_def(undefined); - } - const funct = type_exp(env, lid._0); - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, funct.exp_type); - } - const ty = instance(undefined, env, funct.exp_type); + } + const funct = type_exp(env, lid._0); + if (principal.contents) { end_def(undefined); - wrap_trace_gadt_instances(env, (function (param) { - let _seen = /* [] */ 0; - let _ty_fun = param; - while (true) { - const ty_fun = _ty_fun; - const seen = _seen; - const ty = expand_head(env, ty_fun); - if (Stdlib__List.memq(ty, seen)) { - return; - } - const match = ty.desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { - return; - } - if (match.TAG !== /* Tarrow */ 1) { - return; - } - try { - unify_var(env, newvar(undefined, undefined), match._1); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44266, - 65 - ] - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + generalize_structure$1(current_level.contents, funct.exp_type); + } + const ty = instance(undefined, env, funct.exp_type); + end_def(undefined); + wrap_trace_gadt_instances(env, (function (param) { + let _seen = /* [] */ 0; + let _ty_fun = param; + while (true) { + const ty_fun = _ty_fun; + const seen = _seen; + const ty = expand_head(env, ty_fun); + if (Stdlib__List.memq(ty, seen)) { + return; + } + const match = ty.desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { + return; + } + if (match.TAG !== /* Tarrow */ 1) { + return; + } + try { + unify_var(env, newvar(undefined, undefined), match._1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44266, + 65 + ] + }); } - _ty_fun = match._2; - _seen = { - hd: ty, - tl: seen - }; - continue; - }; - }), ty); - begin_def(undefined); - const match$9 = type_application(env, funct, sargs); - end_def(undefined); - unify_var(env, newvar(undefined, undefined), funct.exp_type); - return rue({ - exp_desc: { - TAG: /* Texp_apply */ 4, - _0: funct, - _1: match$9[0] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: match$9[1], - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - case /* Pexp_match */ 6 : - begin_def(undefined); - const arg = type_exp(env, lid._0); - end_def(undefined); - if (is_nonexpansive(arg)) { - iter_generalize$1({ - contents: /* [] */ 0 - }, arg.exp_type); - } else { - generalize_expansive$1(env, arg.exp_type); - } - const split_cases = function (_vc, _ec, _param) { - while (true) { - const param = _param; - const ec = _ec; - const vc = _vc; - if (!param) { - return [ - Stdlib__List.rev(vc), - Stdlib__List.rev(ec) - ]; - } - const c = param.hd; - const p = c.pc_lhs.ppat_desc; - if (!/* tag */ (typeof p === "number" || typeof p === "string") && p.TAG === /* Ppat_exception */ 14) { - _param = param.tl; - _ec = { - hd: { - pc_lhs: p._0, - pc_guard: c.pc_guard, - pc_rhs: c.pc_rhs - }, - tl: ec + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + _ty_fun = match._2; + _seen = { + hd: ty, + tl: seen }; continue; - } + }; + }), ty); + begin_def(undefined); + const match$9 = type_application(env, funct, sargs); + end_def(undefined); + unify_var(env, newvar(undefined, undefined), funct.exp_type); + return rue({ + exp_desc: { + TAG: /* Texp_apply */ 4, + _0: funct, + _1: match$9[0] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: match$9[1], + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_match */ 6 : + begin_def(undefined); + const arg = type_exp(env, lid._0); + end_def(undefined); + if (is_nonexpansive(arg)) { + iter_generalize$1({ + contents: /* [] */ 0 + }, arg.exp_type); + } else { + generalize_expansive$1(env, arg.exp_type); + } + const split_cases = function (_vc, _ec, _param) { + while (true) { + const param = _param; + const ec = _ec; + const vc = _vc; + if (!param) { + return [ + Stdlib__List.rev(vc), + Stdlib__List.rev(ec) + ]; + } + const c = param.hd; + const p = c.pc_lhs.ppat_desc; + if (!/* tag */ (typeof p === "number" || typeof p === "string") && p.TAG === /* Ppat_exception */ 14) { _param = param.tl; - _vc = { - hd: c, - tl: vc + _ec = { + hd: { + pc_lhs: p._0, + pc_guard: c.pc_guard, + pc_rhs: c.pc_rhs + }, + tl: ec }; continue; + } + _param = param.tl; + _vc = { + hd: c, + tl: vc }; + continue; }; - const match$10 = split_cases(/* [] */ 0, /* [] */ 0, lid._1); - const exn_caselist = match$10[1]; - const val_caselist = match$10[0]; - if (Caml_obj.caml_equal(val_caselist, /* [] */ 0) && Caml_obj.caml_notequal(exn_caselist, /* [] */ 0)) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: /* No_value_clauses */ 7 - }); - } - const match$11 = type_cases(undefined, env, arg.exp_type, ty_expected, true, loc, val_caselist); - const match$12 = type_cases(undefined, env, type_exn, ty_expected, false, loc, exn_caselist); - return re({ - exp_desc: { - TAG: /* Texp_match */ 5, - _0: arg, - _1: match$11[0], - _2: match$12[0], - _3: match$11[1] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance(undefined, env, ty_expected), - exp_env: env, - exp_attributes: sexp.pexp_attributes + }; + const match$10 = split_cases(/* [] */ 0, /* [] */ 0, lid._1); + const exn_caselist = match$10[1]; + const val_caselist = match$10[0]; + if (Caml_obj.caml_equal(val_caselist, /* [] */ 0) && Caml_obj.caml_notequal(exn_caselist, /* [] */ 0)) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: /* No_value_clauses */ 7 }); + } + const match$11 = type_cases(undefined, env, arg.exp_type, ty_expected, true, loc, val_caselist); + const match$12 = type_cases(undefined, env, type_exn, ty_expected, false, loc, exn_caselist); + return re({ + exp_desc: { + TAG: /* Texp_match */ 5, + _0: arg, + _1: match$11[0], + _2: match$12[0], + _3: match$11[1] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, env, ty_expected), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_try */ 7 : - const body$1 = type_expect(undefined, env, lid._0, ty_expected); - const match$13 = type_cases(undefined, env, type_exn, ty_expected, false, loc, lid._1); - return re({ - exp_desc: { - TAG: /* Texp_try */ 6, - _0: body$1, - _1: match$13[0] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: body$1.exp_type, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + const body$1 = type_expect(undefined, env, lid._0, ty_expected); + const match$13 = type_cases(undefined, env, type_exn, ty_expected, false, loc, lid._1); + return re({ + exp_desc: { + TAG: /* Texp_try */ 6, + _0: body$1, + _1: match$13[0] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: body$1.exp_type, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_tuple */ 8 : - const sexpl = lid._0; - if (Stdlib__List.length(sexpl) < 2) { - ill_formed_ast(loc, "Tuples must have at least 2 components."); - } - const subtypes = Stdlib__List.map((function (param) { - return newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }); - }), sexpl); - const to_unify = newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: subtypes - }); - unify_exp_types(loc, env, to_unify, ty_expected); - const expl = Stdlib__List.map2((function (body, ty) { - return type_expect(undefined, env, body, ty); - }), sexpl, subtypes); - const desc$1 = { - TAG: /* Ttuple */ 2, - _0: Stdlib__List.map((function (e) { - return e.exp_type; - }), expl) - }; - return re({ - exp_desc: { - TAG: /* Texp_tuple */ 7, - _0: expl - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: newty2(current_level.contents, desc$1), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - case /* Pexp_construct */ 9 : - let lid$2 = lid._0; - let sarg = lid._1; - let attrs = sexp.pexp_attributes; - let opath; - try { - const match$14 = extract_concrete_variant(env, ty_expected); - opath = [ - match$14[0], - match$14[1], - ty_expected.level === 100000000 || !principal.contents - ]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - opath = undefined; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - } - const constrs = find_all_constructors(env, lid$2.loc, lid$2.txt); - const constr = wrap_disambiguate("This variant expression is expected to have", ty_expected, (function (param) { - return disambiguate$1(undefined, undefined, undefined, lid$2, env, opath, param); - }), constrs); - mark_constructor(/* Positive */ 0, env, last$1(lid$2.txt), constr); - check_deprecated(loc, constr.cstr_attributes, constr.cstr_name); - let sargs$1; - if (sarg !== undefined) { - const sel = sarg.pexp_desc; - sargs$1 = sel.TAG === /* Pexp_tuple */ 8 && (constr.cstr_arity > 1 || explicit_arity(attrs)) ? sel._0 : ({ - hd: sarg, - tl: /* [] */ 0 - }); + const sexpl = lid._0; + if (Stdlib__List.length(sexpl) < 2) { + ill_formed_ast(loc, "Tuples must have at least 2 components."); + } + const subtypes = Stdlib__List.map((function (param) { + return newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }); + }), sexpl); + const to_unify = newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: subtypes + }); + unify_exp_types(loc, env, to_unify, ty_expected); + const expl = Stdlib__List.map2((function (body, ty) { + return type_expect(undefined, env, body, ty); + }), sexpl, subtypes); + const desc$1 = { + TAG: /* Ttuple */ 2, + _0: Stdlib__List.map((function (e) { + return e.exp_type; + }), expl) + }; + return re({ + exp_desc: { + TAG: /* Texp_tuple */ 7, + _0: expl + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: newty2(current_level.contents, desc$1), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_construct */ 9 : + let lid$2 = lid._0; + let sarg = lid._1; + let attrs = sexp.pexp_attributes; + let opath; + try { + const match$14 = extract_concrete_variant(env, ty_expected); + opath = [ + match$14[0], + match$14[1], + ty_expected.level === 100000000 || !principal.contents + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + opath = undefined; } else { - sargs$1 = /* [] */ 0; - } - if (Stdlib__List.length(sargs$1) !== constr.cstr_arity) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Constructor_arity_mismatch */ 1, - _0: lid$2.txt, - _1: constr.cstr_arity, - _2: Stdlib__List.length(sargs$1) - } - }); - } - const separate = principal.contents || env.local_constraints; - if (separate) { - begin_def(undefined); - begin_def(undefined); + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const match$15 = instance_constructor(undefined, constr); - const ty_res = match$15[1]; - const ty_args = match$15[0]; - const texp = re({ - exp_desc: { - TAG: /* Texp_construct */ 8, - _0: lid$2, - _1: constr, - _2: /* [] */ 0 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: ty_res, - exp_env: env, - exp_attributes: attrs + } + const constrs = find_all_constructors(env, lid$2.loc, lid$2.txt); + const constr = wrap_disambiguate("This variant expression is expected to have", ty_expected, (function (param) { + return disambiguate$1(undefined, undefined, undefined, lid$2, env, opath, param); + }), constrs); + mark_constructor(/* Positive */ 0, env, last$1(lid$2.txt), constr); + check_deprecated(loc, constr.cstr_attributes, constr.cstr_name); + let sargs$1; + if (sarg !== undefined) { + const sel = sarg.pexp_desc; + sargs$1 = sel.TAG === /* Pexp_tuple */ 8 && (constr.cstr_arity > 1 || explicit_arity(attrs)) ? sel._0 : ({ + hd: sarg, + tl: /* [] */ 0 + }); + } else { + sargs$1 = /* [] */ 0; + } + if (Stdlib__List.length(sargs$1) !== constr.cstr_arity) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Constructor_arity_mismatch */ 1, + _0: lid$2.txt, + _1: constr.cstr_arity, + _2: Stdlib__List.length(sargs$1) + } }); - if (separate) { - end_def(undefined); - generalize_structure$1(current_level.contents, ty_res); - unify_exp(env, { - exp_desc: texp.exp_desc, - exp_loc: texp.exp_loc, - exp_extra: texp.exp_extra, - exp_type: instance_def(ty_res), - exp_env: texp.exp_env, - exp_attributes: texp.exp_attributes - }, instance(undefined, env, ty_expected)); - end_def(undefined); - Stdlib__List.iter(generalize_structure$2, ty_args); - generalize_structure$1(current_level.contents, ty_res); - } - const match$16 = instance_list(env, { - hd: ty_res, - tl: ty_args + } + const separate = principal.contents || env.local_constraints; + if (separate) { + begin_def(undefined); + begin_def(undefined); + } + const match$15 = instance_constructor(undefined, constr); + const ty_res = match$15[1]; + const ty_args = match$15[0]; + const texp = re({ + exp_desc: { + TAG: /* Texp_construct */ 8, + _0: lid$2, + _1: constr, + _2: /* [] */ 0 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: ty_res, + exp_env: env, + exp_attributes: attrs + }); + if (separate) { + end_def(undefined); + generalize_structure$1(current_level.contents, ty_res); + unify_exp(env, { + exp_desc: texp.exp_desc, + exp_loc: texp.exp_loc, + exp_extra: texp.exp_extra, + exp_type: instance_def(ty_res), + exp_env: texp.exp_env, + exp_attributes: texp.exp_attributes + }, instance(undefined, env, ty_expected)); + end_def(undefined); + Stdlib__List.iter(generalize_structure$2, ty_args); + generalize_structure$1(current_level.contents, ty_res); + } + const match$16 = instance_list(env, { + hd: ty_res, + tl: ty_args + }); + let match$17; + if (match$16) { + match$17 = [ + match$16.tl, + match$16.hd + ]; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 45498, + 11 + ] }); - let match$17; - if (match$16) { - match$17 = [ - match$16.tl, - match$16.hd - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 45498, - 11 - ] - }); - } - const ty_res$1 = match$17[1]; - const texp_exp_desc = texp.exp_desc; - const texp_exp_loc = texp.exp_loc; - const texp_exp_extra = texp.exp_extra; - const texp_exp_env = texp.exp_env; - const texp_exp_attributes = texp.exp_attributes; - const texp$1 = { - exp_desc: texp_exp_desc, - exp_loc: texp_exp_loc, - exp_extra: texp_exp_extra, - exp_type: ty_res$1, - exp_env: texp_exp_env, - exp_attributes: texp_exp_attributes - }; - if (!separate) { - unify_exp(env, texp$1, instance(undefined, env, ty_expected)); - } - const args = Stdlib__List.map2((function (e, param) { - return type_argument(env, e, param[0], param[1]); - }), sargs$1, Stdlib__List.combine(ty_args, match$17[0])); - if (constr.cstr_private === /* Private */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Private_type */ 19, - _0: ty_res$1 - } - }); - } - return { - exp_desc: { - TAG: /* Texp_construct */ 8, - _0: lid$2, - _1: constr, - _2: args - }, - exp_loc: texp_exp_loc, - exp_extra: texp_exp_extra, - exp_type: ty_res$1, - exp_env: texp_exp_env, - exp_attributes: texp_exp_attributes - }; + } + const ty_res$1 = match$17[1]; + const texp_exp_desc = texp.exp_desc; + const texp_exp_loc = texp.exp_loc; + const texp_exp_extra = texp.exp_extra; + const texp_exp_env = texp.exp_env; + const texp_exp_attributes = texp.exp_attributes; + const texp$1 = { + exp_desc: texp_exp_desc, + exp_loc: texp_exp_loc, + exp_extra: texp_exp_extra, + exp_type: ty_res$1, + exp_env: texp_exp_env, + exp_attributes: texp_exp_attributes + }; + if (!separate) { + unify_exp(env, texp$1, instance(undefined, env, ty_expected)); + } + const args = Stdlib__List.map2((function (e, param) { + return type_argument(env, e, param[0], param[1]); + }), sargs$1, Stdlib__List.combine(ty_args, match$17[0])); + if (constr.cstr_private === /* Private */ 0) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Private_type */ 19, + _0: ty_res$1 + } + }); + } + return { + exp_desc: { + TAG: /* Texp_construct */ 8, + _0: lid$2, + _1: constr, + _2: args + }, + exp_loc: texp_exp_loc, + exp_extra: texp_exp_extra, + exp_type: ty_res$1, + exp_env: texp_exp_env, + exp_attributes: texp_exp_attributes + }; case /* Pexp_variant */ 10 : - const sarg$1 = lid._1; - const l$1 = lid._0; - const ty_expected0 = instance(undefined, env, ty_expected); - try { - const match$18 = expand_head(env, ty_expected); - const match$19 = expand_head(env, ty_expected0); - if (sarg$1 !== undefined) { - const row = match$18.desc; - if (/* tag */ typeof row === "number" || typeof row === "string") { + const sarg$1 = lid._1; + const l$1 = lid._0; + const ty_expected0 = instance(undefined, env, ty_expected); + try { + const match$18 = expand_head(env, ty_expected); + const match$19 = expand_head(env, ty_expected0); + if (sarg$1 !== undefined) { + const row = match$18.desc; + if (/* tag */ typeof row === "number" || typeof row === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); + } + if (row.TAG === /* Tvariant */ 8) { + const row0 = match$19.desc; + if (/* tag */ typeof row0 === "number" || typeof row0 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - if (row.TAG === /* Tvariant */ 8) { - const row0 = match$19.desc; - if (/* tag */ typeof row0 === "number" || typeof row0 === "string") { + if (row0.TAG === /* Tvariant */ 8) { + const row$1 = row_repr_aux(/* [] */ 0, row._0); + const match$20 = row_field_repr_aux(/* [] */ 0, Stdlib__List.assoc(l$1, row$1.row_fields)); + const match$21 = row_field_repr_aux(/* [] */ 0, Stdlib__List.assoc(l$1, row0._0.row_fields)); + if (/* tag */ typeof match$20 === "number" || typeof match$20 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } - if (row0.TAG === /* Tvariant */ 8) { - const row$1 = row_repr_aux(/* [] */ 0, row._0); - const match$20 = row_field_repr_aux(/* [] */ 0, Stdlib__List.assoc(l$1, row$1.row_fields)); - const match$21 = row_field_repr_aux(/* [] */ 0, Stdlib__List.assoc(l$1, row0._0.row_fields)); - if (/* tag */ typeof match$20 === "number" || typeof match$20 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (match$20.TAG === /* Rpresent */ 0) { - const ty$1 = match$20._0; - if (ty$1 !== undefined) { - if (/* tag */ typeof match$21 === "number" || typeof match$21 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } - if (match$21.TAG === /* Rpresent */ 0) { - const ty0 = match$21._0; - if (ty0 !== undefined) { - const arg$1 = type_argument(env, sarg$1, ty$1, ty0); - return re({ - exp_desc: { - TAG: /* Texp_variant */ 9, - _0: l$1, - _1: arg$1 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: ty_expected0, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { - MEL_EXN_ID: Stdlib.Not_found - }); - } + if (match$20.TAG === /* Rpresent */ 0) { + const ty$1 = match$20._0; + if (ty$1 !== undefined) { + if (/* tag */ typeof match$21 === "number" || typeof match$21 === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); - } else { + } + if (match$21.TAG === /* Rpresent */ 0) { + const ty0 = match$21._0; + if (ty0 !== undefined) { + const arg$1 = type_argument(env, sarg$1, ty$1, ty0); + return re({ + exp_desc: { + TAG: /* Texp_variant */ 9, + _0: l$1, + _1: arg$1 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: ty_expected0, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + } throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found }); } + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found @@ -67491,1439 +67486,1476 @@ function type_expect_(in_function, env, sexp, ty_expected) { MEL_EXN_ID: Stdlib.Not_found }); } + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { + MEL_EXN_ID: Stdlib.Not_found + }); } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - const arg$2 = may_map((function (param) { - return type_exp(env, param); - }), sarg$1); - const arg_type = may_map((function (arg) { - return arg.exp_type; - }), arg$2); - const desc$2 = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: { - hd: [ - l$1, - { - TAG: /* Rpresent */ 0, - _0: arg_type - } - ], - tl: /* [] */ 0 + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + const arg$2 = may_map((function (param) { + return type_exp(env, param); + }), sarg$1); + const arg_type = may_map((function (arg) { + return arg.exp_type; + }), arg$2); + const desc$2 = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: { + hd: [ + l$1, + { + TAG: /* Rpresent */ 0, + _0: arg_type + } + ], + tl: /* [] */ 0 + }, + row_more: newvar(undefined, undefined), + row_bound: undefined, + row_closed: false, + row_fixed: false, + row_name: undefined + } + }; + return rue({ + exp_desc: { + TAG: /* Texp_variant */ 9, + _0: l$1, + _1: arg$2 }, - row_more: newvar(undefined, undefined), - row_bound: undefined, - row_closed: false, - row_fixed: false, - row_name: undefined - } - }; - return rue({ - exp_desc: { - TAG: /* Texp_variant */ 9, - _0: l$1, - _1: arg$2 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: newty2(current_level.contents, desc$2), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: newty2(current_level.contents, desc$2), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } case /* Pexp_record */ 11 : - const opt_sexp = lid._1; - const lid_sexp_list = lid._0; - if (Caml_obj.caml_equal(lid_sexp_list, /* [] */ 0)) { - ill_formed_ast(loc, "Records cannot be empty."); + const opt_sexp = lid._1; + const lid_sexp_list = lid._0; + if (Caml_obj.caml_equal(lid_sexp_list, /* [] */ 0)) { + ill_formed_ast(loc, "Records cannot be empty."); + } + let opt_exp; + if (opt_sexp !== undefined) { + if (principal.contents) { + begin_def(undefined); } - let opt_exp; - if (opt_sexp !== undefined) { - if (principal.contents) { - begin_def(undefined); - } - const exp = type_exp(env, opt_sexp); - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, exp.exp_type); - } - opt_exp = exp; - } else { - opt_exp = undefined; + const exp = type_exp(env, opt_sexp); + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, exp.exp_type); } - const get_path = function (ty) { - try { - const match = extract_concrete_record(env, ty); - return [ - match[0], - match[1], - ty.level === 100000000 || !principal.contents - ]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + opt_exp = exp; + } else { + opt_exp = undefined; + } + const get_path = function (ty) { + try { + const match = extract_concrete_record(env, ty); + return [ + match[0], + match[1], + ty.level === 100000000 || !principal.contents + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return; } - }; - const op = get_path(ty_expected); - let match$22; - if (op !== undefined) { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }; + const op = get_path(ty_expected); + let match$22; + if (op !== undefined) { + match$22 = [ + ty_expected, + op + ]; + } else if (opt_exp !== undefined) { + const op$1 = get_path(opt_exp.exp_type); + if (op$1 !== undefined) { + const p$p = op$1[1]; + const decl = find_type_full(p$p, env)[0]; + begin_def(undefined); + const ty$2 = newconstr(p$p, instance_list(env, decl.type_params)); + end_def(undefined); + generalize_structure$1(current_level.contents, ty$2); match$22 = [ - ty_expected, - op + ty$2, + op$1 ]; - } else if (opt_exp !== undefined) { - const op$1 = get_path(opt_exp.exp_type); - if (op$1 !== undefined) { - const p$p = op$1[1]; - const decl = find_type_full(p$p, env)[0]; - begin_def(undefined); - const ty$2 = newconstr(p$p, instance_list(env, decl.type_params)); - end_def(undefined); - generalize_structure$1(current_level.contents, ty$2); - match$22 = [ - ty$2, - op$1 - ]; - } else { - match$22 = [ - newvar(undefined, undefined), - undefined - ]; - } } else { match$22 = [ newvar(undefined, undefined), undefined ]; } - const opath$1 = match$22[1]; - const ty_record = match$22[0]; - const closed = opt_sexp === undefined; - const lbl_exp_list = wrap_disambiguate("This record expression is expected to have", ty_record, (function (param) { - return type_label_a_list(undefined, loc, closed, env, (function (param) { - return type_label_exp(true, env, loc, ty_record, param); - }), opath$1, param); - }), lid_sexp_list); - unify_exp_types(loc, env, ty_record, instance(undefined, env, ty_expected)); - const check_duplicates = function (_param) { - while (true) { - const param = _param; - if (!param) { - return; - } - const match = param.tl; - if (match) { - const lbl1 = param.hd[1]; - if (lbl1.lbl_pos === match.hd[1].lbl_pos) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Label_multiply_defined */ 10, - _0: lbl1.lbl_name - } - }); - } - _param = param.tl; - continue; + } else { + match$22 = [ + newvar(undefined, undefined), + undefined + ]; + } + const opath$1 = match$22[1]; + const ty_record = match$22[0]; + const closed = opt_sexp === undefined; + const lbl_exp_list = wrap_disambiguate("This record expression is expected to have", ty_record, (function (param) { + return type_label_a_list(undefined, loc, closed, env, (function (param) { + return type_label_exp(true, env, loc, ty_record, param); + }), opath$1, param); + }), lid_sexp_list); + unify_exp_types(loc, env, ty_record, instance(undefined, env, ty_expected)); + const check_duplicates = function (_param) { + while (true) { + const param = _param; + if (!param) { + return; + } + const match = param.tl; + if (match) { + const lbl1 = param.hd[1]; + if (lbl1.lbl_pos === match.hd[1].lbl_pos) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Label_multiply_defined */ 10, + _0: lbl1.lbl_name + } + }); } _param = param.tl; continue; - }; - }; - check_duplicates(lbl_exp_list); - let opt_exp$1; - if (opt_exp !== undefined) { - if (lbl_exp_list) { - const ty_exp$1 = instance(undefined, env, opt_exp.exp_type); - const unify_kept = function (lbl) { - if (!Stdlib__List.for_all((function (param) { - return param[1].lbl_pos !== lbl.lbl_pos; - }), lbl_exp_list)) { - return; - } - const match = instance_label(false, lbl); - const match$1 = instance_label(false, lbl); - unify$2(env, match[1], match$1[1]); - unify$2(env, instance(undefined, env, ty_expected), match$1[2]); - unify_exp_types(opt_exp.exp_loc, env, ty_exp$1, match[2]); - }; - Stdlib__Array.iter(unify_kept, lbl_exp_list.hd[1].lbl_all); - opt_exp$1 = { - exp_desc: opt_exp.exp_desc, - exp_loc: opt_exp.exp_loc, - exp_extra: opt_exp.exp_extra, - exp_type: ty_exp$1, - exp_env: opt_exp.exp_env, - exp_attributes: opt_exp.exp_attributes - }; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44455, - 15 - ] - }); } - } else { - opt_exp$1 = undefined; - } - let num_fields; + _param = param.tl; + continue; + }; + }; + check_duplicates(lbl_exp_list); + let opt_exp$1; + if (opt_exp !== undefined) { if (lbl_exp_list) { - num_fields = lbl_exp_list.hd[1].lbl_all.length; + const ty_exp$1 = instance(undefined, env, opt_exp.exp_type); + const unify_kept = function (lbl) { + if (!Stdlib__List.for_all((function (param) { + return param[1].lbl_pos !== lbl.lbl_pos; + }), lbl_exp_list)) { + return; + } + const match = instance_label(false, lbl); + const match$1 = instance_label(false, lbl); + unify$2(env, match[1], match$1[1]); + unify$2(env, instance(undefined, env, ty_expected), match$1[2]); + unify_exp_types(opt_exp.exp_loc, env, ty_exp$1, match[2]); + }; + Stdlib__Array.iter(unify_kept, lbl_exp_list.hd[1].lbl_all); + opt_exp$1 = { + exp_desc: opt_exp.exp_desc, + exp_loc: opt_exp.exp_loc, + exp_extra: opt_exp.exp_extra, + exp_type: ty_exp$1, + exp_env: opt_exp.exp_env, + exp_attributes: opt_exp.exp_attributes + }; } else { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 44458, - 38 + 44455, + 15 ] }); } - if (opt_sexp === undefined && Stdlib__List.length(lid_sexp_list) !== num_fields) { - const present_indices = Stdlib__List.map((function (param) { - return param[1].lbl_pos; - }), lbl_exp_list); - const label_names = extract_label_names(sexp, env, ty_expected); - const missing_labels = function (_n, _param) { - while (true) { - const param = _param; - const n = _n; - if (!param) { - return /* [] */ 0; - } - const rem = param.tl; - if (!Stdlib__List.mem(n, present_indices)) { - return { - hd: param.hd, - tl: missing_labels(n + 1 | 0, rem) - }; - } - _param = rem; - _n = n + 1 | 0; - continue; - }; + } else { + opt_exp$1 = undefined; + } + let num_fields; + if (lbl_exp_list) { + num_fields = lbl_exp_list.hd[1].lbl_all.length; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44458, + 38 + ] + }); + } + if (opt_sexp === undefined && Stdlib__List.length(lid_sexp_list) !== num_fields) { + const present_indices = Stdlib__List.map((function (param) { + return param[1].lbl_pos; + }), lbl_exp_list); + const label_names = extract_label_names(sexp, env, ty_expected); + const missing_labels = function (_n, _param) { + while (true) { + const param = _param; + const n = _n; + if (!param) { + return /* [] */ 0; + } + const rem = param.tl; + if (!Stdlib__List.mem(n, present_indices)) { + return { + hd: param.hd, + tl: missing_labels(n + 1 | 0, rem) + }; + } + _param = rem; + _n = n + 1 | 0; + continue; }; - const missing = missing_labels(0, label_names); - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Label_missing */ 11, - _0: missing - } - }); - } - if (opt_sexp !== undefined && Stdlib__List.length(lid_sexp_list) === num_fields) { - prerr_warning(loc, /* Useless_record_with */ 11); - } - return re({ - exp_desc: { - TAG: /* Texp_record */ 10, - _0: lbl_exp_list, - _1: opt_exp$1 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance(undefined, env, ty_expected), - exp_env: env, - exp_attributes: sexp.pexp_attributes + }; + const missing = missing_labels(0, label_names); + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Label_missing */ 11, + _0: missing + } }); + } + if (opt_sexp !== undefined && Stdlib__List.length(lid_sexp_list) === num_fields) { + prerr_warning(loc, /* Useless_record_with */ 11); + } + return re({ + exp_desc: { + TAG: /* Texp_record */ 10, + _0: lbl_exp_list, + _1: opt_exp$1 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, env, ty_expected), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_field */ 12 : - const lid$3 = lid._1; - const match$23 = type_label_access(env, loc, lid._0, lid$3); - const label = match$23[1]; - const record$3 = match$23[0]; - const match$24 = instance_label(false, label); - unify_exp(env, record$3, match$24[2]); - return rue({ - exp_desc: { - TAG: /* Texp_field */ 11, - _0: record$3, - _1: lid$3, - _2: label - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: match$24[1], - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + const lid$3 = lid._1; + const match$23 = type_label_access(env, loc, lid._0, lid$3); + const label = match$23[1]; + const record$3 = match$23[0]; + const match$24 = instance_label(false, label); + unify_exp(env, record$3, match$24[2]); + return rue({ + exp_desc: { + TAG: /* Texp_field */ 11, + _0: record$3, + _1: lid$3, + _2: label + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: match$24[1], + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_setfield */ 13 : - const lid$4 = lid._1; - const match$25 = type_label_access(env, loc, lid._0, lid$4); - const record$4 = match$25[0]; - const ty_record$1 = match$25[2] === undefined ? newvar(undefined, undefined) : record$4.exp_type; - const match$26 = type_label_exp(false, env, loc, ty_record$1, [ - lid$4, - match$25[1], - lid._2 - ]); - const label$1 = match$26[1]; - unify_exp(env, record$4, ty_record$1); - if (label$1.lbl_mut === /* Immutable */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Label_not_mutable */ 12, - _0: lid$4.txt - } - }); - } - return rue({ - exp_desc: { - TAG: /* Texp_setfield */ 12, - _0: record$4, - _1: match$26[0], - _2: label$1, - _3: match$26[2] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(type_unit), - exp_env: env, - exp_attributes: sexp.pexp_attributes + const lid$4 = lid._1; + const match$25 = type_label_access(env, loc, lid._0, lid$4); + const record$4 = match$25[0]; + const ty_record$1 = match$25[2] === undefined ? newvar(undefined, undefined) : record$4.exp_type; + const match$26 = type_label_exp(false, env, loc, ty_record$1, [ + lid$4, + match$25[1], + lid._2 + ]); + const label$1 = match$26[1]; + unify_exp(env, record$4, ty_record$1); + if (label$1.lbl_mut === /* Immutable */ 0) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Label_not_mutable */ 12, + _0: lid$4.txt + } }); + } + return rue({ + exp_desc: { + TAG: /* Texp_setfield */ 12, + _0: record$4, + _1: match$26[0], + _2: label$1, + _3: match$26[2] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance_def(type_unit), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_array */ 14 : - const ty$3 = newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }); - const to_unify$1 = type_array(ty$3); - unify_exp_types(loc, env, to_unify$1, ty_expected); - const argl = Stdlib__List.map((function (sarg) { - return type_expect(undefined, env, sarg, ty$3); - }), lid._0); - return re({ - exp_desc: { - TAG: /* Texp_array */ 13, - _0: argl - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance(undefined, env, ty_expected), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + const ty$3 = newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }); + const to_unify$1 = type_array(ty$3); + unify_exp_types(loc, env, to_unify$1, ty_expected); + const argl = Stdlib__List.map((function (sarg) { + return type_expect(undefined, env, sarg, ty$3); + }), lid._0); + return re({ + exp_desc: { + TAG: /* Texp_array */ 13, + _0: argl + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, env, ty_expected), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_ifthenelse */ 15 : - const sifnot = lid._2; - const sifso = lid._1; - const cond = type_expect(undefined, env, lid._0, type_bool); - if (sifnot !== undefined) { - const ifso = type_expect(undefined, env, sifso, ty_expected); - const ifnot = type_expect(undefined, env, sifnot, ty_expected); - unify_exp(env, ifnot, ifso.exp_type); - return re({ - exp_desc: { - TAG: /* Texp_ifthenelse */ 14, - _0: cond, - _1: ifso, - _2: ifnot - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: ifso.exp_type, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - const ifso$1 = type_expect(undefined, env, sifso, type_unit); - return rue({ + const sifnot = lid._2; + const sifso = lid._1; + const cond = type_expect(undefined, env, lid._0, type_bool); + if (sifnot !== undefined) { + const ifso = type_expect(undefined, env, sifso, ty_expected); + const ifnot = type_expect(undefined, env, sifnot, ty_expected); + unify_exp(env, ifnot, ifso.exp_type); + return re({ exp_desc: { TAG: /* Texp_ifthenelse */ 14, _0: cond, - _1: ifso$1, - _2: undefined + _1: ifso, + _2: ifnot }, exp_loc: loc, exp_extra: /* [] */ 0, - exp_type: ifso$1.exp_type, + exp_type: ifso.exp_type, exp_env: env, exp_attributes: sexp.pexp_attributes }); + } + const ifso$1 = type_expect(undefined, env, sifso, type_unit); + return rue({ + exp_desc: { + TAG: /* Texp_ifthenelse */ 14, + _0: cond, + _1: ifso$1, + _2: undefined + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: ifso$1.exp_type, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_sequence */ 16 : - const exp1 = type_statement(env, lid._0); - const exp2 = type_expect(undefined, env, lid._1, ty_expected); - return re({ - exp_desc: { - TAG: /* Texp_sequence */ 15, - _0: exp1, - _1: exp2 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: exp2.exp_type, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + const exp1 = type_statement(env, lid._0); + const exp2 = type_expect(undefined, env, lid._1, ty_expected); + return re({ + exp_desc: { + TAG: /* Texp_sequence */ 15, + _0: exp1, + _1: exp2 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: exp2.exp_type, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_while */ 17 : - const cond$1 = type_expect(undefined, env, lid._0, type_bool); - const body$2 = type_statement(env, lid._1); - return rue({ - exp_desc: { - TAG: /* Texp_while */ 16, - _0: cond$1, - _1: body$2 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(type_unit), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + const cond$1 = type_expect(undefined, env, lid._0, type_bool); + const body$2 = type_statement(env, lid._1); + return rue({ + exp_desc: { + TAG: /* Texp_while */ 16, + _0: cond$1, + _1: body$2 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance_def(type_unit), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_for */ 18 : - const param = lid._0; - const low = type_expect(undefined, env, lid._1, type_int); - const high = type_expect(undefined, env, lid._2, type_int); - const match$27 = param.ppat_desc; - let match$28; - if (/* tag */ typeof match$27 === "number" || typeof match$27 === "string") { - match$28 = [ - create("_for"), - env - ]; - } else if (match$27.TAG === /* Ppat_var */ 0) { - match$28 = enter_value((function (s) { - return { - TAG: /* Unused_for_index */ 19, - _0: s - }; - }))(match$27._0.txt, { - val_type: instance_def(type_int), - val_kind: /* Val_reg */ 0, - val_loc: loc, - val_attributes: /* [] */ 0 - }, env); - } else { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: param.ppat_loc, - _2: env, - _3: /* Invalid_for_loop_index */ 6 - }); - } - const body$3 = type_statement(match$28[1], lid._4); - return rue({ - exp_desc: { - TAG: /* Texp_for */ 17, - _0: match$28[0], - _1: param, - _2: low, - _3: high, - _4: lid._3, - _5: body$3 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(type_unit), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - case /* Pexp_constraint */ 19 : - begin_def(undefined); - const cty = transl_simple_type(env, false, lid._1); - const ty$4 = cty.ctyp_type; - end_def(undefined); - generalize_structure$1(current_level.contents, ty$4); - const arg$3 = type_argument(env, lid._0, ty$4, instance(undefined, env, ty$4)); - const ty$p = instance(undefined, env, ty$4); - return rue({ - exp_desc: arg$3.exp_desc, - exp_loc: arg$3.exp_loc, - exp_extra: { - hd: [ - { - TAG: /* Texp_constraint */ 0, - _0: cty - }, - loc, - sexp.pexp_attributes - ], - tl: arg$3.exp_extra - }, - exp_type: ty$p, - exp_env: env, - exp_attributes: arg$3.exp_attributes + const param = lid._0; + const low = type_expect(undefined, env, lid._1, type_int); + const high = type_expect(undefined, env, lid._2, type_int); + const match$27 = param.ppat_desc; + let match$28; + if (/* tag */ typeof match$27 === "number" || typeof match$27 === "string") { + match$28 = [ + create("_for"), + env + ]; + } else if (match$27.TAG === /* Ppat_var */ 0) { + match$28 = enter_value((function (s) { + return { + TAG: /* Unused_for_index */ 19, + _0: s + }; + }))(match$27._0.txt, { + val_type: instance_def(type_int), + val_kind: /* Val_reg */ 0, + val_loc: loc, + val_attributes: /* [] */ 0 + }, env); + } else { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: param.ppat_loc, + _2: env, + _3: /* Invalid_for_loop_index */ 6 }); + } + const body$3 = type_statement(match$28[1], lid._4); + return rue({ + exp_desc: { + TAG: /* Texp_for */ 17, + _0: match$28[0], + _1: param, + _2: low, + _3: high, + _4: lid._3, + _5: body$3 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance_def(type_unit), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_constraint */ 19 : + begin_def(undefined); + const cty = transl_simple_type(env, false, lid._1); + const ty$4 = cty.ctyp_type; + end_def(undefined); + generalize_structure$1(current_level.contents, ty$4); + const arg$3 = type_argument(env, lid._0, ty$4, instance(undefined, env, ty$4)); + const ty$p = instance(undefined, env, ty$4); + return rue({ + exp_desc: arg$3.exp_desc, + exp_loc: arg$3.exp_loc, + exp_extra: { + hd: [ + { + TAG: /* Texp_constraint */ 0, + _0: cty + }, + loc, + sexp.pexp_attributes + ], + tl: arg$3.exp_extra + }, + exp_type: ty$p, + exp_env: env, + exp_attributes: arg$3.exp_attributes + }); case /* Pexp_coerce */ 20 : - const sty$p = lid._2; - const sty = lid._1; - const sarg$2 = lid._0; - let match$29; - if (sty !== undefined) { - begin_def(undefined); - const match$30 = transl_simple_type_delayed(env, sty); - const cty$1 = match$30[0]; - const match$31 = transl_simple_type_delayed(env, sty$p); - const cty$p = match$31[0]; - const ty$5 = cty$1.ctyp_type; - const ty$p$1 = cty$p.ctyp_type; - try { - const force$p$p = subtype(env, ty$5, ty$p$1); - Curry._1(match$30[1], undefined); - Curry._1(match$31[1], undefined); - Curry._1(force$p$p, undefined); + const sty$p = lid._2; + const sty = lid._1; + const sarg$2 = lid._0; + let match$29; + if (sty !== undefined) { + begin_def(undefined); + const match$30 = transl_simple_type_delayed(env, sty); + const cty$1 = match$30[0]; + const match$31 = transl_simple_type_delayed(env, sty$p); + const cty$p = match$31[0]; + const ty$5 = cty$1.ctyp_type; + const ty$p$1 = cty$p.ctyp_type; + try { + const force$p$p = subtype(env, ty$5, ty$p$1); + Curry._1(match$30[1], undefined); + Curry._1(match$31[1], undefined); + Curry._1(force$p$p, undefined); + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Subtype) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Not_subtype */ 23, + _0: exn$2._1, + _1: exn$2._2 + } + }); } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Subtype) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Not_subtype */ 23, - _0: exn$2._1, - _1: exn$2._2 - } - }); + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + end_def(undefined); + generalize_structure$1(current_level.contents, ty$5); + generalize_structure$1(current_level.contents, ty$p$1); + match$29 = [ + type_argument(env, sarg$2, ty$5, instance(undefined, env, ty$5)), + instance(undefined, env, ty$p$1), + cty$1, + cty$p + ]; + } else { + const match$32 = transl_simple_type_delayed(env, sty$p); + const force = match$32[1]; + const cty$p$1 = match$32[0]; + const ty$p$2 = cty$p$1.ctyp_type; + begin_def(undefined); + const arg$4 = type_exp(env, sarg$2); + end_def(undefined); + const tv = newvar(undefined, undefined); + const gen = generalizable(tv.level, arg$4.exp_type); + unify_var(env, tv, arg$4.exp_type); + const match$33 = arg$4.exp_desc; + const match$34 = self_coercion.contents; + const match$35 = repr(ty$p$2).desc; + let exit$2 = 0; + if (match$33.TAG === /* Texp_ident */ 0) { + let tmp$2 = match$33._2.val_kind; + if (/* tag */ typeof tmp$2 === "number" || typeof tmp$2 === "string" || !(tmp$2.TAG === /* Val_self */ 2 && match$34 && !(/* tag */ typeof match$35 === "number" || typeof match$35 === "string" || match$35.TAG !== /* Tconstr */ 3))) { + exit$2 = 1; + } else { + const match$36 = match$34.hd; + const r = match$36[1]; + if (same(match$36[0], match$35._0)) { + r.contents = { + hd: loc, + tl: r.contents + }; + Curry._1(force, undefined); + } else { + exit$2 = 1; } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); } - end_def(undefined); - generalize_structure$1(current_level.contents, ty$5); - generalize_structure$1(current_level.contents, ty$p$1); - match$29 = [ - type_argument(env, sarg$2, ty$5, instance(undefined, env, ty$5)), - instance(undefined, env, ty$p$1), - cty$1, - cty$p - ]; } else { - const match$32 = transl_simple_type_delayed(env, sty$p); - const force = match$32[1]; - const cty$p$1 = match$32[0]; - const ty$p$2 = cty$p$1.ctyp_type; - begin_def(undefined); - const arg$4 = type_exp(env, sarg$2); - end_def(undefined); - const tv = newvar(undefined, undefined); - const gen = generalizable(tv.level, arg$4.exp_type); - unify_var(env, tv, arg$4.exp_type); - const match$33 = arg$4.exp_desc; - const match$34 = self_coercion.contents; - const match$35 = repr(ty$p$2).desc; - let exit$2 = 0; - if (match$33.TAG === /* Texp_ident */ 0) { - let tmp$2 = match$33._2.val_kind; - if (/* tag */ typeof tmp$2 === "number" || typeof tmp$2 === "string" || !(tmp$2.TAG === /* Val_self */ 2 && match$34 && !(/* tag */ typeof match$35 === "number" || typeof match$35 === "string" || match$35.TAG !== /* Tconstr */ 3))) { - exit$2 = 1; - } else { - const match$36 = match$34.hd; - const r = match$36[1]; - if (same(match$36[0], match$35._0)) { - r.contents = { - hd: loc, - tl: r.contents - }; + exit$2 = 1; + } + if (exit$2 === 1) { + if (Caml_obj.caml_equal(free_variables$1(Caml_option.some(env), arg$4.exp_type), /* [] */ 0) && Caml_obj.caml_equal(free_variables$1(Caml_option.some(env), ty$p$2), /* [] */ 0)) { + let tmp$3 = false; + if (!gen) { + const snap = snapshot(undefined); + const match$37 = enlarge_type(env, ty$p$2); + let tmp$4; + try { Curry._1(force, undefined); - } else { - exit$2 = 1; - } - } - } else { - exit$2 = 1; - } - if (exit$2 === 1) { - if (Caml_obj.caml_equal(free_variables$1(Caml_option.some(env), arg$4.exp_type), /* [] */ 0) && Caml_obj.caml_equal(free_variables$1(Caml_option.some(env), ty$p$2), /* [] */ 0)) { - let tmp$3 = false; - if (!gen) { - const snap = snapshot(undefined); - const match$37 = enlarge_type(env, ty$p$2); - let tmp$4; - try { - Curry._1(force, undefined); - unify$2(env, arg$4.exp_type, match$37[0]); - tmp$4 = true; - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Unify) { - backtrack(snap); - tmp$4 = false; - } else { - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); - } - } - tmp$3 = tmp$4; + unify$2(env, arg$4.exp_type, match$37[0]); + tmp$4 = true; } - if (!tmp$3) { - try { - const force$p = subtype(env, arg$4.exp_type, ty$p$2); - Curry._1(force, undefined); - Curry._1(force$p, undefined); - if (!gen) { - prerr_warning(loc, { - TAG: /* Not_principal */ 8, - _0: "this ground coercion" - }); - } - - } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Subtype) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Not_subtype */ 23, - _0: exn$4._1, - _1: exn$4._2 - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Unify) { + backtrack(snap); + tmp$4 = false; + } else { + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); } } - - } else { - const match$38 = enlarge_type(env, ty$p$2); - Curry._1(force, undefined); + tmp$3 = tmp$4; + } + if (!tmp$3) { try { - unify$2(env, arg$4.exp_type, match$38[0]); + const force$p = subtype(env, arg$4.exp_type, ty$p$2); + Curry._1(force, undefined); + Curry._1(force$p, undefined); + if (!gen) { + prerr_warning(loc, { + TAG: /* Not_principal */ 8, + _0: "this ground coercion" + }); + } + } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Subtype) { throw new Caml_js_exceptions.MelangeError($$Error$7, { MEL_EXN_ID: $$Error$7, - _1: sarg$2.pexp_loc, + _1: loc, _2: env, _3: { - TAG: /* Coercion_failure */ 25, - _0: ty$p$2, - _1: full_expand(env, ty$p$2), - _2: trace._1, - _3: match$38[1] + TAG: /* Not_subtype */ 23, + _0: exn$4._1, + _1: exn$4._2 } }); } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + } + + } else { + const match$38 = enlarge_type(env, ty$p$2); + Curry._1(force, undefined); + try { + unify$2(env, arg$4.exp_type, match$38[0]); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: sarg$2.pexp_loc, + _2: env, + _3: { + TAG: /* Coercion_failure */ 25, + _0: ty$p$2, + _1: full_expand(env, ty$p$2), + _2: trace._1, + _3: match$38[1] + } + }); } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); } } - match$29 = [ - arg$4, - ty$p$2, - undefined, - cty$p$1 - ]; } - const arg$5 = match$29[0]; - return rue({ - exp_desc: arg$5.exp_desc, - exp_loc: arg$5.exp_loc, - exp_extra: { - hd: [ + match$29 = [ + arg$4, + ty$p$2, + undefined, + cty$p$1 + ]; + } + const arg$5 = match$29[0]; + return rue({ + exp_desc: arg$5.exp_desc, + exp_loc: arg$5.exp_loc, + exp_extra: { + hd: [ + { + TAG: /* Texp_coerce */ 1, + _0: match$29[2], + _1: match$29[3] + }, + loc, + sexp.pexp_attributes + ], + tl: arg$5.exp_extra + }, + exp_type: match$29[1], + exp_env: env, + exp_attributes: arg$5.exp_attributes + }); + case /* Pexp_send */ 21 : + const met = lid._1; + const e = lid._0; + if (principal.contents) { + begin_def(undefined); + } + const obj = type_exp(env, e); + try { + const match$39 = obj.exp_desc; + let match$40; + let exit$3 = 0; + if (match$39.TAG === /* Texp_ident */ 0) { + const match$41 = match$39._2.val_kind; + const lid$5 = match$39._1; + if (/* tag */ typeof match$41 === "number" || typeof match$41 === "string") { + exit$3 = 1; + } else { + switch (match$41.TAG) { + case /* Val_self */ 2 : + const match$42 = filter_self_method(env, met, /* Private */ 0, match$41._0, match$41._3); + const typ = match$42[1]; + if (is_Tvar(repr(typ))) { + prerr_warning(loc, { + TAG: /* Undeclared_virtual_method */ 7, + _0: met + }); + } + match$40 = [ { - TAG: /* Texp_coerce */ 1, - _0: match$29[2], - _1: match$29[3] + TAG: /* Tmeth_val */ 1, + _0: match$42[0] }, - loc, - sexp.pexp_attributes - ], - tl: arg$5.exp_extra - }, - exp_type: match$29[1], - exp_env: env, - exp_attributes: arg$5.exp_attributes - }); - case /* Pexp_send */ 21 : - const met = lid._1; - const e = lid._0; - if (principal.contents) { - begin_def(undefined); - } - const obj = type_exp(env, e); - try { - const match$39 = obj.exp_desc; - let match$40; - let exit$3 = 0; - if (match$39.TAG === /* Texp_ident */ 0) { - const match$41 = match$39._2.val_kind; - const lid$5 = match$39._1; - if (/* tag */ typeof match$41 === "number" || typeof match$41 === "string") { - exit$3 = 1; - } else { - switch (match$41.TAG) { - case /* Val_self */ 2 : - const match$42 = filter_self_method(env, met, /* Private */ 0, match$41._0, match$41._3); - const typ = match$42[1]; - if (is_Tvar(repr(typ))) { - prerr_warning(loc, { - TAG: /* Undeclared_virtual_method */ 7, + undefined, + typ + ]; + break; + case /* Val_anc */ 3 : + const cl_num = match$41._1; + let method_id; + try { + method_id = Stdlib__List.assoc(met, match$41._0); + } + catch (raw_exn$5){ + const exn$5 = Caml_js_exceptions.internalToOCamlException(raw_exn$5); + if (exn$5.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: e.pexp_loc, + _2: env, + _3: { + TAG: /* Undefined_inherited_method */ 17, _0: met - }); - } - match$40 = [ - { - TAG: /* Tmeth_val */ 1, - _0: match$42[0] + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn$5.MEL_EXN_ID, exn$5); + } + const match$43 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: "selfpat-" + cl_num + }, env); + const match$44 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: "self-" + cl_num + }, env); + const desc$3 = match$43[1]; + const match$45 = desc$3.val_kind; + if (/* tag */ typeof match$45 === "number" || typeof match$45 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44747, + 18 + ] + }); + } + if (match$45.TAG === /* Val_self */ 2) { + const match$46 = filter_self_method(env, met, /* Private */ 0, match$45._0, match$45._3); + const typ$1 = match$46[1]; + const method_type = newvar(undefined, undefined); + const match$47 = filter_arrow(env, method_type, ""); + unify$2(env, match$47[0], desc$3.val_type); + unify$2(env, match$47[1], instance(undefined, env, typ$1)); + const exp_0 = { + exp_desc: { + TAG: /* Texp_ident */ 0, + _0: { + TAG: /* Pident */ 0, + _0: method_id }, - undefined, - typ - ]; - break; - case /* Val_anc */ 3 : - const cl_num = match$41._1; - let method_id; - try { - method_id = Stdlib__List.assoc(met, match$41._0); - } - catch (raw_exn$5){ - const exn$5 = Caml_js_exceptions.internalToOCamlException(raw_exn$5); - if (exn$5.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: e.pexp_loc, - _2: env, - _3: { - TAG: /* Undefined_inherited_method */ 17, - _0: met - } - }); + _1: lid$5, + _2: { + val_type: method_type, + val_kind: /* Val_reg */ 0, + val_loc: none, + val_attributes: /* [] */ 0 } - throw new Caml_js_exceptions.MelangeError(exn$5.MEL_EXN_ID, exn$5); - } - const match$43 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: "selfpat-" + cl_num - }, env); - const match$44 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: "self-" + cl_num - }, env); - const desc$3 = match$43[1]; - const match$45 = desc$3.val_kind; - if (/* tag */ typeof match$45 === "number" || typeof match$45 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44747, - 18 - ] - }); - } - if (match$45.TAG === /* Val_self */ 2) { - const match$46 = filter_self_method(env, met, /* Private */ 0, match$45._0, match$45._3); - const typ$1 = match$46[1]; - const method_type = newvar(undefined, undefined); - const match$47 = filter_arrow(env, method_type, ""); - unify$2(env, match$47[0], desc$3.val_type); - unify$2(env, match$47[1], instance(undefined, env, typ$1)); - const exp_0 = { + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: method_type, + exp_env: env, + exp_attributes: /* [] */ 0 + }; + const exp_1 = { + hd: [ + "", + { exp_desc: { TAG: /* Texp_ident */ 0, - _0: { - TAG: /* Pident */ 0, - _0: method_id - }, + _0: match$44[0], _1: lid$5, - _2: { - val_type: method_type, - val_kind: /* Val_reg */ 0, - val_loc: none, - val_attributes: /* [] */ 0 - } + _2: desc$3 }, - exp_loc: loc, + exp_loc: obj.exp_loc, exp_extra: /* [] */ 0, - exp_type: method_type, + exp_type: desc$3.val_type, exp_env: env, exp_attributes: /* [] */ 0 - }; - const exp_1 = { - hd: [ - "", - { - exp_desc: { - TAG: /* Texp_ident */ 0, - _0: match$44[0], - _1: lid$5, - _2: desc$3 - }, - exp_loc: obj.exp_loc, - exp_extra: /* [] */ 0, - exp_type: desc$3.val_type, - exp_env: env, - exp_attributes: /* [] */ 0 - }, - /* Required */ 0 - ], - tl: /* [] */ 0 - }; - const exp$1 = { - TAG: /* Texp_apply */ 4, - _0: exp_0, - _1: exp_1 - }; - match$40 = [ - { - TAG: /* Tmeth_name */ 0, - _0: met - }, - re({ - exp_desc: exp$1, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: typ$1, - exp_env: env, - exp_attributes: /* [] */ 0 - }), - typ$1 - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44747, - 18 - ] - }); - } - break; - default: - exit$3 = 1; - } - } - } else { - exit$3 = 1; - } - if (exit$3 === 1) { - match$40 = [ - { - TAG: /* Tmeth_name */ 0, - _0: met - }, - undefined, - filter_method(env, met, /* Public */ 1, obj.exp_type) - ]; - } - const typ$2 = match$40[2]; - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, typ$2); - } - const ty$6 = repr(typ$2); - const match$48 = ty$6.desc; - let typ$3; - if (/* tag */ typeof match$48 === "number" || typeof match$48 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44773, - 14 - ] - }); - } - switch (match$48.TAG) { - case /* Tvar */ 0 : - const ty$p$3 = newvar(undefined, undefined); - unify$2(env, instance_def(ty$6), newty2(current_level.contents, { - TAG: /* Tpoly */ 10, - _0: ty$p$3, - _1: /* [] */ 0 - })); - typ$3 = ty$p$3; - break; - case /* Tpoly */ 10 : - const ty$7 = match$48._0; - if (match$48._1) { - const l$2 = ty$6.level; - if (principal.contents && l$2 !== 100000000) { - prerr_warning(loc, { - TAG: /* Not_principal */ 8, - _0: "this use of a polymorphic method" - }); - } - typ$3 = instance_poly(undefined, false, match$48._1, ty$7)[1]; + }, + /* Required */ 0 + ], + tl: /* [] */ 0 + }; + const exp$1 = { + TAG: /* Texp_apply */ 4, + _0: exp_0, + _1: exp_1 + }; + match$40 = [ + { + TAG: /* Tmeth_name */ 0, + _0: met + }, + re({ + exp_desc: exp$1, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: typ$1, + exp_env: env, + exp_attributes: /* [] */ 0 + }), + typ$1 + ]; } else { - typ$3 = instance(undefined, env, ty$7); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44747, + 18 + ] + }); } break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44773, - 14 - ] - }); - } - return rue({ - exp_desc: { - TAG: /* Texp_send */ 18, - _0: obj, - _1: match$40[0], - _2: match$40[1] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: typ$3, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - catch (raw_exn$6){ - const exn$6 = Caml_js_exceptions.internalToOCamlException(raw_exn$6); - if (exn$6.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: e.pexp_loc, - _2: env, - _3: { - TAG: /* Undefined_method */ 16, - _0: obj.exp_type, - _1: met - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn$6.MEL_EXN_ID, exn$6); - } - break; - case /* Pexp_new */ 22 : - const cl = lid._0; - const match$49 = find_class$1(env, loc, cl.txt); - const cl_decl = match$49[1]; - const ty$8 = cl_decl.cty_new; - if (ty$8 !== undefined) { - return rue({ - exp_desc: { - TAG: /* Texp_new */ 19, - _0: match$49[0], - _1: cl, - _2: cl_decl - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(ty$8), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Virtual_class */ 18, - _0: cl.txt - } - }); - case /* Pexp_setinstvar */ 23 : - const lab = lid._0; - try { - const match$50 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: lab.txt - }, env); - const desc$4 = match$50[1]; - const match$51 = desc$4.val_kind; - let exit$4 = 0; - if (/* tag */ typeof match$51 === "number" || typeof match$51 === "string") { - exit$4 = 1; - } else { - if (match$51.TAG === /* Val_ivar */ 1) { - if (match$51._0 === /* Immutable */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Instance_variable_not_mutable */ 22, - _0: true, - _1: lab.txt - } - }); - } - const newval = type_expect(undefined, env, lid._1, instance(undefined, env, desc$4.val_type)); - const match$52 = lookup_value$1({ - TAG: /* Lident */ 0, - _0: "self-" + match$51._1 - }, env); - return rue({ - exp_desc: { - TAG: /* Texp_setinstvar */ 21, - _0: match$52[0], - _1: match$50[0], - _2: lab, - _3: newval - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: instance_def(type_unit), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + default: + exit$3 = 1; } - exit$4 = 1; - } - if (exit$4 === 1) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Instance_variable_not_mutable */ 22, - _0: false, - _1: lab.txt - } - }); - } - - } - catch (raw_exn$7){ - const exn$7 = Caml_js_exceptions.internalToOCamlException(raw_exn$7); - if (exn$7.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Unbound_instance_variable */ 21, - _0: lab.txt - } - }); } - throw new Caml_js_exceptions.MelangeError(exn$7.MEL_EXN_ID, exn$7); + } else { + exit$3 = 1; } - break; - case /* Pexp_override */ 24 : - const lst = lid._0; - Stdlib__List.fold_right((function (param, l) { - const lab = param[0]; - if (Stdlib__List.exists((function (l) { - return l.txt === lab.txt; - }), l)) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Value_multiply_overridden */ 24, - _0: lab.txt - } - }); - } - return { - hd: lab, - tl: l - }; - }), lst, /* [] */ 0); - let match$53; - try { - match$53 = [ - lookup_value$1({ - TAG: /* Lident */ 0, - _0: "selfpat-*" - }, env), - lookup_value$1({ - TAG: /* Lident */ 0, - _0: "self-*" - }, env) + if (exit$3 === 1) { + match$40 = [ + { + TAG: /* Tmeth_name */ 0, + _0: met + }, + undefined, + filter_method(env, met, /* Public */ 1, obj.exp_type) ]; } - catch (raw_exn$8){ - const exn$8 = Caml_js_exceptions.internalToOCamlException(raw_exn$8); - if (exn$8.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: /* Outside_class */ 0 - }); - } - throw new Caml_js_exceptions.MelangeError(exn$8.MEL_EXN_ID, exn$8); + const typ$2 = match$40[2]; + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, typ$2); } - const match$54 = match$53[0][1]; - const match$55 = match$54.val_kind; - if (/* tag */ typeof match$55 === "number" || typeof match$55 === "string") { + const ty$6 = repr(typ$2); + const match$48 = ty$6.desc; + let typ$3; + if (/* tag */ typeof match$48 === "number" || typeof match$48 === "string") { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 44857, - 10 + 44773, + 14 ] }); } - if (match$55.TAG === /* Val_self */ 2) { - const vars = match$55._1; - const type_override = function (param) { - const lab = param[0]; - try { - const match = Curry._2(Meths.find, lab.txt, vars.contents); - return [ - { - TAG: /* Pident */ 0, - _0: match[0] - }, - lab, - type_expect(undefined, env, param[1], instance(undefined, env, match[3])) - ]; - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Unbound_instance_variable */ 21, - _0: lab.txt - } + switch (match$48.TAG) { + case /* Tvar */ 0 : + const ty$p$3 = newvar(undefined, undefined); + unify$2(env, instance_def(ty$6), newty2(current_level.contents, { + TAG: /* Tpoly */ 10, + _0: ty$p$3, + _1: /* [] */ 0 + })); + typ$3 = ty$p$3; + break; + case /* Tpoly */ 10 : + const ty$7 = match$48._0; + if (match$48._1) { + const l$2 = ty$6.level; + if (principal.contents && l$2 !== 100000000) { + prerr_warning(loc, { + TAG: /* Not_principal */ 8, + _0: "this use of a polymorphic method" }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + typ$3 = instance_poly(undefined, false, match$48._1, ty$7)[1]; + } else { + typ$3 = instance(undefined, env, ty$7); } - }; - const modifs = Stdlib__List.map(type_override, lst); - return rue({ - exp_desc: { - TAG: /* Texp_override */ 22, - _0: match$53[1][0], - _1: modifs - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: match$54.val_type, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44857, - 10 - ] - }); - case /* Pexp_letmodule */ 25 : - const name$2 = lid._0; - const ty$9 = newvar(undefined, undefined); - begin_def(undefined); - set_current_time(ty$9.level); - const context = narrow(undefined); - const modl = Curry._2(type_module.contents, env, lid._1); - const match$56 = enter_module(undefined, name$2.txt, modl.mod_type, env); - const new_env = match$56[1]; - init_def(currentstamp.contents); - widen(context); - const body$4 = type_expect(undefined, new_env, lid._2, ty_expected); - end_def(undefined); - try { - unify_var(new_env, ty$9, body$4.exp_type); - } - catch (raw_exn$9){ - const exn$9 = Caml_js_exceptions.internalToOCamlException(raw_exn$9); - if (exn$9.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Scoping_let_module */ 28, - _0: name$2.txt, - _1: body$4.exp_type - } + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44773, + 14 + ] }); - } - throw new Caml_js_exceptions.MelangeError(exn$9.MEL_EXN_ID, exn$9); } - return re({ - exp_desc: { - TAG: /* Texp_letmodule */ 23, - _0: match$56[0], - _1: name$2, - _2: modl, - _3: body$4 - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: ty$9, - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); - case /* Pexp_assert */ 26 : - const cond$2 = type_expect(undefined, env, lid._0, type_bool); - const match$57 = cond$2.exp_desc; - let exp_type; - exp_type = match$57.TAG === /* Texp_construct */ 8 && match$57._1.cstr_name === "false" ? instance(undefined, env, ty_expected) : instance_def(type_unit); return rue({ exp_desc: { - TAG: /* Texp_assert */ 24, - _0: cond$2 + TAG: /* Texp_send */ 18, + _0: obj, + _1: match$40[0], + _2: match$40[1] }, exp_loc: loc, exp_extra: /* [] */ 0, - exp_type: exp_type, + exp_type: typ$3, exp_env: env, exp_attributes: sexp.pexp_attributes }); - case /* Pexp_lazy */ 27 : - const ty$10 = newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }); - const to_unify$2 = type_lazy_t(ty$10); - unify_exp_types(loc, env, to_unify$2, ty_expected); - const arg$6 = type_expect(undefined, env, lid._0, ty$10); - return re({ + } + catch (raw_exn$6){ + const exn$6 = Caml_js_exceptions.internalToOCamlException(raw_exn$6); + if (exn$6.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: e.pexp_loc, + _2: env, + _3: { + TAG: /* Undefined_method */ 16, + _0: obj.exp_type, + _1: met + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn$6.MEL_EXN_ID, exn$6); + } + break; + case /* Pexp_new */ 22 : + const cl = lid._0; + const match$49 = find_class$1(env, loc, cl.txt); + const cl_decl = match$49[1]; + const ty$8 = cl_decl.cty_new; + if (ty$8 !== undefined) { + return rue({ exp_desc: { - TAG: /* Texp_lazy */ 25, - _0: arg$6 + TAG: /* Texp_new */ 19, + _0: match$49[0], + _1: cl, + _2: cl_decl }, exp_loc: loc, exp_extra: /* [] */ 0, - exp_type: instance(undefined, env, ty_expected), + exp_type: instance_def(ty$8), exp_env: env, exp_attributes: sexp.pexp_attributes }); - case /* Pexp_poly */ 28 : - const sty$1 = lid._1; - const sbody$1 = lid._0; - if (principal.contents) { - begin_def(undefined); - } - let match$58; - if (sty$1 !== undefined) { - const sty$2 = force_poly(sty$1); - const cty$2 = transl_simple_type(env, false, sty$2); - match$58 = [ - repr(cty$2.ctyp_type), - cty$2 - ]; - } else { - match$58 = [ - repr(ty_expected), - undefined - ]; - } - const ty$11 = match$58[0]; - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, ty$11); + } + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Virtual_class */ 18, + _0: cl.txt + } + }); + case /* Pexp_setinstvar */ 23 : + const lab = lid._0; + try { + const match$50 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: lab.txt + }, env); + const desc$4 = match$50[1]; + const match$51 = desc$4.val_kind; + let exit$4 = 0; + if (/* tag */ typeof match$51 === "number" || typeof match$51 === "string") { + exit$4 = 1; + } else { + if (match$51.TAG === /* Val_ivar */ 1) { + if (match$51._0 === /* Immutable */ 0) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Instance_variable_not_mutable */ 22, + _0: true, + _1: lab.txt + } + }); + } + const newval = type_expect(undefined, env, lid._1, instance(undefined, env, desc$4.val_type)); + const match$52 = lookup_value$1({ + TAG: /* Lident */ 0, + _0: "self-" + match$51._1 + }, env); + return rue({ + exp_desc: { + TAG: /* Texp_setinstvar */ 21, + _0: match$52[0], + _1: match$50[0], + _2: lab, + _3: newval + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance_def(type_unit), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + } + exit$4 = 1; } - if (sty$1 !== undefined) { - unify_exp_types(loc, env, instance(undefined, env, ty$11), instance(undefined, env, ty_expected)); + if (exit$4 === 1) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Instance_variable_not_mutable */ 22, + _0: false, + _1: lab.txt + } + }); } - const match$59 = expand_head(env, ty$11).desc; - let exp$2; - if (/* tag */ typeof match$59 === "number" || typeof match$59 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44963, - 15 - ] + + } + catch (raw_exn$7){ + const exn$7 = Caml_js_exceptions.internalToOCamlException(raw_exn$7); + if (exn$7.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Unbound_instance_variable */ 21, + _0: lab.txt + } }); } - switch (match$59.TAG) { - case /* Tvar */ 0 : - const exp$3 = type_exp(env, sbody$1); - const exp_exp_desc = exp$3.exp_desc; - const exp_exp_loc = exp$3.exp_loc; - const exp_exp_extra = exp$3.exp_extra; - const exp_exp_type = newty2(current_level.contents, { - TAG: /* Tpoly */ 10, - _0: exp$3.exp_type, - _1: /* [] */ 0 + throw new Caml_js_exceptions.MelangeError(exn$7.MEL_EXN_ID, exn$7); + } + break; + case /* Pexp_override */ 24 : + const lst = lid._0; + Stdlib__List.fold_right((function (param, l) { + const lab = param[0]; + if (Stdlib__List.exists((function (l) { + return l.txt === lab.txt; + }), l)) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Value_multiply_overridden */ 24, + _0: lab.txt + } }); - const exp_exp_env = exp$3.exp_env; - const exp_exp_attributes = exp$3.exp_attributes; - const exp$4 = { - exp_desc: exp_exp_desc, - exp_loc: exp_exp_loc, - exp_extra: exp_exp_extra, - exp_type: exp_exp_type, - exp_env: exp_exp_env, - exp_attributes: exp_exp_attributes - }; - unify_exp(env, exp$4, ty$11); - exp$2 = exp$4; - break; - case /* Tpoly */ 10 : - const ty$p$4 = match$59._0; - if (match$59._1) { - begin_def(undefined); - if (principal.contents) { - begin_def(undefined); - } - const match$60 = instance_poly(undefined, true, match$59._1, ty$p$4); - const ty$p$p = match$60[1]; - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, ty$p$p); - } - const exp$5 = type_expect(undefined, env, sbody$1, ty$p$p); - end_def(undefined); - check_univars(env, false, "method", exp$5, ty_expected, match$60[0]); - exp$2 = { - exp_desc: exp$5.exp_desc, - exp_loc: exp$5.exp_loc, - exp_extra: exp$5.exp_extra, - exp_type: instance(undefined, env, ty$11), - exp_env: exp$5.exp_env, - exp_attributes: exp$5.exp_attributes - }; - } else { - const exp$6 = type_expect(undefined, env, sbody$1, ty$p$4); - exp$2 = { - exp_desc: exp$6.exp_desc, - exp_loc: exp$6.exp_loc, - exp_extra: exp$6.exp_extra, - exp_type: instance(undefined, env, ty$11), - exp_env: exp$6.exp_env, - exp_attributes: exp$6.exp_attributes - }; - } - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 44963, - 15 - ] - }); + } + return { + hd: lab, + tl: l + }; + }), lst, /* [] */ 0); + let match$53; + try { + match$53 = [ + lookup_value$1({ + TAG: /* Lident */ 0, + _0: "selfpat-*" + }, env), + lookup_value$1({ + TAG: /* Lident */ 0, + _0: "self-*" + }, env) + ]; + } + catch (raw_exn$8){ + const exn$8 = Caml_js_exceptions.internalToOCamlException(raw_exn$8); + if (exn$8.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: /* Outside_class */ 0 + }); } - return re({ - exp_desc: exp$2.exp_desc, - exp_loc: exp$2.exp_loc, - exp_extra: { - hd: [ - { - TAG: /* Texp_poly */ 3, - _0: match$58[1] - }, - loc, - sexp.pexp_attributes - ], - tl: exp$2.exp_extra - }, - exp_type: exp$2.exp_type, - exp_env: exp$2.exp_env, - exp_attributes: exp$2.exp_attributes + throw new Caml_js_exceptions.MelangeError(exn$8.MEL_EXN_ID, exn$8); + } + const match$54 = match$53[0][1]; + const match$55 = match$54.val_kind; + if (/* tag */ typeof match$55 === "number" || typeof match$55 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44857, + 10 + ] }); - case /* Pexp_object */ 29 : - const match$61 = Curry._3(type_object.contents, env, loc, lid._0); + } + if (match$55.TAG === /* Val_self */ 2) { + const vars = match$55._1; + const type_override = function (param) { + const lab = param[0]; + try { + const match = Curry._2(Meths.find, lab.txt, vars.contents); + return [ + { + TAG: /* Pident */ 0, + _0: match[0] + }, + lab, + type_expect(undefined, env, param[1], instance(undefined, env, match[3])) + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Unbound_instance_variable */ 21, + _0: lab.txt + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + }; + const modifs = Stdlib__List.map(type_override, lst); return rue({ exp_desc: { - TAG: /* Texp_object */ 26, - _0: match$61[0], - _1: match$61[2] + TAG: /* Texp_override */ 22, + _0: match$53[1][0], + _1: modifs }, exp_loc: loc, exp_extra: /* [] */ 0, - exp_type: match$61[1].csig_self, + exp_type: match$54.val_type, exp_env: env, exp_attributes: sexp.pexp_attributes }); - case /* Pexp_newtype */ 30 : - const name$3 = lid._0; - const ty$12 = newvar(undefined, undefined); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44857, + 10 + ] + }); + case /* Pexp_letmodule */ 25 : + const name$2 = lid._0; + const ty$9 = newvar(undefined, undefined); + begin_def(undefined); + set_current_time(ty$9.level); + const context = narrow(undefined); + const modl = Curry._2(type_module.contents, env, lid._1); + const match$56 = enter_module(undefined, name$2.txt, modl.mod_type, env); + const new_env = match$56[1]; + init_def(currentstamp.contents); + widen(context); + const body$4 = type_expect(undefined, new_env, lid._2, ty_expected); + end_def(undefined); + try { + unify_var(new_env, ty$9, body$4.exp_type); + } + catch (raw_exn$9){ + const exn$9 = Caml_js_exceptions.internalToOCamlException(raw_exn$9); + if (exn$9.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Scoping_let_module */ 28, + _0: name$2.txt, + _1: body$4.exp_type + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn$9.MEL_EXN_ID, exn$9); + } + return re({ + exp_desc: { + TAG: /* Texp_letmodule */ 23, + _0: match$56[0], + _1: name$2, + _2: modl, + _3: body$4 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: ty$9, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_assert */ 26 : + const cond$2 = type_expect(undefined, env, lid._0, type_bool); + const match$57 = cond$2.exp_desc; + let exp_type; + exp_type = match$57.TAG === /* Texp_construct */ 8 && match$57._1.cstr_name === "false" ? instance(undefined, env, ty_expected) : instance_def(type_unit); + return rue({ + exp_desc: { + TAG: /* Texp_assert */ 24, + _0: cond$2 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: exp_type, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_lazy */ 27 : + const ty$10 = newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }); + const to_unify$2 = type_lazy_t(ty$10); + unify_exp_types(loc, env, to_unify$2, ty_expected); + const arg$6 = type_expect(undefined, env, lid._0, ty$10); + return re({ + exp_desc: { + TAG: /* Texp_lazy */ 25, + _0: arg$6 + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, env, ty_expected), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_poly */ 28 : + const sty$1 = lid._1; + const sbody$1 = lid._0; + if (principal.contents) { begin_def(undefined); - const level = current_level.contents; - const decl_type_newtype_level = [ - level, - level + } + let match$58; + if (sty$1 !== undefined) { + const sty$2 = force_poly(sty$1); + const cty$2 = transl_simple_type(env, false, sty$2); + match$58 = [ + repr(cty$2.ctyp_type), + cty$2 ]; - const decl$1 = { - type_params: /* [] */ 0, - type_arity: 0, - type_kind: /* Type_abstract */ 0, - type_private: /* Public */ 1, - type_manifest: undefined, - type_variance: /* [] */ 0, - type_newtype_level: decl_type_newtype_level, - type_loc: loc, - type_attributes: /* [] */ 0 - }; - set_current_time(ty$12.level); - const match$62 = enter_type(name$3, decl$1, env); - const id = match$62[0]; - init_def(currentstamp.contents); - const body$5 = type_exp(match$62[1], lid._1); - const seen = Stdlib__Hashtbl.create(undefined, 8); - const replace = function (t) { - if (Stdlib__Hashtbl.mem(seen, t.id)) { - return; - } - Stdlib__Hashtbl.add(seen, t.id, undefined); - const match = t.desc; - if (/* tag */ typeof match === "number" || typeof match === "string") { - return iter_type_expr(replace, t); - } - if (match.TAG !== /* Tconstr */ 3) { - return iter_type_expr(replace, t); - } - const id$p = match._0; - switch (id$p.TAG) { - case /* Pident */ 0 : - if (id === id$p._0) { - return link_type(t, ty$12); - } else { - return iter_type_expr(replace, t); - } - case /* Pdot */ 1 : - case /* Papply */ 2 : - return iter_type_expr(replace, t); - - } - }; - const ety = type_expr(identity, body$5.exp_type); - replace(ety); + } else { + match$58 = [ + repr(ty_expected), + undefined + ]; + } + const ty$11 = match$58[0]; + if (principal.contents) { end_def(undefined); - return rue({ - exp_desc: body$5.exp_desc, - exp_loc: loc, - exp_extra: { - hd: [ - { - TAG: /* Texp_newtype */ 4, - _0: name$3 - }, - loc, - sexp.pexp_attributes - ], - tl: body$5.exp_extra - }, - exp_type: ety, - exp_env: body$5.exp_env, - exp_attributes: body$5.exp_attributes + generalize_structure$1(current_level.contents, ty$11); + } + if (sty$1 !== undefined) { + unify_exp_types(loc, env, instance(undefined, env, ty$11), instance(undefined, env, ty_expected)); + } + const match$59 = expand_head(env, ty$11).desc; + let exp$2; + if (/* tag */ typeof match$59 === "number" || typeof match$59 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44963, + 15 + ] }); + } + switch (match$59.TAG) { + case /* Tvar */ 0 : + const exp$3 = type_exp(env, sbody$1); + const exp_exp_desc = exp$3.exp_desc; + const exp_exp_loc = exp$3.exp_loc; + const exp_exp_extra = exp$3.exp_extra; + const exp_exp_type = newty2(current_level.contents, { + TAG: /* Tpoly */ 10, + _0: exp$3.exp_type, + _1: /* [] */ 0 + }); + const exp_exp_env = exp$3.exp_env; + const exp_exp_attributes = exp$3.exp_attributes; + const exp$4 = { + exp_desc: exp_exp_desc, + exp_loc: exp_exp_loc, + exp_extra: exp_exp_extra, + exp_type: exp_exp_type, + exp_env: exp_exp_env, + exp_attributes: exp_exp_attributes + }; + unify_exp(env, exp$4, ty$11); + exp$2 = exp$4; + break; + case /* Tpoly */ 10 : + const ty$p$4 = match$59._0; + if (match$59._1) { + begin_def(undefined); + if (principal.contents) { + begin_def(undefined); + } + const match$60 = instance_poly(undefined, true, match$59._1, ty$p$4); + const ty$p$p = match$60[1]; + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, ty$p$p); + } + const exp$5 = type_expect(undefined, env, sbody$1, ty$p$p); + end_def(undefined); + check_univars(env, false, "method", exp$5, ty_expected, match$60[0]); + exp$2 = { + exp_desc: exp$5.exp_desc, + exp_loc: exp$5.exp_loc, + exp_extra: exp$5.exp_extra, + exp_type: instance(undefined, env, ty$11), + exp_env: exp$5.exp_env, + exp_attributes: exp$5.exp_attributes + }; + } else { + const exp$6 = type_expect(undefined, env, sbody$1, ty$p$4); + exp$2 = { + exp_desc: exp$6.exp_desc, + exp_loc: exp$6.exp_loc, + exp_extra: exp$6.exp_extra, + exp_type: instance(undefined, env, ty$11), + exp_env: exp$6.exp_env, + exp_attributes: exp$6.exp_attributes + }; + } + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 44963, + 15 + ] + }); + } + return re({ + exp_desc: exp$2.exp_desc, + exp_loc: exp$2.exp_loc, + exp_extra: { + hd: [ + { + TAG: /* Texp_poly */ 3, + _0: match$58[1] + }, + loc, + sexp.pexp_attributes + ], + tl: exp$2.exp_extra + }, + exp_type: exp$2.exp_type, + exp_env: exp$2.exp_env, + exp_attributes: exp$2.exp_attributes + }); + case /* Pexp_object */ 29 : + const match$61 = Curry._3(type_object.contents, env, loc, lid._0); + return rue({ + exp_desc: { + TAG: /* Texp_object */ 26, + _0: match$61[0], + _1: match$61[2] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: match$61[1].csig_self, + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); + case /* Pexp_newtype */ 30 : + const name$3 = lid._0; + const ty$12 = newvar(undefined, undefined); + begin_def(undefined); + const level = current_level.contents; + const decl_type_newtype_level = [ + level, + level + ]; + const decl$1 = { + type_params: /* [] */ 0, + type_arity: 0, + type_kind: /* Type_abstract */ 0, + type_private: /* Public */ 1, + type_manifest: undefined, + type_variance: /* [] */ 0, + type_newtype_level: decl_type_newtype_level, + type_loc: loc, + type_attributes: /* [] */ 0 + }; + set_current_time(ty$12.level); + const match$62 = enter_type(name$3, decl$1, env); + const id = match$62[0]; + init_def(currentstamp.contents); + const body$5 = type_exp(match$62[1], lid._1); + const seen = Stdlib__Hashtbl.create(undefined, 8); + const replace = function (t) { + if (Stdlib__Hashtbl.mem(seen, t.id)) { + return; + } + Stdlib__Hashtbl.add(seen, t.id, undefined); + const match = t.desc; + if (/* tag */ typeof match === "number" || typeof match === "string") { + return iter_type_expr(replace, t); + } + if (match.TAG !== /* Tconstr */ 3) { + return iter_type_expr(replace, t); + } + const id$p = match._0; + switch (id$p.TAG) { + case /* Pident */ 0 : + if (id === id$p._0) { + return link_type(t, ty$12); + } else { + return iter_type_expr(replace, t); + } + case /* Pdot */ 1 : + case /* Papply */ 2 : + return iter_type_expr(replace, t); + + } + }; + const ety = type_expr(identity, body$5.exp_type); + replace(ety); + end_def(undefined); + return rue({ + exp_desc: body$5.exp_desc, + exp_loc: loc, + exp_extra: { + hd: [ + { + TAG: /* Texp_newtype */ 4, + _0: name$3 + }, + loc, + sexp.pexp_attributes + ], + tl: body$5.exp_extra + }, + exp_type: ety, + exp_env: body$5.exp_env, + exp_attributes: body$5.exp_attributes + }); case /* Pexp_pack */ 31 : - const match$63 = expand_head(env, instance(undefined, env, ty_expected)); - const match$64 = match$63.desc; - let match$65; - if (/* tag */ typeof match$64 === "number" || typeof match$64 === "string") { + const match$63 = expand_head(env, instance(undefined, env, ty_expected)); + const match$64 = match$63.desc; + let match$65; + if (/* tag */ typeof match$64 === "number" || typeof match$64 === "string") { + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: { + TAG: /* Not_a_packed_module */ 32, + _0: ty_expected + } + }); + } + switch (match$64.TAG) { + case /* Tvar */ 0 : + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: loc, + _2: env, + _3: /* Cannot_infer_signature */ 3 + }); + case /* Tpackage */ 11 : + if (principal.contents && expand_head(env, ty_expected).level < 100000000) { + prerr_warning(loc, { + TAG: /* Not_principal */ 8, + _0: "this module packing" + }); + } + match$65 = [ + match$64._0, + match$64._1, + match$64._2 + ]; + break; + default: throw new Caml_js_exceptions.MelangeError($$Error$7, { MEL_EXN_ID: $$Error$7, _1: loc, @@ -68933,90 +68965,58 @@ function type_expect_(in_function, env, sexp, ty_expected) { _0: ty_expected } }); - } - switch (match$64.TAG) { - case /* Tvar */ 0 : - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: /* Cannot_infer_signature */ 3 - }); - case /* Tpackage */ 11 : - if (principal.contents && expand_head(env, ty_expected).level < 100000000) { - prerr_warning(loc, { - TAG: /* Not_principal */ 8, - _0: "this module packing" - }); - } - match$65 = [ - match$64._0, - match$64._1, - match$64._2 - ]; - break; - default: - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: loc, - _2: env, - _3: { - TAG: /* Not_a_packed_module */ 32, - _0: ty_expected - } - }); - } - const nl = match$65[1]; - const p = match$65[0]; - const match$66 = Curry._5(type_package.contents, env, lid._0, p, nl, match$65[2]); - return rue({ - exp_desc: { - TAG: /* Texp_pack */ 27, - _0: match$66[0] - }, - exp_loc: loc, - exp_extra: /* [] */ 0, - exp_type: newty2(current_level.contents, { - TAG: /* Tpackage */ 11, - _0: p, - _1: nl, - _2: match$66[1] - }), - exp_env: env, - exp_attributes: sexp.pexp_attributes - }); + } + const nl = match$65[1]; + const p = match$65[0]; + const match$66 = Curry._5(type_package.contents, env, lid._0, p, nl, match$65[2]); + return rue({ + exp_desc: { + TAG: /* Texp_pack */ 27, + _0: match$66[0] + }, + exp_loc: loc, + exp_extra: /* [] */ 0, + exp_type: newty2(current_level.contents, { + TAG: /* Tpackage */ 11, + _0: p, + _1: nl, + _2: match$66[1] + }), + exp_env: env, + exp_attributes: sexp.pexp_attributes + }); case /* Pexp_open */ 32 : - const lid$6 = lid._1; - const ovf = lid._0; - const match$67 = Curry._4(type_open.contents, ovf, env, sexp.pexp_loc, lid$6); - const newenv = match$67[1]; - const exp$7 = type_expect(undefined, newenv, lid._2, ty_expected); - return { - exp_desc: exp$7.exp_desc, - exp_loc: exp$7.exp_loc, - exp_extra: { - hd: [ - { - TAG: /* Texp_open */ 2, - _0: ovf, - _1: match$67[0], - _2: lid$6, - _3: newenv - }, - loc, - sexp.pexp_attributes - ], - tl: exp$7.exp_extra - }, - exp_type: exp$7.exp_type, - exp_env: exp$7.exp_env, - exp_attributes: exp$7.exp_attributes - }; + const lid$6 = lid._1; + const ovf = lid._0; + const match$67 = Curry._4(type_open.contents, ovf, env, sexp.pexp_loc, lid$6); + const newenv = match$67[1]; + const exp$7 = type_expect(undefined, newenv, lid._2, ty_expected); + return { + exp_desc: exp$7.exp_desc, + exp_loc: exp$7.exp_loc, + exp_extra: { + hd: [ + { + TAG: /* Texp_open */ 2, + _0: ovf, + _1: match$67[0], + _2: lid$6, + _3: newenv + }, + loc, + sexp.pexp_attributes + ], + tl: exp$7.exp_extra + }, + exp_type: exp$7.exp_type, + exp_env: exp$7.exp_env, + exp_attributes: exp$7.exp_attributes + }; case /* Pexp_extension */ 33 : - throw new Caml_js_exceptions.MelangeError(Error_forward$1, { - MEL_EXN_ID: Error_forward$1, - _1: error_of_extension(lid._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$1, { + MEL_EXN_ID: Error_forward$1, + _1: error_of_extension(lid._0) + }); } } @@ -69328,18 +69328,18 @@ function type_argument(env, sarg, ty_expected$p, ty_expected) { const match = sexp.pexp_desc; switch (match.TAG) { case /* Pexp_ifthenelse */ 15 : - const e2 = match._2; - if (e2 === undefined) { - return false; - } - if (!is_inferred(match._1)) { - return false; - } - _sexp = e2; - continue; + const e2 = match._2; + if (e2 === undefined) { + return false; + } + if (!is_inferred(match._1)) { + return false; + } + _sexp = e2; + continue; case /* Pexp_sequence */ 16 : - _sexp = match._1; - continue; + _sexp = match._1; + continue; case /* Pexp_ident */ 0 : case /* Pexp_apply */ 5 : case /* Pexp_field */ 12 : @@ -69347,10 +69347,10 @@ function type_argument(env, sarg, ty_expected$p, ty_expected) { case /* Pexp_coerce */ 20 : case /* Pexp_send */ 21 : case /* Pexp_new */ 22 : - return true; + return true; case /* Pexp_open */ 32 : - _sexp = match._2; - continue; + _sexp = match._2; + continue; default: return false; } @@ -69378,34 +69378,34 @@ function type_argument(env, sarg, ty_expected$p, ty_expected) { if (!/* tag */ (typeof match === "number" || typeof match === "string")) { switch (match.TAG) { case /* Tvar */ 0 : + return [ + Stdlib__List.rev(args), + ty_fun, + false + ]; + case /* Tarrow */ 1 : + const l = match._0; + if (is_optional(l)) { + const ty = option_none(instance(undefined, env, match._1), sarg.pexp_loc); + _ty_fun = match._2; + _args = { + hd: [ + l, + ty, + /* Optional */ 1 + ], + tl: args + }; + continue; + } + if (l === "" || classic.contents) { return [ Stdlib__List.rev(args), ty_fun, - false + no_labels(match._2) ]; - case /* Tarrow */ 1 : - const l = match._0; - if (is_optional(l)) { - const ty = option_none(instance(undefined, env, match._1), sarg.pexp_loc); - _ty_fun = match._2; - _args = { - hd: [ - l, - ty, - /* Optional */ 1 - ], - tl: args - }; - continue; - } - if (l === "" || classic.contents) { - return [ - Stdlib__List.rev(args), - ty_fun, - no_labels(match._2) - ]; - } - break; + } + break; } } @@ -69899,50 +69899,50 @@ function type_application(env, funct, sargs) { } else { switch (td.TAG) { case /* Tvar */ 0 : - const t1 = newvar(undefined, undefined); - const t2 = newvar(undefined, undefined); - const not_identity = function (param) { - if (param.TAG !== /* Texp_ident */ 0) { - return true; - } - const match = param._2.val_kind; - if (/* tag */ typeof match === "number" || typeof match === "string" || !(match.TAG === /* Val_prim */ 0 && match._0.prim_name === "%identity")) { - return true; - } else { - return false; - } - }; - if (ty_fun$3.level >= t1.level && not_identity(funct.exp_desc)) { - prerr_warning(sarg1.pexp_loc, /* Unused_argument */ 9); + const t1 = newvar(undefined, undefined); + const t2 = newvar(undefined, undefined); + const not_identity = function (param) { + if (param.TAG !== /* Texp_ident */ 0) { + return true; } - unify$2(env, ty_fun$3, newty2(current_level.contents, { - TAG: /* Tarrow */ 1, - _0: l1, - _1: t1, - _2: t2, - _3: { - TAG: /* Clink */ 0, - _0: { - contents: /* Cunknown */ 1 - } + const match = param._2.val_kind; + if (/* tag */ typeof match === "number" || typeof match === "string" || !(match.TAG === /* Val_prim */ 0 && match._0.prim_name === "%identity")) { + return true; + } else { + return false; + } + }; + if (ty_fun$3.level >= t1.level && not_identity(funct.exp_desc)) { + prerr_warning(sarg1.pexp_loc, /* Unused_argument */ 9); + } + unify$2(env, ty_fun$3, newty2(current_level.contents, { + TAG: /* Tarrow */ 1, + _0: l1, + _1: t1, + _2: t2, + _3: { + TAG: /* Clink */ 0, + _0: { + contents: /* Cunknown */ 1 } - })); + } + })); + match$12 = [ + t1, + t2 + ]; + break; + case /* Tarrow */ 1 : + const l$1 = td._0; + if (l$1 === l1 || classic.contents && l1 === "" && !is_optional(l$1)) { match$12 = [ - t1, - t2 + td._1, + td._2 ]; - break; - case /* Tarrow */ 1 : - const l$1 = td._0; - if (l$1 === l1 || classic.contents && l1 === "" && !is_optional(l$1)) { - match$12 = [ - td._1, - td._2 - ]; - } else { - exit$2 = 1; - } - break; + } else { + exit$2 = 1; + } + break; default: exit$2 = 1; } @@ -70030,13 +70030,13 @@ function type_application(env, funct, sargs) { if (!/* tag */ (typeof match$5 === "number" || typeof match$5 === "string")) { switch (match$5.TAG) { case /* Tvar */ 0 : - add_delayed_check(function (param) { - check_application_result(env, false, exp); - }); - break; + add_delayed_check(function (param) { + check_application_result(env, false, exp); + }); + break; case /* Tarrow */ 1 : - prerr_warning(exp.exp_loc, /* Partial_application */ 2); - break; + prerr_warning(exp.exp_loc, /* Partial_application */ 2); + break; } } @@ -70082,24 +70082,24 @@ function type_statement(env, sexp) { } else { switch (match.TAG) { case /* Tvar */ 0 : - if (ty.level > tv.level) { - prerr_warning(loc, /* Nonreturning_statement */ 10); - } else { - add_delayed_check(function (param) { - check_application_result(env, true, exp); - }); - } - break; + if (ty.level > tv.level) { + prerr_warning(loc, /* Nonreturning_statement */ 10); + } else { + add_delayed_check(function (param) { + check_application_result(env, true, exp); + }); + } + break; case /* Tarrow */ 1 : - prerr_warning(loc, /* Partial_application */ 2); - break; + prerr_warning(loc, /* Partial_application */ 2); + break; case /* Tconstr */ 3 : - if (same(match._0, path_unit)) { - - } else { - prerr_warning(loc, /* Statement_type */ 4); - } - break; + if (same(match._0, path_unit)) { + + } else { + prerr_warning(loc, /* Statement_type */ 4); + } + break; default: prerr_warning(loc, /* Statement_type */ 4); } @@ -70376,12 +70376,12 @@ function type_let(checkOpt, check_strictOpt, env, rec_flag, spat_sexp_list, scop const match$2 = match$1._0.txt; switch (match$2.TAG) { case /* Lident */ 0 : - is_fake_let = match$2._0 === "*opt*" && !spat_sexp_list.tl ? true : false; - break; + is_fake_let = match$2._0 === "*opt*" && !spat_sexp_list.tl ? true : false; + break; case /* Ldot */ 1 : case /* Lapply */ 2 : - is_fake_let = false; - break; + is_fake_let = false; + break; } } else { @@ -70407,11 +70407,11 @@ function type_let(checkOpt, check_strictOpt, env, rec_flag, spat_sexp_list, scop } switch (match$1.TAG) { case /* Pexp_constraint */ 19 : - sty = match$1._1; - break; + sty = match$1._1; + break; case /* Pexp_coerce */ 20 : - sty = match$1._2; - break; + sty = match$1._2; + break; default: return spat; } @@ -70707,286 +70707,285 @@ register_error_of_exn(function (err) { if (/* tag */ typeof param$1 === "number" || typeof param$1 === "string") { switch (param$1) { case /* Outside_class */ 0 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This object duplication occurs outside a method definition", - _1: /* End_of_format */ 0 - }, - _1: "This object duplication occurs outside a method definition" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This object duplication occurs outside a method definition", + _1: /* End_of_format */ 0 + }, + _1: "This object duplication occurs outside a method definition" + }); case /* Incoherent_label_order */ 1 : - Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This function is applied to arguments", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - } - }, - _1: "This function is applied to arguments@ " - }); - Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "in an order different from other calls.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - } - }, - _1: "in an order different from other calls.@ " - }); - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This is only allowed when the real type is known.", + Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This function is applied to arguments", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: /* End_of_format */ 0 - }, - _1: "This is only allowed when the real type is known." - }); - case /* Modules_not_allowed */ 2 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Modules are not allowed in this pattern.", + } + }, + _1: "This function is applied to arguments@ " + }); + Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "in an order different from other calls.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: /* End_of_format */ 0 - }, - _1: "Modules are not allowed in this pattern." - }); + } + }, + _1: "in an order different from other calls.@ " + }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This is only allowed when the real type is known.", + _1: /* End_of_format */ 0 + }, + _1: "This is only allowed when the real type is known." + }); + case /* Modules_not_allowed */ 2 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Modules are not allowed in this pattern.", + _1: /* End_of_format */ 0 + }, + _1: "Modules are not allowed in this pattern." + }); case /* Cannot_infer_signature */ 3 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The signature for this packaged module couldn't be inferred.", - _1: /* End_of_format */ 0 - }, - _1: "The signature for this packaged module couldn't be inferred." - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The signature for this packaged module couldn't be inferred.", + _1: /* End_of_format */ 0 + }, + _1: "The signature for this packaged module couldn't be inferred." + }); case /* Unexpected_existential */ 4 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected existential", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected existential" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected existential", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected existential" + }); case /* Invalid_interval */ 5 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Only character intervals are supported in patterns.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[Only character intervals are supported in patterns.@]" - }); + _1: { + TAG: /* String_literal */ 11, + _0: "Only character intervals are supported in patterns.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + }, + _1: "@[Only character intervals are supported in patterns.@]" + }); case /* Invalid_for_loop_index */ 6 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Invalid for-loop index: only variables and _ are allowed.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[Invalid for-loop index: only variables and _ are allowed.@]" - }); - case /* No_value_clauses */ 7 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "None of the patterns in this 'match' expression match values.", - _1: /* End_of_format */ 0 - }, - _1: "None of the patterns in this 'match' expression match values." - }); + _0: "Invalid for-loop index: only variables and _ are allowed.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + }, + _1: "@[Invalid for-loop index: only variables and _ are allowed.@]" + }); + case /* No_value_clauses */ 7 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "None of the patterns in this 'match' expression match values.", + _1: /* End_of_format */ 0 + }, + _1: "None of the patterns in this 'match' expression match values." + }); case /* Exception_pattern_below_toplevel */ 8 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Exception patterns must be at the top level of a match case.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[Exception patterns must be at the top level of a match case.@]" - }); + _1: { + TAG: /* String_literal */ 11, + _0: "Exception patterns must be at the top level of a match case.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + }, + _1: "@[Exception patterns must be at the top level of a match case.@]" + }); } } else { switch (param$1.TAG) { case /* Polymorphic_label */ 0 : - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The record field ", _1: { - TAG: /* String_literal */ 11, - _0: "The record field ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " is polymorphic.", + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " is polymorphic.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[The record field %a is polymorphic.@ %s@]" - }), longident, param$1._0, "You cannot instantiate it in a pattern."); + } + }, + _1: "@[The record field %a is polymorphic.@ %s@]" + }), longident, param$1._0, "You cannot instantiate it in a pattern."); case /* Constructor_arity_mismatch */ 1 : - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The constructor ", _1: { - TAG: /* String_literal */ 11, - _0: "The constructor ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "expects ", _1: { - TAG: /* String_literal */ 11, - _0: "expects ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " argument(s),", + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " argument(s),", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "but is applied here to ", _1: { - TAG: /* String_literal */ 11, - _0: "but is applied here to ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " argument(s)", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " argument(s)", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -70997,272 +70996,167 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The constructor %a@ expects %i argument(s),@ but is applied here to %i argument(s)@]" - }), longident, param$1._0, param$1._1, param$1._2); + } + }, + _1: "@[The constructor %a@ expects %i argument(s),@ but is applied here to %i argument(s)@]" + }), longident, param$1._0, param$1._1, param$1._2); case /* Label_mismatch */ 2 : - const lid = param$1._0; - return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The record field ", - _1: { - TAG: /* Alpha */ 15, + const lid = param$1._0; + return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { + Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The record field ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "belongs to the type", - _1: /* End_of_format */ 0 - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "belongs to the type", + _1: /* End_of_format */ 0 } } - }, - _1: "The record field %a@ belongs to the type" - }), longident, lid); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is mixed here with fields of type", - _1: /* End_of_format */ 0 - }, - _1: "but is mixed here with fields of type" - }); - })); - case /* Pattern_type_clash */ 3 : - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This pattern matches values of type", - _1: /* End_of_format */ 0 - }, - _1: "This pattern matches values of type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but a pattern was expected which matches values of type", - _1: /* End_of_format */ 0 - }, - _1: "but a pattern was expected which matches values of type" - }); - })); - case /* Or_pattern_type_clash */ 4 : - const id = param$1._0; - return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " on the left-hand side of this or-pattern has type", - _1: /* End_of_format */ 0 - } - } - }, - _1: "The variable %s on the left-hand side of this or-pattern has type" - }), id.name); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but on the right-hand side it has type", - _1: /* End_of_format */ 0 - }, - _1: "but on the right-hand side it has type" - }); - })); - case /* Multiply_bound_variable */ 5 : - return Curry._1(Stdlib__Format.fprintf(param)({ + } + }, + _1: "The record field %a@ belongs to the type" + }), longident, lid); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is bound several times in this matching", - _1: /* End_of_format */ 0 - } - } + _0: "but is mixed here with fields of type", + _1: /* End_of_format */ 0 }, - _1: "Variable %s is bound several times in this matching" - }), param$1._0); - case /* Orpat_vars */ 6 : - return Curry._1(Stdlib__Format.fprintf(param)({ + _1: "but is mixed here with fields of type" + }); + })); + case /* Pattern_type_clash */ 3 : + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " must occur on both sides of this | pattern", - _1: /* End_of_format */ 0 - } - } + _0: "This pattern matches values of type", + _1: /* End_of_format */ 0 }, - _1: "Variable %s must occur on both sides of this | pattern" - }), param$1._0.name); - case /* Expr_type_clash */ 7 : - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This expression has type", - _1: /* End_of_format */ 0 - }, - _1: "This expression has type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but an expression was expected of type", - _1: /* End_of_format */ 0 - }, - _1: "but an expression was expected of type" - }); - })); - case /* Apply_non_function */ 8 : - const typ = param$1._0; - reset(undefined); - mark_loops(typ); - const match = repr(typ).desc; - if (!/* tag */ (typeof match === "number" || typeof match === "string") && match.TAG === /* Tarrow */ 1) { - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, + _1: "This pattern matches values of type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but a pattern was expected which matches values of type", + _1: /* End_of_format */ 0 + }, + _1: "but a pattern was expected which matches values of type" + }); + })); + case /* Or_pattern_type_clash */ 4 : + const id = param$1._0; + return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "The variable ", _1: { - TAG: /* String_literal */ 11, - _0: "This function has type", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } + TAG: /* String_literal */ 11, + _0: " on the left-hand side of this or-pattern has type", + _1: /* End_of_format */ 0 } } - } - }, - _1: "@[@[<2>This function has type@ %a@]" - }), type_expr$1, typ); - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "It is applied to too many arguments;", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "@ @[It is applied to too many arguments;@ %s@]@]" - }), "maybe you forgot a `;'."); - } - return Curry._3(Stdlib__Format.fprintf(param)({ + _1: "The variable %s on the left-hand side of this or-pattern has type" + }), id.name); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but on the right-hand side it has type", + _1: /* End_of_format */ 0 + }, + _1: "but on the right-hand side it has type" + }); + })); + case /* Multiply_bound_variable */ 5 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " is bound several times in this matching", + _1: /* End_of_format */ 0 + } + } + }, + _1: "Variable %s is bound several times in this matching" + }), param$1._0); + case /* Orpat_vars */ 6 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " must occur on both sides of this | pattern", + _1: /* End_of_format */ 0 + } + } + }, + _1: "Variable %s must occur on both sides of this | pattern" + }), param$1._0.name); + case /* Expr_type_clash */ 7 : + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This expression has type", + _1: /* End_of_format */ 0 + }, + _1: "This expression has type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but an expression was expected of type", + _1: /* End_of_format */ 0 + }, + _1: "but an expression was expected of type" + }); + })); + case /* Apply_non_function */ 8 : + const typ = param$1._0; + reset(undefined); + mark_loops(typ); + const match = repr(typ).desc; + if (!/* tag */ (typeof match === "number" || typeof match === "string") && match.TAG === /* Tarrow */ 1) { + Curry._2(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -71294,7 +71188,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "This expression has type", + _0: "This function has type", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -71308,78 +71202,24 @@ register_error_of_exn(function (err) { _0: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + _1: /* End_of_format */ 0 } } } } } }, - _1: "@[@[<2>This expression has type@ %a@]@ %s@]" - }), type_expr$1, typ, "This is not a function; it cannot be applied."); - case /* Apply_wrong_label */ 9 : - const ty = param$1._1; - const print_label = function (ppf, l) { - if (l === "") { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "without label", - _1: /* End_of_format */ 0 - }, - _1: "without label" - }); - } else { - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "with label ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "with label %s" - }), prefixed_label_name(l)); - } - }; - reset(undefined); - mark_loops(ty); - return Curry._4(Stdlib__Format.fprintf(param)({ + _1: "@[@[<2>This function has type@ %a@]" + }), type_expr$1, typ); + return Curry._1(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { TAG: /* Formatting_gen */ 18, @@ -71387,17 +71227,13 @@ register_error_of_exn(function (err) { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" + _0: /* End_of_format */ 0, + _1: "" } }, _1: { TAG: /* String_literal */ 11, - _0: "The function applied to this argument has type", + _0: "It is applied to too many arguments;", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -71407,25 +71243,15 @@ register_error_of_exn(function (err) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: { - TAG: /* String_literal */ 11, - _0: "This argument cannot be applied ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -71433,54 +71259,26 @@ register_error_of_exn(function (err) { } } }, - _1: "@[@[<2>The function applied to this argument has type@ %a@]@.This argument cannot be applied %a@]" - }), type_expr$1, ty, print_label, param$1._0); - case /* Label_multiply_defined */ 10 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "@ @[It is applied to too many arguments;@ %s@]@]" + }), "maybe you forgot a `;'."); + } + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String_literal */ 11, - _0: "The record field label ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { TAG: /* String_literal */ 11, - _0: " is defined several times", + _0: "", _1: /* End_of_format */ 0 - } + }, + _1: "" } }, - _1: "The record field label %s is defined several times" - }), param$1._0); - case /* Label_missing */ 11 : - const print_labels = function (ppf) { - return function (param) { - return Stdlib__List.iter((function (lbl) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "@ %s" - }), lbl.name); - }), param); - }; - }; - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -71488,105 +71286,144 @@ register_error_of_exn(function (err) { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "", + _0: "<2>", _1: /* End_of_format */ 0 }, - _1: "" + _1: "<2>" } }, _1: { TAG: /* String_literal */ 11, - _0: "Some record fields are undefined:", + _0: "This expression has type", _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } } - }, - _1: "@[Some record fields are undefined:%a@]" - }), print_labels, param$1._0); - case /* Label_not_mutable */ 12 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[<2>This expression has type@ %a@]@ %s@]" + }), type_expr$1, typ, "This is not a function; it cannot be applied."); + case /* Apply_wrong_label */ 9 : + const ty = param$1._1; + const print_label = function (ppf, l) { + if (l === "") { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "without label", + _1: /* End_of_format */ 0 + }, + _1: "without label" + }); + } else { + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "with label ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "with label %s" + }), prefixed_label_name(l)); + } + }; + reset(undefined); + mark_loops(ty); + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String_literal */ 11, - _0: "The record field ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: " is not mutable", + _0: "", _1: /* End_of_format */ 0 - } + }, + _1: "" } }, - _1: "The record field %a is not mutable" - }), longident, param$1._0); - case /* Wrong_name */ 13 : - const lid$1 = param$1._4; - const p = param$1._3; - const kind = param$1._2; - const ty$1 = param$1._1; - reset(undefined); - mark_loops(ty$1); - Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + TAG: /* String_literal */ 11, + _0: "The function applied to this argument has type", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* String_literal */ 11, - _0: " type", - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + _0: /* Close_box */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, + _1: { + TAG: /* String_literal */ 11, + _0: "This argument cannot be applied ", _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } @@ -71594,30 +71431,161 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[@[<2>%s type@ %a@]@ " - }), param$1._0, type_expr$1, ty$1); - Curry._5(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[<2>The function applied to this argument has type@ %a@]@.This argument cannot be applied %a@]" + }), type_expr$1, ty, print_label, param$1._0); + case /* Label_multiply_defined */ 10 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The record field label ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " is defined several times", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The record field label %s is defined several times" + }), param$1._0); + case /* Label_missing */ 11 : + const print_labels = function (ppf) { + return function (param) { + return Stdlib__List.iter((function (lbl) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "@ %s" + }), lbl.name); + }), param); + }; + }; + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "The ", + _0: "Some record fields are undefined:", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "@[Some record fields are undefined:%a@]" + }), print_labels, param$1._0); + case /* Label_not_mutable */ 12 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The record field ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " is not mutable", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The record field %a is not mutable" + }), longident, param$1._0); + case /* Wrong_name */ 13 : + const lid$1 = param$1._4; + const p = param$1._3; + const kind = param$1._2; + const ty$1 = param$1._1; + reset(undefined); + mark_loops(ty$1); + Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String_literal */ 11, + _0: " type", _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* String_literal */ 11, - _0: " does not belong to type ", - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: /* End_of_format */ 0 } } @@ -71625,238 +71593,187 @@ register_error_of_exn(function (err) { } } } - }, - _1: "The %s %a does not belong to type %a@]" - }), kind === "record" ? "field" : "constructor", longident, lid$1, path, p); - if (kind === "record") { - return spellcheck_simple(param, fold_labels, (function (d) { - if (compare_type_path(env, p, get_type_path$1(env, d))) { - return d.lbl_name; - } else { - return ""; - } - }))(env, lid$1); - } else { - return spellcheck_simple(param, fold_constructors, (function (d) { - if (compare_type_path(env, p, get_type_path$2(env, d))) { - return d.cstr_name; - } else { - return ""; } - }))(env, lid$1); - } - case /* Name_type_mismatch */ 14 : - const lid$2 = param$1._1; - const kind$1 = param$1._0; - const name = kind$1 === "record" ? "field" : "constructor"; - let param$3 = param$1._2; - let tpl = param$1._3; - const txt1 = function (ppf) { - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The ", + }, + _1: "@[@[<2>%s type@ %a@]@ " + }), param$1._0, type_expr$1, ty$1); + Curry._5(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " does not belong to type ", _1: { TAG: /* Alpha */ 15, _0: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + }, + _1: "The %s %a does not belong to type %a@]" + }), kind === "record" ? "field" : "constructor", longident, lid$1, path, p); + if (kind === "record") { + return spellcheck_simple(param, fold_labels, (function (d) { + if (compare_type_path(env, p, get_type_path$1(env, d))) { + return d.lbl_name; + } else { + return ""; + } + }))(env, lid$1); + } else { + return spellcheck_simple(param, fold_constructors, (function (d) { + if (compare_type_path(env, p, get_type_path$2(env, d))) { + return d.cstr_name; + } else { + return ""; + } + }))(env, lid$1); + } + case /* Name_type_mismatch */ 14 : + const lid$2 = param$1._1; + const kind$1 = param$1._0; + const name = kind$1 === "record" ? "field" : "constructor"; + let param$3 = param$1._2; + let tpl = param$1._3; + const txt1 = function (ppf) { + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "belongs to the ", _1: { - TAG: /* String_literal */ 11, - _0: "belongs to the ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " type", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " type", + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "The %s %a@ belongs to the %s type" - }), name, longident, lid$2, kind$1); - }; - const txt2 = function (ppf) { - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The ", + } + }, + _1: "The %s %a@ belongs to the %s type" + }), name, longident, lid$2, kind$1); + }; + const txt2 = function (ppf) { + Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "belongs to one of the following ", _1: { - TAG: /* String_literal */ 11, - _0: "belongs to one of the following ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " types:", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " types:", + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "The %s %a@ belongs to one of the following %s types:" - }), name, longident, lid$2, kind$1); - }; - const txt3 = function (ppf) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but a ", + } + }, + _1: "The %s %a@ belongs to one of the following %s types:" + }), name, longident, lid$2, kind$1); + }; + const txt3 = function (ppf) { + Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but a ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " was expected belonging to the ", _1: { - TAG: /* String_literal */ 11, - _0: " was expected belonging to the ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " type", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " type", + _1: /* End_of_format */ 0 } } } - }, - _1: "but a %s was expected belonging to the %s type" - }), name, kind$1); - }; - const tp0$p = param$3[1]; - const tp0 = param$3[0]; - return wrap_printing_env(env, (function (param$4) { - reset(undefined); - Stdlib__List.iter((function (param) { - path_same_name(tp0, param[0]); - path_same_name(tp0$p, param[1]); - }), tpl); - if (tpl) { - if (tpl.tl) { - return Curry._6(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - } - } - } - }, - _1: "@[%t@;<1 2>@[%a@]@ %t@;<1 2>%a@]" - }), txt2, type_path_list, tpl, txt3, (function (param, param$1) { - return type_path_expansion(tp0, param, param$1); - }), tp0$p); - } - const match = tpl.hd; - const tp = match[0]; + } + }, + _1: "but a %s was expected belonging to the %s type" + }), name, kind$1); + }; + const tp0$p = param$3[1]; + const tp0 = param$3[0]; + return wrap_printing_env(env, (function (param$4) { + reset(undefined); + Stdlib__List.iter((function (param) { + path_same_name(tp0, param[0]); + path_same_name(tp0$p, param[1]); + }), tpl); + if (tpl) { + if (tpl.tl) { return Curry._6(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { @@ -71880,31 +71797,50 @@ register_error_of_exn(function (err) { _2: 2 }, _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_lit */ 17, + TAG: /* Open_box */ 1, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Theta */ 16, + TAG: /* Format */ 0, _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@;<1 2>", + _0: "@ ", _1: 1, - _2: 2 + _2: 0 }, _1: { - TAG: /* Alpha */ 15, + TAG: /* Theta */ 16, _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } } @@ -71914,608 +71850,511 @@ register_error_of_exn(function (err) { } } }, - _1: "@[%t@;<1 2>%a@ %t@;<1 2>%a@]" - }), txt1, (function (param, param$1) { - return type_path_expansion(tp, param, param$1); - }), match[1], txt3, (function (param, param$1) { + _1: "@[%t@;<1 2>@[%a@]@ %t@;<1 2>%a@]" + }), txt2, type_path_list, tpl, txt3, (function (param, param$1) { return type_path_expansion(tp0, param, param$1); }), tp0$p); } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 37069, - 12 - ] - }); - })); - case /* Invalid_format */ 15 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%s" - }), param$1._0); - case /* Undefined_method */ 16 : - const ty$2 = param$1._0; - reset(undefined); - mark_loops(ty$2); - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { + const match = tpl.hd; + const tp = match[0]; + return Curry._6(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This expression has type", - _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, _1: { - TAG: /* Alpha */ 15, + TAG: /* Theta */ 16, _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "It has no method ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Theta */ 16, + _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } } } } } - } - } + }, + _1: "@[%t@;<1 2>%a@ %t@;<1 2>%a@]" + }), txt1, (function (param, param$1) { + return type_path_expansion(tp, param, param$1); + }), match[1], txt3, (function (param, param$1) { + return type_path_expansion(tp0, param, param$1); + }), tp0$p); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 37069, + 12 + ] + }); + })); + case /* Invalid_format */ 15 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%s" + }), param$1._0); + case /* Undefined_method */ 16 : + const ty$2 = param$1._0; + reset(undefined); + mark_loops(ty$2); + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, - _1: "@[@[This expression has type@;<1 2>%a@]@,It has no method %s@]" - }), type_expr$1, ty$2, param$1._1); - case /* Undefined_inherited_method */ 17 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This expression has no method ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "This expression has no method %s" - }), param$1._0); - case /* Virtual_class */ 18 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Cannot instantiate the virtual class ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Cannot instantiate the virtual class %a" - }), longident, param$1._0); - case /* Private_type */ 19 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Cannot create values of the private type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "Cannot create values of the private type %a" - }), type_expr$1, param$1._0); - case /* Private_label */ 20 : - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Cannot assign field ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: " of the private type ", - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - } - } - }, - _1: "Cannot assign field %a of the private type %a" - }), longident, param$1._0, type_expr$1, param$1._1); - case /* Unbound_instance_variable */ 21 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unbound instance variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "Unbound instance variable %s" - }), param$1._0); - case /* Instance_variable_not_mutable */ 22 : - const v = param$1._1; - if (param$1._0) { - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String_literal */ 11, - _0: "The instance variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is not mutable", - _1: /* End_of_format */ 0 - } + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "The instance variable %s is not mutable" - }), v); - } else { - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "The value ", + _0: "This expression has type", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is not an instance variable", - _1: /* End_of_format */ 0 - } - } - }, - _1: "The value %s is not an instance variable" - }), v); - } - case /* Not_subtype */ 23 : - let tr1 = param$1._0; - let txt1$1 = "is not a subtype of"; - let tr2 = param$1._1; - return wrap_printing_env(env, (function (param$4) { - reset(undefined); - const tr1$1 = Stdlib__List.map(prepare_expansion, tr1); - const tr2$1 = Stdlib__List.map(prepare_expansion, tr2); - const partial_arg = Caml_obj.caml_equal(tr2$1, /* [] */ 0); - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - }, - _1: "@[%a" - }), (function (param, param$1) { - return trace$1(true, partial_arg, txt1$1, param, param$1); - }), tr1$1); - if (Caml_obj.caml_equal(tr2$1, /* [] */ 0)) { - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - }, - _1: "@]" - }); - } - const mis = mismatch(true, tr2$1); - const partial_arg$1 = mis === undefined; - Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Theta */ 16, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - }, - _1: "%a%t@]" - }), (function (param, param$1) { - return trace$1(false, partial_arg$1, "is not compatible with type", param, param$1); - }), tr2$1, (function (param) { - return explanation(true, mis, param); - })); - })); - case /* Value_multiply_overridden */ 24 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The instance variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " is overridden several times", - _1: /* End_of_format */ 0 - } - } - }, - _1: "The instance variable %s is overridden several times" - }), param$1._0); - case /* Coercion_failure */ 25 : - const ty$p = param$1._1; - const ty$3 = param$1._0; - report_unification_error(param, env, undefined, param$1._2, (function (ppf) { - const match = prepare_expansion([ - ty$3, - ty$p - ]); - const ty$4 = match[0]; - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, _0: { - TAG: /* String_literal */ 11, - _0: "This expression cannot be coerced to type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ';' */59, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "it has type", - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 }, - _1: "This expression cannot be coerced to type@;<1 2>%a;@ it has type" - }), (function (param, param$1) { - return type_expansion(ty$4, param, param$1); - }), match[1]); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is here used with type", - _1: /* End_of_format */ 0 - }, - _1: "but is here used with type" - }); - })); - if (param$1._3) { - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", - _1: 1, + _0: "@,", + _1: 0, _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "It has no method ", _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } } } - }, - _1: ".@.@[%s@ %s@]" - }), "This simple coercion was not fully general.", "Consider using a double coercion."); - } else { - return; - } - case /* Too_many_arguments */ 26 : - const ty$4 = param$1._1; - reset(undefined); - mark_loops(ty$4); - if (param$1._0) { - Stdlib__Format.fprintf(param)({ + } + } + }, + _1: "@[@[This expression has type@;<1 2>%a@]@,It has no method %s@]" + }), type_expr$1, ty$2, param$1._1); + case /* Undefined_inherited_method */ 17 : + return Curry._1(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "This function expects too many arguments,", + _0: "This expression has no method ", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: /* End_of_format */ 0 } }, - _1: "This function expects too many arguments,@ " - }); - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "This expression has no method %s" + }), param$1._0); + case /* Virtual_class */ 18 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Cannot instantiate the virtual class ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Cannot instantiate the virtual class %a" + }), longident, param$1._0); + case /* Private_type */ 19 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Cannot create values of the private type ", + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + }, + _1: "Cannot create values of the private type %a" + }), type_expr$1, param$1._0); + case /* Private_label */ 20 : + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Cannot assign field ", + _1: { + TAG: /* Alpha */ 15, _0: { TAG: /* String_literal */ 11, - _0: "it should have type", + _0: " of the private type ", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, - _1: "it should have type@ %a" - }), type_expr$1, ty$4); - } else { - Stdlib__Format.fprintf(param)({ + } + } + }, + _1: "Cannot assign field %a of the private type %a" + }), longident, param$1._0, type_expr$1, param$1._1); + case /* Unbound_instance_variable */ 21 : + return Curry._1(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "This expression should not be a function,", + _0: "Unbound instance variable ", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: /* End_of_format */ 0 } }, - _1: "This expression should not be a function,@ " - }); - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "the expected type is", + _1: "Unbound instance variable %s" + }), param$1._0); + case /* Instance_variable_not_mutable */ 22 : + const v = param$1._1; + if (param$1._0) { + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The instance variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* String_literal */ 11, + _0: " is not mutable", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The instance variable %s is not mutable" + }), v); + } else { + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The value ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " is not an instance variable", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The value %s is not an instance variable" + }), v); + } + case /* Not_subtype */ 23 : + let tr1 = param$1._0; + let txt1$1 = "is not a subtype of"; + let tr2 = param$1._1; + return wrap_printing_env(env, (function (param$4) { + reset(undefined); + const tr1$1 = Stdlib__List.map(prepare_expansion, tr1); + const tr2$1 = Stdlib__List.map(prepare_expansion, tr2); + const partial_arg = Caml_obj.caml_equal(tr2$1, /* [] */ 0); + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } }, _1: { TAG: /* Alpha */ 15, _0: /* End_of_format */ 0 } - } - }, - _1: "the expected type is@ %a" - }), type_expr$1, ty$4); - } - case /* Abstract_wrong_label */ 27 : - const ty$5 = param$1._1; - const label_mark = function (l) { - if (l === "") { - return "but its first argument is not labelled"; - } else { - return Curry._1(Stdlib__Format.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but its first argument is labelled ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } }, - _1: "but its first argument is labelled %s" - }), prefixed_label_name(l)); - } - }; - reset(undefined); - mark_loops(ty$5); - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, + _1: "@[%a" + }), (function (param, param$1) { + return trace$1(true, partial_arg, txt1$1, param, param$1); + }), tr1$1); + if (Caml_obj.caml_equal(tr2$1, /* [] */ 0)) { + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 }, - _1: { - TAG: /* Formatting_gen */ 18, + _1: "@]" + }); + } + const mis = mismatch(true, tr2$1); + const partial_arg$1 = mis === undefined; + Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, + TAG: /* Alpha */ 15, _0: { - TAG: /* Format */ 0, + TAG: /* Theta */ 16, _0: { - TAG: /* String_literal */ 11, - _0: "<2>", + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: /* End_of_format */ 0 - }, - _1: "<2>" + } } }, - _1: { + _1: "%a%t@]" + }), (function (param, param$1) { + return trace$1(false, partial_arg$1, "is not compatible with type", param, param$1); + }), tr2$1, (function (param) { + return explanation(true, mis, param); + })); + })); + case /* Value_multiply_overridden */ 24 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The instance variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " is overridden several times", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The instance variable %s is overridden several times" + }), param$1._0); + case /* Coercion_failure */ 25 : + const ty$p = param$1._1; + const ty$3 = param$1._0; + report_unification_error(param, env, undefined, param$1._2, (function (ppf) { + const match = prepare_expansion([ + ty$3, + ty$p + ]); + const ty$4 = match[0]; + Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { TAG: /* String_literal */ 11, - _0: "This function should have type", + _0: "This expression cannot be coerced to type", _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", + _0: "@;<1 2>", _1: 1, - _2: 0 + _2: 2 }, _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Char_literal */ 12, + _0: /* ';' */59, _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@,", - _1: 0, + _0: "@ ", + _1: 1, _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "it has type", + _1: /* End_of_format */ 0 } } } } } + }, + _1: "This expression cannot be coerced to type@;<1 2>%a;@ it has type" + }), (function (param, param$1) { + return type_expansion(ty$4, param, param$1); + }), match[1]); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but is here used with type", + _1: /* End_of_format */ 0 + }, + _1: "but is here used with type" + }); + })); + if (param$1._3) { + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } }, - _1: "@[@[<2>This function should have type@ %a@]@,%s@]" - }), type_expr$1, ty$5, label_mark(param$1._0)); - case /* Scoping_let_module */ 28 : - const ty$6 = param$1._1; - reset(undefined); - mark_loops(ty$6); - Curry._2(Stdlib__Format.fprintf(param)({ + _1: ".@.@[%s@ %s@]" + }), "This simple coercion was not fully general.", "Consider using a double coercion."); + } else { + return; + } + case /* Too_many_arguments */ 26 : + const ty$4 = param$1._1; + reset(undefined); + mark_loops(ty$4); + if (param$1._0) { + Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This function expects too many arguments,", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: /* End_of_format */ 0 + } + }, + _1: "This function expects too many arguments,@ " + }); + return Curry._2(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "This `let module' expression has type", + _0: "it should have type", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -72526,47 +72365,110 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 - } + _0: /* End_of_format */ 0 } } }, - _1: "This `let module' expression has type@ %a@ " - }), type_expr$1, ty$6); - return Curry._1(Stdlib__Format.fprintf(param)({ + _1: "it should have type@ %a" + }), type_expr$1, ty$4); + } else { + Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This expression should not be a function,", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: /* End_of_format */ 0 + } + }, + _1: "This expression should not be a function,@ " + }); + return Curry._2(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "In this type, the locally bound module name ", + _0: "the expected type is", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* String_literal */ 11, - _0: " escapes its scope", - _1: /* End_of_format */ 0 + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } } }, - _1: "In this type, the locally bound module name %s escapes its scope" - }), param$1._0); - case /* Masked_instance_variable */ 29 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "the expected type is@ %a" + }), type_expr$1, ty$4); + } + case /* Abstract_wrong_label */ 27 : + const ty$5 = param$1._1; + const label_mark = function (l) { + if (l === "") { + return "but its first argument is not labelled"; + } else { + return Curry._1(Stdlib__Format.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but its first argument is labelled ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "but its first argument is labelled %s" + }), prefixed_label_name(l)); + } + }; + reset(undefined); + mark_loops(ty$5); + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String_literal */ 11, - _0: "The instance variable ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 + }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "This function should have type", + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -72575,21 +72477,53 @@ register_error_of_exn(function (err) { _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "cannot be accessed from the definition of another instance variable", - _1: /* End_of_format */ 0 + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@,", + _1: 0, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } } - }, - _1: "The instance variable %a@ cannot be accessed from the definition of another instance variable" - }), longident, param$1._0); - case /* Not_a_variant_type */ 30 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The type ", + } + }, + _1: "@[@[<2>This function should have type@ %a@]@,%s@]" + }), type_expr$1, ty$5, label_mark(param$1._0)); + case /* Scoping_let_module */ 28 : + const ty$6 = param$1._1; + reset(undefined); + mark_loops(ty$6); + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This `let module' expression has type", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* Alpha */ 15, _0: { @@ -72600,54 +72534,39 @@ register_error_of_exn(function (err) { _1: 1, _2: 0 }, - _1: { - TAG: /* String_literal */ 11, - _0: "is not a variant type", - _1: /* End_of_format */ 0 - } + _1: /* End_of_format */ 0 } } - }, - _1: "The type %a@ is not a variant type" - }), longident, param$1._0); - case /* Less_general */ 31 : - const kind$2 = param$1._0; - return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " has type", - _1: /* End_of_format */ 0 - } - } - }, - _1: "This %s has type" - }), kind$2); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + } + }, + _1: "This `let module' expression has type@ %a@ " + }), type_expr$1, ty$6); + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "In this type, the locally bound module name ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* String_literal */ 11, - _0: "which is less general than", + _0: " escapes its scope", _1: /* End_of_format */ 0 - }, - _1: "which is less general than" - }); - })); - case /* Not_a_packed_module */ 32 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This expression is packed module, but the expected type is", - _1: { + } + } + }, + _1: "In this type, the locally bound module name %s escapes its scope" + }), param$1._0); + case /* Masked_instance_variable */ 29 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The instance variable ", + _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -72656,78 +72575,158 @@ register_error_of_exn(function (err) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + TAG: /* String_literal */ 11, + _0: "cannot be accessed from the definition of another instance variable", + _1: /* End_of_format */ 0 } } - }, - _1: "This expression is packed module, but the expected type is@ %a" - }), type_expr$1, param$1._0); - case /* Recursive_local_constraint */ 33 : - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "The instance variable %a@ cannot be accessed from the definition of another instance variable" + }), longident, param$1._0); + case /* Not_a_variant_type */ 30 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type ", + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: "Recursive local constraint when unifying", - _1: /* End_of_format */ 0 - }, - _1: "Recursive local constraint when unifying" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not a variant type", + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "The type %a@ is not a variant type" + }), longident, param$1._0); + case /* Less_general */ 31 : + const kind$2 = param$1._0; + return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " has type", + _1: /* End_of_format */ 0 + } + } + }, + _1: "This %s has type" + }), kind$2); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "which is less general than", + _1: /* End_of_format */ 0 + }, + _1: "which is less general than" + }); + })); + case /* Not_a_packed_module */ 32 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This expression is packed module, but the expected type is", + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* String_literal */ 11, - _0: "with", - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, - _1: "with" - }); - })); - case /* Unqualified_gadt_pattern */ 34 : - return Curry._4(Stdlib__Format.fprintf(param)({ + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + }, + _1: "This expression is packed module, but the expected type is@ %a" + }), type_expr$1, param$1._0); + case /* Recursive_local_constraint */ 33 : + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* String_literal */ 11, + _0: "Recursive local constraint when unifying", + _1: /* End_of_format */ 0 + }, + _1: "Recursive local constraint when unifying" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "with", + _1: /* End_of_format */ 0 + }, + _1: "with" + }); + })); + case /* Unqualified_gadt_pattern */ 34 : + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The GADT constructor ", _1: { - TAG: /* String_literal */ 11, - _0: "The GADT constructor ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " of type ", _1: { - TAG: /* String_literal */ 11, - _0: " of type ", - _1: { - TAG: /* Alpha */ 15, + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* '.' */46, _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -72735,9 +72734,10 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The GADT constructor %s of type %a@ %s.@]" - }), param$1._1, path, param$1._0, "must be qualified in this pattern"); + } + }, + _1: "@[The GADT constructor %s of type %a@ %s.@]" + }), param$1._1, path, param$1._0, "must be qualified in this pattern"); } } @@ -72791,22 +72791,22 @@ function is_fixed_type(sd) { } switch (match.TAG) { case /* Ptyp_object */ 4 : - if (match._1 === /* Closed */ 0) { - return false; - } else { - return true; - } - case /* Ptyp_class */ 5 : + if (match._1 === /* Closed */ 0) { + return false; + } else { return true; + } + case /* Ptyp_class */ 5 : + return true; case /* Ptyp_alias */ 6 : - _sty = match._0; - continue; + _sty = match._0; + continue; case /* Ptyp_variant */ 7 : - if (match._1 === /* Closed */ 0) { - return match._2 !== undefined; - } else { - return true; - } + if (match._1 === /* Closed */ 0) { + return match._2 !== undefined; + } else { + return true; + } default: return false; } @@ -72845,23 +72845,23 @@ function set_fixed_row(env, loc, p, decl) { } switch (row.TAG) { case /* Tobject */ 4 : - rv = flatten_fields(row._0)[1]; - break; + rv = flatten_fields(row._0)[1]; + break; case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - tm.desc = { - TAG: /* Tvariant */ 8, - _0: { - row_fields: row$1.row_fields, - row_more: row$1.row_more, - row_bound: row$1.row_bound, - row_closed: row$1.row_closed, - row_fixed: true, - row_name: row$1.row_name - } - }; - rv = static_row(row$1) ? newty2(100000000, /* Tnil */ 0) : row$1.row_more; - break; + const row$1 = row_repr_aux(/* [] */ 0, row._0); + tm.desc = { + TAG: /* Tvariant */ 8, + _0: { + row_fields: row$1.row_fields, + row_more: row$1.row_more, + row_bound: row$1.row_bound, + row_closed: row$1.row_closed, + row_fixed: true, + row_name: row$1.row_name + } + }; + rv = static_row(row$1) ? newty2(100000000, /* Tnil */ 0) : row$1.row_more; + break; default: throw new Caml_js_exceptions.MelangeError($$Error$8, { MEL_EXN_ID: $$Error$8, @@ -73140,57 +73140,57 @@ function check_constraints_rec(env, loc, visited, _ty) { } switch (match.TAG) { case /* Tconstr */ 3 : - const args = match._1; - const path = match._0; - const args$p = Stdlib__List.map((function (param) { - return newvar(undefined, undefined); - }), args); - const ty$p = newconstr(path, args$p); - try { - enforce_constraints(env, ty$p); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 46574, - 28 - ] - }); - } - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$8, { - MEL_EXN_ID: $$Error$8, - _1: loc, - _2: { - TAG: /* Unavailable_type_constructor */ 17, - _0: path - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const args = match._1; + const path = match._0; + const args$p = Stdlib__List.map((function (param) { + return newvar(undefined, undefined); + }), args); + const ty$p = newconstr(path, args$p); + try { + enforce_constraints(env, ty$p); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 46574, + 28 + ] + }); } - if (!matches(env, ty$1, ty$p)) { + if (exn.MEL_EXN_ID === Stdlib.Not_found) { throw new Caml_js_exceptions.MelangeError($$Error$8, { MEL_EXN_ID: $$Error$8, _1: loc, _2: { - TAG: /* Constraint_failed */ 5, - _0: ty$1, - _1: ty$p + TAG: /* Unavailable_type_constructor */ 17, + _0: path } }); } - return Stdlib__List.iter((function (param) { - return check_constraints_rec(env, loc, visited, param); - }), args); + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + if (!matches(env, ty$1, ty$p)) { + throw new Caml_js_exceptions.MelangeError($$Error$8, { + MEL_EXN_ID: $$Error$8, + _1: loc, + _2: { + TAG: /* Constraint_failed */ 5, + _0: ty$1, + _1: ty$p + } + }); + } + return Stdlib__List.iter((function (param) { + return check_constraints_rec(env, loc, visited, param); + }), args); case /* Tpoly */ 10 : - const match$1 = instance_poly(undefined, false, match._1, match._0); - _ty = match$1[1]; - continue; + const match$1 = instance_poly(undefined, false, match._1, match._0); + _ty = match$1[1]; + continue; default: return iter_type_expr((function (param) { return check_constraints_rec(env, loc, visited, param); @@ -73513,8 +73513,8 @@ function check_well_founded(env, loc, path, to_check, ty) { switch (match$3.TAG) { case /* Tobject */ 4 : case /* Tvariant */ 8 : - tmp$2 = true; - break; + tmp$2 = true; + break; default: tmp$2 = false; } @@ -73589,67 +73589,67 @@ function check_recursion(env, loc, path, decl, to_check) { } switch (match.TAG) { case /* Tconstr */ 3 : - const args$p = match._1; - const path$p = match._0; - if (same(path, path$p)) { - if (!equal$5(env, false, args, args$p)) { - throw new Caml_js_exceptions.MelangeError($$Error$8, { - MEL_EXN_ID: $$Error$8, - _1: loc, - _2: { - TAG: /* Parameters_differ */ 8, - _0: cpath, - _1: ty$1, - _2: newconstr(path, args) - } - }); - } - - } else if (Curry._1(to_check, path$p) && !Stdlib__List.mem(path$p, prev_exp)) { + const args$p = match._1; + const path$p = match._0; + if (same(path, path$p)) { + if (!equal$5(env, false, args, args$p)) { + throw new Caml_js_exceptions.MelangeError($$Error$8, { + MEL_EXN_ID: $$Error$8, + _1: loc, + _2: { + TAG: /* Parameters_differ */ 8, + _0: cpath, + _1: ty$1, + _2: newconstr(path, args) + } + }); + } + + } else if (Curry._1(to_check, path$p) && !Stdlib__List.mem(path$p, prev_exp)) { + try { + const match$1 = find_type_expansion(path$p, env); + const params0 = match$1[0]; + const match$2 = instance_parameterized_type(undefined, params0, match$1[1]); try { - const match$1 = find_type_expansion(path$p, env); - const params0 = match$1[0]; - const match$2 = instance_parameterized_type(undefined, params0, match$1[1]); - try { - Stdlib__List.iter2((function (param, param$1) { - return unify$2(env, param, param$1); - }), match$2[0], args$p); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$8, { - MEL_EXN_ID: $$Error$8, - _1: loc, - _2: { - TAG: /* Constraint_failed */ 5, - _0: ty$1, - _1: newconstr(path$p, params0) - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - check_regular(path$p, args, { - hd: path$p, - tl: prev_exp - }, match$2[1]); + Stdlib__List.iter2((function (param, param$1) { + return unify$2(env, param, param$1); + }), match$2[0], args$p); } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID !== Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$8, { + MEL_EXN_ID: $$Error$8, + _1: loc, + _2: { + TAG: /* Constraint_failed */ 5, + _0: ty$1, + _1: newconstr(path$p, params0) + } + }); } - + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + check_regular(path$p, args, { + hd: path$p, + tl: prev_exp + }, match$2[1]); } - return Stdlib__List.iter((function (param) { - return check_regular(cpath, args, prev_exp, param); - }), args$p); + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID !== Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + + } + } + return Stdlib__List.iter((function (param) { + return check_regular(cpath, args, prev_exp, param); + }), args$p); case /* Tpoly */ 10 : - const match$3 = instance_poly(true, false, match._1, match._0); - _ty = match$3[1]; - continue; + const match$3 = instance_poly(true, false, match._1, match._0); + _ty = match$3[1]; + continue; default: return iter_type_expr((function (param) { return check_regular(cpath, args, prev_exp, param); @@ -73697,94 +73697,94 @@ function compute_variance(env, visited, vari, ty) { } switch (tl.TAG) { case /* Tarrow */ 1 : - const v = Curry._1(Types_Variance.conjugate, vari$1); - const v1 = Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v) ? Curry._3(Types_Variance.set, /* May_weak */ 2, true, v) : v; - compute_variance_rec(v1, tl._1); - _ty = tl._2; - _vari = vari$1; - continue; + const v = Curry._1(Types_Variance.conjugate, vari$1); + const v1 = Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v) ? Curry._3(Types_Variance.set, /* May_weak */ 2, true, v) : v; + compute_variance_rec(v1, tl._1); + _ty = tl._2; + _vari = vari$1; + continue; case /* Ttuple */ 2 : - return Stdlib__List.iter(compute_same, tl._0); + return Stdlib__List.iter(compute_same, tl._0); case /* Tconstr */ 3 : - const tl$1 = tl._1; - if (Caml_obj.caml_equal(tl$1, /* [] */ 0)) { - return; - } - try { - const decl = find_type_full(tl._0, env)[0]; - return Stdlib__List.iter2((function (ty, v) { - const strict = Curry._2(Types_Variance.mem, /* Inv */ 6, vari$1) && Curry._2(Types_Variance.mem, /* Inj */ 3, v) || (Curry._2(Types_Variance.mem, /* Pos */ 4, vari$1) || Curry._2(Types_Variance.mem, /* Neg */ 5, vari$1)) && Curry._2(Types_Variance.mem, /* Inv */ 6, v); - if (strict) { - return compute_variance_rec(Types_Variance.full, ty); - } - const p1 = Curry._2(Types_Variance.inter, v, vari$1); - const n1 = Curry._2(Types_Variance.inter, v, Curry._1(Types_Variance.conjugate, vari$1)); - const v1 = Curry._2(Types_Variance.union, Curry._2(Types_Variance.inter, Types_Variance.covariant, Curry._2(Types_Variance.union, p1, Curry._1(Types_Variance.conjugate, p1))), Curry._2(Types_Variance.inter, Curry._1(Types_Variance.conjugate, Types_Variance.covariant), Curry._2(Types_Variance.union, n1, Curry._1(Types_Variance.conjugate, n1)))); - const weak = Curry._2(Types_Variance.mem, /* May_weak */ 2, vari$1) && (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) || (Curry._2(Types_Variance.mem, /* May_pos */ 0, vari$1) || Curry._2(Types_Variance.mem, /* May_neg */ 1, vari$1)) && Curry._2(Types_Variance.mem, /* May_weak */ 2, v); - const v2 = Curry._3(Types_Variance.set, /* May_weak */ 2, weak, v1); - compute_variance_rec(v2, ty); - }), tl$1, decl.type_variance); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return Stdlib__List.iter((function (param) { - return compute_variance_rec(Types_Variance.may_inv, param); - }), tl$1); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const tl$1 = tl._1; + if (Caml_obj.caml_equal(tl$1, /* [] */ 0)) { + return; + } + try { + const decl = find_type_full(tl._0, env)[0]; + return Stdlib__List.iter2((function (ty, v) { + const strict = Curry._2(Types_Variance.mem, /* Inv */ 6, vari$1) && Curry._2(Types_Variance.mem, /* Inj */ 3, v) || (Curry._2(Types_Variance.mem, /* Pos */ 4, vari$1) || Curry._2(Types_Variance.mem, /* Neg */ 5, vari$1)) && Curry._2(Types_Variance.mem, /* Inv */ 6, v); + if (strict) { + return compute_variance_rec(Types_Variance.full, ty); + } + const p1 = Curry._2(Types_Variance.inter, v, vari$1); + const n1 = Curry._2(Types_Variance.inter, v, Curry._1(Types_Variance.conjugate, vari$1)); + const v1 = Curry._2(Types_Variance.union, Curry._2(Types_Variance.inter, Types_Variance.covariant, Curry._2(Types_Variance.union, p1, Curry._1(Types_Variance.conjugate, p1))), Curry._2(Types_Variance.inter, Curry._1(Types_Variance.conjugate, Types_Variance.covariant), Curry._2(Types_Variance.union, n1, Curry._1(Types_Variance.conjugate, n1)))); + const weak = Curry._2(Types_Variance.mem, /* May_weak */ 2, vari$1) && (Curry._2(Types_Variance.mem, /* May_pos */ 0, v) || Curry._2(Types_Variance.mem, /* May_neg */ 1, v)) || (Curry._2(Types_Variance.mem, /* May_pos */ 0, vari$1) || Curry._2(Types_Variance.mem, /* May_neg */ 1, vari$1)) && Curry._2(Types_Variance.mem, /* May_weak */ 2, v); + const v2 = Curry._3(Types_Variance.set, /* May_weak */ 2, weak, v1); + compute_variance_rec(v2, ty); + }), tl$1, decl.type_variance); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return Stdlib__List.iter((function (param) { + return compute_variance_rec(Types_Variance.may_inv, param); + }), tl$1); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case /* Tfield */ 5 : - compute_variance_rec(vari$1, tl._2); - _ty = tl._3; - _vari = vari$1; - continue; + compute_variance_rec(vari$1, tl._2); + _ty = tl._3; + _vari = vari$1; + continue; case /* Tvariant */ 8 : - const row = row_repr_aux(/* [] */ 0, tl._0); - Stdlib__List.iter((function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string") { + const row = row_repr_aux(/* [] */ 0, tl._0); + Stdlib__List.iter((function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + return; + } + if (match.TAG === /* Rpresent */ 0) { + const ty = match._0; + if (ty !== undefined) { + return compute_variance_rec(vari$1, ty); + } else { return; } - if (match.TAG === /* Rpresent */ 0) { - const ty = match._0; - if (ty !== undefined) { - return compute_variance_rec(vari$1, ty); - } else { - return; - } - } - const upper = Stdlib__List.fold_left((function (s, f) { - return Curry._3(Types_Variance.set, f, true, s); - }), Types_Variance.$$null, { - hd: /* May_pos */ 0, + } + const upper = Stdlib__List.fold_left((function (s, f) { + return Curry._3(Types_Variance.set, f, true, s); + }), Types_Variance.$$null, { + hd: /* May_pos */ 0, + tl: { + hd: /* May_neg */ 1, tl: { - hd: /* May_neg */ 1, - tl: { - hd: /* May_weak */ 2, - tl: /* [] */ 0 - } + hd: /* May_weak */ 2, + tl: /* [] */ 0 } - }); - const v = Curry._2(Types_Variance.inter, vari$1, upper); - Stdlib__List.iter((function (param) { - return compute_variance_rec(v, param); - }), match._1); - }), row.row_fields); - _ty = row.row_more; - _vari = vari$1; - continue; + } + }); + const v = Curry._2(Types_Variance.inter, vari$1, upper); + Stdlib__List.iter((function (param) { + return compute_variance_rec(v, param); + }), match._1); + }), row.row_fields); + _ty = row.row_more; + _vari = vari$1; + continue; case /* Tobject */ 4 : case /* Tsubst */ 7 : case /* Tpoly */ 10 : - _ty = tl._0; - _vari = vari$1; - continue; + _ty = tl._0; + _vari = vari$1; + continue; case /* Tpackage */ 11 : - const v$1 = Curry._2(Types_Variance.mem, /* Pos */ 4, vari$1) || Curry._2(Types_Variance.mem, /* Neg */ 5, vari$1) ? Types_Variance.full : Types_Variance.may_inv; - return Stdlib__List.iter((function (param) { - return compute_variance_rec(v$1, param); - }), tl._2); + const v$1 = Curry._2(Types_Variance.mem, /* Pos */ 4, vari$1) || Curry._2(Types_Variance.mem, /* Neg */ 5, vari$1) ? Types_Variance.full : Types_Variance.may_inv; + return Stdlib__List.iter((function (param) { + return compute_variance_rec(v$1, param); + }), tl._2); default: return; } @@ -74245,23 +74245,23 @@ function add_injectivity(param) { return Stdlib__List.map((function (param) { switch (param) { case /* Covariant */ 0 : - return [ - true, - false, - false - ]; + return [ + true, + false, + false + ]; case /* Contravariant */ 1 : - return [ - false, - true, - false - ]; + return [ + false, + true, + false + ]; case /* Invariant */ 2 : - return [ - false, - false, - false - ]; + return [ + false, + false, + false + ]; } }), param); @@ -74873,10 +74873,10 @@ function transl_type_decl(env, rec_flag, sdecl_list) { const to_check = function (id) { switch (id.TAG) { case /* Pident */ 0 : - return Stdlib__List.mem_assoc(id._0, id_loc_list); + return Stdlib__List.mem_assoc(id._0, id_loc_list); case /* Pdot */ 1 : case /* Papply */ 2 : - return false; + return false; } }; @@ -75251,17 +75251,17 @@ function transl_extension_constructor(env, check_open, type_path, type_params, t switch (match$7.TAG) { case /* Cstr_constant */ 0 : case /* Cstr_block */ 1 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 47401, - 17 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 47401, + 17 + ] + }); case /* Cstr_extension */ 2 : - path = match$7._0; - break; + path = match$7._0; + break; } match = [ @@ -75488,35 +75488,35 @@ function customize_arity(arity, pval_attributes) { const match = x[1]; switch (match.TAG) { case /* PStr */ 0 : - const match$1 = match._0; - if (!match$1) { - return; - } - const match$2 = match$1.hd.pstr_desc; - if (match$2.TAG !== /* Pstr_eval */ 0) { - return; - } - const match$3 = match$2._0.pexp_desc; - if (match$3.TAG !== /* Pexp_constant */ 1) { - return; - } - const i = match$3._0; - if (i.TAG !== /* Const_int */ 0) { - return; - } - if (match$1.tl) { - return; - } - const i$1 = i._0; - if (i$1 < cur_arity.contents) { - cur_arity.contents = i$1; - return; - } else { - return; - } + const match$1 = match._0; + if (!match$1) { + return; + } + const match$2 = match$1.hd.pstr_desc; + if (match$2.TAG !== /* Pstr_eval */ 0) { + return; + } + const match$3 = match$2._0.pexp_desc; + if (match$3.TAG !== /* Pexp_constant */ 1) { + return; + } + const i = match$3._0; + if (i.TAG !== /* Const_int */ 0) { + return; + } + if (match$1.tl) { + return; + } + const i$1 = i._0; + if (i$1 < cur_arity.contents) { + cur_arity.contents = i$1; + return; + } else { + return; + } case /* PTyp */ 1 : case /* PPat */ 2 : - return; + return; } }), pval_attributes); @@ -75879,227 +75879,293 @@ function report_error$5(ppf, s) { if (/* tag */ typeof s === "number" || typeof s === "string") { switch (s) { case /* Repeated_parameter */ 0 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A type parameter occurs several times", - _1: /* End_of_format */ 0 - }, - _1: "A type parameter occurs several times" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A type parameter occurs several times", + _1: /* End_of_format */ 0 + }, + _1: "A type parameter occurs several times" + }); case /* Too_many_constructors */ 1 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Too many non-constant constructors", _1: { - TAG: /* String_literal */ 11, - _0: "Too many non-constant constructors", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "-- maximum is ", _1: { - TAG: /* String_literal */ 11, - _0: "-- maximum is ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[Too many non-constant constructors@ -- maximum is %i %s@]" - }), 246, "non-constant constructors"); + } + }, + _1: "@[Too many non-constant constructors@ -- maximum is %i %s@]" + }), 246, "non-constant constructors"); case /* Null_arity_external */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "External identifiers must be functions", - _1: /* End_of_format */ 0 - }, - _1: "External identifiers must be functions" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "External identifiers must be functions", + _1: /* End_of_format */ 0 + }, + _1: "External identifiers must be functions" + }); case /* Missing_native_external */ 3 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "An external function with more than 5 arguments requires a second stub function", _1: { - TAG: /* String_literal */ 11, - _0: "An external function with more than 5 arguments requires a second stub function", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "for native-code compilation", _1: { - TAG: /* String_literal */ 11, - _0: "for native-code compilation", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[An external function with more than 5 arguments requires a second stub function@ for native-code compilation@]" - }); + } + }, + _1: "@[An external function with more than 5 arguments requires a second stub function@ for native-code compilation@]" + }); case /* Varying_anonymous */ 4 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[%s@ %s@ %s@]" - }), "In this GADT definition,", "the variance of some parameter", "cannot be checked"); + } + }, + _1: "@[%s@ %s@ %s@]" + }), "In this GADT definition,", "the variance of some parameter", "cannot be checked"); } } else { switch (s.TAG) { case /* Duplicate_constructor */ 0 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Two constructors are named ", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Two constructors are named ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Two constructors are named %s" + }), s._0); + case /* Duplicate_label */ 1 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Two labels are named ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Two labels are named %s" + }), s._0); + case /* Recursive_abbrev */ 2 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type abbreviation ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is cyclic", _1: /* End_of_format */ 0 } - }, - _1: "Two constructors are named %s" - }), s._0); - case /* Duplicate_label */ 1 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "The type abbreviation %s is cyclic" + }), s._0); + case /* Cycle_in_def */ 3 : + const ty = s._1; + reset(undefined); + mark_loops(ty); + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* String_literal */ 11, - _0: "Two labels are named ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, - _1: "Two labels are named %s" - }), s._0); - case /* Recursive_abbrev */ 2 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "The type abbreviation ", + _0: "The definition of ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: " is cyclic", - _1: /* End_of_format */ 0 + _0: " contains a cycle:", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } } } - }, - _1: "The type abbreviation %s is cyclic" - }), s._0); - case /* Cycle_in_def */ 3 : - const ty = s._1; - reset(undefined); - mark_loops(ty); - return Curry._3(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The definition of %s contains a cycle:@ %a@]" + }), s._0, type_expr$1, ty); + case /* Definition_mismatch */ 4 : + const ty$1 = s._0; + reset(undefined); + mark_loops(ty$1); + return Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -76107,81 +76173,246 @@ function report_error$5(ppf, s) { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "", + _0: "", _1: /* End_of_format */ 0 }, - _1: "" + _1: "" } }, _1: { - TAG: /* String_literal */ 11, - _0: "The definition of ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " contains a cycle:", - _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", + _0: "@;<1 2>", _1: 1, - _2: 0 + _2: 2 }, _1: { TAG: /* Alpha */ 15, _0: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } } } } } - }, - _1: "@[The definition of %s contains a cycle:@ %a@]" - }), s._0, type_expr$1, ty); - case /* Definition_mismatch */ 4 : - const ty$1 = s._0; - reset(undefined); - mark_loops(ty$1); - return Curry._6(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[%s@ %s@;<1 2>%a@]%a@]" + }), "This variant or record definition", "does not match that of type", type_expr$1, ty$1, (function (param) { + return report_type_mismatch("the original", "this", "definition", param); + }), s._1); + case /* Constraint_failed */ 5 : + const ty$p = s._1; + const ty$2 = s._0; + reset(undefined); + mark_loops(ty$2); + mark_loops(ty$p); + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Format */ 0, + TAG: /* Open_box */ 1, _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Type", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "should be an instance of", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } } + } + } + } + }, + _1: "@[%s@ @[Type@ %a@ should be an instance of@ %a@]@]" + }), "Constraints are not satisfied in this type.", type_expr$1, ty$2, type_expr$1, ty$p); + case /* Inconsistent_constraint */ 6 : + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type constraints are not consistent.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, + _1: /* End_of_format */ 0 + } + }, + _1: "The type constraints are not consistent.@." + }); + return report_unification_error(ppf, s._0, undefined, s._1, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Type", + _1: /* End_of_format */ 0 + }, + _1: "Type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "is not compatible with type", + _1: /* End_of_format */ 0 + }, + _1: "is not compatible with type" + }); + })); + case /* Type_clash */ 7 : + return report_unification_error(ppf, s._0, undefined, s._1, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This type constructor expands to type", + _1: /* End_of_format */ 0 + }, + _1: "This type constructor expands to type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but is used here with type", + _1: /* End_of_format */ 0 + }, + _1: "but is used here with type" + }); + })); + case /* Parameters_differ */ 8 : + const ty$p$1 = s._2; + const ty$3 = s._1; + reset(undefined); + mark_loops(ty$3); + mark_loops(ty$p$1); + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "In the definition of ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: ", type", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -76191,21 +76422,26 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@;<1 2>", + _0: "@ ", _1: 1, - _2: 2 + _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String_literal */ 11, + _0: "should be", + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* Alpha */ 15, _0: { @@ -76221,27 +76457,227 @@ function report_error$5(ppf, s) { } } } + } + }, + _1: "@[In the definition of %s, type@ %a@ should be@ %a@]" + }), name(undefined, s._0), type_expr$1, ty$3, type_expr$1, ty$p$1); + case /* Unbound_type_var */ 9 : + const decl = s._1; + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A type variable is unbound in this type declaration", + _1: /* End_of_format */ 0 + }, + _1: "A type variable is unbound in this type declaration" + }); + const ty$4 = repr(s._0); + const match = decl.type_kind; + const match$1 = decl.type_manifest; + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (match === /* Type_abstract */ 0 && match$1 !== undefined) { + const trivial = function (ty$5) { + explain_unbound(ppf, ty$4, { + hd: ty$5, + tl: /* [] */ 0 + }, (function (t) { + return t; + }), "type", (function (param) { + return ""; + })); + }; + const row = repr(match$1).desc; + if (/* tag */ typeof row === "number" || typeof row === "string") { + return trivial(match$1); + } + switch (row.TAG) { + case /* Tobject */ 4 : + const match$2 = flatten_fields(row._0); + if (match$2[1] === ty$4) { + return trivial(match$1); + } else { + return explain_unbound(ppf, ty$4, match$2[0], (function (param) { + return param[2]; + }), "method", (function (param) { + return param[0] + ": "; + })); + } + case /* Tvariant */ 8 : + const row$1 = row_repr_aux(/* [] */ 0, row._0); + if (row$1.row_more === ty$4) { + return trivial(match$1); + } else { + return explain_unbound(ppf, ty$4, row$1.row_fields, (function (param) { + const match = row_field_repr_aux(/* [] */ 0, param[1]); + if (/* tag */ typeof match === "number" || typeof match === "string") { + return newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: /* [] */ 0 + }); + } + if (match.TAG === /* Rpresent */ 0) { + const t = match._0; + if (t !== undefined) { + return t; + } else { + return newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: /* [] */ 0 + }); + } + } + const match$1 = match._1; + if (match$1 && !match$1.tl) { + return match$1.hd; + } else { + return newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: match._1 + }); + } + }), "case", (function (param) { + return "`" + (param[0] + " of "); + })); + } + default: + return trivial(match$1); + } + } else { + return; + } + } else if (match.TAG === /* Type_record */ 0) { + return explain_unbound(ppf, ty$4, match._0, (function (l) { + return l.ld_type; + }), "field", (function (l) { + return l.ld_id.name + ": "; + })); + } else { + return explain_unbound(ppf, ty$4, match._0, (function (c) { + return newty2(100000000, { + TAG: /* Ttuple */ 2, + _0: c.cd_args + }); + }), "case", (function (c) { + return c.cd_id.name + " of "; + })); + } + case /* Not_open_type */ 10 : + return Curry._3(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + }, + _1: "@[%s@ %a@]" + }), "Cannot extend type definition", path, s._0); + case /* Not_extensible_type */ 11 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, - _1: "@[@[%s@ %s@;<1 2>%a@]%a@]" - }), "This variant or record definition", "does not match that of type", type_expr$1, ty$1, (function (param) { - return report_type_mismatch("the original", "this", "definition", param); - }), s._1); - case /* Constraint_failed */ 5 : - const ty$p = s._1; - const ty$2 = s._0; - reset(undefined); - mark_loops(ty$2); - mark_loops(ty$p); - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + }, + _1: "@[%s@ %a@ %s@]" + }), "Type", path, s._0, "is not extensible"); + case /* Extension_mismatch */ 12 : + return Curry._5(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" } }, _1: { @@ -76256,22 +76692,118 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } + } + }, + _1: "@[@[%s@ %s@;<1 2>%s@]%a@]" + }), "This extension", "does not match the definition of type", name(undefined, s._0), (function (param) { + return report_type_mismatch("the type", "this extension", "definition", param); + }), s._1); + case /* Rebind_wrong_type */ 13 : + const lid = s._0; + return report_unification_error(ppf, s._1, undefined, s._2, (function (ppf) { + Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The constructor ", + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "has type", + _1: /* End_of_format */ 0 } + } + } + }, + _1: "The constructor %a@ has type" + }), longident, lid); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but was expected to be of type", + _1: /* End_of_format */ 0 + }, + _1: "but was expected to be of type" + }); + })); + case /* Rebind_mismatch */ 14 : + return Curry._8(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "Type", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -76281,8 +76813,9 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -76291,8 +76824,8 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "should be an instance of", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -76302,14 +76835,24 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } @@ -76322,248 +76865,107 @@ function report_error$5(ppf, s) { } } } - }, - _1: "@[%s@ @[Type@ %a@ should be an instance of@ %a@]@]" - }), "Constraints are not satisfied in this type.", type_expr$1, ty$2, type_expr$1, ty$p); - case /* Inconsistent_constraint */ 6 : - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The type constraints are not consistent.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: /* End_of_format */ 0 - } - }, - _1: "The type constraints are not consistent.@." - }); - return report_unification_error(ppf, s._0, undefined, s._1, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Type", - _1: /* End_of_format */ 0 - }, - _1: "Type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "is not compatible with type", - _1: /* End_of_format */ 0 - }, - _1: "is not compatible with type" - }); - })); - case /* Type_clash */ 7 : - return report_unification_error(ppf, s._0, undefined, s._1, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This type constructor expands to type", - _1: /* End_of_format */ 0 - }, - _1: "This type constructor expands to type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is used here with type", - _1: /* End_of_format */ 0 - }, - _1: "but is used here with type" - }); - })); - case /* Parameters_differ */ 8 : - const ty$p$1 = s._2; - const ty$3 = s._1; - reset(undefined); - mark_loops(ty$3); - mark_loops(ty$p$1); - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[%s@ %a@ %s@ %s@ %s@ %s@ %s@]" + }), "The constructor", longident, s._0, "extends type", name(undefined, s._1), "whose declaration does not match", "the declaration of type", name(undefined, s._2)); + case /* Rebind_private */ 15 : + return Curry._4(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "In the definition of ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: ", type", + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "should be", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[In the definition of %s, type@ %a@ should be@ %a@]" - }), name(undefined, s._0), type_expr$1, ty$3, type_expr$1, ty$p$1); - case /* Unbound_type_var */ 9 : - const decl = s._1; - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A type variable is unbound in this type declaration", - _1: /* End_of_format */ 0 - }, - _1: "A type variable is unbound in this type declaration" - }); - const ty$4 = repr(s._0); - const match = decl.type_kind; - const match$1 = decl.type_manifest; - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (match === /* Type_abstract */ 0 && match$1 !== undefined) { - const trivial = function (ty$5) { - explain_unbound(ppf, ty$4, { - hd: ty$5, - tl: /* [] */ 0 - }, (function (t) { - return t; - }), "type", (function (param) { - return ""; - })); - }; - const row = repr(match$1).desc; - if (/* tag */ typeof row === "number" || typeof row === "string") { - return trivial(match$1); - } - switch (row.TAG) { - case /* Tobject */ 4 : - const match$2 = flatten_fields(row._0); - if (match$2[1] === ty$4) { - return trivial(match$1); - } else { - return explain_unbound(ppf, ty$4, match$2[0], (function (param) { - return param[2]; - }), "method", (function (param) { - return param[0] + ": "; - })); - } - case /* Tvariant */ 8 : - const row$1 = row_repr_aux(/* [] */ 0, row._0); - if (row$1.row_more === ty$4) { - return trivial(match$1); - } else { - return explain_unbound(ppf, ty$4, row$1.row_fields, (function (param) { - const match = row_field_repr_aux(/* [] */ 0, param[1]); - if (/* tag */ typeof match === "number" || typeof match === "string") { - return newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: /* [] */ 0 - }); - } - if (match.TAG === /* Rpresent */ 0) { - const t = match._0; - if (t !== undefined) { - return t; - } else { - return newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: /* [] */ 0 - }); - } - } - const match$1 = match._1; - if (match$1 && !match$1.tl) { - return match$1.hd; - } else { - return newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: match._1 - }); - } - }), "case", (function (param) { - return "`" + (param[0] + " of "); - })); } - default: - return trivial(match$1); - } + }, + _1: "@[%s@ %a@ %s@]" + }), "The constructor", longident, s._0, "is private"); + case /* Bad_variance */ 16 : + const n = s._0; + const variance = function (param) { + const n = param[1]; + const inj = param[2] ? "injective " : ""; + if (param[0]) { + if (n) { + return inj + "invariant"; } else { - return; + return inj + "covariant"; } - } else if (match.TAG === /* Type_record */ 0) { - return explain_unbound(ppf, ty$4, match._0, (function (l) { - return l.ld_type; - }), "field", (function (l) { - return l.ld_id.name + ": "; - })); + } else if (n) { + return inj + "contravariant"; + } else if (inj === "") { + return "unrestricted"; } else { - return explain_unbound(ppf, ty$4, match._0, (function (c) { - return newty2(100000000, { - TAG: /* Ttuple */ 2, - _0: c.cd_args - }); - }), "case", (function (c) { - return c.cd_id.name + " of "; - })); + return inj; } - case /* Not_open_type */ 10 : - return Curry._3(Stdlib__Format.fprintf(ppf)({ + }; + const suffix = function (n) { + const teen = (n % 100 / 10 | 0) === 1; + const match = n % 10; + switch (match) { + case 1 : + if (teen) { + return "th"; + } else { + return "st"; + } + case 2 : + if (teen) { + return "th"; + } else { + return "nd"; + } + case 3 : + if (teen) { + return "th"; + } else { + return "rd"; + } + default: + return "th"; + } + }; + if (n === -1) { + Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -76587,20 +76989,30 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "It", + _1: /* End_of_format */ 0 + } } } } } }, - _1: "@[%s@ %a@]" - }), "Cannot extend type definition", path, s._0); - case /* Not_extensible_type */ 11 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ + _1: "@[%s@ %s@ It" + }), "In this definition, a type variable has a variance that", "is not reflected by its occurrence in type parameters."); + } else if (n === -2) { + Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -76624,151 +77036,21 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - }, - _1: "@[%s@ %a@ %s@]" - }), "Type", path, s._0, "is not extensible"); - case /* Extension_mismatch */ 12 : - return Curry._5(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", + _0: /* Close_box */ 0, _1: /* End_of_format */ 0 - }, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } } } } } }, - _1: "@[@[%s@ %s@;<1 2>%s@]%a@]" - }), "This extension", "does not match the definition of type", name(undefined, s._0), (function (param) { - return report_type_mismatch("the type", "this extension", "definition", param); - }), s._1); - case /* Rebind_wrong_type */ 13 : - const lid = s._0; - return report_unification_error(ppf, s._1, undefined, s._2, (function (ppf) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The constructor ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "has type", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "The constructor %a@ has type" - }), longident, lid); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but was expected to be of type", - _1: /* End_of_format */ 0 - }, - _1: "but was expected to be of type" - }); - })); - case /* Rebind_mismatch */ 14 : - return Curry._8(Stdlib__Format.fprintf(ppf)({ + _1: "@[%s@ %s@]" + }), "In this definition, a type variable cannot be deduced", "from the type parameters."); + } else if (n === -3) { + Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -76792,8 +77074,9 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -76802,75 +77085,19 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - } - } + TAG: /* String_literal */ 11, + _0: "It", + _1: /* End_of_format */ 0 } } } } } }, - _1: "@[%s@ %a@ %s@ %s@ %s@ %s@ %s@]" - }), "The constructor", longident, s._0, "extends type", name(undefined, s._1), "whose declaration does not match", "the declaration of type", name(undefined, s._2)); - case /* Rebind_private */ 15 : - return Curry._4(Stdlib__Format.fprintf(ppf)({ + _1: "@[%s@ %s@ It" + }), "In this definition, a type variable has a variance that", "cannot be deduced from the type parameters."); + } else { + Curry._4(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* Formatting_gen */ 18, @@ -76894,8 +77121,9 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -76904,12 +77132,22 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "The ", _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* Int */ 4, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " type parameter", + _1: /* End_of_format */ 0 + } + } } } } @@ -76917,69 +77155,21 @@ function report_error$5(ppf, s) { } } }, - _1: "@[%s@ %a@ %s@]" - }), "The constructor", longident, s._0, "is private"); - case /* Bad_variance */ 16 : - const n = s._0; - const variance = function (param) { - const n = param[1]; - const inj = param[2] ? "injective " : ""; - if (param[0]) { - if (n) { - return inj + "invariant"; - } else { - return inj + "covariant"; - } - } else if (n) { - return inj + "contravariant"; - } else if (inj === "") { - return "unrestricted"; - } else { - return inj; - } - }; - const suffix = function (n) { - const teen = (n % 100 / 10 | 0) === 1; - const match = n % 10; - switch (match) { - case 1 : - if (teen) { - return "th"; - } else { - return "st"; - } - case 2 : - if (teen) { - return "th"; - } else { - return "nd"; - } - case 3 : - if (teen) { - return "th"; - } else { - return "rd"; - } - default: - return "th"; - } - }; - if (n === -1) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _1: "@[%s@ %s@ The %d%s type parameter" + }), "In this definition, expected parameter", "variances are not satisfied.", n, suffix(n)); + } + if (n !== -2) { + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: " was expected to be ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -76989,276 +77179,86 @@ function report_error$5(ppf, s) { _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "but it is ", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "It", - _1: /* End_of_format */ 0 + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } } - }, - _1: "@[%s@ %s@ It" - }), "In this definition, a type variable has a variance that", "is not reflected by its occurrence in type parameters."); - } else if (n === -2) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: " was expected to be %s,@ but it is %s.@]" + }), variance(s._2), variance(s._1)); + } else { + return; + } + case /* Unavailable_type_constructor */ 17 : + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The definition of type ", + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "@[%s@ %s@]" - }), "In this definition, a type variable cannot be deduced", "from the type parameters."); - } else if (n === -3) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "It", - _1: /* End_of_format */ 0 - } - } - } - } - } - }, - _1: "@[%s@ %s@ It" - }), "In this definition, a type variable has a variance that", "cannot be deduced from the type parameters."); - } else { - Curry._4(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "The ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " type parameter", - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - } - }, - _1: "@[%s@ %s@ The %d%s type parameter" - }), "In this definition, expected parameter", "variances are not satisfied.", n, suffix(n)); - } - if (n !== -2) { - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: " was expected to be ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "but it is ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - }, - _1: " was expected to be %s,@ but it is %s.@]" - }), variance(s._2), variance(s._1)); - } else { - return; - } - case /* Unavailable_type_constructor */ 17 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The definition of type ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is unavailable", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "is unavailable", + _1: /* End_of_format */ 0 } } - }, - _1: "The definition of type %a@ is unavailable" - }), path, s._0); + } + }, + _1: "The definition of type %a@ is unavailable" + }), path, s._0); case /* Bad_fixed_type */ 18 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This fixed type ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "This fixed type %s" - }), s._0); + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This fixed type ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "This fixed type %s" + }), s._0); case /* Unbound_type_var_ext */ 19 : - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "A type variable is unbound in this extension constructor", - _1: /* End_of_format */ 0 - }, - _1: "A type variable is unbound in this extension constructor" - }); - return explain_unbound(ppf, s._0, s._1.ext_args, (function (c) { - return c; - }), "type", (function (param) { - return ""; - })); + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "A type variable is unbound in this extension constructor", + _1: /* End_of_format */ 0 + }, + _1: "A type variable is unbound in this extension constructor" + }); + return explain_unbound(ppf, s._0, s._1.ext_args, (function (c) { + return c; + }), "type", (function (param) { + return ""; + })); } } @@ -77295,11 +77295,11 @@ function scrape_class_type(_cty) { const cty = _cty; switch (cty.TAG) { case /* Cty_constr */ 0 : - _cty = cty._2; - continue; + _cty = cty._2; + continue; case /* Cty_signature */ 1 : case /* Cty_arrow */ 2 : - return cty; + return cty; } }; @@ -77310,22 +77310,22 @@ function generalize_class_type(gen, _param) { const param = _param; switch (param.TAG) { case /* Cty_constr */ 0 : - Stdlib__List.iter(gen, param._1); - _param = param._2; - continue; + Stdlib__List.iter(gen, param._1); + _param = param._2; + continue; case /* Cty_signature */ 1 : - const match = param._0; - Curry._1(gen, match.csig_self); - Curry._2(Meths.iter, (function (param, param$1) { - Curry._1(gen, param$1[2]); - }), match.csig_vars); - return Stdlib__List.iter((function (param) { - Stdlib__List.iter(gen, param[1]); - }), match.csig_inher); + const match = param._0; + Curry._1(gen, match.csig_self); + Curry._2(Meths.iter, (function (param, param$1) { + Curry._1(gen, param$1[2]); + }), match.csig_vars); + return Stdlib__List.iter((function (param) { + Stdlib__List.iter(gen, param[1]); + }), match.csig_inher); case /* Cty_arrow */ 2 : - Curry._1(gen, param._1); - _param = param._2; - continue; + Curry._1(gen, param._1); + _param = param._2; + continue; } }; @@ -77351,22 +77351,22 @@ function constructor_type(constr, _cty) { const cty = _cty; switch (cty.TAG) { case /* Cty_constr */ 0 : - _cty = cty._2; - continue; + _cty = cty._2; + continue; case /* Cty_signature */ 1 : - return constr; + return constr; case /* Cty_arrow */ 2 : - const desc_0 = cty._0; - const desc_1 = cty._1; - const desc_2 = constructor_type(constr, cty._2); - const desc = { - TAG: /* Tarrow */ 1, - _0: desc_0, - _1: desc_1, - _2: desc_2, - _3: /* Cok */ 0 - }; - return newty2(current_level.contents, desc); + const desc_0 = cty._0; + const desc_1 = cty._1; + const desc_2 = constructor_type(constr, cty._2); + const desc = { + TAG: /* Tarrow */ 1, + _0: desc_0, + _1: desc_1, + _2: desc_2, + _3: /* Cok */ 0 + }; + return newty2(current_level.contents, desc); } }; @@ -77378,10 +77378,10 @@ function class_body(_cty) { switch (cty.TAG) { case /* Cty_constr */ 0 : case /* Cty_signature */ 1 : - return cty; + return cty; case /* Cty_arrow */ 2 : - _cty = cty._2; - continue; + _cty = cty._2; + continue; } }; @@ -77416,19 +77416,19 @@ function abbreviate_class_type(path, params, cty) { switch (cty.TAG) { case /* Cty_constr */ 0 : case /* Cty_signature */ 1 : - return { - TAG: /* Cty_constr */ 0, - _0: path, - _1: params, - _2: cty - }; + return { + TAG: /* Cty_constr */ 0, + _0: path, + _1: params, + _2: cty + }; case /* Cty_arrow */ 2 : - return { - TAG: /* Cty_arrow */ 2, - _0: cty._0, - _1: cty._1, - _2: abbreviate_class_type(path, params, cty._2) - }; + return { + TAG: /* Cty_arrow */ 2, + _0: cty._0, + _1: cty._1, + _2: abbreviate_class_type(path, params, cty._2) + }; } } @@ -77440,26 +77440,26 @@ function closed_class$1(cty) { const sign = _sign; switch (sign.TAG) { case /* Cty_constr */ 0 : - return Stdlib__List.for_all(closed_schema, sign._1); + return Stdlib__List.for_all(closed_schema, sign._1); case /* Cty_signature */ 1 : - const sign$1 = sign._0; - if (closed_schema(sign$1.csig_self)) { - return Curry._3(Meths.fold, (function (param, param$1, cc) { - if (closed_schema(param$1[2])) { - return cc; - } else { - return false; - } - }), sign$1.csig_vars, true); - } else { - return false; - } + const sign$1 = sign._0; + if (closed_schema(sign$1.csig_self)) { + return Curry._3(Meths.fold, (function (param, param$1, cc) { + if (closed_schema(param$1[2])) { + return cc; + } else { + return false; + } + }), sign$1.csig_vars, true); + } else { + return false; + } case /* Cty_arrow */ 2 : - if (!closed_schema(sign._1)) { - return false; - } - _sign = sign._2; - continue; + if (!closed_schema(sign._1)) { + return false; + } + _sign = sign._2; + continue; } }; @@ -77473,26 +77473,26 @@ function limited_generalize$1(rv, _sign) { const sign = _sign; switch (sign.TAG) { case /* Cty_constr */ 0 : - Stdlib__List.iter((function (param) { - return limited_generalize(rv, param); - }), sign._1); - _sign = sign._2; - continue; + Stdlib__List.iter((function (param) { + return limited_generalize(rv, param); + }), sign._1); + _sign = sign._2; + continue; case /* Cty_signature */ 1 : - const sign$1 = sign._0; - limited_generalize(rv, sign$1.csig_self); - Curry._2(Meths.iter, (function (param, param$1) { - limited_generalize(rv, param$1[2]); - }), sign$1.csig_vars); - return Stdlib__List.iter((function (param) { - Stdlib__List.iter((function (param) { - return limited_generalize(rv, param); - }), param[1]); - }), sign$1.csig_inher); + const sign$1 = sign._0; + limited_generalize(rv, sign$1.csig_self); + Curry._2(Meths.iter, (function (param, param$1) { + limited_generalize(rv, param$1[2]); + }), sign$1.csig_vars); + return Stdlib__List.iter((function (param) { + Stdlib__List.iter((function (param) { + return limited_generalize(rv, param); + }), param[1]); + }), sign$1.csig_inher); case /* Cty_arrow */ 2 : - limited_generalize(rv, sign._1); - _sign = sign._2; - continue; + limited_generalize(rv, sign._1); + _sign = sign._2; + continue; } }; @@ -77617,42 +77617,39 @@ function inheritance(self_type, env, ovf, concr_meths, warn_vals, loc, parent) { const cl_sig = scrape_class_type(parent); switch (cl_sig.TAG) { case /* Cty_signature */ 1 : - const cl_sig$1 = cl_sig._0; - try { - unify$2(env, self_type, cl_sig$1.csig_self); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - const trace$1 = trace._1; - let exit = 0; - if (trace$1) { - const match = trace$1.tl; - if (match) { - const match$1 = match.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - const match$3 = match$2.hd[0].desc; - if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { - exit = 1; - } else { - if (match$3.TAG === /* Tfield */ 5) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: env, - _3: { - TAG: /* Field_type_mismatch */ 1, - _0: "method", - _1: match$3._0, - _2: match$2.tl - } - }); - } - exit = 1; - } + const cl_sig$1 = cl_sig._0; + try { + unify$2(env, self_type, cl_sig$1.csig_self); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + const trace$1 = trace._1; + let exit = 0; + if (trace$1) { + const match = trace$1.tl; + if (match) { + const match$1 = match.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { + const match$3 = match$2.hd[0].desc; + if (/* tag */ typeof match$3 === "number" || typeof match$3 === "string") { + exit = 1; } else { + if (match$3.TAG === /* Tfield */ 5) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: env, + _3: { + TAG: /* Field_type_mismatch */ 1, + _0: "method", + _1: match$3._0, + _2: match$2.tl + } + }); + } exit = 1; } } else { @@ -77664,90 +77661,93 @@ function inheritance(self_type, env, ovf, concr_meths, warn_vals, loc, parent) { } else { exit = 1; } - if (exit === 1) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 48280, - 12 - ] - }); - } - } else { - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + exit = 1; + } + if (exit === 1) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 48280, + 12 + ] + }); } + + } else { + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); } - const over_meths = Curry._2(inter$1, cl_sig$1.csig_concr, concr_meths); - const concr_vals$1 = concr_vals(cl_sig$1.csig_vars); - const over_vals = Curry._2(inter$1, concr_vals$1, warn_vals); - if (ovf !== undefined) { - if (ovf === /* Override */ 0) { - if (Curry._1(is_empty$1, over_meths) && Curry._1(is_empty$1, over_vals)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: env, - _3: { - TAG: /* No_overriding */ 23, - _0: "", - _1: "" - } - }); - } - - } else { - let cname; - switch (parent.TAG) { - case /* Cty_constr */ 0 : - cname = name(undefined, parent._0); - break; - case /* Cty_signature */ 1 : - case /* Cty_arrow */ 2 : - cname = "inherited"; - break; - - } - if (!Curry._1(is_empty$1, over_meths)) { - prerr_warning(loc, { - TAG: /* Method_override */ 2, - _0: { - hd: cname, - tl: Curry._1(elements, over_meths) - } - }); - } - if (!Curry._1(is_empty$1, over_vals)) { - prerr_warning(loc, { - TAG: /* Instance_variable_override */ 5, - _0: { - hd: cname, - tl: Curry._1(elements, over_vals) - } - }); - } + } + const over_meths = Curry._2(inter$1, cl_sig$1.csig_concr, concr_meths); + const concr_vals$1 = concr_vals(cl_sig$1.csig_vars); + const over_vals = Curry._2(inter$1, concr_vals$1, warn_vals); + if (ovf !== undefined) { + if (ovf === /* Override */ 0) { + if (Curry._1(is_empty$1, over_meths) && Curry._1(is_empty$1, over_vals)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: env, + _3: { + TAG: /* No_overriding */ 23, + _0: "", + _1: "" + } + }); + } + + } else { + let cname; + switch (parent.TAG) { + case /* Cty_constr */ 0 : + cname = name(undefined, parent._0); + break; + case /* Cty_signature */ 1 : + case /* Cty_arrow */ 2 : + cname = "inherited"; + break; } + if (!Curry._1(is_empty$1, over_meths)) { + prerr_warning(loc, { + TAG: /* Method_override */ 2, + _0: { + hd: cname, + tl: Curry._1(elements, over_meths) + } + }); + } + if (!Curry._1(is_empty$1, over_vals)) { + prerr_warning(loc, { + TAG: /* Instance_variable_override */ 5, + _0: { + hd: cname, + tl: Curry._1(elements, over_vals) + } + }); + } + } - const concr_meths$1 = Curry._2(union$2, cl_sig$1.csig_concr, concr_meths); - const warn_vals$1 = Curry._2(union$2, concr_vals$1, warn_vals); - return [ - cl_sig$1, - concr_meths$1, - warn_vals$1 - ]; + } + const concr_meths$1 = Curry._2(union$2, cl_sig$1.csig_concr, concr_meths); + const warn_vals$1 = Curry._2(union$2, concr_vals$1, warn_vals); + return [ + cl_sig$1, + concr_meths$1, + warn_vals$1 + ]; case /* Cty_constr */ 0 : case /* Cty_arrow */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: env, - _3: { - TAG: /* Structure_expected */ 2, - _0: parent - } - }); + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: env, + _3: { + TAG: /* Structure_expected */ 2, + _0: parent + } + }); } } @@ -77958,137 +77958,137 @@ function class_signature$1(env, param) { const sparent = param$1.pctf_desc; switch (sparent.TAG) { case /* Pctf_inherit */ 0 : - const sparent$1 = sparent._0; - const parent = class_type$3(env, sparent$1); - const match = parent.cltyp_type; - let inher$1; - switch (match.TAG) { - case /* Cty_constr */ 0 : - inher$1 = { - hd: [ - match._0, - match._1 - ], - tl: inher - }; - break; - case /* Cty_signature */ 1 : - case /* Cty_arrow */ 2 : - inher$1 = inher; - break; - - } - const match$1 = inheritance(self_type, env, undefined, concr_meths, /* Empty */ 0, sparent$1.pcty_loc, parent.cltyp_type); - const partial_arg = sparent$1.pcty_loc; - const val_sig$1 = Curry._3(Meths.fold, (function (param, param$1, param$2) { - return add_val(env, partial_arg, param, param$1, param$2); - }), match$1[0].csig_vars, val_sig); - return [ - { - hd: mkctf({ - TAG: /* Tctf_inherit */ 0, - _0: parent - }), - tl: fields - }, - val_sig$1, - match$1[1], - inher$1 - ]; + const sparent$1 = sparent._0; + const parent = class_type$3(env, sparent$1); + const match = parent.cltyp_type; + let inher$1; + switch (match.TAG) { + case /* Cty_constr */ 0 : + inher$1 = { + hd: [ + match._0, + match._1 + ], + tl: inher + }; + break; + case /* Cty_signature */ 1 : + case /* Cty_arrow */ 2 : + inher$1 = inher; + break; + + } + const match$1 = inheritance(self_type, env, undefined, concr_meths, /* Empty */ 0, sparent$1.pcty_loc, parent.cltyp_type); + const partial_arg = sparent$1.pcty_loc; + const val_sig$1 = Curry._3(Meths.fold, (function (param, param$1, param$2) { + return add_val(env, partial_arg, param, param$1, param$2); + }), match$1[0].csig_vars, val_sig); + return [ + { + hd: mkctf({ + TAG: /* Tctf_inherit */ 0, + _0: parent + }), + tl: fields + }, + val_sig$1, + match$1[1], + inher$1 + ]; case /* Pctf_val */ 1 : - const match$2 = sparent._0; - const virt = match$2[2]; - const mut = match$2[1]; - const lab = match$2[0]; - const cty = transl_simple_type(env, false, match$2[3]); - const ty = cty.ctyp_type; - return [ - { - hd: mkctf({ - TAG: /* Tctf_val */ 1, - _0: [ - lab, - mut, - virt, - cty - ] - }), - tl: fields - }, - add_val(env, param$1.pctf_loc, lab, [ - mut, - virt, - ty - ], val_sig), - concr_meths, - inher - ]; + const match$2 = sparent._0; + const virt = match$2[2]; + const mut = match$2[1]; + const lab = match$2[0]; + const cty = transl_simple_type(env, false, match$2[3]); + const ty = cty.ctyp_type; + return [ + { + hd: mkctf({ + TAG: /* Tctf_val */ 1, + _0: [ + lab, + mut, + virt, + cty + ] + }), + tl: fields + }, + add_val(env, param$1.pctf_loc, lab, [ + mut, + virt, + ty + ], val_sig), + concr_meths, + inher + ]; case /* Pctf_method */ 2 : - const match$3 = sparent._0; - const virt$1 = match$3[2]; - const priv = match$3[1]; - const lab$1 = match$3[0]; - const cty$1 = declare_method(env, meths, self_type, lab$1, priv, match$3[3], param$1.pctf_loc); - let concr_meths$1; - concr_meths$1 = virt$1 === /* Virtual */ 0 ? concr_meths : Curry._2(add$2, lab$1, concr_meths); - return [ - { - hd: mkctf({ - TAG: /* Tctf_method */ 2, - _0: [ - lab$1, - priv, - virt$1, - cty$1 - ] - }), - tl: fields - }, - val_sig, - concr_meths$1, - inher - ]; + const match$3 = sparent._0; + const virt$1 = match$3[2]; + const priv = match$3[1]; + const lab$1 = match$3[0]; + const cty$1 = declare_method(env, meths, self_type, lab$1, priv, match$3[3], param$1.pctf_loc); + let concr_meths$1; + concr_meths$1 = virt$1 === /* Virtual */ 0 ? concr_meths : Curry._2(add$2, lab$1, concr_meths); + return [ + { + hd: mkctf({ + TAG: /* Tctf_method */ 2, + _0: [ + lab$1, + priv, + virt$1, + cty$1 + ] + }), + tl: fields + }, + val_sig, + concr_meths$1, + inher + ]; case /* Pctf_constraint */ 3 : - const match$4 = sparent._0; - const match$5 = type_constraint(env, match$4[0], match$4[1], param$1.pctf_loc); - return [ - { - hd: mkctf({ - TAG: /* Tctf_constraint */ 3, - _0: [ - match$5[0], - match$5[1] - ] - }), - tl: fields - }, - val_sig, - concr_meths, - inher - ]; + const match$4 = sparent._0; + const match$5 = type_constraint(env, match$4[0], match$4[1], param$1.pctf_loc); + return [ + { + hd: mkctf({ + TAG: /* Tctf_constraint */ 3, + _0: [ + match$5[0], + match$5[1] + ] + }), + tl: fields + }, + val_sig, + concr_meths, + inher + ]; case /* Pctf_attribute */ 4 : - const x = sparent._0; - warning_attribute({ - hd: x, - tl: /* [] */ 0 - }); - return [ - { - hd: mkctf({ - TAG: /* Tctf_attribute */ 4, - _0: x - }), - tl: fields - }, - val_sig, - concr_meths, - inher - ]; + const x = sparent._0; + warning_attribute({ + hd: x, + tl: /* [] */ 0 + }); + return [ + { + hd: mkctf({ + TAG: /* Tctf_attribute */ 4, + _0: x + }), + tl: fields + }, + val_sig, + concr_meths, + inher + ]; case /* Pctf_extension */ 5 : - throw new Caml_js_exceptions.MelangeError(Error_forward$2, { - MEL_EXN_ID: Error_forward$2, - _1: error_of_extension(sparent._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$2, { + MEL_EXN_ID: Error_forward$2, + _1: error_of_extension(sparent._0) + }); } }), [ @@ -78127,106 +78127,106 @@ function class_type$3(env, scty) { const pcsig = scty.pcty_desc; switch (pcsig.TAG) { case /* Pcty_constr */ 0 : - const styl = pcsig._1; - const lid = pcsig._0; - const match = find_class_type(env, scty.pcty_loc, lid.txt); - const decl = match[1]; - const path = match[0]; - if (same(decl.clty_path, unbound_class)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: scty.pcty_loc, - _2: env, - _3: { - TAG: /* Unbound_class_type_2 */ 7, - _0: lid.txt - } - }); - } - const match$1 = instance_class(decl.clty_params, decl.clty_type); - const params = match$1[0]; - if (Stdlib__List.length(params) !== Stdlib__List.length(styl)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: scty.pcty_loc, - _2: env, - _3: { - TAG: /* Parameter_arity_mismatch */ 11, - _0: lid.txt, - _1: Stdlib__List.length(params), - _2: Stdlib__List.length(styl) - } - }); - } - const ctys = Stdlib__List.map2((function (sty, ty) { - const cty$p = transl_simple_type(env, false, sty); - const ty$p = cty$p.ctyp_type; - try { - unify$2(env, ty$p, ty); + const styl = pcsig._1; + const lid = pcsig._0; + const match = find_class_type(env, scty.pcty_loc, lid.txt); + const decl = match[1]; + const path = match[0]; + if (same(decl.clty_path, unbound_class)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: scty.pcty_loc, + _2: env, + _3: { + TAG: /* Unbound_class_type_2 */ 7, + _0: lid.txt } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: sty.ptyp_loc, - _2: env, - _3: { - TAG: /* Parameter_mismatch */ 12, - _0: trace._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + }); + } + const match$1 = instance_class(decl.clty_params, decl.clty_type); + const params = match$1[0]; + if (Stdlib__List.length(params) !== Stdlib__List.length(styl)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: scty.pcty_loc, + _2: env, + _3: { + TAG: /* Parameter_arity_mismatch */ 11, + _0: lid.txt, + _1: Stdlib__List.length(params), + _2: Stdlib__List.length(styl) } - return cty$p; - }), styl, params); - const typ_2 = match$1[1]; - const typ = { - TAG: /* Cty_constr */ 0, - _0: path, - _1: params, - _2: typ_2 - }; - return cltyp({ - TAG: /* Tcty_constr */ 0, - _0: path, - _1: lid, - _2: ctys - }, typ); + }); + } + const ctys = Stdlib__List.map2((function (sty, ty) { + const cty$p = transl_simple_type(env, false, sty); + const ty$p = cty$p.ctyp_type; + try { + unify$2(env, ty$p, ty); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: sty.ptyp_loc, + _2: env, + _3: { + TAG: /* Parameter_mismatch */ 12, + _0: trace._1 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + return cty$p; + }), styl, params); + const typ_2 = match$1[1]; + const typ = { + TAG: /* Cty_constr */ 0, + _0: path, + _1: params, + _2: typ_2 + }; + return cltyp({ + TAG: /* Tcty_constr */ 0, + _0: path, + _1: lid, + _2: ctys + }, typ); case /* Pcty_signature */ 1 : - const clsig = class_signature$1(env, pcsig._0); - const typ$1 = { - TAG: /* Cty_signature */ 1, - _0: clsig.csig_type - }; - return cltyp({ - TAG: /* Tcty_signature */ 1, - _0: clsig - }, typ$1); + const clsig = class_signature$1(env, pcsig._0); + const typ$1 = { + TAG: /* Cty_signature */ 1, + _0: clsig.csig_type + }; + return cltyp({ + TAG: /* Tcty_signature */ 1, + _0: clsig + }, typ$1); case /* Pcty_arrow */ 2 : - const l = pcsig._0; - const cty = transl_simple_type(env, false, pcsig._1); - const ty = cty.ctyp_type; - const clty = class_type$3(env, pcsig._2); - const typ_2$1 = clty.cltyp_type; - const typ$2 = { - TAG: /* Cty_arrow */ 2, - _0: l, - _1: ty, - _2: typ_2$1 - }; - return cltyp({ - TAG: /* Tcty_arrow */ 2, - _0: l, - _1: cty, - _2: clty - }, typ$2); + const l = pcsig._0; + const cty = transl_simple_type(env, false, pcsig._1); + const ty = cty.ctyp_type; + const clty = class_type$3(env, pcsig._2); + const typ_2$1 = clty.cltyp_type; + const typ$2 = { + TAG: /* Cty_arrow */ 2, + _0: l, + _1: ty, + _2: typ_2$1 + }; + return cltyp({ + TAG: /* Tcty_arrow */ 2, + _0: l, + _1: cty, + _2: clty + }, typ$2); case /* Pcty_extension */ 3 : - throw new Caml_js_exceptions.MelangeError(Error_forward$2, { - MEL_EXN_ID: Error_forward$2, - _1: error_of_extension(pcsig._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$2, { + MEL_EXN_ID: Error_forward$2, + _1: error_of_extension(pcsig._0) + }); } } @@ -78337,237 +78337,135 @@ function class_structure(cl_num, $$final, val_env, met_env, loc, param) { const expr = param$1.pcf_desc; switch (expr.TAG) { case /* Pcf_inherit */ 0 : - const $$super = expr._2; - const sparent = expr._1; - const ovf = expr._0; - const parent = class_expr(cl_num, val_env, par_env, sparent); - const match = parent.cl_type; - let inher$1; - switch (match.TAG) { - case /* Cty_constr */ 0 : - inher$1 = { - hd: [ - match._0, - match._1 - ], - tl: inher - }; - break; - case /* Cty_signature */ 1 : - case /* Cty_arrow */ 2 : - inher$1 = inher; - break; - - } - const match$1 = inheritance(self_type, val_env, ovf, concr_meths, warn_vals, sparent.pcl_loc, parent.cl_type); - const cl_sig = match$1[0]; - const match$2 = Curry._3(Meths.fold, (function (lab, info, param) { - const match = enter_val(cl_num, vars, true, lab, info[0], info[1], info[2], param[0], param[1], param[2], sparent.pcl_loc); - return [ - match[1], - match[2], - match[3], - { - hd: [ - lab, - match[0] - ], - tl: param[3] - } - ]; - }), cl_sig.csig_vars, [ - val_env, - met_env, - par_env, - /* [] */ 0 - ]); - const inh_vars = match$2[3]; - const par_env$1 = match$2[2]; - const met_env$1 = match$2[1]; - const val_env$1 = match$2[0]; - const inh_meths = Curry._3(fold$1, (function (lab, rem) { - return { + const $$super = expr._2; + const sparent = expr._1; + const ovf = expr._0; + const parent = class_expr(cl_num, val_env, par_env, sparent); + const match = parent.cl_type; + let inher$1; + switch (match.TAG) { + case /* Cty_constr */ 0 : + inher$1 = { + hd: [ + match._0, + match._1 + ], + tl: inher + }; + break; + case /* Cty_signature */ 1 : + case /* Cty_arrow */ 2 : + inher$1 = inher; + break; + + } + const match$1 = inheritance(self_type, val_env, ovf, concr_meths, warn_vals, sparent.pcl_loc, parent.cl_type); + const cl_sig = match$1[0]; + const match$2 = Curry._3(Meths.fold, (function (lab, info, param) { + const match = enter_val(cl_num, vars, true, lab, info[0], info[1], info[2], param[0], param[1], param[2], sparent.pcl_loc); + return [ + match[1], + match[2], + match[3], + { hd: [ lab, - create(lab) + match[0] ], - tl: rem + tl: param[3] + } + ]; + }), cl_sig.csig_vars, [ + val_env, + met_env, + par_env, + /* [] */ 0 + ]); + const inh_vars = match$2[3]; + const par_env$1 = match$2[2]; + const met_env$1 = match$2[1]; + const val_env$1 = match$2[0]; + const inh_meths = Curry._3(fold$1, (function (lab, rem) { + return { + hd: [ + lab, + create(lab) + ], + tl: rem + }; + }), cl_sig.csig_concr, /* [] */ 0); + let match$3; + if ($$super !== undefined) { + const match$4 = enter_met_env((function (s) { + return { + TAG: /* Unused_ancestor */ 20, + _0: s }; - }), cl_sig.csig_concr, /* [] */ 0); - let match$3; - if ($$super !== undefined) { - const match$4 = enter_met_env((function (s) { - return { - TAG: /* Unused_ancestor */ 20, - _0: s - }; - }), sparent.pcl_loc, $$super, { - TAG: /* Val_anc */ 3, - _0: inh_meths, - _1: cl_num - }, self_type, val_env$1, met_env$1, par_env$1); - match$3 = [ - match$4[1], - match$4[2], - match$4[3] - ]; - } else { - match$3 = [ - val_env$1, - met_env$1, - par_env$1 - ]; - } - return [ - match$3[0], - match$3[1], - match$3[2], - { - hd: { - LAZY_DONE: false, - VAL: (function () { - return mkcf({ - TAG: /* Tcf_inherit */ 0, - _0: ovf, - _1: parent, - _2: $$super, - _3: inh_vars, - _4: inh_meths - }); - }) - }, - tl: fields - }, - match$1[1], - match$1[2], - inher$1, - local_meths, - local_vals + }), sparent.pcl_loc, $$super, { + TAG: /* Val_anc */ 3, + _0: inh_meths, + _1: cl_num + }, self_type, val_env$1, met_env$1, par_env$1); + match$3 = [ + match$4[1], + match$4[2], + match$4[3] + ]; + } else { + match$3 = [ + val_env$1, + met_env$1, + par_env$1 ]; + } + return [ + match$3[0], + match$3[1], + match$3[2], + { + hd: { + LAZY_DONE: false, + VAL: (function () { + return mkcf({ + TAG: /* Tcf_inherit */ 0, + _0: ovf, + _1: parent, + _2: $$super, + _3: inh_vars, + _4: inh_meths + }); + }) + }, + tl: fields + }, + match$1[1], + match$1[2], + inher$1, + local_meths, + local_vals + ]; case /* Pcf_val */ 1 : - const match$5 = expr._0; - const styp = match$5[2]; - const mut = match$5[1]; - const lab = match$5[0]; - if (styp.TAG === /* Cfk_virtual */ 0) { - if (principal.contents) { - begin_def(undefined); - } - const cty = transl_simple_type(val_env, false, styp._0); - const ty = cty.ctyp_type; - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, ty); - } - const match$6 = enter_val(cl_num, vars, false, lab.txt, mut, /* Virtual */ 0, ty, val_env, met_env, par_env, loc); - const met_env$p = match$6[2]; - const id = match$6[0]; - return [ - match$6[1], - met_env$p, - match$6[3], - { - hd: { - LAZY_DONE: false, - VAL: (function () { - return mkcf({ - TAG: /* Tcf_val */ 1, - _0: lab, - _1: mut, - _2: id, - _3: { - TAG: /* Tcfk_virtual */ 0, - _0: cty - }, - _4: met_env === met_env$p - }); - }) - }, - tl: fields - }, - concr_meths, - warn_vals, - inher, - local_meths, - local_vals - ]; - } - const ovf$1 = styp._0; - if (Curry._2(mem$2, lab.txt, local_vals)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: val_env, - _3: { - TAG: /* Duplicate */ 24, - _0: "instance variable", - _1: lab.txt - } - }); - } - if (Curry._2(mem$2, lab.txt, warn_vals)) { - if (ovf$1 === /* Fresh */ 1) { - prerr_warning(lab.loc, { - TAG: /* Instance_variable_override */ 5, - _0: { - hd: lab.txt, - tl: /* [] */ 0 - } - }); - } - - } else if (ovf$1 === /* Override */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: val_env, - _3: { - TAG: /* No_overriding */ 23, - _0: "instance variable", - _1: lab.txt - } - }); - } + const match$5 = expr._0; + const styp = match$5[2]; + const mut = match$5[1]; + const lab = match$5[0]; + if (styp.TAG === /* Cfk_virtual */ 0) { if (principal.contents) { begin_def(undefined); } - let exp; - try { - exp = type_exp(val_env, styp._1); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - const match$7 = exn._1; - if (match$7) { - if (match$7.tl) { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: val_env, - _3: { - TAG: /* Make_nongen_seltype */ 17, - _0: match$7.hd[0] - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } + const cty = transl_simple_type(val_env, false, styp._0); + const ty = cty.ctyp_type; if (principal.contents) { end_def(undefined); - generalize_structure$1(current_level.contents, exp.exp_type); + generalize_structure$1(current_level.contents, ty); } - const match$8 = enter_val(cl_num, vars, false, lab.txt, mut, /* Concrete */ 1, exp.exp_type, val_env, met_env, par_env, loc); - const met_env$p$1 = match$8[2]; - const id$1 = match$8[0]; + const match$6 = enter_val(cl_num, vars, false, lab.txt, mut, /* Virtual */ 0, ty, val_env, met_env, par_env, loc); + const met_env$p = match$6[2]; + const id = match$6[0]; return [ - match$8[1], - met_env$p$1, - match$8[3], + match$6[1], + met_env$p, + match$6[3], { hd: { LAZY_DONE: false, @@ -78576,223 +78474,133 @@ function class_structure(cl_num, $$final, val_env, met_env, loc, param) { TAG: /* Tcf_val */ 1, _0: lab, _1: mut, - _2: id$1, + _2: id, _3: { - TAG: /* Tcfk_concrete */ 1, - _0: ovf$1, - _1: exp + TAG: /* Tcfk_virtual */ 0, + _0: cty }, - _4: met_env === met_env$p$1 + _4: met_env === met_env$p }); }) }, tl: fields }, concr_meths, - Curry._2(add$2, lab.txt, warn_vals), + warn_vals, inher, local_meths, - Curry._2(add$2, lab.txt, local_vals) + local_vals ]; - case /* Pcf_method */ 2 : - const match$9 = expr._0; - const sty = match$9[2]; - const priv = match$9[1]; - const lab$1 = match$9[0]; - if (sty.TAG === /* Cfk_virtual */ 0) { - const cty$1 = virtual_method(val_env, meths, self_type, lab$1.txt, priv, sty._0, loc); - return [ - val_env, - met_env, - par_env, - { - hd: { - LAZY_DONE: false, - VAL: (function () { - return mkcf({ - TAG: /* Tcf_method */ 2, - _0: lab$1, - _1: priv, - _2: { - TAG: /* Tcfk_virtual */ 0, - _0: cty$1 - } - }); - }) - }, - tl: fields - }, - concr_meths, - warn_vals, - inher, - local_meths, - local_vals - ]; - } - const expr$1 = sty._1; - const ovf$2 = sty._0; - const match$10 = expr$1.pexp_desc; - let expr$2; - expr$2 = match$10.TAG === /* Pexp_poly */ 28 ? expr$1 : Curry._4(Ast_helper_Exp.poly, expr$1.pexp_loc, undefined, expr$1, undefined); - if (Curry._2(mem$2, lab$1.txt, local_meths)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: val_env, - _3: { - TAG: /* Duplicate */ 24, - _0: "method", - _1: lab$1.txt - } - }); - } - if (Curry._2(mem$2, lab$1.txt, concr_meths)) { - if (ovf$2 === /* Fresh */ 1) { - prerr_warning(loc, { - TAG: /* Method_override */ 2, - _0: { - hd: lab$1.txt, - tl: /* [] */ 0 - } - }); - } - - } else if (ovf$2 === /* Override */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: loc, - _2: val_env, - _3: { - TAG: /* No_overriding */ 23, - _0: "method", - _1: lab$1.txt + } + const ovf$1 = styp._0; + if (Curry._2(mem$2, lab.txt, local_vals)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: val_env, + _3: { + TAG: /* Duplicate */ 24, + _0: "instance variable", + _1: lab.txt + } + }); + } + if (Curry._2(mem$2, lab.txt, warn_vals)) { + if (ovf$1 === /* Fresh */ 1) { + prerr_warning(lab.loc, { + TAG: /* Instance_variable_override */ 5, + _0: { + hd: lab.txt, + tl: /* [] */ 0 } }); } - const match$11 = filter_self_method(val_env, lab$1.txt, priv, meths, self_type); - const ty$1 = match$11[1]; - try { - const match$12 = expr$2.pexp_desc; - if (match$12.TAG === /* Pexp_poly */ 28) { - const sty$1 = match$12._1; - const sbody = match$12._0; - if (sty$1 !== undefined) { - const sty$2 = force_poly(sty$1); - const cty$p = transl_simple_type(val_env, false, sty$2); - const ty$p = cty$p.ctyp_type; - unify$2(val_env, ty$p, ty$1); - } - const match$13 = repr(ty$1).desc; - if (/* tag */ typeof match$13 === "number" || typeof match$13 === "string") { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 48681, - 17 - ] - }); - } - switch (match$13.TAG) { - case /* Tvar */ 0 : - const ty$p$1 = newvar(undefined, undefined); - unify$2(val_env, newty2(current_level.contents, { - TAG: /* Tpoly */ 10, - _0: ty$p$1, - _1: /* [] */ 0 - }), ty$1); - unify$2(val_env, type_approx(val_env, sbody), ty$p$1); - break; - case /* Tpoly */ 10 : - const match$14 = instance_poly(undefined, false, match$13._1, match$13._0); - const ty2 = type_approx(val_env, sbody); - unify$2(val_env, ty2, match$14[1]); - break; - default: - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 48681, - 17 - ] - }); + + } else if (ovf$1 === /* Override */ 0) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: val_env, + _3: { + TAG: /* No_overriding */ 23, + _0: "instance variable", + _1: lab.txt + } + }); + } + if (principal.contents) { + begin_def(undefined); + } + let exp; + try { + exp = type_exp(val_env, styp._1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + const match$7 = exn._1; + if (match$7) { + if (match$7.tl) { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 48683, - 13 - ] - }); - } - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { throw new Caml_js_exceptions.MelangeError($$Error$9, { MEL_EXN_ID: $$Error$9, _1: loc, _2: val_env, _3: { - TAG: /* Field_type_mismatch */ 1, - _0: "method", - _1: lab$1.txt, - _2: trace._1 + TAG: /* Make_nongen_seltype */ 17, + _0: match$7.hd[0] } }); } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const meth_expr = make_method(self_loc, cl_num, expr$2); - const vars_local = vars.contents; - const field = { - LAZY_DONE: false, - VAL: (function () { - const meth_type = newty2(100000000, { - TAG: /* Tarrow */ 1, - _0: "", - _1: self_type, - _2: ty$1, - _3: /* Cok */ 0 - }); - raise_nongen_level(undefined); - vars.contents = vars_local; - const texp = type_expect(undefined, met_env, meth_expr, meth_type); - end_def(undefined); - return mkcf({ - TAG: /* Tcf_method */ 2, - _0: lab$1, - _1: priv, - _2: { - TAG: /* Tcfk_concrete */ 1, - _0: ovf$2, - _1: texp - } - }); - }) - }; - return [ - val_env, - met_env, - par_env, - { - hd: field, - tl: fields + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, exp.exp_type); + } + const match$8 = enter_val(cl_num, vars, false, lab.txt, mut, /* Concrete */ 1, exp.exp_type, val_env, met_env, par_env, loc); + const met_env$p$1 = match$8[2]; + const id$1 = match$8[0]; + return [ + match$8[1], + met_env$p$1, + match$8[3], + { + hd: { + LAZY_DONE: false, + VAL: (function () { + return mkcf({ + TAG: /* Tcf_val */ 1, + _0: lab, + _1: mut, + _2: id$1, + _3: { + TAG: /* Tcfk_concrete */ 1, + _0: ovf$1, + _1: exp + }, + _4: met_env === met_env$p$1 + }); + }) }, - Curry._2(add$2, lab$1.txt, concr_meths), - warn_vals, - inher, - Curry._2(add$2, lab$1.txt, local_meths), - local_vals - ]; - case /* Pcf_constraint */ 3 : - const match$15 = expr._0; - const match$16 = type_constraint(val_env, match$15[0], match$15[1], loc); - const cty$p$1 = match$16[1]; - const cty$2 = match$16[0]; + tl: fields + }, + concr_meths, + Curry._2(add$2, lab.txt, warn_vals), + inher, + local_meths, + Curry._2(add$2, lab.txt, local_vals) + ]; + case /* Pcf_method */ 2 : + const match$9 = expr._0; + const sty = match$9[2]; + const priv = match$9[1]; + const lab$1 = match$9[0]; + if (sty.TAG === /* Cfk_virtual */ 0) { + const cty$1 = virtual_method(val_env, meths, self_type, lab$1.txt, priv, sty._0, loc); return [ val_env, met_env, @@ -78802,9 +78610,13 @@ function class_structure(cl_num, $$final, val_env, met_env, loc, param) { LAZY_DONE: false, VAL: (function () { return mkcf({ - TAG: /* Tcf_constraint */ 3, - _0: cty$2, - _1: cty$p$1 + TAG: /* Tcf_method */ 2, + _0: lab$1, + _1: priv, + _2: { + TAG: /* Tcfk_virtual */ 0, + _0: cty$1 + } }); }) }, @@ -78816,78 +78628,266 @@ function class_structure(cl_num, $$final, val_env, met_env, loc, param) { local_meths, local_vals ]; - case /* Pcf_initializer */ 4 : - const expr$3 = make_method(self_loc, cl_num, expr._0); - const vars_local$1 = vars.contents; - const field$1 = { - LAZY_DONE: false, - VAL: (function () { - raise_nongen_level(undefined); - const desc_2 = instance_def(type_unit); - const desc = { - TAG: /* Tarrow */ 1, - _0: "", - _1: self_type, - _2: desc_2, - _3: /* Cok */ 0 - }; - const meth_type = newty2(current_level.contents, desc); - vars.contents = vars_local$1; - const texp = type_expect(undefined, met_env, expr$3, meth_type); - end_def(undefined); - return mkcf({ - TAG: /* Tcf_initializer */ 4, - _0: texp + } + const expr$1 = sty._1; + const ovf$2 = sty._0; + const match$10 = expr$1.pexp_desc; + let expr$2; + expr$2 = match$10.TAG === /* Pexp_poly */ 28 ? expr$1 : Curry._4(Ast_helper_Exp.poly, expr$1.pexp_loc, undefined, expr$1, undefined); + if (Curry._2(mem$2, lab$1.txt, local_meths)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: val_env, + _3: { + TAG: /* Duplicate */ 24, + _0: "method", + _1: lab$1.txt + } + }); + } + if (Curry._2(mem$2, lab$1.txt, concr_meths)) { + if (ovf$2 === /* Fresh */ 1) { + prerr_warning(loc, { + TAG: /* Method_override */ 2, + _0: { + hd: lab$1.txt, + tl: /* [] */ 0 + } + }); + } + + } else if (ovf$2 === /* Override */ 0) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: val_env, + _3: { + TAG: /* No_overriding */ 23, + _0: "method", + _1: lab$1.txt + } + }); + } + const match$11 = filter_self_method(val_env, lab$1.txt, priv, meths, self_type); + const ty$1 = match$11[1]; + try { + const match$12 = expr$2.pexp_desc; + if (match$12.TAG === /* Pexp_poly */ 28) { + const sty$1 = match$12._1; + const sbody = match$12._0; + if (sty$1 !== undefined) { + const sty$2 = force_poly(sty$1); + const cty$p = transl_simple_type(val_env, false, sty$2); + const ty$p = cty$p.ctyp_type; + unify$2(val_env, ty$p, ty$1); + } + const match$13 = repr(ty$1).desc; + if (/* tag */ typeof match$13 === "number" || typeof match$13 === "string") { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 48681, + 17 + ] }); - }) - }; - return [ - val_env, - met_env, - par_env, - { - hd: field$1, - tl: fields + } + switch (match$13.TAG) { + case /* Tvar */ 0 : + const ty$p$1 = newvar(undefined, undefined); + unify$2(val_env, newty2(current_level.contents, { + TAG: /* Tpoly */ 10, + _0: ty$p$1, + _1: /* [] */ 0 + }), ty$1); + unify$2(val_env, type_approx(val_env, sbody), ty$p$1); + break; + case /* Tpoly */ 10 : + const match$14 = instance_poly(undefined, false, match$13._1, match$13._0); + const ty2 = type_approx(val_env, sbody); + unify$2(val_env, ty2, match$14[1]); + break; + default: + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 48681, + 17 + ] + }); + } + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 48683, + 13 + ] + }); + } + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: loc, + _2: val_env, + _3: { + TAG: /* Field_type_mismatch */ 1, + _0: "method", + _1: lab$1.txt, + _2: trace._1 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + const meth_expr = make_method(self_loc, cl_num, expr$2); + const vars_local = vars.contents; + const field = { + LAZY_DONE: false, + VAL: (function () { + const meth_type = newty2(100000000, { + TAG: /* Tarrow */ 1, + _0: "", + _1: self_type, + _2: ty$1, + _3: /* Cok */ 0 + }); + raise_nongen_level(undefined); + vars.contents = vars_local; + const texp = type_expect(undefined, met_env, meth_expr, meth_type); + end_def(undefined); + return mkcf({ + TAG: /* Tcf_method */ 2, + _0: lab$1, + _1: priv, + _2: { + TAG: /* Tcfk_concrete */ 1, + _0: ovf$2, + _1: texp + } + }); + }) + }; + return [ + val_env, + met_env, + par_env, + { + hd: field, + tl: fields + }, + Curry._2(add$2, lab$1.txt, concr_meths), + warn_vals, + inher, + Curry._2(add$2, lab$1.txt, local_meths), + local_vals + ]; + case /* Pcf_constraint */ 3 : + const match$15 = expr._0; + const match$16 = type_constraint(val_env, match$15[0], match$15[1], loc); + const cty$p$1 = match$16[1]; + const cty$2 = match$16[0]; + return [ + val_env, + met_env, + par_env, + { + hd: { + LAZY_DONE: false, + VAL: (function () { + return mkcf({ + TAG: /* Tcf_constraint */ 3, + _0: cty$2, + _1: cty$p$1 + }); + }) }, - concr_meths, - warn_vals, - inher, - local_meths, - local_vals - ]; + tl: fields + }, + concr_meths, + warn_vals, + inher, + local_meths, + local_vals + ]; + case /* Pcf_initializer */ 4 : + const expr$3 = make_method(self_loc, cl_num, expr._0); + const vars_local$1 = vars.contents; + const field$1 = { + LAZY_DONE: false, + VAL: (function () { + raise_nongen_level(undefined); + const desc_2 = instance_def(type_unit); + const desc = { + TAG: /* Tarrow */ 1, + _0: "", + _1: self_type, + _2: desc_2, + _3: /* Cok */ 0 + }; + const meth_type = newty2(current_level.contents, desc); + vars.contents = vars_local$1; + const texp = type_expect(undefined, met_env, expr$3, meth_type); + end_def(undefined); + return mkcf({ + TAG: /* Tcf_initializer */ 4, + _0: texp + }); + }) + }; + return [ + val_env, + met_env, + par_env, + { + hd: field$1, + tl: fields + }, + concr_meths, + warn_vals, + inher, + local_meths, + local_vals + ]; case /* Pcf_attribute */ 5 : - const x = expr._0; - warning_attribute({ - hd: x, - tl: /* [] */ 0 - }); - return [ - val_env, - met_env, - par_env, - { - hd: { - LAZY_DONE: false, - VAL: (function () { - return mkcf({ - TAG: /* Tcf_attribute */ 5, - _0: x - }); - }) - }, - tl: fields + const x = expr._0; + warning_attribute({ + hd: x, + tl: /* [] */ 0 + }); + return [ + val_env, + met_env, + par_env, + { + hd: { + LAZY_DONE: false, + VAL: (function () { + return mkcf({ + TAG: /* Tcf_attribute */ 5, + _0: x + }); + }) }, - concr_meths, - warn_vals, - inher, - local_meths, - local_vals - ]; + tl: fields + }, + concr_meths, + warn_vals, + inher, + local_meths, + local_vals + ]; case /* Pcf_extension */ 6 : - throw new Caml_js_exceptions.MelangeError(Error_forward$2, { - MEL_EXN_ID: Error_forward$2, - _1: error_of_extension(expr._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$2, { + MEL_EXN_ID: Error_forward$2, + _1: error_of_extension(expr._0) + }); } }), [ @@ -79058,669 +79058,669 @@ function class_expr(cl_num, val_env, met_env, _scl) { const cl_str = scl.pcl_desc; switch (cl_str.TAG) { case /* Pcl_constr */ 0 : - const lid = cl_str._0; - const match = find_class$1(val_env, scl.pcl_loc, lid.txt); - const decl = match[1]; - const path = match[0]; - if (same(decl.cty_path, unbound_class)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: scl.pcl_loc, - _2: val_env, - _3: { - TAG: /* Unbound_class_2 */ 6, - _0: lid.txt - } - }); - } - const tyl = Stdlib__List.map((function (sty) { - return transl_simple_type(val_env, false, sty); - }), cl_str._1); - const match$1 = instance_class(decl.cty_params, decl.cty_type); - const clty = match$1[1]; - const params = match$1[0]; - const clty$p = abbreviate_class_type(path, params, clty); - if (Stdlib__List.length(params) !== Stdlib__List.length(tyl)) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: scl.pcl_loc, - _2: val_env, - _3: { - TAG: /* Parameter_arity_mismatch */ 11, - _0: lid.txt, - _1: Stdlib__List.length(params), - _2: Stdlib__List.length(tyl) - } - }); - } - Stdlib__List.iter2((function (cty$p, ty) { - const ty$p = cty$p.ctyp_type; - try { - return unify$2(val_env, ty$p, ty); - } - catch (raw_trace){ - const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); - if (trace.MEL_EXN_ID === Unify) { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: cty$p.ctyp_loc, - _2: val_env, - _3: { - TAG: /* Parameter_mismatch */ 12, - _0: trace._1 - } - }); - } - throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + const lid = cl_str._0; + const match = find_class$1(val_env, scl.pcl_loc, lid.txt); + const decl = match[1]; + const path = match[0]; + if (same(decl.cty_path, unbound_class)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: scl.pcl_loc, + _2: val_env, + _3: { + TAG: /* Unbound_class_2 */ 6, + _0: lid.txt } - }), tyl, params); - const cl = rc({ - cl_desc: { - TAG: /* Tcl_ident */ 0, - _0: path, - _1: lid, - _2: tyl - }, - cl_loc: scl.pcl_loc, - cl_type: clty$p, - cl_env: val_env, - cl_attributes: scl.pcl_attributes }); - const match$2 = extract_constraints(clty); - return rc({ - cl_desc: { - TAG: /* Tcl_constraint */ 5, - _0: cl, - _1: undefined, - _2: match$2[0], - _3: match$2[1], - _4: match$2[2] - }, - cl_loc: scl.pcl_loc, - cl_type: clty$p, - cl_env: val_env, - cl_attributes: /* [] */ 0 + } + const tyl = Stdlib__List.map((function (sty) { + return transl_simple_type(val_env, false, sty); + }), cl_str._1); + const match$1 = instance_class(decl.cty_params, decl.cty_type); + const clty = match$1[1]; + const params = match$1[0]; + const clty$p = abbreviate_class_type(path, params, clty); + if (Stdlib__List.length(params) !== Stdlib__List.length(tyl)) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: scl.pcl_loc, + _2: val_env, + _3: { + TAG: /* Parameter_arity_mismatch */ 11, + _0: lid.txt, + _1: Stdlib__List.length(params), + _2: Stdlib__List.length(tyl) + } }); + } + Stdlib__List.iter2((function (cty$p, ty) { + const ty$p = cty$p.ctyp_type; + try { + return unify$2(val_env, ty$p, ty); + } + catch (raw_trace){ + const trace = Caml_js_exceptions.internalToOCamlException(raw_trace); + if (trace.MEL_EXN_ID === Unify) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: cty$p.ctyp_loc, + _2: val_env, + _3: { + TAG: /* Parameter_mismatch */ 12, + _0: trace._1 + } + }); + } + throw new Caml_js_exceptions.MelangeError(trace.MEL_EXN_ID, trace); + } + }), tyl, params); + const cl = rc({ + cl_desc: { + TAG: /* Tcl_ident */ 0, + _0: path, + _1: lid, + _2: tyl + }, + cl_loc: scl.pcl_loc, + cl_type: clty$p, + cl_env: val_env, + cl_attributes: scl.pcl_attributes + }); + const match$2 = extract_constraints(clty); + return rc({ + cl_desc: { + TAG: /* Tcl_constraint */ 5, + _0: cl, + _1: undefined, + _2: match$2[0], + _3: match$2[1], + _4: match$2[2] + }, + cl_loc: scl.pcl_loc, + cl_type: clty$p, + cl_env: val_env, + cl_attributes: /* [] */ 0 + }); case /* Pcl_structure */ 1 : - const match$3 = class_structure(cl_num, false, val_env, met_env, scl.pcl_loc, cl_str._0); - return rc({ - cl_desc: { - TAG: /* Tcl_structure */ 1, - _0: match$3[0] - }, - cl_loc: scl.pcl_loc, - cl_type: { - TAG: /* Cty_signature */ 1, - _0: match$3[1] - }, - cl_env: val_env, - cl_attributes: scl.pcl_attributes - }); + const match$3 = class_structure(cl_num, false, val_env, met_env, scl.pcl_loc, cl_str._0); + return rc({ + cl_desc: { + TAG: /* Tcl_structure */ 1, + _0: match$3[0] + }, + cl_loc: scl.pcl_loc, + cl_type: { + TAG: /* Cty_signature */ 1, + _0: match$3[1] + }, + cl_env: val_env, + cl_attributes: scl.pcl_attributes + }); case /* Pcl_fun */ 2 : - const $$default = cl_str._1; - const l = cl_str._0; - if ($$default !== undefined) { - const loc = $$default.pexp_loc; - const scases_0 = Curry._3(Ast_helper_Exp.$$case, construct(loc, undefined, { + const $$default = cl_str._1; + const l = cl_str._0; + if ($$default !== undefined) { + const loc = $$default.pexp_loc; + const scases_0 = Curry._3(Ast_helper_Exp.$$case, construct(loc, undefined, { + txt: { + TAG: /* Ldot */ 1, + _0: { + TAG: /* Lident */ 0, + _0: "*predef*" + }, + _1: "Some" + }, + loc: none + }, $$var$1(loc, undefined, { + txt: "*sth*", + loc: none + })), undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { + txt: { + TAG: /* Lident */ 0, + _0: "*sth*" + }, + loc: none + })); + const scases_1 = { + hd: Curry._3(Ast_helper_Exp.$$case, construct(loc, undefined, { txt: { TAG: /* Ldot */ 1, _0: { TAG: /* Lident */ 0, _0: "*predef*" }, - _1: "Some" - }, - loc: none - }, $$var$1(loc, undefined, { - txt: "*sth*", - loc: none - })), undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { - txt: { - TAG: /* Lident */ 0, - _0: "*sth*" + _1: "None" }, loc: none - })); - const scases_1 = { - hd: Curry._3(Ast_helper_Exp.$$case, construct(loc, undefined, { - txt: { - TAG: /* Ldot */ 1, - _0: { - TAG: /* Lident */ 0, - _0: "*predef*" - }, - _1: "None" - }, - loc: none - }, undefined), undefined, $$default), - tl: /* [] */ 0 - }; - const scases = { - hd: scases_0, - tl: scases_1 - }; - const smatch = Curry._4(Ast_helper_Exp.match_, loc, undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { + }, undefined), undefined, $$default), + tl: /* [] */ 0 + }; + const scases = { + hd: scases_0, + tl: scases_1 + }; + const smatch = Curry._4(Ast_helper_Exp.match_, loc, undefined, Curry._3(Ast_helper_Exp.ident, loc, undefined, { + txt: { + TAG: /* Lident */ 0, + _0: "*opt*" + }, + loc: none + }), scases); + const sfun = fun_$1(scl.pcl_loc, undefined, l, undefined, $$var$1(loc, undefined, { + txt: "*opt*", + loc: none + }), let_$1(scl.pcl_loc, undefined, /* Nonrecursive */ 0, { + hd: mk$17(undefined, undefined, undefined, undefined, cl_str._2, smatch), + tl: /* [] */ 0 + }, cl_str._3)); + _scl = sfun; + continue; + } + if (principal.contents) { + begin_def(undefined); + } + const match$4 = type_class_arg_pattern(cl_num, val_env, met_env, l, cl_str._2); + const val_env$p = match$4[2]; + const pat = match$4[0]; + if (principal.contents) { + end_def(undefined); + iter_pattern((function (param) { + generalize_structure$1(current_level.contents, param.pat_type); + }), pat); + } + const pv = Stdlib__List.map((function (param) { + const id = param[0]; + const path = { + TAG: /* Pident */ 0, + _0: param[2] + }; + const vd = find_value(path, val_env$p); + return [ + id, + param[1], + { + exp_desc: { + TAG: /* Texp_ident */ 0, + _0: path, + _1: { txt: { TAG: /* Lident */ 0, - _0: "*opt*" + _0: id.name }, loc: none - }), scases); - const sfun = fun_$1(scl.pcl_loc, undefined, l, undefined, $$var$1(loc, undefined, { - txt: "*opt*", - loc: none - }), let_$1(scl.pcl_loc, undefined, /* Nonrecursive */ 0, { - hd: mk$17(undefined, undefined, undefined, undefined, cl_str._2, smatch), - tl: /* [] */ 0 - }, cl_str._3)); - _scl = sfun; - continue; - } - if (principal.contents) { - begin_def(undefined); - } - const match$4 = type_class_arg_pattern(cl_num, val_env, met_env, l, cl_str._2); - const val_env$p = match$4[2]; - const pat = match$4[0]; - if (principal.contents) { - end_def(undefined); - iter_pattern((function (param) { - generalize_structure$1(current_level.contents, param.pat_type); - }), pat); - } - const pv = Stdlib__List.map((function (param) { - const id = param[0]; - const path = { - TAG: /* Pident */ 0, - _0: param[2] - }; - const vd = find_value(path, val_env$p); - return [ - id, - param[1], - { - exp_desc: { - TAG: /* Texp_ident */ 0, - _0: path, - _1: { - txt: { - TAG: /* Lident */ 0, - _0: id.name - }, - loc: none - }, - _2: vd }, - exp_loc: none, - exp_extra: /* [] */ 0, - exp_type: instance(undefined, val_env$p, vd.val_type), - exp_env: val_env$p, - exp_attributes: /* [] */ 0 - } - ]; - }), match$4[1]); - const not_function = function (param) { - switch (param.TAG) { + _2: vd + }, + exp_loc: none, + exp_extra: /* [] */ 0, + exp_type: instance(undefined, val_env$p, vd.val_type), + exp_env: val_env$p, + exp_attributes: /* [] */ 0 + } + ]; + }), match$4[1]); + const not_function = function (param) { + switch (param.TAG) { + case /* Cty_constr */ 0 : + case /* Cty_signature */ 1 : + return true; + case /* Cty_arrow */ 2 : + return false; + + } + }; + const partial = check_partial$1(undefined, val_env, pat.pat_type)(pat.pat_loc, { + hd: { + c_lhs: pat, + c_guard: undefined, + c_rhs: { + exp_desc: { + TAG: /* Texp_constant */ 1, + _0: { + TAG: /* Const_int */ 0, + _0: 1 + } + }, + exp_loc: none, + exp_extra: /* [] */ 0, + exp_type: none$2, + exp_env: empty, + exp_attributes: /* [] */ 0 + } + }, + tl: /* [] */ 0 + }); + raise_nongen_level(undefined); + const cl$1 = class_expr(cl_num, val_env$p, match$4[3], cl_str._3); + end_def(undefined); + if (is_optional(l) && not_function(cl$1.cl_type)) { + prerr_warning(pat.pat_loc, /* Unerasable_optional_argument */ 8); + } + return rc({ + cl_desc: { + TAG: /* Tcl_fun */ 2, + _0: l, + _1: pat, + _2: pv, + _3: cl$1, + _4: partial + }, + cl_loc: scl.pcl_loc, + cl_type: { + TAG: /* Cty_arrow */ 2, + _0: l, + _1: instance_def(pat.pat_type), + _2: cl$1.cl_type + }, + cl_env: val_env, + cl_attributes: scl.pcl_attributes + }); + case /* Pcl_apply */ 3 : + const sargs = cl_str._1; + if (Caml_obj.caml_equal(sargs, /* [] */ 0)) { + ill_formed_ast(scl.pcl_loc, "Function application with no argument."); + } + if (principal.contents) { + begin_def(undefined); + } + const cl$2 = class_expr(cl_num, val_env, met_env, cl_str._0); + if (principal.contents) { + end_def(undefined); + generalize_class_type(generalize_structure$2, cl$2.cl_type); + } + const nonopt_labels = function (_ls, _ty_fun) { + while (true) { + const ty_fun = _ty_fun; + const ls = _ls; + switch (ty_fun.TAG) { case /* Cty_constr */ 0 : case /* Cty_signature */ 1 : - return true; + return ls; case /* Cty_arrow */ 2 : - return false; + const ty_res = ty_fun._2; + const l = ty_fun._0; + if (is_optional(l)) { + _ty_fun = ty_res; + continue; + } + _ty_fun = ty_res; + _ls = { + hd: l, + tl: ls + }; + continue; } }; - const partial = check_partial$1(undefined, val_env, pat.pat_type)(pat.pat_loc, { - hd: { - c_lhs: pat, - c_guard: undefined, - c_rhs: { - exp_desc: { - TAG: /* Texp_constant */ 1, - _0: { - TAG: /* Const_int */ 0, - _0: 1 - } - }, - exp_loc: none, - exp_extra: /* [] */ 0, - exp_type: none$2, - exp_env: empty, - exp_attributes: /* [] */ 0 - } - }, - tl: /* [] */ 0 - }); - raise_nongen_level(undefined); - const cl$1 = class_expr(cl_num, val_env$p, match$4[3], cl_str._3); - end_def(undefined); - if (is_optional(l) && not_function(cl$1.cl_type)) { - prerr_warning(pat.pat_loc, /* Unerasable_optional_argument */ 8); - } - return rc({ - cl_desc: { - TAG: /* Tcl_fun */ 2, - _0: l, - _1: pat, - _2: pv, - _3: cl$1, - _4: partial - }, - cl_loc: scl.pcl_loc, - cl_type: { - TAG: /* Cty_arrow */ 2, - _0: l, - _1: instance_def(pat.pat_type), - _2: cl$1.cl_type - }, - cl_env: val_env, - cl_attributes: scl.pcl_attributes - }); - case /* Pcl_apply */ 3 : - const sargs = cl_str._1; - if (Caml_obj.caml_equal(sargs, /* [] */ 0)) { - ill_formed_ast(scl.pcl_loc, "Function application with no argument."); - } - if (principal.contents) { - begin_def(undefined); - } - const cl$2 = class_expr(cl_num, val_env, met_env, cl_str._0); - if (principal.contents) { - end_def(undefined); - generalize_class_type(generalize_structure$2, cl$2.cl_type); - } - const nonopt_labels = function (_ls, _ty_fun) { - while (true) { - const ty_fun = _ty_fun; - const ls = _ls; - switch (ty_fun.TAG) { - case /* Cty_constr */ 0 : - case /* Cty_signature */ 1 : - return ls; - case /* Cty_arrow */ 2 : - const ty_res = ty_fun._2; - const l = ty_fun._0; - if (is_optional(l)) { - _ty_fun = ty_res; - continue; - } - _ty_fun = ty_res; - _ls = { - hd: l, - tl: ls - }; - continue; - - } - }; - }; - let ignore_labels = true; - if (!classic.contents) { - const labels = nonopt_labels(/* [] */ 0, cl$2.cl_type); - ignore_labels = Stdlib__List.length(labels) === Stdlib__List.length(sargs) && Stdlib__List.for_all((function (param) { - return param[0] === ""; - }), sargs) && Stdlib__List.exists((function (l) { - return l !== ""; - }), labels) && (prerr_warning(cl$2.cl_loc, /* Labels_omitted */ 3), true); - } - const type_args = function (_args, _omitted, _ty_fun, _ty_fun0, _sargs, _more_sargs) { - while (true) { - const more_sargs = _more_sargs; - const sargs = _sargs; - const ty_fun0 = _ty_fun0; - const ty_fun = _ty_fun; - const omitted = _omitted; - const args = _args; - switch (ty_fun.TAG) { - case /* Cty_constr */ 0 : - case /* Cty_signature */ 1 : + }; + let ignore_labels = true; + if (!classic.contents) { + const labels = nonopt_labels(/* [] */ 0, cl$2.cl_type); + ignore_labels = Stdlib__List.length(labels) === Stdlib__List.length(sargs) && Stdlib__List.for_all((function (param) { + return param[0] === ""; + }), sargs) && Stdlib__List.exists((function (l) { + return l !== ""; + }), labels) && (prerr_warning(cl$2.cl_loc, /* Labels_omitted */ 3), true); + } + const type_args = function (_args, _omitted, _ty_fun, _ty_fun0, _sargs, _more_sargs) { + while (true) { + const more_sargs = _more_sargs; + const sargs = _sargs; + const ty_fun0 = _ty_fun0; + const ty_fun = _ty_fun; + const omitted = _omitted; + const args = _args; + switch (ty_fun.TAG) { + case /* Cty_constr */ 0 : + case /* Cty_signature */ 1 : + break; + case /* Cty_arrow */ 2 : + const ty = ty_fun._1; + const l = ty_fun._0; + switch (ty_fun0.TAG) { + case /* Cty_constr */ 0 : + case /* Cty_signature */ 1 : break; - case /* Cty_arrow */ 2 : - const ty = ty_fun._1; - const l = ty_fun._0; - switch (ty_fun0.TAG) { - case /* Cty_constr */ 0 : - case /* Cty_signature */ 1 : - break; - case /* Cty_arrow */ 2 : - if (Caml_obj.caml_notequal(sargs, /* [] */ 0) || Caml_obj.caml_notequal(more_sargs, /* [] */ 0)) { - const ty0 = ty_fun0._1; - const name = label_name(l); - const optional = is_optional(l) ? /* Optional */ 1 : /* Required */ 0; - let match; - if (ignore_labels && !is_optional(l)) { - if (sargs) { - const match$1 = sargs.hd; - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: match$1[1].pexp_loc, - _2: val_env, - _3: { - TAG: /* Apply_wrong_label */ 4, - _0: match$1[0] - } - }); - } - if (more_sargs) { - const match$2 = more_sargs.hd; - const sarg0 = match$2[1]; - const l$p = match$2[0]; - if (l !== l$p && l$p !== "") { - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: sarg0.pexp_loc, - _2: val_env, - _3: { - TAG: /* Apply_wrong_label */ 4, - _0: l$p - } - }); - } - match = [ - /* [] */ 0, - more_sargs.tl, - type_argument(val_env, sarg0, ty, ty0) - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 49036, - 20 - ] - }); - } - } else { - try { - let match$3; - try { - const match$4 = extract_label_aux(/* [] */ 0, name, sargs); - match$3 = [ - match$4[0], - match$4[1], - Stdlib.$at(match$4[2], match$4[3]), - more_sargs - ]; + case /* Cty_arrow */ 2 : + if (Caml_obj.caml_notequal(sargs, /* [] */ 0) || Caml_obj.caml_notequal(more_sargs, /* [] */ 0)) { + const ty0 = ty_fun0._1; + const name = label_name(l); + const optional = is_optional(l) ? /* Optional */ 1 : /* Required */ 0; + let match; + if (ignore_labels && !is_optional(l)) { + if (sargs) { + const match$1 = sargs.hd; + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: match$1[1].pexp_loc, + _2: val_env, + _3: { + TAG: /* Apply_wrong_label */ 4, + _0: match$1[0] } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - const match$5 = extract_label_aux(/* [] */ 0, name, more_sargs); - match$3 = [ - match$5[0], - match$5[1], - Stdlib.$at(sargs, match$5[2]), - match$5[3] - ]; - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + }); + } + if (more_sargs) { + const match$2 = more_sargs.hd; + const sarg0 = match$2[1]; + const l$p = match$2[0]; + if (l !== l$p && l$p !== "") { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: sarg0.pexp_loc, + _2: val_env, + _3: { + TAG: /* Apply_wrong_label */ 4, + _0: l$p } - } - const sarg0$1 = match$3[1]; - const l$p$1 = match$3[0]; - if (optional === /* Required */ 0 && is_optional(l$p$1)) { - prerr_warning(sarg0$1.pexp_loc, { - TAG: /* Nonoptional_label */ 26, - _0: l - }); - } - let tmp; - if (optional === /* Required */ 0 || is_optional(l$p$1)) { - tmp = type_argument(val_env, sarg0$1, ty, ty0); - } else { - const ty$p = extract_option_type(val_env, ty); - const ty0$p = extract_option_type(val_env, ty0); - const arg = type_argument(val_env, sarg0$1, ty$p, ty0$p); - tmp = option_some(arg); - } - match = [ - match$3[2], - match$3[3], - tmp - ]; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - match = [ - sargs, - more_sargs, - is_optional(l) && (Stdlib__List.mem_assoc("", sargs) || Stdlib__List.mem_assoc("", more_sargs)) ? option_none(ty0, none) : undefined - ]; - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } - } + }); + } + match = [ + /* [] */ 0, + more_sargs.tl, + type_argument(val_env, sarg0, ty, ty0) + ]; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 49036, + 20 + ] + }); + } + } else { + try { + let match$3; + try { + const match$4 = extract_label_aux(/* [] */ 0, name, sargs); + match$3 = [ + match$4[0], + match$4[1], + Stdlib.$at(match$4[2], match$4[3]), + more_sargs + ]; + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + const match$5 = extract_label_aux(/* [] */ 0, name, more_sargs); + match$3 = [ + match$5[0], + match$5[1], + Stdlib.$at(sargs, match$5[2]), + match$5[3] + ]; + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const arg$1 = match[2]; - const omitted$1 = arg$1 === undefined ? ({ - hd: [ - l, - ty0 - ], - tl: omitted - }) : omitted; - _more_sargs = match[1]; - _sargs = match[0]; - _ty_fun0 = ty_fun0._2; - _ty_fun = ty_fun._2; - _omitted = omitted$1; - _args = { - hd: [ - l, - arg$1, - optional - ], - tl: args - }; - continue; } - break; - + const sarg0$1 = match$3[1]; + const l$p$1 = match$3[0]; + if (optional === /* Required */ 0 && is_optional(l$p$1)) { + prerr_warning(sarg0$1.pexp_loc, { + TAG: /* Nonoptional_label */ 26, + _0: l + }); + } + let tmp; + if (optional === /* Required */ 0 || is_optional(l$p$1)) { + tmp = type_argument(val_env, sarg0$1, ty, ty0); + } else { + const ty$p = extract_option_type(val_env, ty); + const ty0$p = extract_option_type(val_env, ty0); + const arg = type_argument(val_env, sarg0$1, ty$p, ty0$p); + tmp = option_some(arg); + } + match = [ + match$3[2], + match$3[3], + tmp + ]; + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { + match = [ + sargs, + more_sargs, + is_optional(l) && (Stdlib__List.mem_assoc("", sargs) || Stdlib__List.mem_assoc("", more_sargs)) ? option_none(ty0, none) : undefined + ]; + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + } + } + const arg$1 = match[2]; + const omitted$1 = arg$1 === undefined ? ({ + hd: [ + l, + ty0 + ], + tl: omitted + }) : omitted; + _more_sargs = match[1]; + _sargs = match[0]; + _ty_fun0 = ty_fun0._2; + _ty_fun = ty_fun._2; + _omitted = omitted$1; + _args = { + hd: [ + l, + arg$1, + optional + ], + tl: args + }; + continue; } break; - - } - const match$6 = Stdlib.$at(sargs, more_sargs); - if (!match$6) { - return [ - Stdlib__List.rev(args), - Stdlib__List.fold_left((function (ty_fun, param) { - return { - TAG: /* Cty_arrow */ 2, - _0: param[0], - _1: param[1], - _2: ty_fun - }; - }), ty_fun0, omitted) - ]; - } - if (Caml_obj.caml_notequal(omitted, /* [] */ 0)) { - const match$7 = match$6.hd; - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: match$7[1].pexp_loc, - _2: val_env, - _3: { - TAG: /* Apply_wrong_label */ 4, - _0: match$7[0] - } - }); - } + + } + break; + + } + const match$6 = Stdlib.$at(sargs, more_sargs); + if (!match$6) { + return [ + Stdlib__List.rev(args), + Stdlib__List.fold_left((function (ty_fun, param) { + return { + TAG: /* Cty_arrow */ 2, + _0: param[0], + _1: param[1], + _2: ty_fun + }; + }), ty_fun0, omitted) + ]; + } + if (Caml_obj.caml_notequal(omitted, /* [] */ 0)) { + const match$7 = match$6.hd; throw new Caml_js_exceptions.MelangeError($$Error$9, { MEL_EXN_ID: $$Error$9, - _1: cl$2.cl_loc, + _1: match$7[1].pexp_loc, _2: val_env, _3: { - TAG: /* Cannot_apply */ 3, - _0: cl$2.cl_type + TAG: /* Apply_wrong_label */ 4, + _0: match$7[0] } }); - }; - }; - const match$5 = instance_class(/* [] */ 0, cl$2.cl_type); - const ty_fun0 = match$5[1]; - const match$6 = ignore_labels ? type_args(/* [] */ 0, /* [] */ 0, cl$2.cl_type, ty_fun0, /* [] */ 0, sargs) : type_args(/* [] */ 0, /* [] */ 0, cl$2.cl_type, ty_fun0, sargs, /* [] */ 0); - return rc({ - cl_desc: { - TAG: /* Tcl_apply */ 3, - _0: cl$2, - _1: match$6[0] - }, - cl_loc: scl.pcl_loc, - cl_type: match$6[1], - cl_env: val_env, - cl_attributes: scl.pcl_attributes - }); - case /* Pcl_let */ 4 : - const rec_flag = cl_str._0; - let match$7; - try { - match$7 = type_let$1(val_env, rec_flag, cl_str._1, undefined); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Unify) { - const match$8 = exn._1; - if (match$8) { - if (match$8.tl) { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - throw new Caml_js_exceptions.MelangeError($$Error$9, { - MEL_EXN_ID: $$Error$9, - _1: scl.pcl_loc, - _2: val_env, - _3: { - TAG: /* Make_nongen_seltype */ 17, - _0: match$8.hd[0] - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - const val_env$1 = match$7[1]; - const defs = match$7[0]; - const match$9 = Stdlib__List.fold_right((function (param, param$1) { - const id = param[0]; - const path = { - TAG: /* Pident */ 0, - _0: id - }; - const vd = find_value(path, val_env$1); - begin_def(undefined); - const expr_exp_desc = { - TAG: /* Texp_ident */ 0, - _0: path, - _1: { - txt: { - TAG: /* Lident */ 0, - _0: id.name - }, - loc: none - }, - _2: vd - }; - const expr_exp_type = instance(undefined, val_env$1, vd.val_type); - const expr = { - exp_desc: expr_exp_desc, - exp_loc: none, - exp_extra: /* [] */ 0, - exp_type: expr_exp_type, - exp_env: val_env$1, - exp_attributes: /* [] */ 0 - }; - end_def(undefined); - iter_generalize$1({ - contents: /* [] */ 0 - }, expr_exp_type); - const desc_val_type = expr_exp_type; - const desc_val_kind = { - TAG: /* Val_ivar */ 1, - _0: /* Immutable */ 0, - _1: cl_num - }; - const desc_val_loc = vd.val_loc; - const desc = { - val_type: desc_val_type, - val_kind: desc_val_kind, - val_loc: desc_val_loc, - val_attributes: /* [] */ 0 - }; - const id$p = create(id.name); - return [ - { - hd: [ - id$p, - param[1], - expr - ], - tl: param$1[0] - }, - add_value(undefined, id$p, desc, param$1[1]) - ]; - }), Stdlib__List.rev(rev_let_bound_idents_with_loc(defs)), [ - /* [] */ 0, - met_env - ]); - const cl$3 = class_expr(cl_num, val_env$1, match$9[1], cl_str._2); - return rc({ - cl_desc: { - TAG: /* Tcl_let */ 4, - _0: rec_flag, - _1: defs, - _2: match$9[0], - _3: cl$3 - }, - cl_loc: scl.pcl_loc, - cl_type: cl$3.cl_type, - cl_env: val_env$1, - cl_attributes: scl.pcl_attributes - }); - case /* Pcl_constraint */ 5 : - begin_class_def(undefined); - const context = narrow(undefined); - const cl$4 = class_expr(cl_num, val_env, met_env, cl_str._0); - widen(context); - const context$1 = narrow(undefined); - const clty$1 = class_type$4(val_env, cl_str._1); - widen(context$1); - end_def(undefined); - limited_generalize$1(row_variable(repr(signature_of_class_type(cl$4.cl_type).csig_self)), cl$4.cl_type); - limited_generalize$1(row_variable(repr(signature_of_class_type(clty$1.cltyp_type).csig_self)), clty$1.cltyp_type); - const error = class_types(val_env, cl$4.cl_type, clty$1.cltyp_type); - if (error) { throw new Caml_js_exceptions.MelangeError($$Error$9, { MEL_EXN_ID: $$Error$9, - _1: cl$4.cl_loc, + _1: cl$2.cl_loc, _2: val_env, _3: { - TAG: /* Class_match_failure */ 14, - _0: error + TAG: /* Cannot_apply */ 3, + _0: cl$2.cl_type } }); + }; + }; + const match$5 = instance_class(/* [] */ 0, cl$2.cl_type); + const ty_fun0 = match$5[1]; + const match$6 = ignore_labels ? type_args(/* [] */ 0, /* [] */ 0, cl$2.cl_type, ty_fun0, /* [] */ 0, sargs) : type_args(/* [] */ 0, /* [] */ 0, cl$2.cl_type, ty_fun0, sargs, /* [] */ 0); + return rc({ + cl_desc: { + TAG: /* Tcl_apply */ 3, + _0: cl$2, + _1: match$6[0] + }, + cl_loc: scl.pcl_loc, + cl_type: match$6[1], + cl_env: val_env, + cl_attributes: scl.pcl_attributes + }); + case /* Pcl_let */ 4 : + const rec_flag = cl_str._0; + let match$7; + try { + match$7 = type_let$1(val_env, rec_flag, cl_str._1, undefined); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Unify) { + const match$8 = exn._1; + if (match$8) { + if (match$8.tl) { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: scl.pcl_loc, + _2: val_env, + _3: { + TAG: /* Make_nongen_seltype */ 17, + _0: match$8.hd[0] + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - const match$10 = extract_constraints(clty$1.cltyp_type); - return rc({ - cl_desc: { - TAG: /* Tcl_constraint */ 5, - _0: cl$4, - _1: clty$1, - _2: match$10[0], - _3: match$10[1], - _4: match$10[2] + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + const val_env$1 = match$7[1]; + const defs = match$7[0]; + const match$9 = Stdlib__List.fold_right((function (param, param$1) { + const id = param[0]; + const path = { + TAG: /* Pident */ 0, + _0: id + }; + const vd = find_value(path, val_env$1); + begin_def(undefined); + const expr_exp_desc = { + TAG: /* Texp_ident */ 0, + _0: path, + _1: { + txt: { + TAG: /* Lident */ 0, + _0: id.name + }, + loc: none + }, + _2: vd + }; + const expr_exp_type = instance(undefined, val_env$1, vd.val_type); + const expr = { + exp_desc: expr_exp_desc, + exp_loc: none, + exp_extra: /* [] */ 0, + exp_type: expr_exp_type, + exp_env: val_env$1, + exp_attributes: /* [] */ 0 + }; + end_def(undefined); + iter_generalize$1({ + contents: /* [] */ 0 + }, expr_exp_type); + const desc_val_type = expr_exp_type; + const desc_val_kind = { + TAG: /* Val_ivar */ 1, + _0: /* Immutable */ 0, + _1: cl_num + }; + const desc_val_loc = vd.val_loc; + const desc = { + val_type: desc_val_type, + val_kind: desc_val_kind, + val_loc: desc_val_loc, + val_attributes: /* [] */ 0 + }; + const id$p = create(id.name); + return [ + { + hd: [ + id$p, + param[1], + expr + ], + tl: param$1[0] }, - cl_loc: scl.pcl_loc, - cl_type: instance_class(/* [] */ 0, clty$1.cltyp_type)[1], - cl_env: val_env, - cl_attributes: scl.pcl_attributes + add_value(undefined, id$p, desc, param$1[1]) + ]; + }), Stdlib__List.rev(rev_let_bound_idents_with_loc(defs)), [ + /* [] */ 0, + met_env + ]); + const cl$3 = class_expr(cl_num, val_env$1, match$9[1], cl_str._2); + return rc({ + cl_desc: { + TAG: /* Tcl_let */ 4, + _0: rec_flag, + _1: defs, + _2: match$9[0], + _3: cl$3 + }, + cl_loc: scl.pcl_loc, + cl_type: cl$3.cl_type, + cl_env: val_env$1, + cl_attributes: scl.pcl_attributes + }); + case /* Pcl_constraint */ 5 : + begin_class_def(undefined); + const context = narrow(undefined); + const cl$4 = class_expr(cl_num, val_env, met_env, cl_str._0); + widen(context); + const context$1 = narrow(undefined); + const clty$1 = class_type$4(val_env, cl_str._1); + widen(context$1); + end_def(undefined); + limited_generalize$1(row_variable(repr(signature_of_class_type(cl$4.cl_type).csig_self)), cl$4.cl_type); + limited_generalize$1(row_variable(repr(signature_of_class_type(clty$1.cltyp_type).csig_self)), clty$1.cltyp_type); + const error = class_types(val_env, cl$4.cl_type, clty$1.cltyp_type); + if (error) { + throw new Caml_js_exceptions.MelangeError($$Error$9, { + MEL_EXN_ID: $$Error$9, + _1: cl$4.cl_loc, + _2: val_env, + _3: { + TAG: /* Class_match_failure */ 14, + _0: error + } }); + } + const match$10 = extract_constraints(clty$1.cltyp_type); + return rc({ + cl_desc: { + TAG: /* Tcl_constraint */ 5, + _0: cl$4, + _1: clty$1, + _2: match$10[0], + _3: match$10[1], + _4: match$10[2] + }, + cl_loc: scl.pcl_loc, + cl_type: instance_class(/* [] */ 0, clty$1.cltyp_type)[1], + cl_env: val_env, + cl_attributes: scl.pcl_attributes + }); case /* Pcl_extension */ 6 : - throw new Caml_js_exceptions.MelangeError(Error_forward$2, { - MEL_EXN_ID: Error_forward$2, - _1: error_of_extension(cl_str._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$2, { + MEL_EXN_ID: Error_forward$2, + _1: error_of_extension(cl_str._0) + }); } }; @@ -79737,23 +79737,23 @@ function approx_declaration(_cl) { const match = cl.pcl_desc; switch (match.TAG) { case /* Pcl_fun */ 2 : - const l = match._0; - const arg = is_optional(l) ? instance_def(var_option) : newvar(undefined, undefined); - const desc_2 = approx_declaration(match._3); - const desc = { - TAG: /* Tarrow */ 1, - _0: l, - _1: arg, - _2: desc_2, - _3: /* Cok */ 0 - }; - return newty2(current_level.contents, desc); + const l = match._0; + const arg = is_optional(l) ? instance_def(var_option) : newvar(undefined, undefined); + const desc_2 = approx_declaration(match._3); + const desc = { + TAG: /* Tarrow */ 1, + _0: l, + _1: arg, + _2: desc_2, + _3: /* Cok */ 0 + }; + return newty2(current_level.contents, desc); case /* Pcl_let */ 4 : - _cl = match._2; - continue; + _cl = match._2; + continue; case /* Pcl_constraint */ 5 : - _cl = match._0; - continue; + _cl = match._0; + continue; default: return newvar(undefined, undefined); } @@ -80552,35 +80552,35 @@ function unify_parents_struct(env, ty, st) { const st = cl.cl_desc; switch (st.TAG) { case /* Tcl_ident */ 0 : - try { - const decl = find_class(st._0, env); - const match$1 = find_cltype_for_path(env, decl.cty_path); - return unify$2(env, ty, instance(undefined, env, match$1[1])); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return; - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 49658, - 15 - ] - }); + try { + const decl = find_class(st._0, env); + const match$1 = find_cltype_for_path(env, decl.cty_path); + return unify$2(env, ty, instance(undefined, env, match$1[1])); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return; } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 49658, + 15 + ] + }); + } case /* Tcl_structure */ 1 : - return unify_parents_struct(env, ty, st._0); + return unify_parents_struct(env, ty, st._0); case /* Tcl_fun */ 2 : case /* Tcl_let */ 4 : - _cl = st._3; - continue; + _cl = st._3; + continue; case /* Tcl_apply */ 3 : case /* Tcl_constraint */ 5 : - _cl = st._0; - continue; + _cl = st._0; + continue; } }; @@ -80654,525 +80654,236 @@ register_error_of_exn(function (err) { } switch (param$1.TAG) { case /* Unconsistent_constraint */ 0 : - Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The class constraints are not consistent.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: /* End_of_format */ 0 - } - }, - _1: "The class constraints are not consistent.@." - }); - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Type", - _1: /* End_of_format */ 0 - }, - _1: "Type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "is not compatible with type", - _1: /* End_of_format */ 0 - }, - _1: "is not compatible with type" - }); - })); - case /* Field_type_mismatch */ 1 : - const m = param$1._1; - const k = param$1._0; - return report_unification_error(param, env, undefined, param$1._2, (function (ppf) { - Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "has type", - _1: /* End_of_format */ 0 - } - } - } - } - } - }, - _1: "The %s %s@ has type" - }), k, m); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "but is expected to have type" - }); - })); - case /* Structure_expected */ 2 : - return Curry._2(Stdlib__Format.fprintf(param)({ + Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The class constraints are not consistent.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, + _1: /* End_of_format */ 0 + } + }, + _1: "The class constraints are not consistent.@." + }); + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This class expression is not a class structure; it has type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } + TAG: /* String_literal */ 11, + _0: "Type", + _1: /* End_of_format */ 0 }, - _1: "@[This class expression is not a class structure; it has type@ %a@]" - }), class_type$2, param$1._0); - case /* Cannot_apply */ 3 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This class expression is not a class function, it cannot be applied", - _1: /* End_of_format */ 0 - }, - _1: "This class expression is not a class function, it cannot be applied" - }); - case /* Apply_wrong_label */ 4 : - const mark_label = function (l) { - if (l === "") { - return "out label"; - } else { - return Curry._1(Stdlib__Format.sprintf({ + _1: "Type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "is not compatible with type", + _1: /* End_of_format */ 0 + }, + _1: "is not compatible with type" + }); + })); + case /* Field_type_mismatch */ 1 : + const m = param$1._1; + const k = param$1._0; + return report_unification_error(param, env, undefined, param$1._2, (function (ppf) { + Curry._2(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: " label ~", + _0: "The ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "has type", + _1: /* End_of_format */ 0 + } + } + } + } } }, - _1: " label ~%s" - }), l); - } - }; - return Curry._1(Stdlib__Format.fprintf(param)({ + _1: "The %s %s@ has type" + }), k, m); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "This argument cannot be applied with", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + _0: "but is expected to have type", + _1: /* End_of_format */ 0 }, - _1: "This argument cannot be applied with%s" - }), mark_label(param$1._0)); - case /* Pattern_type_clash */ 5 : - const ty = param$1._0; - reset(undefined); - mark_loops(ty); - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "but is expected to have type" + }); + })); + case /* Structure_expected */ 2 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[%s@ %a@]" - }), "This pattern cannot match self: it only matches values of type", type_expr$1, ty); - case /* Unbound_class_2 */ 6 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "This class expression is not a class structure; it has type", _1: { - TAG: /* String_literal */ 11, - _0: "The class", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is not yet completely defined", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[The class@ %a@ is not yet completely defined@]" - }), longident, param$1._0); - case /* Unbound_class_type_2 */ 7 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, + } + }, + _1: "@[This class expression is not a class structure; it has type@ %a@]" + }), class_type$2, param$1._0); + case /* Cannot_apply */ 3 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This class expression is not a class function, it cannot be applied", + _1: /* End_of_format */ 0 + }, + _1: "This class expression is not a class function, it cannot be applied" + }); + case /* Apply_wrong_label */ 4 : + const mark_label = function (l) { + if (l === "") { + return "out label"; + } else { + return Curry._1(Stdlib__Format.sprintf({ + TAG: /* Format */ 0, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { TAG: /* String_literal */ 11, - _0: "The class type", + _0: " label ~", _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is not yet completely defined", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } - } - }, - _1: "@[The class type@ %a@ is not yet completely defined@]" - }), longident, param$1._0); - case /* Abbrev_type_clash */ 8 : - const expected = param$1._2; - const actual = param$1._1; - const abbrev = param$1._0; - reset_and_mark_loops_list({ - hd: abbrev, - tl: { - hd: actual, - tl: { - hd: expected, - tl: /* [] */ 0 - } - } - }); - return Curry._6(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + }, + _1: " label ~%s" + }), l); + } + }; + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This argument cannot be applied with", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "This argument cannot be applied with%s" + }), mark_label(param$1._0)); + case /* Pattern_type_clash */ 5 : + const ty = param$1._0; + reset(undefined); + mark_loops(ty); + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "The abbreviation", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "expands to type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "but is used with type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[The abbreviation@ %a@ expands to type@ %a@ but is used with type@ %a@]" - }), type_expr$1, abbrev, type_expr$1, actual, type_expr$1, expected); - case /* Constructor_type_mismatch */ 9 : - const c = param$1._0; - return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The expression \"new ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "\" has type", - _1: /* End_of_format */ 0 - } - } - }, - _1: "The expression \"new %s\" has type" - }), c); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, + } + }, + _1: "@[%s@ %a@]" + }), "This pattern cannot match self: it only matches values of type", type_expr$1, ty); + case /* Unbound_class_2 */ 6 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* String_literal */ 11, - _0: "but is used with type", - _1: /* End_of_format */ 0 - }, - _1: "but is used with type" - }); - })); - case /* Virtual_class */ 10 : - const vals = param$1._3; - const mets = param$1._2; - const imm = param$1._1; - const cl = param$1._0; - const print_mets = function (ppf, mets) { - Stdlib__List.iter((function (met) { - Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "@ %s" - }), met); - }), mets); - }; - const missings = mets ? ( - vals ? "methods and variables" : "methods" - ) : "variables"; - const print_msg = function (ppf) { - if (imm) { - return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This object has virtual ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "This object has virtual %s" - }), missings); - } else if (cl) { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This class should be virtual", - _1: /* End_of_format */ 0 + _0: /* End_of_format */ 0, + _1: "" + } }, - _1: "This class should be virtual" - }); - } else { - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* String_literal */ 11, - _0: "This class type should be virtual", - _1: /* End_of_format */ 0 - }, - _1: "This class type should be virtual" - }); - } - }; - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _0: "The class", _1: { - TAG: /* Theta */ 16, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, @@ -81180,67 +80891,46 @@ register_error_of_exn(function (err) { _1: 1, _2: 0 }, - _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "<2>", - _1: /* End_of_format */ 0 - }, - _1: "<2>" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "is not yet completely defined", _1: { - TAG: /* String_literal */ 11, - _0: "The following ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " are undefined :", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[%t.@ @[<2>The following %s are undefined :%a@]@]" - }), print_msg, missings, print_mets, Stdlib.$at(mets, vals)); - case /* Parameter_arity_mismatch */ 11 : - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The class@ %a@ is not yet completely defined@]" + }), longident, param$1._0); + case /* Unbound_class_type_2 */ 7 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The class type", _1: { - TAG: /* String_literal */ 11, - _0: "The class constructor ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* Alpha */ 15, _0: { @@ -81253,99 +80943,57 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "expects ", + _0: "is not yet completely defined", _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " type argument(s),", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "but is here applied to ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: " type argument(s)", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } - }, - _1: "@[The class constructor %a@ expects %i type argument(s),@ but is here applied to %i type argument(s)@]" - }), longident, param$1._0, param$1._1, param$1._2); - case /* Parameter_mismatch */ 12 : - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "The type parameter", - _1: /* End_of_format */ 0 - }, - _1: "The type parameter" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "does not meet its constraint: it should be", - _1: /* End_of_format */ 0 - }, - _1: "does not meet its constraint: it should be" - }); - })); - case /* Bad_parameters */ 13 : - const cstrs = param$1._2; - const params = param$1._1; - reset_and_mark_loops_list({ - hd: params, + } + }, + _1: "@[The class type@ %a@ is not yet completely defined@]" + }), longident, param$1._0); + case /* Abbrev_type_clash */ 8 : + const expected = param$1._2; + const actual = param$1._1; + const abbrev = param$1._0; + reset_and_mark_loops_list({ + hd: abbrev, + tl: { + hd: actual, tl: { - hd: cstrs, + hd: expected, tl: /* [] */ 0 } - }); - return Curry._6(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }); + return Curry._6(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The abbreviation", _1: { - TAG: /* String_literal */ 11, - _0: "The abbreviation ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* Alpha */ 15, _0: { @@ -81358,7 +81006,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "is used with parameters", + _0: "expands to type", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -81379,7 +81027,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "wich are incompatible with constraints", + _0: "but is used with type", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -81405,108 +81053,165 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The abbreviation %a@ is used with parameters@ %a@ wich are incompatible with constraints@ %a@]" - }), ident$3, param$1._0, type_expr$1, params, type_expr$1, cstrs); - case /* Class_match_failure */ 14 : - return report_error$3(param, param$1._0); - case /* Unbound_val */ 15 : - return Curry._1(Stdlib__Format.fprintf(param)({ + } + }, + _1: "@[The abbreviation@ %a@ expands to type@ %a@ but is used with type@ %a@]" + }), type_expr$1, abbrev, type_expr$1, actual, type_expr$1, expected); + case /* Constructor_type_mismatch */ 9 : + const c = param$1._0; + return report_unification_error(param, env, undefined, param$1._1, (function (ppf) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The expression \"new ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "\" has type", + _1: /* End_of_format */ 0 + } + } + }, + _1: "The expression \"new %s\" has type" + }), c); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Unbound instance variable ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + _0: "but is used with type", + _1: /* End_of_format */ 0 }, - _1: "Unbound instance variable %s" - }), param$1._0); - case /* Unbound_type_var */ 16 : - const print_common = function (ppf, kind, ty0, real, lab, ty) { - const ty1 = real ? ty0 : newty2(100000000, { - TAG: /* Tobject */ 4, - _0: ty0, - _1: { - contents: undefined - } + _1: "but is used with type" }); - mark_loops(ty1); - Curry._6(Stdlib__Format.fprintf(ppf)({ + })); + case /* Virtual_class */ 10 : + const vals = param$1._3; + const mets = param$1._2; + const imm = param$1._1; + const cl = param$1._0; + const print_mets = function (ppf, mets) { + Stdlib__List.iter((function (met) { + Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "@ %s" + }), met); + }), mets); + }; + const missings = mets ? ( + vals ? "methods and variables" : "methods" + ) : "variables"; + const print_msg = function (ppf) { + if (imm) { + return Curry._1(Stdlib__Format.fprintf(ppf)({ TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "The ", + _0: "This object has virtual ", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "This object has virtual %s" + }), missings); + } else if (cl) { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This class should be virtual", + _1: /* End_of_format */ 0 + }, + _1: "This class should be virtual" + }); + } else { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This class type should be virtual", + _1: /* End_of_format */ 0 + }, + _1: "This class type should be virtual" + }); + } + }; + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* Theta */ 16, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 + TAG: /* String_literal */ 11, + _0: "<2>", + _1: /* End_of_format */ 0 }, + _1: "<2>" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The following ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "has type", + _0: " are undefined :", _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "where", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "is unbound", - _1: /* End_of_format */ 0 - } - } - } - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } @@ -81515,87 +81220,291 @@ register_error_of_exn(function (err) { } } } - }, - _1: "The %s %s@ has type@;<1 2>%a@ where@ %a@ is unbound" - }), kind, lab, type_expr$1, ty, type_expr$1, ty0); - }; - const print_reason = function (ppf, param) { - if (param.TAG === /* CC_Method */ 0) { - return print_common(ppf, "method", param._0, param._1, param._2, param._3); - } else { - return print_common(ppf, "instance variable", param._0, param._1, param._2, param._3); - } - }; - reset(undefined); - return Curry._3(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + } + }, + _1: "@[%t.@ @[<2>The following %s are undefined :%a@]@]" + }), print_msg, missings, print_mets, Stdlib.$at(mets, vals)); + case /* Parameter_arity_mismatch */ 11 : + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The class constructor ", + _1: { + TAG: /* Alpha */ 15, _0: { - TAG: /* Format */ 0, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, - _1: "" + _1: { + TAG: /* String_literal */ 11, + _0: "expects ", + _1: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " type argument(s),", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "but is here applied to ", + _1: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: " type argument(s)", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } } - }, + } + } + }, + _1: "@[The class constructor %a@ expects %i type argument(s),@ but is here applied to %i type argument(s)@]" + }), longident, param$1._0, param$1._1, param$1._2); + case /* Parameter_mismatch */ 12 : + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type parameter", + _1: /* End_of_format */ 0 + }, + _1: "The type parameter" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "does not meet its constraint: it should be", + _1: /* End_of_format */ 0 + }, + _1: "does not meet its constraint: it should be" + }); + })); + case /* Bad_parameters */ 13 : + const cstrs = param$1._2; + const params = param$1._1; + reset_and_mark_loops_list({ + hd: params, + tl: { + hd: cstrs, + tl: /* [] */ 0 + } + }); + return Curry._6(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The abbreviation ", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Some type variables are unbound in this type:", + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, + TAG: /* String_literal */ 11, + _0: "is used with parameters", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "wich are incompatible with constraints", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } + } + } + } + }, + _1: "@[The abbreviation %a@ is used with parameters@ %a@ wich are incompatible with constraints@ %a@]" + }), ident$3, param$1._0, type_expr$1, params, type_expr$1, cstrs); + case /* Class_match_failure */ 14 : + return report_error$3(param, param$1._0); + case /* Unbound_val */ 15 : + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unbound instance variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Unbound instance variable %s" + }), param$1._0); + case /* Unbound_type_var */ 16 : + const print_common = function (ppf, kind, ty0, real, lab, ty) { + const ty1 = real ? ty0 : newty2(100000000, { + TAG: /* Tobject */ 4, + _0: ty0, + _1: { + contents: undefined + } + }); + mark_loops(ty1); + Curry._6(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Theta */ 16, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "has type", _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", + _0: "@;<1 2>", _1: 1, - _2: 0 + _2: 2 }, _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Alpha */ 15, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "where", _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "is unbound", + _1: /* End_of_format */ 0 + } + } + } } } } @@ -81607,66 +81516,87 @@ register_error_of_exn(function (err) { } } }, - _1: "@[@[Some type variables are unbound in this type:@;<1 2>%t@]@ @[%a@]@]" - }), param$1._0, print_reason, param$1._1); - case /* Make_nongen_seltype */ 17 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "The %s %s@ has type@;<1 2>%a@ where@ %a@ is unbound" + }), kind, lab, type_expr$1, ty, type_expr$1, ty0); + }; + const print_reason = function (ppf, param) { + if (param.TAG === /* CC_Method */ 0) { + return print_common(ppf, "method", param._0, param._1, param._2, param._3); + } else { + return print_common(ppf, "instance variable", param._0, param._1, param._2, param._3); + } + }; + reset(undefined); + return Curry._3(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, _0: { TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" + _0: /* End_of_format */ 0, + _1: "" } }, _1: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "Some type variables are unbound in this type:", _1: { - TAG: /* String_literal */ 11, - _0: "Self type should not occur in the non-generic type", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@;<1 2>", + _1: 1, + _2: 2 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Theta */ 16, _0: { - TAG: /* Break */ 0, - _0: "@;<1 2>", - _1: 1, - _2: 2 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: { TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Break */ 0, - _0: "@,", - _1: 0, - _2: 0 + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } }, _1: { - TAG: /* String_literal */ 11, - _0: "It would escape the scope of its class", - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } @@ -81675,14 +81605,28 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[@[Self type should not occur in the non-generic type@;<1 2>%a@]@,It would escape the scope of its class@]" - }), type_scheme, param$1._0); - case /* Non_generalizable_class */ 18 : - const id = param$1._0; - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[Some type variables are unbound in this type:@;<1 2>%t@]@ @[%a@]@]" + }), param$1._0, print_reason, param$1._1); + case /* Make_nongen_seltype */ 17 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -81694,31 +81638,31 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "The type of this class,", + _0: "Self type should not occur in the non-generic type", _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", + _0: "@;<1 2>", _1: 1, - _2: 0 + _2: 2 }, _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, _1: { TAG: /* Formatting_lit */ 17, _0: { TAG: /* Break */ 0, - _0: "@ ", - _1: 1, + _0: "@,", + _1: 0, _2: 0 }, _1: { TAG: /* String_literal */ 11, - _0: "contains type variables that cannot be generalized", + _0: "It would escape the scope of its class", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, @@ -81730,38 +81674,40 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The type of this class,@ %a,@ contains type variables that cannot be generalized@]" - }), (function (param, param$1) { - return class_declaration$1(id, param, param$1); - }), param$1._1); - case /* Cannot_coerce_self */ 19 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[Self type should not occur in the non-generic type@;<1 2>%a@]@,It would escape the scope of its class@]" + }), type_scheme, param$1._0); + case /* Non_generalizable_class */ 18 : + const id = param$1._0; + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type of this class,", _1: { - TAG: /* String_literal */ 11, - _0: "The type of self cannot be coerced to", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "the type of the current class:", + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -81771,77 +81717,75 @@ register_error_of_exn(function (err) { _2: 0 }, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: { - TAG: /* String_literal */ 11, - _0: "Some occurrences are contravariant", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* String_literal */ 11, + _0: "contains type variables that cannot be generalized", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } - }, - _1: "@[The type of self cannot be coerced to@ the type of the current class:@ %a.@.Some occurrences are contravariant@]" - }), type_scheme, param$1._0); - case /* Non_collapsable_conjunction */ 20 : - const id$1 = param$1._0; - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The type of this class,@ %a,@ contains type variables that cannot be generalized@]" + }), (function (param, param$1) { + return class_declaration$1(id, param, param$1); + }), param$1._1); + case /* Cannot_coerce_self */ 19 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type of self cannot be coerced to", _1: { - TAG: /* String_literal */ 11, - _0: "The type of this class,", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: "the type of the current class:", _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '.' */46, _1: { - TAG: /* String_literal */ 11, - _0: "contains non-collapsible conjunctive types in constraints", + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* String_literal */ 11, + _0: "Some occurrences are contravariant", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } @@ -81849,83 +81793,40 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The type of this class,@ %a,@ contains non-collapsible conjunctive types in constraints@]" - }), (function (param, param$1) { - return class_declaration$1(id$1, param, param$1); - }), param$1._1); - return report_unification_error(param, env, undefined, param$1._2, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Type", - _1: /* End_of_format */ 0 - }, - _1: "Type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "is not compatible with type", - _1: /* End_of_format */ 0 - }, - _1: "is not compatible with type" - }); - })); - case /* Final_self_clash */ 21 : - return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This object is expected to have type", - _1: /* End_of_format */ 0 - }, - _1: "This object is expected to have type" - }); - }), (function (ppf) { - Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "but actually has type", - _1: /* End_of_format */ 0 - }, - _1: "but actually has type" - }); - })); - case /* Mutability_mismatch */ 22 : - const match = param$1._1 === /* Immutable */ 0 ? [ - "mutable", - "immutable" - ] : [ - "immutable", - "mutable" - ]; - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The type of self cannot be coerced to@ the type of the current class:@ %a.@.Some occurrences are contravariant@]" + }), type_scheme, param$1._0); + case /* Non_collapsable_conjunction */ 20 : + const id$1 = param$1._0; + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type of this class,", _1: { - TAG: /* String_literal */ 11, - _0: "The instance variable is ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Char_literal */ 12, - _0: /* ';' */59, + _0: /* ',' */44, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -81936,41 +81837,95 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "it cannot be redefined as ", + _0: "contains non-collapsible conjunctive types in constraints", _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } } } } + } + }, + _1: "@[The type of this class,@ %a,@ contains non-collapsible conjunctive types in constraints@]" + }), (function (param, param$1) { + return class_declaration$1(id$1, param, param$1); + }), param$1._1); + return report_unification_error(param, env, undefined, param$1._2, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Type", + _1: /* End_of_format */ 0 }, - _1: "@[The instance variable is %s;@ it cannot be redefined as %s@]" - }), match[0], match[1]); - case /* No_overriding */ 23 : - if (param$1._1 === "") { - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + _1: "Type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "is not compatible with type", + _1: /* End_of_format */ 0 + }, + _1: "is not compatible with type" + }); + })); + case /* Final_self_clash */ 21 : + return report_unification_error(param, env, undefined, param$1._0, (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This object is expected to have type", + _1: /* End_of_format */ 0 + }, + _1: "This object is expected to have type" + }); + }), (function (ppf) { + Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "but actually has type", + _1: /* End_of_format */ 0 + }, + _1: "but actually has type" + }); + })); + case /* Mutability_mismatch */ 22 : + const match = param$1._1 === /* Immutable */ 0 ? [ + "mutable", + "immutable" + ] : [ + "immutable", + "mutable" + ]; + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The instance variable is ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "This inheritance does not override any method", + TAG: /* Char_literal */ 12, + _0: /* ';' */59, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -81980,75 +81935,65 @@ register_error_of_exn(function (err) { _2: 0 }, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "it cannot be redefined as ", _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } - }, - _1: "@[This inheritance does not override any method@ %s@]" - }), "instance variable"); - } else { - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + } + }, + _1: "@[The instance variable is %s;@ it cannot be redefined as %s@]" + }), match[0], match[1]); + case /* No_overriding */ 23 : + if (param$1._1 === "") { + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "This inheritance does not override any method", _1: { - TAG: /* String_literal */ 11, - _0: "The ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: " `", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '\'' */39, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "has no previous definition", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[The %s `%s'@ has no previous definition@]" - }), param$1._0, param$1._1); - } - case /* Duplicate */ 24 : + } + }, + _1: "@[This inheritance does not override any method@ %s@]" + }), "instance variable"); + } else { return Curry._2(Stdlib__Format.fprintf(param)({ TAG: /* Format */ 0, _0: { @@ -82086,7 +82031,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "has multiple definitions in this object", + _0: "has no previous definition", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, @@ -82100,8 +82045,63 @@ register_error_of_exn(function (err) { } } }, - _1: "@[The %s `%s'@ has multiple definitions in this object@]" + _1: "@[The %s `%s'@ has no previous definition@]" }), param$1._0, param$1._1); + } + case /* Duplicate */ 24 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " `", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* Char_literal */ 12, + _0: /* '\'' */39, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "has multiple definitions in this object", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } + } + } + } + } + }, + _1: "@[The %s `%s'@ has multiple definitions in this object@]" + }), param$1._0, param$1._1); } })); @@ -82119,31 +82119,31 @@ function fst3(param) { function path_concat(head, p) { switch (p.TAG) { case /* Pident */ 0 : - return { - TAG: /* Pdot */ 1, - _0: { - TAG: /* Pident */ 0, - _0: head - }, - _1: p._0.name, - _2: 0 - }; + return { + TAG: /* Pdot */ 1, + _0: { + TAG: /* Pident */ 0, + _0: head + }, + _1: p._0.name, + _2: 0 + }; case /* Pdot */ 1 : - return { - TAG: /* Pdot */ 1, - _0: path_concat(head, p._0), - _1: p._1, - _2: p._2 - }; + return { + TAG: /* Pdot */ 1, + _0: path_concat(head, p._0), + _1: p._1, + _2: p._2 + }; case /* Papply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 50016, - 16 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 50016, + 16 + ] + }); } } @@ -82235,11 +82235,11 @@ function add_rec_types(_env, _param) { switch (match._2) { case /* Trec_not */ 0 : case /* Trec_first */ 1 : - return env; + return env; case /* Trec_next */ 2 : - _param = param.tl; - _env = add_type$1(true, match._0, match._1, env); - continue; + _param = param.tl; + _env = add_type$1(true, match._0, match._1, env); + continue; } }; @@ -82257,9 +82257,9 @@ function update_rec_next(rs, rem) { switch (rs) { case /* Trec_not */ 0 : case /* Trec_first */ 1 : - break; + break; case /* Trec_next */ 2 : - return rem; + return rem; } if (!rem) { @@ -82268,39 +82268,39 @@ function update_rec_next(rs, rem) { const match = rem.hd; switch (match.TAG) { case /* Sig_type */ 1 : - switch (match._2) { - case /* Trec_not */ 0 : - case /* Trec_first */ 1 : - return rem; - case /* Trec_next */ 2 : - return { - hd: { - TAG: /* Sig_type */ 1, - _0: match._0, - _1: match._1, - _2: rs - }, - tl: rem.tl - }; - - } + switch (match._2) { + case /* Trec_not */ 0 : + case /* Trec_first */ 1 : + return rem; + case /* Trec_next */ 2 : + return { + hd: { + TAG: /* Sig_type */ 1, + _0: match._0, + _1: match._1, + _2: rs + }, + tl: rem.tl + }; + + } case /* Sig_module */ 3 : - switch (match._2) { - case /* Trec_not */ 0 : - case /* Trec_first */ 1 : - return rem; - case /* Trec_next */ 2 : - return { - hd: { - TAG: /* Sig_module */ 3, - _0: match._0, - _1: match._1, - _2: rs - }, - tl: rem.tl - }; - - } + switch (match._2) { + case /* Trec_not */ 0 : + case /* Trec_first */ 1 : + return rem; + case /* Trec_next */ 2 : + return { + hd: { + TAG: /* Sig_module */ 3, + _0: match._0, + _1: match._1, + _2: rs + }, + tl: rem.tl + }; + + } default: return rem; } @@ -82311,28 +82311,28 @@ function merge_constraint(initial_env, loc, sg, constr) { switch (constr.TAG) { case /* Pwith_type */ 0 : case /* Pwith_module */ 1 : - lid = constr._0; - break; + lid = constr._0; + break; case /* Pwith_typesubst */ 2 : - const s = constr._0.ptype_name; - lid = { - txt: { - TAG: /* Lident */ 0, - _0: s.txt - }, - loc: s.loc - }; - break; + const s = constr._0.ptype_name; + lid = { + txt: { + TAG: /* Lident */ 0, + _0: s.txt + }, + loc: s.loc + }; + break; case /* Pwith_modsubst */ 3 : - const s$1 = constr._0; - lid = { - txt: { - TAG: /* Lident */ 0, - _0: s$1.txt - }, - loc: s$1.loc - }; - break; + const s$1 = constr._0; + lid = { + txt: { + TAG: /* Lident */ 0, + _0: s$1.txt + }, + loc: s$1.loc + }; + break; } const real_id = { @@ -82346,178 +82346,131 @@ function merge_constraint(initial_env, loc, sg, constr) { const item = sg.hd; switch (item.TAG) { case /* Sig_type */ 1 : - if (namelist && !namelist.tl) { - const s = namelist.hd; - const rem = sg.tl; - const rs = item._2; - const decl = item._1; - const id = item._0; - let exit = 0; - switch (constr.TAG) { - case /* Pwith_type */ 0 : - const sdecl = constr._1; - let exit$1 = 0; - let tmp = sdecl.ptype_kind; - if (/* tag */ (typeof tmp === "number" || typeof tmp === "string") && tmp === /* Ptype_abstract */ 0) { - if (id.name === s && is_fixed_type(sdecl)) { - const decl_row_type_params = Stdlib__List.map((function (param) { - return newty2(100000000, { - TAG: /* Tvar */ 0, - _0: undefined - }); - }), sdecl.ptype_params); - const decl_row_type_arity = Stdlib__List.length(sdecl.ptype_params); - const decl_row_type_variance = Stdlib__List.map((function (param) { - let match; - switch (param[1]) { - case /* Covariant */ 0 : - match = [ - true, - false - ]; - break; - case /* Contravariant */ 1 : - match = [ - false, - true - ]; - break; - case /* Invariant */ 2 : - match = [ - false, - false - ]; - break; - - } - let p = !match[1]; - let n = !match[0]; - let i = false; - return Curry._3(Types_Variance.set, /* May_pos */ 0, p, Curry._3(Types_Variance.set, /* May_neg */ 1, n, Curry._3(Types_Variance.set, /* May_weak */ 2, n, Curry._3(Types_Variance.set, /* Inj */ 3, i, Types_Variance.$$null)))); - }), sdecl.ptype_params); - const decl_row_type_loc = sdecl.ptype_loc; - const decl_row = { - type_params: decl_row_type_params, - type_arity: decl_row_type_arity, - type_kind: /* Type_abstract */ 0, - type_private: /* Private */ 0, - type_manifest: undefined, - type_variance: decl_row_type_variance, - type_newtype_level: undefined, - type_loc: decl_row_type_loc, - type_attributes: /* [] */ 0 - }; - const id_row = create(s + "#row"); - const initial_env$1 = add_type$1(true, id_row, decl_row, initial_env); - const tdecl = transl_with_constraint(initial_env$1, id, { - TAG: /* Pident */ 0, - _0: id_row - }, decl, sdecl); - const newdecl = tdecl.typ_type; - check_type_decl(env, sdecl.ptype_loc, id, row_id, newdecl, decl, rs, rem); - const decl_row_type_params$1 = newdecl.type_params; - const decl_row_type_arity$1 = decl_row_type_arity; - const decl_row_type_variance$1 = decl_row_type_variance; - const decl_row_type_loc$1 = decl_row_type_loc; - const decl_row$1 = { - type_params: decl_row_type_params$1, - type_arity: decl_row_type_arity$1, - type_kind: /* Type_abstract */ 0, - type_private: /* Private */ 0, - type_manifest: undefined, - type_variance: decl_row_type_variance$1, - type_newtype_level: undefined, - type_loc: decl_row_type_loc$1, - type_attributes: /* [] */ 0 - }; - const rs$p = rs === /* Trec_first */ 1 ? /* Trec_not */ 0 : rs; - return [ - [ - { - TAG: /* Pident */ 0, - _0: id - }, - lid, - { - TAG: /* Twith_type */ 0, - _0: tdecl - } - ], - { - hd: { - TAG: /* Sig_type */ 1, - _0: id_row, - _1: decl_row$1, - _2: rs$p - }, - tl: { - hd: { - TAG: /* Sig_type */ 1, - _0: id, - _1: newdecl, - _2: rs - }, - tl: rem - } - } - ]; - } - exit$1 = 3; - } else { - exit$1 = 3; - } - if (exit$1 === 3) { - if (id.name === s) { - const tdecl$1 = transl_with_constraint(initial_env, id, undefined, decl, sdecl); - const newdecl$1 = tdecl$1.typ_type; - check_type_decl(env, sdecl.ptype_loc, id, row_id, newdecl$1, decl, rs, rem); - return [ - [ - { - TAG: /* Pident */ 0, - _0: id - }, - lid, - { - TAG: /* Twith_type */ 0, - _0: tdecl$1 - } - ], - { - hd: { - TAG: /* Sig_type */ 1, - _0: id, - _1: newdecl$1, - _2: rs - }, - tl: rem + if (namelist && !namelist.tl) { + const s = namelist.hd; + const rem = sg.tl; + const rs = item._2; + const decl = item._1; + const id = item._0; + let exit = 0; + switch (constr.TAG) { + case /* Pwith_type */ 0 : + const sdecl = constr._1; + let exit$1 = 0; + let tmp = sdecl.ptype_kind; + if (/* tag */ (typeof tmp === "number" || typeof tmp === "string") && tmp === /* Ptype_abstract */ 0) { + if (id.name === s && is_fixed_type(sdecl)) { + const decl_row_type_params = Stdlib__List.map((function (param) { + return newty2(100000000, { + TAG: /* Tvar */ 0, + _0: undefined + }); + }), sdecl.ptype_params); + const decl_row_type_arity = Stdlib__List.length(sdecl.ptype_params); + const decl_row_type_variance = Stdlib__List.map((function (param) { + let match; + switch (param[1]) { + case /* Covariant */ 0 : + match = [ + true, + false + ]; + break; + case /* Contravariant */ 1 : + match = [ + false, + true + ]; + break; + case /* Invariant */ 2 : + match = [ + false, + false + ]; + break; + } - ]; + let p = !match[1]; + let n = !match[0]; + let i = false; + return Curry._3(Types_Variance.set, /* May_pos */ 0, p, Curry._3(Types_Variance.set, /* May_neg */ 1, n, Curry._3(Types_Variance.set, /* May_weak */ 2, n, Curry._3(Types_Variance.set, /* Inj */ 3, i, Types_Variance.$$null)))); + }), sdecl.ptype_params); + const decl_row_type_loc = sdecl.ptype_loc; + const decl_row = { + type_params: decl_row_type_params, + type_arity: decl_row_type_arity, + type_kind: /* Type_abstract */ 0, + type_private: /* Private */ 0, + type_manifest: undefined, + type_variance: decl_row_type_variance, + type_newtype_level: undefined, + type_loc: decl_row_type_loc, + type_attributes: /* [] */ 0 + }; + const id_row = create(s + "#row"); + const initial_env$1 = add_type$1(true, id_row, decl_row, initial_env); + const tdecl = transl_with_constraint(initial_env$1, id, { + TAG: /* Pident */ 0, + _0: id_row + }, decl, sdecl); + const newdecl = tdecl.typ_type; + check_type_decl(env, sdecl.ptype_loc, id, row_id, newdecl, decl, rs, rem); + const decl_row_type_params$1 = newdecl.type_params; + const decl_row_type_arity$1 = decl_row_type_arity; + const decl_row_type_variance$1 = decl_row_type_variance; + const decl_row_type_loc$1 = decl_row_type_loc; + const decl_row$1 = { + type_params: decl_row_type_params$1, + type_arity: decl_row_type_arity$1, + type_kind: /* Type_abstract */ 0, + type_private: /* Private */ 0, + type_manifest: undefined, + type_variance: decl_row_type_variance$1, + type_newtype_level: undefined, + type_loc: decl_row_type_loc$1, + type_attributes: /* [] */ 0 + }; + const rs$p = rs === /* Trec_first */ 1 ? /* Trec_not */ 0 : rs; + return [ + [ + { + TAG: /* Pident */ 0, + _0: id + }, + lid, + { + TAG: /* Twith_type */ 0, + _0: tdecl + } + ], + { + hd: { + TAG: /* Sig_type */ 1, + _0: id_row, + _1: decl_row$1, + _2: rs$p + }, + tl: { + hd: { + TAG: /* Sig_type */ 1, + _0: id, + _1: newdecl, + _2: rs + }, + tl: rem + } } - exit = 2; - } - break; - case /* Pwith_typesubst */ 2 : - exit = 2; - break; - case /* Pwith_module */ 1 : - case /* Pwith_modsubst */ 3 : - break; - - } - if (exit === 2) { - if (id.name === s + "#row") { - _row_id = id; - _sg = rem; - continue; + ]; + } + exit$1 = 3; + } else { + exit$1 = 3; } - if (constr.TAG !== /* Pwith_type */ 0) { - const sdecl$1 = constr._0; + if (exit$1 === 3) { if (id.name === s) { - const tdecl$2 = transl_with_constraint(initial_env, id, undefined, decl, sdecl$1); - const newdecl$2 = tdecl$2.typ_type; - check_type_decl(env, sdecl$1.ptype_loc, id, row_id, newdecl$2, decl, rs, rem); - real_id.contents = id; + const tdecl$1 = transl_with_constraint(initial_env, id, undefined, decl, sdecl); + const newdecl$1 = tdecl$1.typ_type; + check_type_decl(env, sdecl.ptype_loc, id, row_id, newdecl$1, decl, rs, rem); return [ [ { @@ -82526,137 +82479,184 @@ function merge_constraint(initial_env, loc, sg, constr) { }, lid, { - TAG: /* Twith_typesubst */ 2, - _0: tdecl$2 + TAG: /* Twith_type */ 0, + _0: tdecl$1 } ], - update_rec_next(rs, rem) + { + hd: { + TAG: /* Sig_type */ 1, + _0: id, + _1: newdecl$1, + _2: rs + }, + tl: rem + } ]; } - + exit = 2; + } + break; + case /* Pwith_typesubst */ 2 : + exit = 2; + break; + case /* Pwith_module */ 1 : + case /* Pwith_modsubst */ 3 : + break; + + } + if (exit === 2) { + if (id.name === s + "#row") { + _row_id = id; + _sg = rem; + continue; + } + if (constr.TAG !== /* Pwith_type */ 0) { + const sdecl$1 = constr._0; + if (id.name === s) { + const tdecl$2 = transl_with_constraint(initial_env, id, undefined, decl, sdecl$1); + const newdecl$2 = tdecl$2.typ_type; + check_type_decl(env, sdecl$1.ptype_loc, id, row_id, newdecl$2, decl, rs, rem); + real_id.contents = id; + return [ + [ + { + TAG: /* Pident */ 0, + _0: id + }, + lid, + { + TAG: /* Twith_typesubst */ 2, + _0: tdecl$2 + } + ], + update_rec_next(rs, rem) + ]; } } } - break; + + } + break; case /* Sig_module */ 3 : - if (namelist) { - const s$1 = namelist.hd; - const rem$1 = sg.tl; - const rs$1 = item._2; - const md = item._1; - const id$1 = item._0; - let exit$2 = 0; - if (namelist.tl) { - exit$2 = 2; - } else { - switch (constr.TAG) { - case /* Pwith_module */ 1 : - const lid$p = constr._1; - if (id$1.name === s$1) { - const match = find_module$1(initial_env, loc, lid$p.txt); - const md$p = match[1]; - const path = match[0]; - const md$p$p_md_type = remove_aliases$1(env, md$p.md_type); - const md$p$p_md_attributes = md$p.md_attributes; - const md$p$p_md_loc = md$p.md_loc; - const md$p$p = { - md_type: md$p$p_md_type, - md_attributes: md$p$p_md_attributes, - md_loc: md$p$p_md_loc - }; - const newmd = strengthen_decl(env, md$p$p, path); - modtypes$1(env, newmd.md_type, md.md_type); - return [ - [ - { - TAG: /* Pident */ 0, - _0: id$1 - }, - lid, - { - TAG: /* Twith_module */ 1, - _0: path, - _1: lid$p - } - ], - { - hd: { - TAG: /* Sig_module */ 3, - _0: id$1, - _1: newmd, - _2: rs$1 - }, - tl: rem$1 - } - ]; - } - exit$2 = 2; - break; - case /* Pwith_type */ 0 : - case /* Pwith_typesubst */ 2 : - exit$2 = 2; - break; - case /* Pwith_modsubst */ 3 : - const lid$p$1 = constr._1; - if (id$1.name === s$1) { - const match$1 = find_module$1(initial_env, loc, lid$p$1.txt); - const path$1 = match$1[0]; - const newmd$1 = strengthen_decl(env, match$1[1], path$1); - modtypes$1(env, newmd$1.md_type, md.md_type); - real_id.contents = id$1; - return [ - [ - { - TAG: /* Pident */ 0, - _0: id$1 - }, - lid, - { - TAG: /* Twith_modsubst */ 3, - _0: path$1, - _1: lid$p$1 - } - ], - update_rec_next(rs$1, rem$1) - ]; + if (namelist) { + const s$1 = namelist.hd; + const rem$1 = sg.tl; + const rs$1 = item._2; + const md = item._1; + const id$1 = item._0; + let exit$2 = 0; + if (namelist.tl) { + exit$2 = 2; + } else { + switch (constr.TAG) { + case /* Pwith_module */ 1 : + const lid$p = constr._1; + if (id$1.name === s$1) { + const match = find_module$1(initial_env, loc, lid$p.txt); + const md$p = match[1]; + const path = match[0]; + const md$p$p_md_type = remove_aliases$1(env, md$p.md_type); + const md$p$p_md_attributes = md$p.md_attributes; + const md$p$p_md_loc = md$p.md_loc; + const md$p$p = { + md_type: md$p$p_md_type, + md_attributes: md$p$p_md_attributes, + md_loc: md$p$p_md_loc + }; + const newmd = strengthen_decl(env, md$p$p, path); + modtypes$1(env, newmd.md_type, md.md_type); + return [ + [ + { + TAG: /* Pident */ 0, + _0: id$1 + }, + lid, + { + TAG: /* Twith_module */ 1, + _0: path, + _1: lid$p + } + ], + { + hd: { + TAG: /* Sig_module */ 3, + _0: id$1, + _1: newmd, + _2: rs$1 + }, + tl: rem$1 } - exit$2 = 2; - break; - - } - } - if (exit$2 === 2 && id$1.name === s$1) { - const match$2 = merge(env, extract_sig(env, loc, md.md_type), namelist.tl, undefined); - const match$3 = match$2[0]; - return [ - [ - path_concat(id$1, match$3[0]), - lid, - match$3[2] - ], - { - hd: { - TAG: /* Sig_module */ 3, - _0: id$1, - _1: { - md_type: { - TAG: /* Mty_signature */ 1, - _0: match$2[1] + ]; + } + exit$2 = 2; + break; + case /* Pwith_type */ 0 : + case /* Pwith_typesubst */ 2 : + exit$2 = 2; + break; + case /* Pwith_modsubst */ 3 : + const lid$p$1 = constr._1; + if (id$1.name === s$1) { + const match$1 = find_module$1(initial_env, loc, lid$p$1.txt); + const path$1 = match$1[0]; + const newmd$1 = strengthen_decl(env, match$1[1], path$1); + modtypes$1(env, newmd$1.md_type, md.md_type); + real_id.contents = id$1; + return [ + [ + { + TAG: /* Pident */ 0, + _0: id$1 }, - md_attributes: md.md_attributes, - md_loc: md.md_loc - }, - _2: rs$1 - }, - tl: rem$1 + lid, + { + TAG: /* Twith_modsubst */ 3, + _0: path$1, + _1: lid$p$1 + } + ], + update_rec_next(rs$1, rem$1) + ]; } - ]; + exit$2 = 2; + break; + } - } - break; + if (exit$2 === 2 && id$1.name === s$1) { + const match$2 = merge(env, extract_sig(env, loc, md.md_type), namelist.tl, undefined); + const match$3 = match$2[0]; + return [ + [ + path_concat(id$1, match$3[0]), + lid, + match$3[2] + ], + { + hd: { + TAG: /* Sig_module */ 3, + _0: id$1, + _1: { + md_type: { + TAG: /* Mty_signature */ 1, + _0: match$2[1] + }, + md_attributes: md.md_attributes, + md_loc: md.md_loc + }, + _2: rs$1 + }, + tl: rem$1 + } + ]; + } + + } + break; } const match$4 = merge(add_item(item, env), sg.tl, namelist, row_id); @@ -82688,74 +82688,69 @@ function merge_constraint(initial_env, loc, sg, constr) { switch (constr.TAG) { case /* Pwith_type */ 0 : case /* Pwith_module */ 1 : - sg$2 = sg$1; - break; + sg$2 = sg$1; + break; case /* Pwith_typesubst */ 2 : - const sdecl = constr._0; - const id = real_id.contents; - let id$1; - if (id !== undefined) { - id$1 = id; - } else { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 50208, - 38 - ] - }); - } - let lid$1; - try { - const match$1 = sdecl.ptype_manifest; - if (match$1 !== undefined) { - const match$2 = match$1.ptyp_desc; - if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (match$2.TAG === /* Ptyp_constr */ 3) { - const stl = match$2._1; - if (Stdlib__List.length(stl) === Stdlib__List.length(sdecl.ptype_params)) { - Stdlib__List.iter2((function (x, param) { - const sx = x.ptyp_desc; - if (/* tag */ typeof sx === "number" || typeof sx === "string") { + const sdecl = constr._0; + const id = real_id.contents; + let id$1; + if (id !== undefined) { + id$1 = id; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 50208, + 38 + ] + }); + } + let lid$1; + try { + const match$1 = sdecl.ptype_manifest; + if (match$1 !== undefined) { + const match$2 = match$1.ptyp_desc; + if (/* tag */ typeof match$2 === "number" || typeof match$2 === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (match$2.TAG === /* Ptyp_constr */ 3) { + const stl = match$2._1; + if (Stdlib__List.length(stl) === Stdlib__List.length(sdecl.ptype_params)) { + Stdlib__List.iter2((function (x, param) { + const sx = x.ptyp_desc; + if (/* tag */ typeof sx === "number" || typeof sx === "string") { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + if (sx.TAG === /* Ptyp_var */ 0) { + const sy = param[0].ptyp_desc; + if (/* tag */ typeof sy === "number" || typeof sy === "string") { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); } - if (sx.TAG === /* Ptyp_var */ 0) { - const sy = param[0].ptyp_desc; - if (/* tag */ typeof sy === "number" || typeof sy === "string") { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } - if (sy.TAG === /* Ptyp_var */ 0) { - if (sx._0 === sy._0) { - return; - } - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); + if (sy.TAG === /* Ptyp_var */ 0) { + if (sx._0 === sy._0) { + return; } throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit }); - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); } - }), stl, sdecl.ptype_params); - lid$1 = match$2._0; - } else { - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); - } + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); + } + }), stl, sdecl.ptype_params); + lid$1 = match$2._0; } else { throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { MEL_EXN_ID: Stdlib.Exit @@ -82766,59 +82761,64 @@ function merge_constraint(initial_env, loc, sg, constr) { MEL_EXN_ID: Stdlib.Exit }); } + } else { + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Exit) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: sdecl.ptype_loc, - _2: initial_env, - _3: /* With_need_typeconstr */ 2 - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } - let match$3; - try { - match$3 = lookup_type$1(lid$1.txt, initial_env); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 50225, - 68 - ] - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Exit) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: sdecl.ptype_loc, + _2: initial_env, + _3: /* With_need_typeconstr */ 2 + }); } - const sub = add_type(id$1, match$3[0], identity); - sg$2 = signature$2(sub, sg$1); - break; - case /* Pwith_modsubst */ 3 : - const id$2 = real_id.contents; - let id$3; - if (id$2 !== undefined) { - id$3 = id$2; - } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } + let match$3; + try { + match$3 = lookup_type$1(lid$1.txt, initial_env); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Not_found) { throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", _1: [ "jscomp/test/ocaml_typedtree_test.ml", - 50231, - 38 + 50225, + 68 ] }); } - const path = lookup_module$1(undefined, initial_env, loc, constr._1.txt); - const sub$1 = add_module(id$3, path, identity); - sg$2 = signature$2(sub$1, sg$1); - break; + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + const sub = add_type(id$1, match$3[0], identity); + sg$2 = signature$2(sub, sg$1); + break; + case /* Pwith_modsubst */ 3 : + const id$2 = real_id.contents; + let id$3; + if (id$2 !== undefined) { + id$3 = id$2; + } else { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 50231, + 38 + ] + }); + } + const path = lookup_module$1(undefined, initial_env, loc, constr._1.txt); + const sub$1 = add_module(id$3, path, identity); + sg$2 = signature$2(sub$1, sg$1); + break; } } else { @@ -82915,47 +82915,47 @@ function approx_modtype(env, _smty) { const lid = smty.pmty_desc; switch (lid.TAG) { case /* Pmty_ident */ 0 : - const match = find_modtype$1(env, smty.pmty_loc, lid._0.txt); - return { - TAG: /* Mty_ident */ 0, - _0: match[0] - }; + const match = find_modtype$1(env, smty.pmty_loc, lid._0.txt); + return { + TAG: /* Mty_ident */ 0, + _0: match[0] + }; case /* Pmty_signature */ 1 : - return { - TAG: /* Mty_signature */ 1, - _0: approx_sig(env, lid._0) - }; + return { + TAG: /* Mty_signature */ 1, + _0: approx_sig(env, lid._0) + }; case /* Pmty_functor */ 2 : - const arg = may_map((function (param) { - return approx_modtype(env, param); - }), lid._1); - const match$1 = enter_module(true, lid._0.txt, arg !== undefined ? arg : ({ - TAG: /* Mty_signature */ 1, - _0: /* [] */ 0 - }), env); - const res = approx_modtype(match$1[1], lid._2); - return { - TAG: /* Mty_functor */ 2, - _0: match$1[0], - _1: arg, - _2: res - }; + const arg = may_map((function (param) { + return approx_modtype(env, param); + }), lid._1); + const match$1 = enter_module(true, lid._0.txt, arg !== undefined ? arg : ({ + TAG: /* Mty_signature */ 1, + _0: /* [] */ 0 + }), env); + const res = approx_modtype(match$1[1], lid._2); + return { + TAG: /* Mty_functor */ 2, + _0: match$1[0], + _1: arg, + _2: res + }; case /* Pmty_with */ 3 : - _smty = lid._0; - continue; + _smty = lid._0; + continue; case /* Pmty_typeof */ 4 : - return Curry._2(type_module_type_of_fwd.contents, env, lid._0)[1]; + return Curry._2(type_module_type_of_fwd.contents, env, lid._0)[1]; case /* Pmty_extension */ 5 : - throw new Caml_js_exceptions.MelangeError(Error_forward$3, { - MEL_EXN_ID: Error_forward$3, - _1: error_of_extension(lid._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$3, { + MEL_EXN_ID: Error_forward$3, + _1: error_of_extension(lid._0) + }); case /* Pmty_alias */ 6 : - const path = lookup_module$1(undefined, env, smty.pmty_loc, lid._0.txt); - return { - TAG: /* Mty_alias */ 3, - _0: path - }; + const path = lookup_module$1(undefined, env, smty.pmty_loc, lid._0.txt); + return { + TAG: /* Mty_alias */ 3, + _0: path + }; } }; @@ -82980,75 +82980,75 @@ function approx_sig(_env, _ssg) { const sdecls = ssg.hd.psig_desc; switch (sdecls.TAG) { case /* Psig_type */ 1 : - const sdecls$1 = sdecls._0; - const rec_flag = rec_flag_of_ptype_declarations(sdecls$1); - const decls = approx_type_decl(env, sdecls$1); - const rem = approx_sig(env, srem); - return map_rec_type(rec_flag, (function (rs, param) { - return { - TAG: /* Sig_type */ 1, - _0: param[0], - _1: param[1], - _2: rs - }; - }), decls, rem); + const sdecls$1 = sdecls._0; + const rec_flag = rec_flag_of_ptype_declarations(sdecls$1); + const decls = approx_type_decl(env, sdecls$1); + const rem = approx_sig(env, srem); + return map_rec_type(rec_flag, (function (rs, param) { + return { + TAG: /* Sig_type */ 1, + _0: param[0], + _1: param[1], + _2: rs + }; + }), decls, rem); case /* Psig_module */ 4 : - const pmd = sdecls._0; - const md = approx_module_declaration(env, pmd); - const match = enter_module_declaration(undefined, pmd.pmd_name.txt, md, env); - return { - hd: { - TAG: /* Sig_module */ 3, - _0: match[0], - _1: md, - _2: /* Trec_not */ 0 - }, - tl: approx_sig(match[1], srem) - }; + const pmd = sdecls._0; + const md = approx_module_declaration(env, pmd); + const match = enter_module_declaration(undefined, pmd.pmd_name.txt, md, env); + return { + hd: { + TAG: /* Sig_module */ 3, + _0: match[0], + _1: md, + _2: /* Trec_not */ 0 + }, + tl: approx_sig(match[1], srem) + }; case /* Psig_recmodule */ 5 : - const decls$1 = Stdlib__List.map((function (pmd) { - return [ - create(pmd.pmd_name.txt), - approx_module_declaration(env, pmd) - ]; - }), sdecls._0); - const newenv = Stdlib__List.fold_left((function (env, param) { - return add_module_declaration(undefined, param[0], param[1], env); - }), env, decls$1); - return map_rec((function (rs, param) { - return { - TAG: /* Sig_module */ 3, - _0: param[0], - _1: param[1], - _2: rs - }; - }), decls$1, approx_sig(newenv, srem)); + const decls$1 = Stdlib__List.map((function (pmd) { + return [ + create(pmd.pmd_name.txt), + approx_module_declaration(env, pmd) + ]; + }), sdecls._0); + const newenv = Stdlib__List.fold_left((function (env, param) { + return add_module_declaration(undefined, param[0], param[1], env); + }), env, decls$1); + return map_rec((function (rs, param) { + return { + TAG: /* Sig_module */ 3, + _0: param[0], + _1: param[1], + _2: rs + }; + }), decls$1, approx_sig(newenv, srem)); case /* Psig_modtype */ 6 : - const d = sdecls._0; - const info = approx_modtype_info(env, d); - const match$1 = enter_modtype(d.pmtd_name.txt, info, env); - return { - hd: { - TAG: /* Sig_modtype */ 4, - _0: match$1[0], - _1: info - }, - tl: approx_sig(match$1[1], srem) - }; + const d = sdecls._0; + const info = approx_modtype_info(env, d); + const match$1 = enter_modtype(d.pmtd_name.txt, info, env); + return { + hd: { + TAG: /* Sig_modtype */ 4, + _0: match$1[0], + _1: info + }, + tl: approx_sig(match$1[1], srem) + }; case /* Psig_open */ 7 : - const match$2 = type_open$1(undefined, env, sdecls._0); - _ssg = srem; - _env = match$2[1]; - continue; + const match$2 = type_open$1(undefined, env, sdecls._0); + _ssg = srem; + _env = match$2[1]; + continue; case /* Psig_include */ 8 : - const smty = sdecls._0.pincl_mod; - const mty = approx_modtype(env, smty); - const sg = signature$2(identity, extract_sig(env, smty.pmty_loc, mty)); - const newenv$1 = add_signature(sg, env); - return Stdlib.$at(sg, approx_sig(newenv$1, srem)); + const smty = sdecls._0.pincl_mod; + const mty = approx_modtype(env, smty); + const sg = signature$2(identity, extract_sig(env, smty.pmty_loc, mty)); + const newenv$1 = add_signature(sg, env); + return Stdlib.$at(sg, approx_sig(newenv$1, srem)); case /* Psig_class */ 9 : case /* Psig_class_type */ 10 : - break; + break; default: _ssg = srem; continue; @@ -83274,11 +83274,11 @@ function check_name(cl, set_ref, name) { function check_sig_item(type_names, module_names, modtype_names, loc, param) { switch (param.TAG) { case /* Sig_type */ 1 : - return check("type", loc, type_names, param._0.name); + return check("type", loc, type_names, param._0.name); case /* Sig_module */ 3 : - return check("module", loc, module_names, param._0.name); + return check("module", loc, module_names, param._0.name); case /* Sig_modtype */ 4 : - return check("module type", loc, modtype_names, param._0.name); + return check("module type", loc, modtype_names, param._0.name); default: return; } @@ -83293,67 +83293,67 @@ function remove_duplicates(val_ids, ext_ids, _param) { const f = param.hd; switch (f.TAG) { case /* Sig_value */ 0 : - const id = f._0; - if (Stdlib__List.exists((function (param) { - return equal(id, param); - }), val_ids)) { - _param = param.tl; - continue; - } - break; + const id = f._0; + if (Stdlib__List.exists((function (param) { + return equal(id, param); + }), val_ids)) { + _param = param.tl; + continue; + } + break; case /* Sig_typext */ 2 : - const id$1 = f._0; - let exit = 0; - switch (f._2) { - case /* Text_first */ 0 : - const match = param.tl; - if (match) { - const match$1 = match.hd; - if (match$1.TAG === /* Sig_typext */ 2) { - switch (match$1._2) { - case /* Text_next */ 1 : - if (Stdlib__List.exists((function (param) { - return equal(id$1, param); - }), ext_ids)) { - _param = { - hd: { - TAG: /* Sig_typext */ 2, - _0: match$1._0, - _1: match$1._1, - _2: /* Text_first */ 0 - }, - tl: match.tl - }; - continue; - } - exit = 2; - break; - case /* Text_first */ 0 : - case /* Text_exception */ 2 : - exit = 2; - break; - + const id$1 = f._0; + let exit = 0; + switch (f._2) { + case /* Text_first */ 0 : + const match = param.tl; + if (match) { + const match$1 = match.hd; + if (match$1.TAG === /* Sig_typext */ 2) { + switch (match$1._2) { + case /* Text_next */ 1 : + if (Stdlib__List.exists((function (param) { + return equal(id$1, param); + }), ext_ids)) { + _param = { + hd: { + TAG: /* Sig_typext */ 2, + _0: match$1._0, + _1: match$1._1, + _2: /* Text_first */ 0 + }, + tl: match.tl + }; + continue; } - } else { exit = 2; - } - } else { - exit = 2; + break; + case /* Text_first */ 0 : + case /* Text_exception */ 2 : + exit = 2; + break; + } - break; - case /* Text_next */ 1 : - case /* Text_exception */ 2 : + } else { exit = 2; - break; - - } - if (exit === 2 && Stdlib__List.exists((function (param) { - return equal(id$1, param); - }), ext_ids)) { - _param = param.tl; - continue; - } - break; + } + } else { + exit = 2; + } + break; + case /* Text_next */ 1 : + case /* Text_exception */ 2 : + exit = 2; + break; + + } + if (exit === 2 && Stdlib__List.exists((function (param) { + return equal(id$1, param); + }), ext_ids)) { + _param = param.tl; + continue; + } + break; } return { @@ -83440,99 +83440,99 @@ function transl_modtype$1(env, smty) { const lid = smty.pmty_desc; switch (lid.TAG) { case /* Pmty_ident */ 0 : - const lid$1 = lid._0; - const path = transl_modtype_longident$1(loc, env, lid$1.txt); - return mkmty$1({ - TAG: /* Tmty_ident */ 0, - _0: path, - _1: lid$1 - }, { - TAG: /* Mty_ident */ 0, - _0: path - }, env, loc, smty.pmty_attributes); + const lid$1 = lid._0; + const path = transl_modtype_longident$1(loc, env, lid$1.txt); + return mkmty$1({ + TAG: /* Tmty_ident */ 0, + _0: path, + _1: lid$1 + }, { + TAG: /* Mty_ident */ 0, + _0: path + }, env, loc, smty.pmty_attributes); case /* Pmty_signature */ 1 : - const sg = transl_signature(env, lid._0); - return mkmty$1({ - TAG: /* Tmty_signature */ 1, - _0: sg - }, { - TAG: /* Mty_signature */ 1, - _0: sg.sig_type - }, env, loc, smty.pmty_attributes); + const sg = transl_signature(env, lid._0); + return mkmty$1({ + TAG: /* Tmty_signature */ 1, + _0: sg + }, { + TAG: /* Mty_signature */ 1, + _0: sg.sig_type + }, env, loc, smty.pmty_attributes); case /* Pmty_functor */ 2 : - const param = lid._0; - const arg = may_map((function (param) { - return transl_modtype$1(env, param); - }), lid._1); - const ty_arg = may_map((function (m) { - return m.mty_type; - }), arg); - const match = enter_module(true, param.txt, ty_arg !== undefined ? ty_arg : ({ - TAG: /* Mty_signature */ 1, - _0: /* [] */ 0 - }), env); - const id = match[0]; - init_def(currentstamp.contents); - const res = transl_modtype$1(match[1], lid._2); - return mkmty$1({ - TAG: /* Tmty_functor */ 2, - _0: id, - _1: param, - _2: arg, - _3: res - }, { - TAG: /* Mty_functor */ 2, - _0: id, - _1: ty_arg, - _2: res.mty_type - }, env, loc, smty.pmty_attributes); + const param = lid._0; + const arg = may_map((function (param) { + return transl_modtype$1(env, param); + }), lid._1); + const ty_arg = may_map((function (m) { + return m.mty_type; + }), arg); + const match = enter_module(true, param.txt, ty_arg !== undefined ? ty_arg : ({ + TAG: /* Mty_signature */ 1, + _0: /* [] */ 0 + }), env); + const id = match[0]; + init_def(currentstamp.contents); + const res = transl_modtype$1(match[1], lid._2); + return mkmty$1({ + TAG: /* Tmty_functor */ 2, + _0: id, + _1: param, + _2: arg, + _3: res + }, { + TAG: /* Mty_functor */ 2, + _0: id, + _1: ty_arg, + _2: res.mty_type + }, env, loc, smty.pmty_attributes); case /* Pmty_with */ 3 : - const sbody = lid._0; - const body = transl_modtype$1(env, sbody); - const init_sg = extract_sig(env, sbody.pmty_loc, body.mty_type); - const match$1 = Stdlib__List.fold_left((function (param, sdecl) { - const match = merge_constraint(env, smty.pmty_loc, param[1], sdecl); - return [ - { - hd: match[0], - tl: param[0] - }, - match[1] - ]; - }), [ - /* [] */ 0, - init_sg - ], lid._1); - return mkmty$1({ - TAG: /* Tmty_with */ 3, - _0: body, - _1: Stdlib__List.rev(match$1[0]) - }, modtype(identity, { - TAG: /* Mty_signature */ 1, - _0: match$1[1] - }), env, loc, smty.pmty_attributes); + const sbody = lid._0; + const body = transl_modtype$1(env, sbody); + const init_sg = extract_sig(env, sbody.pmty_loc, body.mty_type); + const match$1 = Stdlib__List.fold_left((function (param, sdecl) { + const match = merge_constraint(env, smty.pmty_loc, param[1], sdecl); + return [ + { + hd: match[0], + tl: param[0] + }, + match[1] + ]; + }), [ + /* [] */ 0, + init_sg + ], lid._1); + return mkmty$1({ + TAG: /* Tmty_with */ 3, + _0: body, + _1: Stdlib__List.rev(match$1[0]) + }, modtype(identity, { + TAG: /* Mty_signature */ 1, + _0: match$1[1] + }), env, loc, smty.pmty_attributes); case /* Pmty_typeof */ 4 : - const match$2 = Curry._2(type_module_type_of_fwd.contents, env, lid._0); - return mkmty$1({ - TAG: /* Tmty_typeof */ 4, - _0: match$2[0] - }, match$2[1], env, loc, smty.pmty_attributes); + const match$2 = Curry._2(type_module_type_of_fwd.contents, env, lid._0); + return mkmty$1({ + TAG: /* Tmty_typeof */ 4, + _0: match$2[0] + }, match$2[1], env, loc, smty.pmty_attributes); case /* Pmty_extension */ 5 : - throw new Caml_js_exceptions.MelangeError(Error_forward$3, { - MEL_EXN_ID: Error_forward$3, - _1: error_of_extension(lid._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$3, { + MEL_EXN_ID: Error_forward$3, + _1: error_of_extension(lid._0) + }); case /* Pmty_alias */ 6 : - const lid$2 = lid._0; - const path$1 = transl_module_alias(loc, env, lid$2.txt); - return mkmty$1({ - TAG: /* Tmty_alias */ 5, - _0: path$1, - _1: lid$2 - }, { - TAG: /* Mty_alias */ 3, - _0: path$1 - }, env, loc, smty.pmty_attributes); + const lid$2 = lid._0; + const path$1 = transl_module_alias(loc, env, lid$2.txt); + return mkmty$1({ + TAG: /* Tmty_alias */ 5, + _0: path$1, + _1: lid$2 + }, { + TAG: /* Mty_alias */ 3, + _0: path$1 + }, env, loc, smty.pmty_attributes); } } @@ -83562,383 +83562,383 @@ function transl_signature(env, sg) { const sdesc = item.psig_desc; switch (sdesc.TAG) { case /* Psig_value */ 0 : - const match = transl_value_decl(env, item.psig_loc, sdesc._0); - const tdesc = match[0]; - const match$1 = transl_sig(match[1], srem); - const rem = match$1[1]; - const partial_arg = tdesc.val_id; - return [ - { - hd: mksig$1({ - TAG: /* Tsig_value */ 0, - _0: tdesc - }, env, loc), - tl: match$1[0] - }, - Stdlib__List.exists((function (param) { - return equal(partial_arg, param); - }), get_values(rem)) ? rem : ({ - hd: { - TAG: /* Sig_value */ 0, - _0: tdesc.val_id, - _1: tdesc.val_val - }, - tl: rem - }), - match$1[2] - ]; + const match = transl_value_decl(env, item.psig_loc, sdesc._0); + const tdesc = match[0]; + const match$1 = transl_sig(match[1], srem); + const rem = match$1[1]; + const partial_arg = tdesc.val_id; + return [ + { + hd: mksig$1({ + TAG: /* Tsig_value */ 0, + _0: tdesc + }, env, loc), + tl: match$1[0] + }, + Stdlib__List.exists((function (param) { + return equal(partial_arg, param); + }), get_values(rem)) ? rem : ({ + hd: { + TAG: /* Sig_value */ 0, + _0: tdesc.val_id, + _1: tdesc.val_val + }, + tl: rem + }), + match$1[2] + ]; case /* Psig_type */ 1 : - const sdecls = sdesc._0; - const rec_flag = rec_flag_of_ptype_declarations(sdecls); - Stdlib__List.iter((function (decl) { - check_name("type", type_names, decl.ptype_name); - }), sdecls); - const match$2 = transl_type_decl(env, rec_flag, sdecls); - const decls = match$2[0]; - const match$3 = transl_sig(match$2[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_type */ 1, - _0: decls - }, env, loc), - tl: match$3[0] - }, - map_rec_type_with_row_types(rec_flag, (function (rs, td) { - return { - TAG: /* Sig_type */ 1, - _0: td.typ_id, - _1: td.typ_type, - _2: rs - }; - }), decls, match$3[1]), - match$3[2] - ]; + const sdecls = sdesc._0; + const rec_flag = rec_flag_of_ptype_declarations(sdecls); + Stdlib__List.iter((function (decl) { + check_name("type", type_names, decl.ptype_name); + }), sdecls); + const match$2 = transl_type_decl(env, rec_flag, sdecls); + const decls = match$2[0]; + const match$3 = transl_sig(match$2[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_type */ 1, + _0: decls + }, env, loc), + tl: match$3[0] + }, + map_rec_type_with_row_types(rec_flag, (function (rs, td) { + return { + TAG: /* Sig_type */ 1, + _0: td.typ_id, + _1: td.typ_type, + _2: rs + }; + }), decls, match$3[1]), + match$3[2] + ]; case /* Psig_typext */ 2 : - const match$4 = transl_type_extension(false, env, item.psig_loc, sdesc._0); - const tyext = match$4[0]; - const match$5 = transl_sig(match$4[1], srem); - const rem$1 = match$5[1]; - const constructors = Stdlib__List.filter((function (ext) { - const partial_arg = ext.ext_id; - return !Stdlib__List.exists((function (param) { - return equal(partial_arg, param); - }), get_extension_constructors(rem$1)); - }), tyext.tyext_constructors); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_typext */ 2, - _0: tyext - }, env, loc), - tl: match$5[0] - }, - map_ext((function (es, ext) { - return { - TAG: /* Sig_typext */ 2, - _0: ext.ext_id, - _1: ext.ext_type, - _2: es - }; - }), constructors, rem$1), - match$5[2] - ]; - case /* Psig_exception */ 3 : - const match$6 = transl_exception(env, sdesc._0); - const ext = match$6[0]; - const match$7 = transl_sig(match$6[1], srem); - const rem$2 = match$7[1]; - const partial_arg$1 = ext.ext_id; - const shadowed = Stdlib__List.exists((function (param) { - return equal(partial_arg$1, param); - }), get_extension_constructors(rem$2)); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_exception */ 3, - _0: ext - }, env, loc), - tl: match$7[0] - }, - shadowed ? rem$2 : ({ - hd: { + const match$4 = transl_type_extension(false, env, item.psig_loc, sdesc._0); + const tyext = match$4[0]; + const match$5 = transl_sig(match$4[1], srem); + const rem$1 = match$5[1]; + const constructors = Stdlib__List.filter((function (ext) { + const partial_arg = ext.ext_id; + return !Stdlib__List.exists((function (param) { + return equal(partial_arg, param); + }), get_extension_constructors(rem$1)); + }), tyext.tyext_constructors); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_typext */ 2, + _0: tyext + }, env, loc), + tl: match$5[0] + }, + map_ext((function (es, ext) { + return { TAG: /* Sig_typext */ 2, _0: ext.ext_id, _1: ext.ext_type, - _2: /* Text_exception */ 2 - }, - tl: rem$2 - }), - match$7[2] - ]; - case /* Psig_module */ 4 : - const pmd = sdesc._0; - check_name("module", module_names, pmd.pmd_name); - const tmty = transl_modtype$1(env, pmd.pmd_type); - const md_md_type = tmty.mty_type; - const md_md_attributes = pmd.pmd_attributes; - const md_md_loc = pmd.pmd_loc; - const md = { - md_type: md_md_type, - md_attributes: md_md_attributes, - md_loc: md_md_loc - }; - const match$8 = enter_module_declaration(undefined, pmd.pmd_name.txt, md, env); - const id = match$8[0]; - const match$9 = transl_sig(match$8[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_module */ 4, - _0: { - md_id: id, - md_name: pmd.pmd_name, - md_type: tmty, - md_attributes: pmd.pmd_attributes, - md_loc: pmd.pmd_loc - } - }, env, loc), - tl: match$9[0] - }, - { + _2: es + }; + }), constructors, rem$1), + match$5[2] + ]; + case /* Psig_exception */ 3 : + const match$6 = transl_exception(env, sdesc._0); + const ext = match$6[0]; + const match$7 = transl_sig(match$6[1], srem); + const rem$2 = match$7[1]; + const partial_arg$1 = ext.ext_id; + const shadowed = Stdlib__List.exists((function (param) { + return equal(partial_arg$1, param); + }), get_extension_constructors(rem$2)); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_exception */ 3, + _0: ext + }, env, loc), + tl: match$7[0] + }, + shadowed ? rem$2 : ({ hd: { - TAG: /* Sig_module */ 3, - _0: id, - _1: md, - _2: /* Trec_not */ 0 + TAG: /* Sig_typext */ 2, + _0: ext.ext_id, + _1: ext.ext_type, + _2: /* Text_exception */ 2 }, - tl: match$9[1] + tl: rem$2 + }), + match$7[2] + ]; + case /* Psig_module */ 4 : + const pmd = sdesc._0; + check_name("module", module_names, pmd.pmd_name); + const tmty = transl_modtype$1(env, pmd.pmd_type); + const md_md_type = tmty.mty_type; + const md_md_attributes = pmd.pmd_attributes; + const md_md_loc = pmd.pmd_loc; + const md = { + md_type: md_md_type, + md_attributes: md_md_attributes, + md_loc: md_md_loc + }; + const match$8 = enter_module_declaration(undefined, pmd.pmd_name.txt, md, env); + const id = match$8[0]; + const match$9 = transl_sig(match$8[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_module */ 4, + _0: { + md_id: id, + md_name: pmd.pmd_name, + md_type: tmty, + md_attributes: pmd.pmd_attributes, + md_loc: pmd.pmd_loc + } + }, env, loc), + tl: match$9[0] + }, + { + hd: { + TAG: /* Sig_module */ 3, + _0: id, + _1: md, + _2: /* Trec_not */ 0 }, - match$9[2] - ]; + tl: match$9[1] + }, + match$9[2] + ]; case /* Psig_recmodule */ 5 : - const sdecls$1 = sdesc._0; - Stdlib__List.iter((function (pmd) { - check_name("module", module_names, pmd.pmd_name); - }), sdecls$1); - const match$10 = transl_recmodule_modtypes(item.psig_loc, env, sdecls$1); - const decls$1 = match$10[0]; - const match$11 = transl_sig(match$10[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_recmodule */ 5, - _0: decls$1 - }, env, loc), - tl: match$11[0] - }, - map_rec((function (rs, md) { - const d_md_type = md.md_type.mty_type; - const d_md_attributes = md.md_attributes; - const d_md_loc = md.md_loc; - const d = { - md_type: d_md_type, - md_attributes: d_md_attributes, - md_loc: d_md_loc - }; - return { - TAG: /* Sig_module */ 3, - _0: md.md_id, - _1: d, - _2: rs - }; - }), decls$1, match$11[1]), - match$11[2] - ]; + const sdecls$1 = sdesc._0; + Stdlib__List.iter((function (pmd) { + check_name("module", module_names, pmd.pmd_name); + }), sdecls$1); + const match$10 = transl_recmodule_modtypes(item.psig_loc, env, sdecls$1); + const decls$1 = match$10[0]; + const match$11 = transl_sig(match$10[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_recmodule */ 5, + _0: decls$1 + }, env, loc), + tl: match$11[0] + }, + map_rec((function (rs, md) { + const d_md_type = md.md_type.mty_type; + const d_md_attributes = md.md_attributes; + const d_md_loc = md.md_loc; + const d = { + md_type: d_md_type, + md_attributes: d_md_attributes, + md_loc: d_md_loc + }; + return { + TAG: /* Sig_module */ 3, + _0: md.md_id, + _1: d, + _2: rs + }; + }), decls$1, match$11[1]), + match$11[2] + ]; case /* Psig_modtype */ 6 : - const match$12 = transl_modtype_decl(modtype_names, env, item.psig_loc, sdesc._0); - const match$13 = transl_sig(match$12[0], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_modtype */ 6, - _0: match$12[1] - }, env, loc), - tl: match$13[0] - }, - { - hd: match$12[2], - tl: match$13[1] - }, - match$13[2] - ]; + const match$12 = transl_modtype_decl(modtype_names, env, item.psig_loc, sdesc._0); + const match$13 = transl_sig(match$12[0], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_modtype */ 6, + _0: match$12[1] + }, env, loc), + tl: match$13[0] + }, + { + hd: match$12[2], + tl: match$13[1] + }, + match$13[2] + ]; case /* Psig_open */ 7 : - const match$14 = type_open$1(undefined, env, sdesc._0); - const match$15 = transl_sig(match$14[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_open */ 7, - _0: match$14[2] - }, env, loc), - tl: match$15[0] - }, - match$15[1], - match$15[2] - ]; + const match$14 = type_open$1(undefined, env, sdesc._0); + const match$15 = transl_sig(match$14[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_open */ 7, + _0: match$14[2] + }, env, loc), + tl: match$15[0] + }, + match$15[1], + match$15[2] + ]; case /* Psig_include */ 8 : - const sincl = sdesc._0; - const smty = sincl.pincl_mod; - const tmty$1 = transl_modtype$1(env, smty); - const mty = tmty$1.mty_type; - const sg$1 = signature$2(identity, extract_sig(env, smty.pmty_loc, mty)); - const partial_arg$2 = item.psig_loc; - Stdlib__List.iter((function (param) { - return check_sig_item(type_names, module_names, modtype_names, partial_arg$2, param); - }), sg$1); - const newenv = add_signature(sg$1, env); - const incl_incl_loc = sincl.pincl_loc; - const incl_incl_attributes = sincl.pincl_attributes; - const incl = { - incl_mod: tmty$1, - incl_type: sg$1, - incl_loc: incl_incl_loc, - incl_attributes: incl_incl_attributes - }; - const match$16 = transl_sig(newenv, srem); - const rem$3 = match$16[1]; - return [ - { - hd: mksig$1({ - TAG: /* Tsig_include */ 8, - _0: incl - }, env, loc), - tl: match$16[0] - }, - Stdlib.$at(remove_duplicates(get_values(rem$3), get_extension_constructors(rem$3), sg$1), rem$3), - match$16[2] - ]; + const sincl = sdesc._0; + const smty = sincl.pincl_mod; + const tmty$1 = transl_modtype$1(env, smty); + const mty = tmty$1.mty_type; + const sg$1 = signature$2(identity, extract_sig(env, smty.pmty_loc, mty)); + const partial_arg$2 = item.psig_loc; + Stdlib__List.iter((function (param) { + return check_sig_item(type_names, module_names, modtype_names, partial_arg$2, param); + }), sg$1); + const newenv = add_signature(sg$1, env); + const incl_incl_loc = sincl.pincl_loc; + const incl_incl_attributes = sincl.pincl_attributes; + const incl = { + incl_mod: tmty$1, + incl_type: sg$1, + incl_loc: incl_incl_loc, + incl_attributes: incl_incl_attributes + }; + const match$16 = transl_sig(newenv, srem); + const rem$3 = match$16[1]; + return [ + { + hd: mksig$1({ + TAG: /* Tsig_include */ 8, + _0: incl + }, env, loc), + tl: match$16[0] + }, + Stdlib.$at(remove_duplicates(get_values(rem$3), get_extension_constructors(rem$3), sg$1), rem$3), + match$16[2] + ]; case /* Psig_class */ 9 : - const cl = sdesc._0; - Stdlib__List.iter((function (param) { - check_name("type", type_names, param.pci_name); - }), cl); - const match$17 = class_descriptions(env, cl); - const classes = match$17[0]; - const match$18 = transl_sig(match$17[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_class */ 9, - _0: Stdlib__List.map2((function (pcl, tcl) { - return tcl[11]; - }), cl, classes) - }, env, loc), - tl: match$18[0] - }, - Stdlib__List.flatten(map_rec((function (rs, param) { - return { + const cl = sdesc._0; + Stdlib__List.iter((function (param) { + check_name("type", type_names, param.pci_name); + }), cl); + const match$17 = class_descriptions(env, cl); + const classes = match$17[0]; + const match$18 = transl_sig(match$17[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_class */ 9, + _0: Stdlib__List.map2((function (pcl, tcl) { + return tcl[11]; + }), cl, classes) + }, env, loc), + tl: match$18[0] + }, + Stdlib__List.flatten(map_rec((function (rs, param) { + return { + hd: { + TAG: /* Sig_class */ 5, + _0: param[0], + _1: param[2], + _2: rs + }, + tl: { hd: { - TAG: /* Sig_class */ 5, - _0: param[0], - _1: param[2], + TAG: /* Sig_class_type */ 6, + _0: param[3], + _1: param[4], _2: rs }, tl: { hd: { - TAG: /* Sig_class_type */ 6, - _0: param[3], - _1: param[4], + TAG: /* Sig_type */ 1, + _0: param[5], + _1: param[6], _2: rs }, tl: { hd: { TAG: /* Sig_type */ 1, - _0: param[5], - _1: param[6], + _0: param[7], + _1: param[8], _2: rs }, - tl: { - hd: { - TAG: /* Sig_type */ 1, - _0: param[7], - _1: param[8], - _2: rs - }, - tl: /* [] */ 0 - } + tl: /* [] */ 0 } } - }; - }), classes, { - hd: match$18[1], - tl: /* [] */ 0 - })), - match$18[2] - ]; + } + }; + }), classes, { + hd: match$18[1], + tl: /* [] */ 0 + })), + match$18[2] + ]; case /* Psig_class_type */ 10 : - const cl$1 = sdesc._0; - Stdlib__List.iter((function (param) { - check_name("type", type_names, param.pci_name); - }), cl$1); - const match$19 = class_type_declarations$2(env, cl$1); - const classes$1 = match$19[0]; - const match$20 = transl_sig(match$19[1], srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_class_type */ 10, - _0: Stdlib__List.map2((function (pcl, tcl) { - return tcl[7]; - }), cl$1, classes$1) - }, env, loc), - tl: match$20[0] - }, - Stdlib__List.flatten(map_rec((function (rs, param) { - return { + const cl$1 = sdesc._0; + Stdlib__List.iter((function (param) { + check_name("type", type_names, param.pci_name); + }), cl$1); + const match$19 = class_type_declarations$2(env, cl$1); + const classes$1 = match$19[0]; + const match$20 = transl_sig(match$19[1], srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_class_type */ 10, + _0: Stdlib__List.map2((function (pcl, tcl) { + return tcl[7]; + }), cl$1, classes$1) + }, env, loc), + tl: match$20[0] + }, + Stdlib__List.flatten(map_rec((function (rs, param) { + return { + hd: { + TAG: /* Sig_class_type */ 6, + _0: param[0], + _1: param[2], + _2: rs + }, + tl: { hd: { - TAG: /* Sig_class_type */ 6, - _0: param[0], - _1: param[2], + TAG: /* Sig_type */ 1, + _0: param[3], + _1: param[4], _2: rs }, tl: { hd: { TAG: /* Sig_type */ 1, - _0: param[3], - _1: param[4], + _0: param[5], + _1: param[6], _2: rs }, - tl: { - hd: { - TAG: /* Sig_type */ 1, - _0: param[5], - _1: param[6], - _2: rs - }, - tl: /* [] */ 0 - } + tl: /* [] */ 0 } - }; - }), classes$1, { - hd: match$20[1], - tl: /* [] */ 0 - })), - match$20[2] - ]; + } + }; + }), classes$1, { + hd: match$20[1], + tl: /* [] */ 0 + })), + match$20[2] + ]; case /* Psig_attribute */ 11 : - const x = sdesc._0; - warning_attribute({ - hd: x, - tl: /* [] */ 0 - }); - const match$21 = transl_sig(env, srem); - return [ - { - hd: mksig$1({ - TAG: /* Tsig_attribute */ 11, - _0: x - }, env, loc), - tl: match$21[0] - }, - match$21[1], - match$21[2] - ]; + const x = sdesc._0; + warning_attribute({ + hd: x, + tl: /* [] */ 0 + }); + const match$21 = transl_sig(env, srem); + return [ + { + hd: mksig$1({ + TAG: /* Tsig_attribute */ 11, + _0: x + }, env, loc), + tl: match$21[0] + }, + match$21[1], + match$21[2] + ]; case /* Psig_extension */ 12 : - throw new Caml_js_exceptions.MelangeError(Error_forward$3, { - MEL_EXN_ID: Error_forward$3, - _1: error_of_extension(sdesc._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$3, { + MEL_EXN_ID: Error_forward$3, + _1: error_of_extension(sdesc._0) + }); } }; @@ -84074,71 +84074,71 @@ function simplify_signature(sg) { const component = param.hd; switch (component.TAG) { case /* Sig_value */ 0 : - const k = aux(param.tl); - const val_names = k[1]; - const name = component._0.name; - if (Curry._2(mem$7, name, val_names)) { - return k; - } else { - return [ - { - hd: component, - tl: k[0] - }, - Curry._2(add$14, name, val_names), - k[2] - ]; - } + const k = aux(param.tl); + const val_names = k[1]; + const name = component._0.name; + if (Curry._2(mem$7, name, val_names)) { + return k; + } else { + return [ + { + hd: component, + tl: k[0] + }, + Curry._2(add$14, name, val_names), + k[2] + ]; + } case /* Sig_typext */ 2 : - const k$1 = aux(param.tl); - const ext_names = k$1[2]; - const val_names$1 = k$1[1]; - const sg = k$1[0]; - const name$1 = component._0.name; - if (!Curry._2(mem$7, name$1, ext_names)) { - return [ - { - hd: component, - tl: sg - }, - val_names$1, - Curry._2(add$14, name$1, ext_names) - ]; - } - switch (component._2) { - case /* Text_first */ 0 : - if (!sg) { - return k$1; - } - const match = sg.hd; - if (match.TAG !== /* Sig_typext */ 2) { - return k$1; - } - switch (match._2) { - case /* Text_next */ 1 : - return [ - { - hd: { - TAG: /* Sig_typext */ 2, - _0: match._0, - _1: match._1, - _2: /* Text_first */ 0 - }, - tl: sg.tl - }, - val_names$1, - ext_names - ]; - case /* Text_first */ 0 : - case /* Text_exception */ 2 : - return k$1; - - } - case /* Text_next */ 1 : - case /* Text_exception */ 2 : + const k$1 = aux(param.tl); + const ext_names = k$1[2]; + const val_names$1 = k$1[1]; + const sg = k$1[0]; + const name$1 = component._0.name; + if (!Curry._2(mem$7, name$1, ext_names)) { + return [ + { + hd: component, + tl: sg + }, + val_names$1, + Curry._2(add$14, name$1, ext_names) + ]; + } + switch (component._2) { + case /* Text_first */ 0 : + if (!sg) { + return k$1; + } + const match = sg.hd; + if (match.TAG !== /* Sig_typext */ 2) { + return k$1; + } + switch (match._2) { + case /* Text_next */ 1 : + return [ + { + hd: { + TAG: /* Sig_typext */ 2, + _0: match._0, + _1: match._1, + _2: /* Text_first */ 0 + }, + tl: sg.tl + }, + val_names$1, + ext_names + ]; + case /* Text_first */ 0 : + case /* Text_exception */ 2 : return k$1; - - } + + } + case /* Text_next */ 1 : + case /* Text_exception */ 2 : + return k$1; + + } default: const match$1 = aux(param.tl); return [ @@ -84162,21 +84162,21 @@ function path_of_module(_mexp) { const match = mexp.mod_desc; switch (match.TAG) { case /* Tmod_ident */ 0 : - return match._0; + return match._0; case /* Tmod_apply */ 3 : - if (applicative_functors.contents) { - return { - TAG: /* Papply */ 2, - _0: path_of_module(match._0), - _1: path_of_module(match._1) - }; - } - throw new Caml_js_exceptions.MelangeError(Not_a_path, { - MEL_EXN_ID: Not_a_path - }); + if (applicative_functors.contents) { + return { + TAG: /* Papply */ 2, + _0: path_of_module(match._0), + _1: path_of_module(match._1) + }; + } + throw new Caml_js_exceptions.MelangeError(Not_a_path, { + MEL_EXN_ID: Not_a_path + }); case /* Tmod_constraint */ 4 : - _mexp = match._0; - continue; + _mexp = match._0; + continue; default: throw new Caml_js_exceptions.MelangeError(Not_a_path, { MEL_EXN_ID: Not_a_path @@ -84203,13 +84203,13 @@ function closed_modtype(_p) { const p = _p; switch (p.TAG) { case /* Mty_signature */ 1 : - return Stdlib__List.for_all(closed_signature_item, p._0); + return Stdlib__List.for_all(closed_signature_item, p._0); case /* Mty_functor */ 2 : - _p = p._2; - continue; + _p = p._2; + continue; case /* Mty_ident */ 0 : case /* Mty_alias */ 3 : - return true; + return true; } }; @@ -84218,9 +84218,9 @@ function closed_modtype(_p) { function closed_signature_item(param) { switch (param.TAG) { case /* Sig_value */ 0 : - return closed_schema(param._1.val_type); + return closed_schema(param._1.val_type); case /* Sig_module */ 3 : - return closed_modtype(param._1.md_type); + return closed_modtype(param._1.md_type); default: return true; } @@ -84374,84 +84374,84 @@ function package_constraints(env, loc, mty, constrs) { const sg$p = Stdlib__List.map((function (item) { switch (item.TAG) { case /* Sig_type */ 1 : - const td = item._1; - if (td.type_params) { - return item; - } - const id = item._0; - if (!Stdlib__List.mem_assoc({ - hd: id.name, - tl: /* [] */ 0 - }, constrs)) { - return item; - } - const ty = Stdlib__List.assoc({ + const td = item._1; + if (td.type_params) { + return item; + } + const id = item._0; + if (!Stdlib__List.mem_assoc({ hd: id.name, tl: /* [] */ 0 - }, constrs); - return { - TAG: /* Sig_type */ 1, - _0: id, - _1: { - type_params: td.type_params, - type_arity: td.type_arity, - type_kind: td.type_kind, - type_private: td.type_private, - type_manifest: ty, - type_variance: td.type_variance, - type_newtype_level: td.type_newtype_level, - type_loc: td.type_loc, - type_attributes: td.type_attributes - }, - _2: item._2 - }; + }, constrs)) { + return item; + } + const ty = Stdlib__List.assoc({ + hd: id.name, + tl: /* [] */ 0 + }, constrs); + return { + TAG: /* Sig_type */ 1, + _0: id, + _1: { + type_params: td.type_params, + type_arity: td.type_arity, + type_kind: td.type_kind, + type_private: td.type_private, + type_manifest: ty, + type_variance: td.type_variance, + type_newtype_level: td.type_newtype_level, + type_loc: td.type_loc, + type_attributes: td.type_attributes + }, + _2: item._2 + }; case /* Sig_module */ 3 : - const md = item._1; - const id$1 = item._0; - const aux = function (_param) { - while (true) { - const param = _param; - if (!param) { - return /* [] */ 0; - } - const match = param.hd; - const match$1 = match[0]; - if (match$1) { - const l = match$1.tl; - if (l) { - if (match$1.hd === id$1.name) { - return { - hd: [ - l, - match[1] - ], - tl: aux(param.tl) - }; - } - _param = param.tl; - continue; + const md = item._1; + const id$1 = item._0; + const aux = function (_param) { + while (true) { + const param = _param; + if (!param) { + return /* [] */ 0; + } + const match = param.hd; + const match$1 = match[0]; + if (match$1) { + const l = match$1.tl; + if (l) { + if (match$1.hd === id$1.name) { + return { + hd: [ + l, + match[1] + ], + tl: aux(param.tl) + }; } _param = param.tl; continue; } _param = param.tl; continue; - }; - }; - const md_md_type = package_constraints(env, loc, md.md_type, aux(constrs)); - const md_md_attributes = md.md_attributes; - const md_md_loc = md.md_loc; - const md$1 = { - md_type: md_md_type, - md_attributes: md_md_attributes, - md_loc: md_md_loc - }; - return { - TAG: /* Sig_module */ 3, - _0: id$1, - _1: md$1, - _2: item._2 + } + _param = param.tl; + continue; }; + }; + const md_md_type = package_constraints(env, loc, md.md_type, aux(constrs)); + const md_md_attributes = md.md_attributes; + const md_md_loc = md.md_loc; + const md$1 = { + md_type: md_md_type, + md_attributes: md_md_attributes, + md_loc: md_md_loc + }; + return { + TAG: /* Sig_module */ 3, + _0: id$1, + _1: md$1, + _2: item._2 + }; default: return item; } @@ -84572,384 +84572,384 @@ function type_module$1(aliasOpt, sttn, funct_body, anchor, env, smod) { const lid = smod.pmod_desc; switch (lid.TAG) { case /* Pmod_ident */ 0 : - const lid$1 = lid._0; - const path = lookup_module$1(!alias, env, smod.pmod_loc, lid$1.txt); - const md_mod_desc = { - TAG: /* Tmod_ident */ 0, - _0: path, - _1: lid$1 - }; - const md_mod_loc = smod.pmod_loc; - const md_mod_type = { - TAG: /* Mty_alias */ 3, - _0: path - }; - const md_mod_attributes = smod.pmod_attributes; - const md = { - mod_desc: md_mod_desc, - mod_loc: md_mod_loc, - mod_type: md_mod_type, - mod_env: env, - mod_attributes: md_mod_attributes - }; - let node; - if (alias && !is_functor_arg(path, env)) { - add_required_global(head(path)); - node = md; + const lid$1 = lid._0; + const path = lookup_module$1(!alias, env, smod.pmod_loc, lid$1.txt); + const md_mod_desc = { + TAG: /* Tmod_ident */ 0, + _0: path, + _1: lid$1 + }; + const md_mod_loc = smod.pmod_loc; + const md_mod_type = { + TAG: /* Mty_alias */ 3, + _0: path + }; + const md_mod_attributes = smod.pmod_attributes; + const md = { + mod_desc: md_mod_desc, + mod_loc: md_mod_loc, + mod_type: md_mod_type, + mod_env: env, + mod_attributes: md_mod_attributes + }; + let node; + if (alias && !is_functor_arg(path, env)) { + add_required_global(head(path)); + node = md; + } else { + const p1 = find_module(false, path, env).md_type; + let exit = 0; + if (p1.TAG === /* Mty_alias */ 3 && !alias) { + const p1$1 = normalize_path$1(smod.pmod_loc, env, p1._0); + const mty = expand_module_alias(env, /* [] */ 0, p1$1); + node = { + mod_desc: { + TAG: /* Tmod_constraint */ 4, + _0: md, + _1: mty, + _2: /* Tmodtype_implicit */ 0, + _3: { + TAG: /* Tcoerce_alias */ 3, + _0: p1$1, + _1: /* Tcoerce_none */ 0 + } + }, + mod_loc: md_mod_loc, + mod_type: sttn ? strengthen$1(env, mty, p1$1) : mty, + mod_env: env, + mod_attributes: md_mod_attributes + }; } else { - const p1 = find_module(false, path, env).md_type; - let exit = 0; - if (p1.TAG === /* Mty_alias */ 3 && !alias) { - const p1$1 = normalize_path$1(smod.pmod_loc, env, p1._0); - const mty = expand_module_alias(env, /* [] */ 0, p1$1); - node = { - mod_desc: { - TAG: /* Tmod_constraint */ 4, - _0: md, - _1: mty, - _2: /* Tmodtype_implicit */ 0, - _3: { - TAG: /* Tcoerce_alias */ 3, - _0: p1$1, - _1: /* Tcoerce_none */ 0 - } - }, - mod_loc: md_mod_loc, - mod_type: sttn ? strengthen$1(env, mty, p1$1) : mty, - mod_env: env, - mod_attributes: md_mod_attributes - }; - } else { - exit = 1; + exit = 1; + } + if (exit === 1) { + const mty$1 = sttn ? strengthen$1(env, p1, path) : p1; + node = { + mod_desc: md_mod_desc, + mod_loc: md_mod_loc, + mod_type: mty$1, + mod_env: env, + mod_attributes: md_mod_attributes + }; + } + + } + record$2({ + TAG: /* Ti_mod */ 3, + _0: node + }); + return node; + case /* Pmod_structure */ 1 : + const match = type_structure(undefined, funct_body, anchor, env, lid._0, smod.pmod_loc); + const sg = match[1]; + const node_mod_desc = { + TAG: /* Tmod_structure */ 1, + _0: match[0] + }; + const node_mod_loc = smod.pmod_loc; + const node_mod_type = { + TAG: /* Mty_signature */ 1, + _0: sg + }; + const node_mod_attributes = smod.pmod_attributes; + const node$1 = { + mod_desc: node_mod_desc, + mod_loc: node_mod_loc, + mod_type: node_mod_type, + mod_env: env, + mod_attributes: node_mod_attributes + }; + record$2({ + TAG: /* Ti_mod */ 3, + _0: node$1 + }); + const sg$p = simplify_signature(sg); + if (Stdlib__List.length(sg$p) === Stdlib__List.length(sg)) { + return node$1; + } else { + return wrap_constraint(implicit_coercion(env), node$1, { + TAG: /* Mty_signature */ 1, + _0: sg$p + }, /* Tmodtype_implicit */ 0); + } + case /* Pmod_functor */ 2 : + const name = lid._0; + const mty$2 = may_map((function (param) { + return transl_modtype$1(env, param); + }), lid._1); + const ty_arg = may_map((function (m) { + return m.mty_type; + }), mty$2); + const match$1 = ty_arg !== undefined ? [ + enter_module(true, name.txt, ty_arg, env), + true + ] : [ + [ + create("*"), + env + ], + false + ]; + const match$2 = match$1[0]; + const id = match$2[0]; + const body = type_module$1(undefined, sttn, match$1[1], undefined, match$2[1], lid._2); + const node_mod_desc$1 = { + TAG: /* Tmod_functor */ 2, + _0: id, + _1: name, + _2: mty$2, + _3: body + }; + const node_mod_loc$1 = smod.pmod_loc; + const node_mod_type$1 = { + TAG: /* Mty_functor */ 2, + _0: id, + _1: ty_arg, + _2: body.mod_type + }; + const node_mod_attributes$1 = smod.pmod_attributes; + const node$2 = { + mod_desc: node_mod_desc$1, + mod_loc: node_mod_loc$1, + mod_type: node_mod_type$1, + mod_env: env, + mod_attributes: node_mod_attributes$1 + }; + record$2({ + TAG: /* Ti_mod */ 3, + _0: node$2 + }); + return node$2; + case /* Pmod_apply */ 3 : + const sarg = lid._1; + const sfunct = lid._0; + const arg = type_module$1(undefined, true, funct_body, undefined, env, sarg); + const path$1 = path_of_module$1(arg); + const funct = type_module$1(undefined, sttn && path$1 !== undefined, funct_body, undefined, env, sfunct); + const mty_functor = scrape_alias(env, undefined, funct.mod_type); + if (mty_functor.TAG === /* Mty_functor */ 2) { + const mty_res = mty_functor._2; + const mty_param = mty_functor._1; + const param = mty_functor._0; + const generative = mty_param === undefined; + const mty_param$1 = mty_param !== undefined ? mty_param : ({ + TAG: /* Mty_signature */ 1, + _0: /* [] */ 0 + }); + if (generative) { + if (Caml_obj.caml_notequal(sarg.pmod_desc, { + TAG: /* Pmod_structure */ 1, + _0: /* [] */ 0 + })) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: sfunct.pmod_loc, + _2: env, + _3: /* Apply_generative */ 4 + }); } - if (exit === 1) { - const mty$1 = sttn ? strengthen$1(env, p1, path) : p1; - node = { - mod_desc: md_mod_desc, - mod_loc: md_mod_loc, - mod_type: mty$1, - mod_env: env, - mod_attributes: md_mod_attributes - }; + if (funct_body && contains_type$1(env, funct.mod_type)) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: smod.pmod_loc, + _2: env, + _3: /* Not_allowed_in_functor_body */ 1 + }); } } - record$2({ - TAG: /* Ti_mod */ 3, - _0: node - }); - return node; - case /* Pmod_structure */ 1 : - const match = type_structure(undefined, funct_body, anchor, env, lid._0, smod.pmod_loc); - const sg = match[1]; - const node_mod_desc = { - TAG: /* Tmod_structure */ 1, - _0: match[0] - }; - const node_mod_loc = smod.pmod_loc; - const node_mod_type = { - TAG: /* Mty_signature */ 1, - _0: sg - }; - const node_mod_attributes = smod.pmod_attributes; - const node$1 = { - mod_desc: node_mod_desc, - mod_loc: node_mod_loc, - mod_type: node_mod_type, - mod_env: env, - mod_attributes: node_mod_attributes - }; - record$2({ - TAG: /* Ti_mod */ 3, - _0: node$1 - }); - const sg$p = simplify_signature(sg); - if (Stdlib__List.length(sg$p) === Stdlib__List.length(sg)) { - return node$1; + let coercion; + try { + coercion = modtypes$1(env, arg.mod_type, mty_param$1); + } + catch (raw_msg){ + const msg = Caml_js_exceptions.internalToOCamlException(raw_msg); + if (msg.MEL_EXN_ID === $$Error$5) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: sarg.pmod_loc, + _2: env, + _3: { + TAG: /* Not_included */ 1, + _0: msg._1 + } + }); + } + throw new Caml_js_exceptions.MelangeError(msg.MEL_EXN_ID, msg); + } + let mty_appl; + if (path$1 !== undefined) { + mty_appl = modtype(add_module(param, path$1, identity), mty_res); + } else if (generative) { + mty_appl = mty_res; } else { - return wrap_constraint(implicit_coercion(env), node$1, { - TAG: /* Mty_signature */ 1, - _0: sg$p - }, /* Tmodtype_implicit */ 0); + try { + mty_appl = nondep_supertype(add_module$1(true, param, arg.mod_type, env), param, mty_res); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: smod.pmod_loc, + _2: env, + _3: { + TAG: /* Cannot_eliminate_dependency */ 2, + _0: mty_functor + } + }); + } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } } - case /* Pmod_functor */ 2 : - const name = lid._0; - const mty$2 = may_map((function (param) { - return transl_modtype$1(env, param); - }), lid._1); - const ty_arg = may_map((function (m) { - return m.mty_type; - }), mty$2); - const match$1 = ty_arg !== undefined ? [ - enter_module(true, name.txt, ty_arg, env), - true - ] : [ - [ - create("*"), - env - ], - false - ]; - const match$2 = match$1[0]; - const id = match$2[0]; - const body = type_module$1(undefined, sttn, match$1[1], undefined, match$2[1], lid._2); - const node_mod_desc$1 = { - TAG: /* Tmod_functor */ 2, - _0: id, - _1: name, - _2: mty$2, - _3: body + const node_mod_desc$2 = { + TAG: /* Tmod_apply */ 3, + _0: funct, + _1: arg, + _2: coercion }; - const node_mod_loc$1 = smod.pmod_loc; - const node_mod_type$1 = { - TAG: /* Mty_functor */ 2, - _0: id, - _1: ty_arg, - _2: body.mod_type - }; - const node_mod_attributes$1 = smod.pmod_attributes; - const node$2 = { - mod_desc: node_mod_desc$1, - mod_loc: node_mod_loc$1, - mod_type: node_mod_type$1, + const node_mod_loc$2 = smod.pmod_loc; + const node_mod_attributes$2 = smod.pmod_attributes; + const node$3 = { + mod_desc: node_mod_desc$2, + mod_loc: node_mod_loc$2, + mod_type: mty_appl, mod_env: env, - mod_attributes: node_mod_attributes$1 + mod_attributes: node_mod_attributes$2 }; record$2({ TAG: /* Ti_mod */ 3, - _0: node$2 - }); - return node$2; - case /* Pmod_apply */ 3 : - const sarg = lid._1; - const sfunct = lid._0; - const arg = type_module$1(undefined, true, funct_body, undefined, env, sarg); - const path$1 = path_of_module$1(arg); - const funct = type_module$1(undefined, sttn && path$1 !== undefined, funct_body, undefined, env, sfunct); - const mty_functor = scrape_alias(env, undefined, funct.mod_type); - if (mty_functor.TAG === /* Mty_functor */ 2) { - const mty_res = mty_functor._2; - const mty_param = mty_functor._1; - const param = mty_functor._0; - const generative = mty_param === undefined; - const mty_param$1 = mty_param !== undefined ? mty_param : ({ - TAG: /* Mty_signature */ 1, - _0: /* [] */ 0 + _0: node$3 }); - if (generative) { - if (Caml_obj.caml_notequal(sarg.pmod_desc, { - TAG: /* Pmod_structure */ 1, - _0: /* [] */ 0 - })) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: sfunct.pmod_loc, - _2: env, - _3: /* Apply_generative */ 4 - }); + return node$3; + } + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: sfunct.pmod_loc, + _2: env, + _3: { + TAG: /* Cannot_apply */ 0, + _0: funct.mod_type } - if (funct_body && contains_type$1(env, funct.mod_type)) { + }); + case /* Pmod_constraint */ 4 : + const arg$1 = type_module$1(alias, true, funct_body, anchor, env, lid._0); + const mty$3 = transl_modtype$1(env, lid._1); + const init = wrap_constraint(env, arg$1, mty$3.mty_type, { + TAG: /* Tmodtype_explicit */ 0, + _0: mty$3 + }); + const node_mod_desc$3 = init.mod_desc; + const node_mod_loc$3 = smod.pmod_loc; + const node_mod_type$2 = init.mod_type; + const node_mod_env = init.mod_env; + const node_mod_attributes$3 = smod.pmod_attributes; + const node$4 = { + mod_desc: node_mod_desc$3, + mod_loc: node_mod_loc$3, + mod_type: node_mod_type$2, + mod_env: node_mod_env, + mod_attributes: node_mod_attributes$3 + }; + record$2({ + TAG: /* Ti_mod */ 3, + _0: node$4 + }); + return node$4; + case /* Pmod_unpack */ 5 : + if (principal.contents) { + begin_def(undefined); + } + const exp = type_exp(env, lid._0); + if (principal.contents) { + end_def(undefined); + generalize_structure$1(current_level.contents, exp.exp_type); + } + const match$3 = expand_head(env, exp.exp_type); + let mty$4; + let exit$1 = 0; + const match$4 = match$3.desc; + if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { + exit$1 = 1; + } else { + switch (match$4.TAG) { + case /* Tvar */ 0 : + throw new Caml_js_exceptions.MelangeError($$Error$7, { + MEL_EXN_ID: $$Error$7, + _1: smod.pmod_loc, + _2: env, + _3: /* Cannot_infer_signature */ 3 + }); + case /* Tpackage */ 11 : + const tl = match$4._2; + if (Stdlib__List.exists((function (t) { + return Caml_obj.caml_notequal(free_variables$1(undefined, t), /* [] */ 0); + }), tl)) { throw new Caml_js_exceptions.MelangeError($$Error$10, { MEL_EXN_ID: $$Error$10, _1: smod.pmod_loc, _2: env, - _3: /* Not_allowed_in_functor_body */ 1 - }); - } - - } - let coercion; - try { - coercion = modtypes$1(env, arg.mod_type, mty_param$1); - } - catch (raw_msg){ - const msg = Caml_js_exceptions.internalToOCamlException(raw_msg); - if (msg.MEL_EXN_ID === $$Error$5) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: sarg.pmod_loc, - _2: env, _3: { - TAG: /* Not_included */ 1, - _0: msg._1 + TAG: /* Incomplete_packed_module */ 13, + _0: exp.exp_type } }); } - throw new Caml_js_exceptions.MelangeError(msg.MEL_EXN_ID, msg); - } - let mty_appl; - if (path$1 !== undefined) { - mty_appl = modtype(add_module(param, path$1, identity), mty_res); - } else if (generative) { - mty_appl = mty_res; - } else { - try { - mty_appl = nondep_supertype(add_module$1(true, param, arg.mod_type, env), param, mty_res); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: smod.pmod_loc, - _2: env, - _3: { - TAG: /* Cannot_eliminate_dependency */ 2, - _0: mty_functor - } - }); - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + if (principal.contents && !generalizable(99999999, exp.exp_type)) { + prerr_warning(smod.pmod_loc, { + TAG: /* Not_principal */ 8, + _0: "this module unpacking" + }); } - } - const node_mod_desc$2 = { - TAG: /* Tmod_apply */ 3, - _0: funct, - _1: arg, - _2: coercion - }; - const node_mod_loc$2 = smod.pmod_loc; - const node_mod_attributes$2 = smod.pmod_attributes; - const node$3 = { - mod_desc: node_mod_desc$2, - mod_loc: node_mod_loc$2, - mod_type: mty_appl, - mod_env: env, - mod_attributes: node_mod_attributes$2 - }; - record$2({ - TAG: /* Ti_mod */ 3, - _0: node$3 - }); - return node$3; + mty$4 = modtype_of_package(env, smod.pmod_loc, match$4._0, match$4._1, tl); + break; + default: + exit$1 = 1; } + } + if (exit$1 === 1) { throw new Caml_js_exceptions.MelangeError($$Error$10, { MEL_EXN_ID: $$Error$10, - _1: sfunct.pmod_loc, + _1: smod.pmod_loc, _2: env, _3: { - TAG: /* Cannot_apply */ 0, - _0: funct.mod_type + TAG: /* Not_a_packed_module */ 12, + _0: exp.exp_type } }); - case /* Pmod_constraint */ 4 : - const arg$1 = type_module$1(alias, true, funct_body, anchor, env, lid._0); - const mty$3 = transl_modtype$1(env, lid._1); - const init = wrap_constraint(env, arg$1, mty$3.mty_type, { - TAG: /* Tmodtype_explicit */ 0, - _0: mty$3 - }); - const node_mod_desc$3 = init.mod_desc; - const node_mod_loc$3 = smod.pmod_loc; - const node_mod_type$2 = init.mod_type; - const node_mod_env = init.mod_env; - const node_mod_attributes$3 = smod.pmod_attributes; - const node$4 = { - mod_desc: node_mod_desc$3, - mod_loc: node_mod_loc$3, - mod_type: node_mod_type$2, - mod_env: node_mod_env, - mod_attributes: node_mod_attributes$3 - }; - record$2({ - TAG: /* Ti_mod */ 3, - _0: node$4 - }); - return node$4; - case /* Pmod_unpack */ 5 : - if (principal.contents) { - begin_def(undefined); - } - const exp = type_exp(env, lid._0); - if (principal.contents) { - end_def(undefined); - generalize_structure$1(current_level.contents, exp.exp_type); - } - const match$3 = expand_head(env, exp.exp_type); - let mty$4; - let exit$1 = 0; - const match$4 = match$3.desc; - if (/* tag */ typeof match$4 === "number" || typeof match$4 === "string") { - exit$1 = 1; - } else { - switch (match$4.TAG) { - case /* Tvar */ 0 : - throw new Caml_js_exceptions.MelangeError($$Error$7, { - MEL_EXN_ID: $$Error$7, - _1: smod.pmod_loc, - _2: env, - _3: /* Cannot_infer_signature */ 3 - }); - case /* Tpackage */ 11 : - const tl = match$4._2; - if (Stdlib__List.exists((function (t) { - return Caml_obj.caml_notequal(free_variables$1(undefined, t), /* [] */ 0); - }), tl)) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: smod.pmod_loc, - _2: env, - _3: { - TAG: /* Incomplete_packed_module */ 13, - _0: exp.exp_type - } - }); - } - if (principal.contents && !generalizable(99999999, exp.exp_type)) { - prerr_warning(smod.pmod_loc, { - TAG: /* Not_principal */ 8, - _0: "this module unpacking" - }); - } - mty$4 = modtype_of_package(env, smod.pmod_loc, match$4._0, match$4._1, tl); - break; - default: - exit$1 = 1; - } - } - if (exit$1 === 1) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: smod.pmod_loc, - _2: env, - _3: { - TAG: /* Not_a_packed_module */ 12, - _0: exp.exp_type - } - }); - } - if (funct_body && contains_type$1(env, mty$4)) { - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: smod.pmod_loc, - _2: env, - _3: /* Not_allowed_in_functor_body */ 1 - }); - } - const node_mod_desc$4 = { - TAG: /* Tmod_unpack */ 5, - _0: exp, - _1: mty$4 - }; - const node_mod_loc$4 = smod.pmod_loc; - const node_mod_attributes$4 = smod.pmod_attributes; - const node$5 = { - mod_desc: node_mod_desc$4, - mod_loc: node_mod_loc$4, - mod_type: mty$4, - mod_env: env, - mod_attributes: node_mod_attributes$4 - }; - record$2({ - TAG: /* Ti_mod */ 3, - _0: node$5 + } + if (funct_body && contains_type$1(env, mty$4)) { + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: smod.pmod_loc, + _2: env, + _3: /* Not_allowed_in_functor_body */ 1 }); - return node$5; + } + const node_mod_desc$4 = { + TAG: /* Tmod_unpack */ 5, + _0: exp, + _1: mty$4 + }; + const node_mod_loc$4 = smod.pmod_loc; + const node_mod_attributes$4 = smod.pmod_attributes; + const node$5 = { + mod_desc: node_mod_desc$4, + mod_loc: node_mod_loc$4, + mod_type: mty$4, + mod_env: env, + mod_attributes: node_mod_attributes$4 + }; + record$2({ + TAG: /* Ti_mod */ 3, + _0: node$5 + }); + return node$5; case /* Pmod_extension */ 6 : - throw new Caml_js_exceptions.MelangeError(Error_forward$3, { - MEL_EXN_ID: Error_forward$3, - _1: error_of_extension(lid._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$3, { + MEL_EXN_ID: Error_forward$3, + _1: error_of_extension(lid._0) + }); } } @@ -84970,487 +84970,487 @@ function type_structure(toplevelOpt, funct_body, anchor, env, sstr, scope) { const desc = param.pstr_desc; switch (desc.TAG) { case /* Pstr_eval */ 0 : - const expr = type_expression(env, desc._0); - return [ - { - TAG: /* Tstr_eval */ 0, - _0: expr, - _1: desc._1 - }, - /* [] */ 0, - env - ]; + const expr = type_expression(env, desc._0); + return [ + { + TAG: /* Tstr_eval */ 0, + _0: expr, + _1: desc._1 + }, + /* [] */ 0, + env + ]; case /* Pstr_value */ 1 : - const rec_flag = desc._0; - let scope$1; - if (rec_flag === /* Nonrecursive */ 0) { - const start = srem ? srem.hd.pstr_loc.loc_start : loc.loc_end; - scope$1 = { - TAG: /* Idef */ 1, - _0: { - loc_start: start, - loc_end: scope.loc_end, - loc_ghost: scope.loc_ghost - } - }; - } else { - scope$1 = { - TAG: /* Idef */ 1, - _0: { - loc_start: loc.loc_start, - loc_end: scope.loc_end, - loc_ghost: scope.loc_ghost - } - }; - } - const match = type_binding(env, rec_flag, desc._1, scope$1); - const newenv = match[1]; - const defs = match[0]; - return [ - { - TAG: /* Tstr_value */ 1, - _0: rec_flag, - _1: defs - }, - Stdlib__List.map((function (id) { - return { - TAG: /* Sig_value */ 0, - _0: id, - _1: find_value({ - TAG: /* Pident */ 0, - _0: id - }, newenv) - }; - }), let_bound_idents(defs)), - newenv - ]; + const rec_flag = desc._0; + let scope$1; + if (rec_flag === /* Nonrecursive */ 0) { + const start = srem ? srem.hd.pstr_loc.loc_start : loc.loc_end; + scope$1 = { + TAG: /* Idef */ 1, + _0: { + loc_start: start, + loc_end: scope.loc_end, + loc_ghost: scope.loc_ghost + } + }; + } else { + scope$1 = { + TAG: /* Idef */ 1, + _0: { + loc_start: loc.loc_start, + loc_end: scope.loc_end, + loc_ghost: scope.loc_ghost + } + }; + } + const match = type_binding(env, rec_flag, desc._1, scope$1); + const newenv = match[1]; + const defs = match[0]; + return [ + { + TAG: /* Tstr_value */ 1, + _0: rec_flag, + _1: defs + }, + Stdlib__List.map((function (id) { + return { + TAG: /* Sig_value */ 0, + _0: id, + _1: find_value({ + TAG: /* Pident */ 0, + _0: id + }, newenv) + }; + }), let_bound_idents(defs)), + newenv + ]; case /* Pstr_primitive */ 2 : - const match$1 = transl_value_decl(env, loc, desc._0); - const desc$1 = match$1[0]; - return [ - { - TAG: /* Tstr_primitive */ 2, - _0: desc$1 - }, - { - hd: { - TAG: /* Sig_value */ 0, - _0: desc$1.val_id, - _1: desc$1.val_val - }, - tl: /* [] */ 0 + const match$1 = transl_value_decl(env, loc, desc._0); + const desc$1 = match$1[0]; + return [ + { + TAG: /* Tstr_primitive */ 2, + _0: desc$1 + }, + { + hd: { + TAG: /* Sig_value */ 0, + _0: desc$1.val_id, + _1: desc$1.val_val }, - match$1[1] - ]; + tl: /* [] */ 0 + }, + match$1[1] + ]; case /* Pstr_type */ 3 : - const sdecls = desc._0; - const rec_flag$1 = rec_flag_of_ptype_declarations(sdecls); - Stdlib__List.iter((function (decl) { - check_name("type", type_names, decl.ptype_name); - }), sdecls); - const match$2 = transl_type_decl(env, rec_flag$1, sdecls); - const decls = match$2[0]; - return [ - { - TAG: /* Tstr_type */ 3, - _0: decls - }, - map_rec_type_with_row_types(rec_flag$1, (function (rs, info) { - return { - TAG: /* Sig_type */ 1, - _0: info.typ_id, - _1: info.typ_type, - _2: rs - }; - }), decls, /* [] */ 0), - enrich_type_decls(anchor, decls, env, match$2[1]) - ]; + const sdecls = desc._0; + const rec_flag$1 = rec_flag_of_ptype_declarations(sdecls); + Stdlib__List.iter((function (decl) { + check_name("type", type_names, decl.ptype_name); + }), sdecls); + const match$2 = transl_type_decl(env, rec_flag$1, sdecls); + const decls = match$2[0]; + return [ + { + TAG: /* Tstr_type */ 3, + _0: decls + }, + map_rec_type_with_row_types(rec_flag$1, (function (rs, info) { + return { + TAG: /* Sig_type */ 1, + _0: info.typ_id, + _1: info.typ_type, + _2: rs + }; + }), decls, /* [] */ 0), + enrich_type_decls(anchor, decls, env, match$2[1]) + ]; case /* Pstr_typext */ 4 : - const match$3 = transl_type_extension(true, env, loc, desc._0); - const tyext = match$3[0]; - return [ - { - TAG: /* Tstr_typext */ 4, - _0: tyext - }, - map_ext((function (es, ext) { - return { - TAG: /* Sig_typext */ 2, - _0: ext.ext_id, - _1: ext.ext_type, - _2: es - }; - }), tyext.tyext_constructors, /* [] */ 0), - match$3[1] - ]; + const match$3 = transl_type_extension(true, env, loc, desc._0); + const tyext = match$3[0]; + return [ + { + TAG: /* Tstr_typext */ 4, + _0: tyext + }, + map_ext((function (es, ext) { + return { + TAG: /* Sig_typext */ 2, + _0: ext.ext_id, + _1: ext.ext_type, + _2: es + }; + }), tyext.tyext_constructors, /* [] */ 0), + match$3[1] + ]; case /* Pstr_exception */ 5 : - const match$4 = transl_exception(env, desc._0); - const ext = match$4[0]; - return [ - { - TAG: /* Tstr_exception */ 5, - _0: ext - }, - { - hd: { - TAG: /* Sig_typext */ 2, - _0: ext.ext_id, - _1: ext.ext_type, - _2: /* Text_exception */ 2 - }, - tl: /* [] */ 0 + const match$4 = transl_exception(env, desc._0); + const ext = match$4[0]; + return [ + { + TAG: /* Tstr_exception */ 5, + _0: ext + }, + { + hd: { + TAG: /* Sig_typext */ 2, + _0: ext.ext_id, + _1: ext.ext_type, + _2: /* Text_exception */ 2 }, - match$4[1] - ]; + tl: /* [] */ 0 + }, + match$4[1] + ]; case /* Pstr_module */ 6 : - const match$5 = desc._0; - const pmb_loc = match$5.pmb_loc; - const attrs = match$5.pmb_attributes; - const name = match$5.pmb_name; - check_name("module", module_names, name); - const modl = type_module$1(true, true, funct_body, anchor_submodule(name.txt, anchor), env, match$5.pmb_expr); - const md_md_type = enrich_module_type(anchor, name.txt, modl.mod_type, env); - const md = { - md_type: md_md_type, - md_attributes: attrs, - md_loc: pmb_loc - }; - const match$6 = enter_module_declaration(undefined, name.txt, md, env); - const id = match$6[0]; - return [ - { - TAG: /* Tstr_module */ 6, - _0: { - mb_id: id, - mb_name: name, - mb_expr: modl, - mb_attributes: attrs, - mb_loc: pmb_loc - } - }, - { - hd: { - TAG: /* Sig_module */ 3, - _0: id, - _1: { - md_type: modl.mod_type, - md_attributes: attrs, - md_loc: pmb_loc - }, - _2: /* Trec_not */ 0 + const match$5 = desc._0; + const pmb_loc = match$5.pmb_loc; + const attrs = match$5.pmb_attributes; + const name = match$5.pmb_name; + check_name("module", module_names, name); + const modl = type_module$1(true, true, funct_body, anchor_submodule(name.txt, anchor), env, match$5.pmb_expr); + const md_md_type = enrich_module_type(anchor, name.txt, modl.mod_type, env); + const md = { + md_type: md_md_type, + md_attributes: attrs, + md_loc: pmb_loc + }; + const match$6 = enter_module_declaration(undefined, name.txt, md, env); + const id = match$6[0]; + return [ + { + TAG: /* Tstr_module */ 6, + _0: { + mb_id: id, + mb_name: name, + mb_expr: modl, + mb_attributes: attrs, + mb_loc: pmb_loc + } + }, + { + hd: { + TAG: /* Sig_module */ 3, + _0: id, + _1: { + md_type: modl.mod_type, + md_attributes: attrs, + md_loc: pmb_loc }, - tl: /* [] */ 0 + _2: /* Trec_not */ 0 }, - match$6[1] - ]; + tl: /* [] */ 0 + }, + match$6[1] + ]; case /* Pstr_recmodule */ 7 : - const sbind = Stdlib__List.map((function (mb) { - const match = mb.pmb_expr.pmod_desc; - if (match.TAG === /* Pmod_constraint */ 4) { - return [ - mb.pmb_name, - match._1, - match._0, - mb.pmb_attributes, - mb.pmb_loc - ]; - } - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: mb.pmb_expr.pmod_loc, - _2: env, - _3: /* Recursive_module_require_explicit_type */ 3 - }); - }), desc._0); - Stdlib__List.iter((function (param) { - check_name("module", module_names, param[0]); - }), sbind); - const match$7 = transl_recmodule_modtypes(loc, env, Stdlib__List.map((function (param) { - return { - pmd_name: param[0], - pmd_type: param[1], - pmd_attributes: param[3], - pmd_loc: param[4] - }; - }), sbind)); - const newenv$1 = match$7[1]; - const decls$1 = match$7[0]; - const bindings1 = Stdlib__List.map2((function (param, param$1) { - const id = param.md_id; - const modl = type_module$1(undefined, true, funct_body, { - TAG: /* Pident */ 0, - _0: id - }, newenv$1, param$1[2]); - const mty$p = enrich_module_type(anchor, id.name, modl.mod_type, newenv$1); + const sbind = Stdlib__List.map((function (mb) { + const match = mb.pmb_expr.pmod_desc; + if (match.TAG === /* Pmod_constraint */ 4) { return [ - id, - param$1[0], - param.md_type, - modl, - mty$p, - param$1[3], - param$1[4] + mb.pmb_name, + match._1, + match._0, + mb.pmb_attributes, + mb.pmb_loc ]; - }), decls$1, sbind); - const newenv$2 = Stdlib__List.fold_left((function (env, md) { - const mdecl_md_type = md.md_type.mty_type; - const mdecl_md_attributes = md.md_attributes; - const mdecl_md_loc = md.md_loc; - const mdecl = { - md_type: mdecl_md_type, - md_attributes: mdecl_md_attributes, - md_loc: mdecl_md_loc - }; - return add_module_declaration(undefined, md.md_id, mdecl, env); - }), env, decls$1); - const bindings2 = check_recmodule_inclusion(newenv$2, bindings1); - return [ - { - TAG: /* Tstr_recmodule */ 7, - _0: bindings2 - }, - map_rec((function (rs, mb) { + } + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: mb.pmb_expr.pmod_loc, + _2: env, + _3: /* Recursive_module_require_explicit_type */ 3 + }); + }), desc._0); + Stdlib__List.iter((function (param) { + check_name("module", module_names, param[0]); + }), sbind); + const match$7 = transl_recmodule_modtypes(loc, env, Stdlib__List.map((function (param) { return { - TAG: /* Sig_module */ 3, - _0: mb.mb_id, - _1: { - md_type: mb.mb_expr.mod_type, - md_attributes: mb.mb_attributes, - md_loc: mb.mb_loc - }, - _2: rs + pmd_name: param[0], + pmd_type: param[1], + pmd_attributes: param[3], + pmd_loc: param[4] }; - }), bindings2, /* [] */ 0), - newenv$2 - ]; + }), sbind)); + const newenv$1 = match$7[1]; + const decls$1 = match$7[0]; + const bindings1 = Stdlib__List.map2((function (param, param$1) { + const id = param.md_id; + const modl = type_module$1(undefined, true, funct_body, { + TAG: /* Pident */ 0, + _0: id + }, newenv$1, param$1[2]); + const mty$p = enrich_module_type(anchor, id.name, modl.mod_type, newenv$1); + return [ + id, + param$1[0], + param.md_type, + modl, + mty$p, + param$1[3], + param$1[4] + ]; + }), decls$1, sbind); + const newenv$2 = Stdlib__List.fold_left((function (env, md) { + const mdecl_md_type = md.md_type.mty_type; + const mdecl_md_attributes = md.md_attributes; + const mdecl_md_loc = md.md_loc; + const mdecl = { + md_type: mdecl_md_type, + md_attributes: mdecl_md_attributes, + md_loc: mdecl_md_loc + }; + return add_module_declaration(undefined, md.md_id, mdecl, env); + }), env, decls$1); + const bindings2 = check_recmodule_inclusion(newenv$2, bindings1); + return [ + { + TAG: /* Tstr_recmodule */ 7, + _0: bindings2 + }, + map_rec((function (rs, mb) { + return { + TAG: /* Sig_module */ 3, + _0: mb.mb_id, + _1: { + md_type: mb.mb_expr.mod_type, + md_attributes: mb.mb_attributes, + md_loc: mb.mb_loc + }, + _2: rs + }; + }), bindings2, /* [] */ 0), + newenv$2 + ]; case /* Pstr_modtype */ 8 : - const match$8 = transl_modtype_decl(modtype_names, env, loc, desc._0); - return [ - { - TAG: /* Tstr_modtype */ 8, - _0: match$8[1] - }, - { - hd: match$8[2], - tl: /* [] */ 0 - }, - match$8[0] - ]; + const match$8 = transl_modtype_decl(modtype_names, env, loc, desc._0); + return [ + { + TAG: /* Tstr_modtype */ 8, + _0: match$8[1] + }, + { + hd: match$8[2], + tl: /* [] */ 0 + }, + match$8[0] + ]; case /* Pstr_open */ 9 : - const match$9 = type_open$1(toplevel, env, desc._0); - return [ - { - TAG: /* Tstr_open */ 9, - _0: match$9[2] - }, - /* [] */ 0, - match$9[1] - ]; + const match$9 = type_open$1(toplevel, env, desc._0); + return [ + { + TAG: /* Tstr_open */ 9, + _0: match$9[2] + }, + /* [] */ 0, + match$9[1] + ]; case /* Pstr_class */ 10 : - const cl = desc._0; - Stdlib__List.iter((function (param) { - check_name("type", type_names, param.pci_name); - }), cl); - const match$10 = class_declarations$2(env, cl); - const classes = match$10[0]; - return [ - { - TAG: /* Tstr_class */ 10, - _0: Stdlib__List.map((function (param) { - const vf = param[2].cty_new === undefined ? /* Virtual */ 0 : /* Concrete */ 1; - return [ - param[11], - param[10], - vf - ]; - }), classes) - }, - Stdlib__List.flatten(map_rec((function (rs, param) { - return { + const cl = desc._0; + Stdlib__List.iter((function (param) { + check_name("type", type_names, param.pci_name); + }), cl); + const match$10 = class_declarations$2(env, cl); + const classes = match$10[0]; + return [ + { + TAG: /* Tstr_class */ 10, + _0: Stdlib__List.map((function (param) { + const vf = param[2].cty_new === undefined ? /* Virtual */ 0 : /* Concrete */ 1; + return [ + param[11], + param[10], + vf + ]; + }), classes) + }, + Stdlib__List.flatten(map_rec((function (rs, param) { + return { + hd: { + TAG: /* Sig_class */ 5, + _0: param[0], + _1: param[2], + _2: rs + }, + tl: { hd: { - TAG: /* Sig_class */ 5, - _0: param[0], - _1: param[2], + TAG: /* Sig_class_type */ 6, + _0: param[3], + _1: param[4], _2: rs }, tl: { hd: { - TAG: /* Sig_class_type */ 6, - _0: param[3], - _1: param[4], + TAG: /* Sig_type */ 1, + _0: param[5], + _1: param[6], _2: rs }, tl: { hd: { TAG: /* Sig_type */ 1, - _0: param[5], - _1: param[6], + _0: param[7], + _1: param[8], _2: rs }, - tl: { - hd: { - TAG: /* Sig_type */ 1, - _0: param[7], - _1: param[8], - _2: rs - }, - tl: /* [] */ 0 - } + tl: /* [] */ 0 } } - }; - }), classes, /* [] */ 0)), - match$10[1] - ]; + } + }; + }), classes, /* [] */ 0)), + match$10[1] + ]; case /* Pstr_class_type */ 11 : - const cl$1 = desc._0; - Stdlib__List.iter((function (param) { - check_name("type", type_names, param.pci_name); - }), cl$1); - const match$11 = class_type_declarations$2(env, cl$1); - const classes$1 = match$11[0]; - return [ - { - TAG: /* Tstr_class_type */ 11, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - param[7] - ]; - }), classes$1) - }, - Stdlib__List.flatten(map_rec((function (rs, param) { - return { + const cl$1 = desc._0; + Stdlib__List.iter((function (param) { + check_name("type", type_names, param.pci_name); + }), cl$1); + const match$11 = class_type_declarations$2(env, cl$1); + const classes$1 = match$11[0]; + return [ + { + TAG: /* Tstr_class_type */ 11, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + param[7] + ]; + }), classes$1) + }, + Stdlib__List.flatten(map_rec((function (rs, param) { + return { + hd: { + TAG: /* Sig_class_type */ 6, + _0: param[0], + _1: param[2], + _2: rs + }, + tl: { hd: { - TAG: /* Sig_class_type */ 6, - _0: param[0], - _1: param[2], + TAG: /* Sig_type */ 1, + _0: param[3], + _1: param[4], _2: rs }, tl: { hd: { TAG: /* Sig_type */ 1, - _0: param[3], - _1: param[4], + _0: param[5], + _1: param[6], _2: rs }, - tl: { - hd: { - TAG: /* Sig_type */ 1, - _0: param[5], - _1: param[6], - _2: rs - }, - tl: /* [] */ 0 - } + tl: /* [] */ 0 } - }; - }), classes$1, /* [] */ 0)), - match$11[1] - ]; + } + }; + }), classes$1, /* [] */ 0)), + match$11[1] + ]; case /* Pstr_include */ 12 : - const sincl = desc._0; - const smodl = sincl.pincl_mod; - const modl$1 = type_module$1(undefined, true, funct_body, undefined, env, smodl); - const sg = signature$2(identity, extract_sig_open(env, smodl.pmod_loc, modl$1.mod_type)); - const match$12 = modl$1.mod_desc; - let sg$1; - if (match$12.TAG === /* Tmod_ident */ 0) { - const p = match$12._0; - if (is_functor_arg(p, env)) { - sg$1 = sg; - } else { - add_required_global(head(p)); - const pos = { - contents: 0 - }; - sg$1 = Stdlib__List.map((function (it) { - switch (it.TAG) { - case /* Sig_value */ 0 : - let tmp = it._1.val_kind; - if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { - return it; - } - if (tmp !== /* Val_reg */ 0) { - return it; - } - pos.contents = pos.contents + 1 | 0; - return it; - case /* Sig_module */ 3 : - const md = it._1; - const id = it._0; - const n = pos.contents; - pos.contents = pos.contents + 1 | 0; - return { - TAG: /* Sig_module */ 3, - _0: id, - _1: { - md_type: { - TAG: /* Mty_alias */ 3, - _0: { - TAG: /* Pdot */ 1, - _0: p, - _1: id.name, - _2: n - } - }, - md_attributes: md.md_attributes, - md_loc: md.md_loc - }, - _2: it._2 - }; - case /* Sig_typext */ 2 : - case /* Sig_class */ 5 : - pos.contents = pos.contents + 1 | 0; - return it; - default: - return it; - } - }), sg); - } - } else { + const sincl = desc._0; + const smodl = sincl.pincl_mod; + const modl$1 = type_module$1(undefined, true, funct_body, undefined, env, smodl); + const sg = signature$2(identity, extract_sig_open(env, smodl.pmod_loc, modl$1.mod_type)); + const match$12 = modl$1.mod_desc; + let sg$1; + if (match$12.TAG === /* Tmod_ident */ 0) { + const p = match$12._0; + if (is_functor_arg(p, env)) { sg$1 = sg; + } else { + add_required_global(head(p)); + const pos = { + contents: 0 + }; + sg$1 = Stdlib__List.map((function (it) { + switch (it.TAG) { + case /* Sig_value */ 0 : + let tmp = it._1.val_kind; + if (!/* tag */ (typeof tmp === "number" || typeof tmp === "string")) { + return it; + } + if (tmp !== /* Val_reg */ 0) { + return it; + } + pos.contents = pos.contents + 1 | 0; + return it; + case /* Sig_module */ 3 : + const md = it._1; + const id = it._0; + const n = pos.contents; + pos.contents = pos.contents + 1 | 0; + return { + TAG: /* Sig_module */ 3, + _0: id, + _1: { + md_type: { + TAG: /* Mty_alias */ 3, + _0: { + TAG: /* Pdot */ 1, + _0: p, + _1: id.name, + _2: n + } + }, + md_attributes: md.md_attributes, + md_loc: md.md_loc + }, + _2: it._2 + }; + case /* Sig_typext */ 2 : + case /* Sig_class */ 5 : + pos.contents = pos.contents + 1 | 0; + return it; + default: + return it; + } + }), sg); } - Stdlib__List.iter((function (param) { - return check_sig_item(type_names, module_names, modtype_names, loc, param); - }), sg$1); - const new_env = add_signature(sg$1, env); - const incl_incl_loc = sincl.pincl_loc; - const incl_incl_attributes = sincl.pincl_attributes; - const incl = { - incl_mod: modl$1, - incl_type: sg$1, - incl_loc: incl_incl_loc, - incl_attributes: incl_incl_attributes - }; - return [ - { - TAG: /* Tstr_include */ 12, - _0: incl - }, - sg$1, - new_env - ]; + } else { + sg$1 = sg; + } + Stdlib__List.iter((function (param) { + return check_sig_item(type_names, module_names, modtype_names, loc, param); + }), sg$1); + const new_env = add_signature(sg$1, env); + const incl_incl_loc = sincl.pincl_loc; + const incl_incl_attributes = sincl.pincl_attributes; + const incl = { + incl_mod: modl$1, + incl_type: sg$1, + incl_loc: incl_incl_loc, + incl_attributes: incl_incl_attributes + }; + return [ + { + TAG: /* Tstr_include */ 12, + _0: incl + }, + sg$1, + new_env + ]; case /* Pstr_attribute */ 13 : - const x = desc._0; - warning_attribute({ - hd: x, - tl: /* [] */ 0 - }); - return [ - { - TAG: /* Tstr_attribute */ 13, - _0: x - }, - /* [] */ 0, - env - ]; + const x = desc._0; + warning_attribute({ + hd: x, + tl: /* [] */ 0 + }); + return [ + { + TAG: /* Tstr_attribute */ 13, + _0: x + }, + /* [] */ 0, + env + ]; case /* Pstr_extension */ 14 : - throw new Caml_js_exceptions.MelangeError(Error_forward$3, { - MEL_EXN_ID: Error_forward$3, - _1: error_of_extension(desc._0) - }); + throw new Caml_js_exceptions.MelangeError(Error_forward$3, { + MEL_EXN_ID: Error_forward$3, + _1: error_of_extension(desc._0) + }); } }; @@ -85543,23 +85543,23 @@ function normalize_signature(env) { return Stdlib__List.iter((function (param) { switch (param.TAG) { case /* Sig_value */ 0 : - return normalize_type(env, param._1.val_type); + return normalize_type(env, param._1.val_type); case /* Sig_module */ 3 : - let _p = param._1.md_type; - while (true) { - const p = _p; - switch (p.TAG) { - case /* Mty_signature */ 1 : - return normalize_signature(env)(p._0); - case /* Mty_functor */ 2 : - _p = p._2; - continue; - case /* Mty_ident */ 0 : - case /* Mty_alias */ 3 : - return; - - } - }; + let _p = param._1.md_type; + while (true) { + const p = _p; + switch (p.TAG) { + case /* Mty_signature */ 1 : + return normalize_signature(env)(p._0); + case /* Mty_functor */ 2 : + _p = p._2; + continue; + case /* Mty_ident */ 0 : + case /* Mty_alias */ 3 : + return; + + } + }; default: return; } @@ -85645,28 +85645,28 @@ function type_package$1(env, m, p, nl, tl) { const mkpath = function (mp, name) { switch (name.TAG) { case /* Lident */ 0 : - return { - TAG: /* Pdot */ 1, - _0: mp, - _1: name._0, - _2: -1 - }; + return { + TAG: /* Pdot */ 1, + _0: mp, + _1: name._0, + _2: -1 + }; case /* Ldot */ 1 : - return { - TAG: /* Pdot */ 1, - _0: mkpath(mp, name._0), - _1: name._1, - _2: -1 - }; + return { + TAG: /* Pdot */ 1, + _0: mkpath(mp, name._0), + _1: name._1, + _2: -1 + }; case /* Lapply */ 2 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/ocaml_typedtree_test.ml", - 51527, - 11 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/ocaml_typedtree_test.ml", + 51527, + 11 + ] + }); } }; @@ -85805,35 +85805,35 @@ function type_implementation_more(sourcefile, outputprefix, modulename, initial_ const match = param.str_desc; switch (match.TAG) { case /* Tstr_value */ 1 : - return Stdlib__List.iter((function (param) { - const exp = param.vb_expr; - if (closed_schema(exp.exp_type)) { - return; - } - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: exp.exp_loc, - _2: finalenv, - _3: { - TAG: /* Non_generalizable */ 7, - _0: exp.exp_type - } - }); - }), match._1); + return Stdlib__List.iter((function (param) { + const exp = param.vb_expr; + if (closed_schema(exp.exp_type)) { + return; + } + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: exp.exp_loc, + _2: finalenv, + _3: { + TAG: /* Non_generalizable */ 7, + _0: exp.exp_type + } + }); + }), match._1); case /* Tstr_module */ 6 : - const md = match._0.mb_expr; - if (closed_modtype(md.mod_type)) { - return; - } - throw new Caml_js_exceptions.MelangeError($$Error$10, { - MEL_EXN_ID: $$Error$10, - _1: md.mod_loc, - _2: finalenv, - _3: { - TAG: /* Non_generalizable_module */ 9, - _0: md.mod_type - } - }); + const md = match._0.mb_expr; + if (closed_modtype(md.mod_type)) { + return; + } + throw new Caml_js_exceptions.MelangeError($$Error$10, { + MEL_EXN_ID: $$Error$10, + _1: md.mod_loc, + _2: finalenv, + _3: { + TAG: /* Non_generalizable_module */ 9, + _0: md.mod_type + } + }); default: return; } @@ -85886,277 +85886,111 @@ register_error_of_exn(function (err) { if (/* tag */ typeof param$1 === "number" || typeof param$1 === "string") { switch (param$1) { case /* Signature_expected */ 0 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This module type is not a signature", - _1: /* End_of_format */ 0 - }, - _1: "This module type is not a signature" - }); + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This module type is not a signature", + _1: /* End_of_format */ 0 + }, + _1: "This module type is not a signature" + }); case /* Not_allowed_in_functor_body */ 1 : - return Curry._1(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This expression creates fresh types.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "@[This expression creates fresh types.@ %s@]" - }), "It is not allowed inside applicative functors."); - case /* With_need_typeconstr */ 2 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Only type constructors with identical parameters can be substituted.", - _1: /* End_of_format */ 0 - }, - _1: "Only type constructors with identical parameters can be substituted." - }); - case /* Recursive_module_require_explicit_type */ 3 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Recursive modules require an explicit module type.", - _1: /* End_of_format */ 0 - }, - _1: "Recursive modules require an explicit module type." - }); - case /* Apply_generative */ 4 : - return Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This is a generative functor. It can only be applied to ()", - _1: /* End_of_format */ 0 - }, - _1: "This is a generative functor. It can only be applied to ()" - }); - - } - } else { - switch (param$1.TAG) { - case /* Cannot_apply */ 0 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + return Curry._1(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This module is not a functor; it has type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[This module is not a functor; it has type@ %a@]" - }), modtype$1, param$1._0); - case /* Not_included */ 1 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "This expression creates fresh types.", _1: { - TAG: /* String_literal */ 11, - _0: "Signature mismatch:", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - }, - _1: "@[Signature mismatch:@ %a@]" - }), report_error$4, param$1._0); - case /* Cannot_eliminate_dependency */ 2 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This functor has type", + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "The parameter cannot be eliminated in the result type.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: " Please bind the argument to a module identifier.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[This functor has type@ %a@ The parameter cannot be eliminated in the result type.@ Please bind the argument to a module identifier.@]" - }), modtype$1, param$1._0); - case /* Structure_expected */ 3 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[This expression creates fresh types.@ %s@]" + }), "It is not allowed inside applicative functors."); + case /* With_need_typeconstr */ 2 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Only type constructors with identical parameters can be substituted.", + _1: /* End_of_format */ 0 + }, + _1: "Only type constructors with identical parameters can be substituted." + }); + case /* Recursive_module_require_explicit_type */ 3 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Recursive modules require an explicit module type.", + _1: /* End_of_format */ 0 + }, + _1: "Recursive modules require an explicit module type." + }); + case /* Apply_generative */ 4 : + return Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This is a generative functor. It can only be applied to ()", + _1: /* End_of_format */ 0 + }, + _1: "This is a generative functor. It can only be applied to ()" + }); + + } + } else { + switch (param$1.TAG) { + case /* Cannot_apply */ 0 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "This module is not a structure; it has type", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[This module is not a structure; it has type@ %a" - }), modtype$1, param$1._0); - case /* With_no_component */ 4 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "This module is not a functor; it has type", _1: { - TAG: /* String_literal */ 11, - _0: "The signature constrained by `with' has no component named ", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { TAG: /* Alpha */ 15, _0: { @@ -86166,177 +86000,88 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The signature constrained by `with' has no component named %a@]" - }), longident, param$1._0); - case /* With_mismatch */ 5 : - return Curry._4(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[This module is not a functor; it has type@ %a@]" + }), modtype$1, param$1._0); + case /* Not_included */ 1 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, _0: { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "", - _1: /* End_of_format */ 0 - }, - _1: "" - } - }, + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Signature mismatch:", _1: { - TAG: /* Formatting_gen */ 18, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 }, _1: { - TAG: /* String_literal */ 11, - _0: "In this `with' constraint, the new definition of ", - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "does not match its original definition", - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "in the constrained signature:", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } - } + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } } - }, - _1: "@[@[In this `with' constraint, the new definition of %a@ does not match its original definition@ in the constrained signature:@]@ %a@]" - }), longident, param$1._0, report_error$4, param$1._1); - case /* Repeated_name */ 6 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[Signature mismatch:@ %a@]" + }), report_error$4, param$1._0); + case /* Cannot_eliminate_dependency */ 2 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Multiple definition of the ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " name ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "Names must be unique in a given structure or signature.", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } - } - } + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" } }, - _1: "@[Multiple definition of the %s name %s.@ Names must be unique in a given structure or signature.@]" - }), param$1._0, param$1._1); - case /* Non_generalizable */ 7 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Formatting_gen */ 18, - _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + _1: { + TAG: /* String_literal */ 11, + _0: "This functor has type", _1: { - TAG: /* String_literal */ 11, - _0: "The type of this expression,", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The parameter cannot be eliminated in the result type.", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86347,7 +86092,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "contains type variables that cannot be generalized", + _0: " Please bind the argument to a module identifier.", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, @@ -86359,70 +86104,89 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The type of this expression,@ %a,@ contains type variables that cannot be generalized@]" - }), type_scheme, param$1._0); - case /* Non_generalizable_class */ 8 : - const id = param$1._0; - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[This functor has type@ %a@ The parameter cannot be eliminated in the result type.@ Please bind the argument to a module identifier.@]" + }), modtype$1, param$1._0); + case /* Structure_expected */ 3 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "This module is not a structure; it has type", + _1: { + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 } - }, + } + } + }, + _1: "@[This module is not a structure; it has type@ %a" + }), modtype$1, param$1._0); + case /* With_no_component */ 4 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The signature constrained by `with' has no component named ", _1: { - TAG: /* String_literal */ 11, - _0: "The type of this class,", - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, - _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* String_literal */ 11, - _0: "contains type variables that cannot be generalized", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 - } - } - } - } - } + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 } } + } + }, + _1: "@[The signature constrained by `with' has no component named %a@]" + }), longident, param$1._0); + case /* With_mismatch */ 5 : + return Curry._4(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, + _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "", + _1: /* End_of_format */ 0 + }, + _1: "" + } }, - _1: "@[The type of this class,@ %a,@ contains type variables that cannot be generalized@]" - }), (function (param, param$1) { - return class_declaration$1(id, param, param$1); - }), param$1._1); - case /* Non_generalizable_module */ 9 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, - _0: { + _1: { TAG: /* Formatting_gen */ 18, _0: { TAG: /* Open_box */ 1, @@ -86434,20 +86198,20 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "The type of this module,", + _0: "In this `with' constraint, the new definition of ", _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, + TAG: /* Formatting_lit */ 17, _0: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "does not match its original definition", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86458,11 +86222,27 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "contains type variables that cannot be generalized", + _0: "in the constrained signature:", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } } } } @@ -86470,38 +86250,38 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The type of this module,@ %a,@ contains type variables that cannot be generalized@]" - }), modtype$1, param$1._0); - case /* Implementation_is_required */ 10 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[@[In this `with' constraint, the new definition of %a@ does not match its original definition@ in the constrained signature:@]@ %a@]" + }), longident, param$1._0, report_error$4, param$1._1); + case /* Repeated_name */ 6 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "Multiple definition of the ", _1: { - TAG: /* String_literal */ 11, - _0: "The interface ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, + TAG: /* String_literal */ 11, + _0: " name ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String_literal */ 11, - _0: "declares values, not just types.", + TAG: /* Char_literal */ 12, + _0: /* '.' */46, _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86512,7 +86292,7 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* String_literal */ 11, - _0: "An implementation must be provided.", + _0: "Names must be unique in a given structure or signature.", _1: { TAG: /* Formatting_lit */ 17, _0: /* Close_box */ 0, @@ -86524,56 +86304,81 @@ register_error_of_exn(function (err) { } } } - }, - _1: "@[The interface %a@ declares values, not just types.@ An implementation must be provided.@]" - }), print_filename, param$1._0); - case /* Interface_not_compiled */ 11 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[Multiple definition of the %s name %s.@ Names must be unique in a given structure or signature.@]" + }), param$1._0, param$1._1); + case /* Non_generalizable */ 7 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { - TAG: /* Formatting_gen */ 18, + TAG: /* Open_box */ 1, _0: { - TAG: /* Open_box */ 1, - _0: { - TAG: /* Format */ 0, - _0: /* End_of_format */ 0, - _1: "" - } - }, + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { + TAG: /* String_literal */ 11, + _0: "The type of this expression,", _1: { - TAG: /* String_literal */ 11, - _0: "Could not find the .cmi file for interface", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, + TAG: /* Alpha */ 15, _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Close_box */ 0, - _1: /* End_of_format */ 0 + TAG: /* String_literal */ 11, + _0: "contains type variables that cannot be generalized", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } } } } } } - }, - _1: "@[Could not find the .cmi file for interface@ %a.@]" - }), print_filename, param$1._0); - case /* Not_a_packed_module */ 12 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The type of this expression,@ %a,@ contains type variables that cannot be generalized@]" + }), type_scheme, param$1._0); + case /* Non_generalizable_class */ 8 : + const id = param$1._0; + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "This expression is not a packed module. It has type", + _0: "The type of this class,", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86584,18 +86389,52 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "contains type variables that cannot be generalized", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } - }, - _1: "This expression is not a packed module. It has type@ %a" - }), type_expr$1, param$1._0); - case /* Incomplete_packed_module */ 13 : - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The type of this class,@ %a,@ contains type variables that cannot be generalized@]" + }), (function (param, param$1) { + return class_declaration$1(id, param, param$1); + }), param$1._1); + case /* Non_generalizable_module */ 9 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "The type of this packed module contains variables:", + _0: "The type of this module,", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86606,43 +86445,104 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + _0: { + TAG: /* Char_literal */ 12, + _0: /* ',' */44, + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "contains type variables that cannot be generalized", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } + } } } - }, - _1: "The type of this packed module contains variables:@ %a" - }), type_expr$1, param$1._0); - case /* Scoping_pack */ 14 : - Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The type of this module,@ %a,@ contains type variables that cannot be generalized@]" + }), modtype$1, param$1._0); + case /* Implementation_is_required */ 10 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "The type ", + _0: "The interface ", _1: { TAG: /* Alpha */ 15, _0: { - TAG: /* String_literal */ 11, - _0: " in this module cannot be exported.", + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, _1: { - TAG: /* Formatting_lit */ 17, - _0: { - TAG: /* Break */ 0, - _0: "@ ", - _1: 1, - _2: 0 - }, - _1: /* End_of_format */ 0 + TAG: /* String_literal */ 11, + _0: "declares values, not just types.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* String_literal */ 11, + _0: "An implementation must be provided.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } + } } } } - }, - _1: "The type %a in this module cannot be exported.@ " - }), longident, param$1._0); - return Curry._2(Stdlib__Format.fprintf(param)({ - TAG: /* Format */ 0, + } + }, + _1: "@[The interface %a@ declares values, not just types.@ An implementation must be provided.@]" + }), print_filename, param$1._0); + case /* Interface_not_compiled */ 11 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Formatting_gen */ 18, _0: { + TAG: /* Open_box */ 1, + _0: { + TAG: /* Format */ 0, + _0: /* End_of_format */ 0, + _1: "" + } + }, + _1: { TAG: /* String_literal */ 11, - _0: "Its type contains local dependencies:", + _0: "Could not find the .cmi file for interface", _1: { TAG: /* Formatting_lit */ 17, _0: { @@ -86653,12 +86553,112 @@ register_error_of_exn(function (err) { }, _1: { TAG: /* Alpha */ 15, - _0: /* End_of_format */ 0 + _0: { + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Close_box */ 0, + _1: /* End_of_format */ 0 + } + } } } - }, - _1: "Its type contains local dependencies:@ %a" - }), type_expr$1, param$1._1); + } + }, + _1: "@[Could not find the .cmi file for interface@ %a.@]" + }), print_filename, param$1._0); + case /* Not_a_packed_module */ 12 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This expression is not a packed module. It has type", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + }, + _1: "This expression is not a packed module. It has type@ %a" + }), type_expr$1, param$1._0); + case /* Incomplete_packed_module */ 13 : + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type of this packed module contains variables:", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + }, + _1: "The type of this packed module contains variables:@ %a" + }), type_expr$1, param$1._0); + case /* Scoping_pack */ 14 : + Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "The type ", + _1: { + TAG: /* Alpha */ 15, + _0: { + TAG: /* String_literal */ 11, + _0: " in this module cannot be exported.", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: /* End_of_format */ 0 + } + } + } + }, + _1: "The type %a in this module cannot be exported.@ " + }), longident, param$1._0); + return Curry._2(Stdlib__Format.fprintf(param)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Its type contains local dependencies:", + _1: { + TAG: /* Formatting_lit */ 17, + _0: { + TAG: /* Break */ 0, + _0: "@ ", + _1: 1, + _2: 0 + }, + _1: { + TAG: /* Alpha */ 15, + _0: /* End_of_format */ 0 + } + } + }, + _1: "Its type contains local dependencies:@ %a" + }), type_expr$1, param$1._1); } } @@ -86785,206 +86785,184 @@ if (match$1) { const match$35 = match$34._0; switch (match$35.TAG) { case /* Pident */ 0 : - const match$36 = match$35._0; - if (match$36.name === "int") { - const match$37 = match$36.flags; - if (match$37 !== 0) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$38 = match$34._1; - const match$39 = match$38.txt; - switch (match$39.TAG) { - case /* Lident */ 0 : - if (match$39._0 === "int") { - const match$40 = match$38.loc; - const match$41 = match$40.loc_start; - if (match$41.pos_fname === "" && !(match$41.pos_lnum !== 3 || match$41.pos_bol !== 10 || match$41.pos_cnum !== 28)) { - const match$42 = match$40.loc_end; - if (match$42.pos_fname === "" && !(match$42.pos_lnum !== 3 || match$42.pos_bol !== 10 || match$42.pos_cnum !== 31 || match$40.loc_ghost || match$34._2)) { - const match$43 = match$33.ctyp_type; - const match$44 = match$43.desc; - if (/* tag */ typeof match$44 === "number" || typeof match$44 === "string" || match$44.TAG !== /* Tconstr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$45 = match$44._0; - switch (match$45.TAG) { - case /* Pident */ 0 : - const match$46 = match$45._0; - if (match$46.name === "int") { - const match$47 = match$46.flags; - if (match$47 !== 0 || match$44._1) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$48 = match$44._2.contents; - if (/* tag */ typeof match$48 === "number" || typeof match$48 === "string") { - const match$49 = match$33.ctyp_loc; - const match$50 = match$49.loc_start; - if (match$50.pos_fname === "" && !(match$50.pos_lnum !== 3 || match$50.pos_bol !== 10 || match$50.pos_cnum !== 28)) { - const match$51 = match$49.loc_end; - if (match$51.pos_fname === "" && !(match$51.pos_lnum !== 3 || match$51.pos_bol !== 10 || match$51.pos_cnum !== 31 || match$49.loc_ghost || match$33.ctyp_attributes)) { - const match$52 = match$32._2; - const match$53 = match$52.ctyp_desc; - if (/* tag */ typeof match$53 === "number" || typeof match$53 === "string" || match$53.TAG !== /* Ttyp_constr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$54 = match$53._0; - switch (match$54.TAG) { - case /* Pident */ 0 : - const match$55 = match$54._0; - if (match$55.name === "int") { - const match$56 = match$55.flags; - if (match$56 !== 0) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$57 = match$53._1; - const match$58 = match$57.txt; - switch (match$58.TAG) { - case /* Lident */ 0 : - if (match$58._0 === "int") { - const match$59 = match$57.loc; - const match$60 = match$59.loc_start; - if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 3 || match$60.pos_bol !== 10 || match$60.pos_cnum !== 35)) { - const match$61 = match$59.loc_end; - if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 3 || match$61.pos_bol !== 10 || match$61.pos_cnum !== 38 || match$59.loc_ghost || match$53._2)) { - const match$62 = match$52.ctyp_type; - const match$63 = match$62.desc; - if (/* tag */ typeof match$63 === "number" || typeof match$63 === "string" || match$63.TAG !== /* Tconstr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$64 = match$63._0; - switch (match$64.TAG) { - case /* Pident */ 0 : - const match$65 = match$64._0; - if (match$65.name === "int") { - const match$66 = match$65.flags; - if (match$66 !== 0 || match$63._1) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$67 = match$63._2.contents; - if (/* tag */ typeof match$67 === "number" || typeof match$67 === "string") { - const match$68 = match$52.ctyp_loc; - const match$69 = match$68.loc_start; - if (match$69.pos_fname === "" && !(match$69.pos_lnum !== 3 || match$69.pos_bol !== 10 || match$69.pos_cnum !== 35)) { - const match$70 = match$68.loc_end; - if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 10 || match$70.pos_cnum !== 38 || match$68.loc_ghost || match$52.ctyp_attributes)) { - const match$71 = match$31.ctyp_type; - const match$72 = match$71.desc; - if (/* tag */ typeof match$72 === "number" || typeof match$72 === "string" || !(match$72.TAG === /* Tarrow */ 1 && match$72._0 === "")) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$73 = match$72._1.desc; - if (/* tag */ typeof match$73 === "number" || typeof match$73 === "string" || match$73.TAG !== /* Tconstr */ 3) { + const match$36 = match$35._0; + if (match$36.name === "int") { + const match$37 = match$36.flags; + if (match$37 !== 0) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$38 = match$34._1; + const match$39 = match$38.txt; + switch (match$39.TAG) { + case /* Lident */ 0 : + if (match$39._0 === "int") { + const match$40 = match$38.loc; + const match$41 = match$40.loc_start; + if (match$41.pos_fname === "" && !(match$41.pos_lnum !== 3 || match$41.pos_bol !== 10 || match$41.pos_cnum !== 28)) { + const match$42 = match$40.loc_end; + if (match$42.pos_fname === "" && !(match$42.pos_lnum !== 3 || match$42.pos_bol !== 10 || match$42.pos_cnum !== 31 || match$40.loc_ghost || match$34._2)) { + const match$43 = match$33.ctyp_type; + const match$44 = match$43.desc; + if (/* tag */ typeof match$44 === "number" || typeof match$44 === "string" || match$44.TAG !== /* Tconstr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$45 = match$44._0; + switch (match$45.TAG) { + case /* Pident */ 0 : + const match$46 = match$45._0; + if (match$46.name === "int") { + const match$47 = match$46.flags; + if (match$47 !== 0 || match$44._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$48 = match$44._2.contents; + if (/* tag */ typeof match$48 === "number" || typeof match$48 === "string") { + const match$49 = match$33.ctyp_loc; + const match$50 = match$49.loc_start; + if (match$50.pos_fname === "" && !(match$50.pos_lnum !== 3 || match$50.pos_bol !== 10 || match$50.pos_cnum !== 28)) { + const match$51 = match$49.loc_end; + if (match$51.pos_fname === "" && !(match$51.pos_lnum !== 3 || match$51.pos_bol !== 10 || match$51.pos_cnum !== 31 || match$49.loc_ghost || match$33.ctyp_attributes)) { + const match$52 = match$32._2; + const match$53 = match$52.ctyp_desc; + if (/* tag */ typeof match$53 === "number" || typeof match$53 === "string" || match$53.TAG !== /* Ttyp_constr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$54 = match$53._0; + switch (match$54.TAG) { + case /* Pident */ 0 : + const match$55 = match$54._0; + if (match$55.name === "int") { + const match$56 = match$55.flags; + if (match$56 !== 0) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$57 = match$53._1; + const match$58 = match$57.txt; + switch (match$58.TAG) { + case /* Lident */ 0 : + if (match$58._0 === "int") { + const match$59 = match$57.loc; + const match$60 = match$59.loc_start; + if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 3 || match$60.pos_bol !== 10 || match$60.pos_cnum !== 35)) { + const match$61 = match$59.loc_end; + if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 3 || match$61.pos_bol !== 10 || match$61.pos_cnum !== 38 || match$59.loc_ghost || match$53._2)) { + const match$62 = match$52.ctyp_type; + const match$63 = match$62.desc; + if (/* tag */ typeof match$63 === "number" || typeof match$63 === "string" || match$63.TAG !== /* Tconstr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$64 = match$63._0; + switch (match$64.TAG) { + case /* Pident */ 0 : + const match$65 = match$64._0; + if (match$65.name === "int") { + const match$66 = match$65.flags; + if (match$66 !== 0 || match$63._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$67 = match$63._2.contents; + if (/* tag */ typeof match$67 === "number" || typeof match$67 === "string") { + const match$68 = match$52.ctyp_loc; + const match$69 = match$68.loc_start; + if (match$69.pos_fname === "" && !(match$69.pos_lnum !== 3 || match$69.pos_bol !== 10 || match$69.pos_cnum !== 35)) { + const match$70 = match$68.loc_end; + if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 10 || match$70.pos_cnum !== 38 || match$68.loc_ghost || match$52.ctyp_attributes)) { + const match$71 = match$31.ctyp_type; + const match$72 = match$71.desc; + if (/* tag */ typeof match$72 === "number" || typeof match$72 === "string" || !(match$72.TAG === /* Tarrow */ 1 && match$72._0 === "")) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$73 = match$72._1.desc; + if (/* tag */ typeof match$73 === "number" || typeof match$73 === "string" || match$73.TAG !== /* Tconstr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$74 = match$73._0; + switch (match$74.TAG) { + case /* Pident */ 0 : + const match$75 = match$74._0; + if (match$75.name === "int") { + const match$76 = match$75.flags; + if (match$76 !== 0 || match$73._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$77 = match$73._2.contents; + if (/* tag */ typeof match$77 === "number" || typeof match$77 === "string") { + const match$78 = match$72._2.desc; + if (/* tag */ typeof match$78 === "number" || typeof match$78 === "string" || match$78.TAG !== /* Tconstr */ 3) { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } else { - const match$74 = match$73._0; - switch (match$74.TAG) { + const match$79 = match$78._0; + switch (match$79.TAG) { case /* Pident */ 0 : - const match$75 = match$74._0; - if (match$75.name === "int") { - const match$76 = match$75.flags; - if (match$76 !== 0 || match$73._1) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$77 = match$73._2.contents; - if (/* tag */ typeof match$77 === "number" || typeof match$77 === "string") { - const match$78 = match$72._2.desc; - if (/* tag */ typeof match$78 === "number" || typeof match$78 === "string" || match$78.TAG !== /* Tconstr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$79 = match$78._0; - switch (match$79.TAG) { - case /* Pident */ 0 : - const match$80 = match$79._0; - if (match$80.name === "int") { - const match$81 = match$80.flags; - if (match$81 !== 0 || match$78._1) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$82 = match$78._2.contents; - if (/* tag */ typeof match$82 === "number" || typeof match$82 === "string") { - let tmp$3 = match$72._3; - if (/* tag */ (typeof tmp$3 === "number" || typeof tmp$3 === "string") && tmp$3 === /* Cok */ 0) { - const match$83 = match$31.ctyp_loc; - const match$84 = match$83.loc_start; - if (match$84.pos_fname === "" && !(match$84.pos_lnum !== 3 || match$84.pos_bol !== 10 || match$84.pos_cnum !== 28)) { - const match$85 = match$83.loc_end; - if (match$85.pos_fname === "" && !(match$85.pos_lnum !== 3 || match$85.pos_bol !== 10 || match$85.pos_cnum !== 38 || match$83.loc_ghost || match$31.ctyp_attributes)) { - const match$86 = match$24.val_val; - const match$87 = match$86.val_type.desc; - if (/* tag */ typeof match$87 === "number" || typeof match$87 === "string" || !(match$87.TAG === /* Tarrow */ 1 && match$87._0 === "")) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$88 = match$87._1.desc; - if (/* tag */ typeof match$88 === "number" || typeof match$88 === "string" || match$88.TAG !== /* Tconstr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$89 = match$88._0; - switch (match$89.TAG) { - case /* Pident */ 0 : - const match$90 = match$89._0; - if (match$90.name === "int") { - const match$91 = match$90.flags; - if (match$91 !== 0 || match$88._1) { + const match$80 = match$79._0; + if (match$80.name === "int") { + const match$81 = match$80.flags; + if (match$81 !== 0 || match$78._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$82 = match$78._2.contents; + if (/* tag */ typeof match$82 === "number" || typeof match$82 === "string") { + let tmp$3 = match$72._3; + if (/* tag */ (typeof tmp$3 === "number" || typeof tmp$3 === "string") && tmp$3 === /* Cok */ 0) { + const match$83 = match$31.ctyp_loc; + const match$84 = match$83.loc_start; + if (match$84.pos_fname === "" && !(match$84.pos_lnum !== 3 || match$84.pos_bol !== 10 || match$84.pos_cnum !== 28)) { + const match$85 = match$83.loc_end; + if (match$85.pos_fname === "" && !(match$85.pos_lnum !== 3 || match$85.pos_bol !== 10 || match$85.pos_cnum !== 38 || match$83.loc_ghost || match$31.ctyp_attributes)) { + const match$86 = match$24.val_val; + const match$87 = match$86.val_type.desc; + if (/* tag */ typeof match$87 === "number" || typeof match$87 === "string" || !(match$87.TAG === /* Tarrow */ 1 && match$87._0 === "")) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$88 = match$87._1.desc; + if (/* tag */ typeof match$88 === "number" || typeof match$88 === "string" || match$88.TAG !== /* Tconstr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$89 = match$88._0; + switch (match$89.TAG) { + case /* Pident */ 0 : + const match$90 = match$89._0; + if (match$90.name === "int") { + const match$91 = match$90.flags; + if (match$91 !== 0 || match$88._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$92 = match$88._2.contents; + if (/* tag */ typeof match$92 === "number" || typeof match$92 === "string") { + const match$93 = match$87._2.desc; + if (/* tag */ typeof match$93 === "number" || typeof match$93 === "string" || match$93.TAG !== /* Tconstr */ 3) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$94 = match$93._0; + switch (match$94.TAG) { + case /* Pident */ 0 : + const match$95 = match$94._0; + if (match$95.name === "int") { + const match$96 = match$95.flags; + if (match$96 !== 0 || match$93._1) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } else { + const match$97 = match$93._2.contents; + if (/* tag */ typeof match$97 === "number" || typeof match$97 === "string") { + let tmp$4 = match$87._3; + if (/* tag */ (typeof tmp$4 === "number" || typeof tmp$4 === "string") && tmp$4 === /* Cok */ 0) { + const match$98 = match$86.val_kind; + if (/* tag */ typeof match$98 === "number" || typeof match$98 === "string" || match$98.TAG !== /* Val_prim */ 0) { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } else { - const match$92 = match$88._2.contents; - if (/* tag */ typeof match$92 === "number" || typeof match$92 === "string") { - const match$93 = match$87._2.desc; - if (/* tag */ typeof match$93 === "number" || typeof match$93 === "string" || match$93.TAG !== /* Tconstr */ 3) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$94 = match$93._0; - switch (match$94.TAG) { - case /* Pident */ 0 : - const match$95 = match$94._0; - if (match$95.name === "int") { - const match$96 = match$95.flags; - if (match$96 !== 0 || match$93._1) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$97 = match$93._2.contents; - if (/* tag */ typeof match$97 === "number" || typeof match$97 === "string") { - let tmp$4 = match$87._3; - if (/* tag */ (typeof tmp$4 === "number" || typeof tmp$4 === "string") && tmp$4 === /* Cok */ 0) { - const match$98 = match$86.val_kind; - if (/* tag */ typeof match$98 === "number" || typeof match$98 === "string" || match$98.TAG !== /* Val_prim */ 0) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } else { - const match$99 = match$98._0; - if (match$99.prim_name === "%negint" && !(match$99.prim_arity !== 1 || !(match$99.prim_alloc && match$99.prim_native_name === "" && !match$99.prim_native_float))) { - const match$100 = match$86.val_loc; - const match$101 = match$100.loc_start; - if (match$101.pos_fname === "" && !(match$101.pos_lnum !== 3 || match$101.pos_bol !== 10 || match$101.pos_cnum !== 10)) { - const match$102 = match$100.loc_end; - if (match$102.pos_fname === "" && !(match$102.pos_lnum !== 3 || match$102.pos_bol !== 10 || match$102.pos_cnum !== 50 || match$100.loc_ghost || match$86.val_attributes)) { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52028, characters 14-21", true, true); - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + const match$99 = match$98._0; + if (match$99.prim_name === "%negint" && !(match$99.prim_arity !== 1 || !(match$99.prim_alloc && match$99.prim_native_name === "" && !match$99.prim_native_float))) { + const match$100 = match$86.val_loc; + const match$101 = match$100.loc_start; + if (match$101.pos_fname === "" && !(match$101.pos_lnum !== 3 || match$101.pos_bol !== 10 || match$101.pos_cnum !== 10)) { + const match$102 = match$100.loc_end; + if (match$102.pos_fname === "" && !(match$102.pos_lnum !== 3 || match$102.pos_bol !== 10 || match$102.pos_cnum !== 50 || match$100.loc_ghost || match$86.val_attributes)) { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52028, characters 14-21", true, true); + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); @@ -86993,150 +86971,172 @@ if (match$1) { } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : + } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + } + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + } + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } + break; case /* Pdot */ 1 : case /* Papply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; } } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } + break; + } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + break; + + } + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } break; - case /* Pdot */ 1 : - case /* Papply */ 2 : + case /* Ldot */ 1 : + case /* Lapply */ 2 : eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); break; - + + } } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } else { + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; - case /* Pdot */ 1 : - case /* Papply */ 2 : + } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - + } + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + case /* Pdot */ 1 : + case /* Papply */ 2 : + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; - - } + } + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; + } - } else { - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); } - break; + } else { + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + } + break; case /* Pdot */ 1 : case /* Papply */ 2 : - eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); - break; + eq("File \"jscomp/test/ocaml_typedtree_test.ml\", line 52029, characters 12-19", true, false); + break; } } diff --git a/jscomp/test/dist/jscomp/test/offset.js b/jscomp/test/dist/jscomp/test/offset.js index dccb947ca4..c3fc4af1a1 100644 --- a/jscomp/test/dist/jscomp/test/offset.js +++ b/jscomp/test/dist/jscomp/test/offset.js @@ -958,28 +958,54 @@ function of_list(l) { const sub = function (n, l) { switch (n) { case 0 : + return [ + /* Empty */ 0, + l + ]; + case 1 : + if (l) { return [ - /* Empty */ 0, - l + { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + const match = l.tl; + if (match) { return [ { TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, + l: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + v: match.hd, r: /* Empty */ 0, - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - const match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + const match$1 = l.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { return [ { TAG: /* Node */ 0, @@ -990,50 +1016,24 @@ function of_list(l) { r: /* Empty */ 0, h: 1 }, - v: match.hd, - r: /* Empty */ 0, + v: match$1.hd, + r: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: match$2.hd, + r: /* Empty */ 0, + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - const match$1 = l.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: /* Node */ 0, - l: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, - r: /* Empty */ 0, - h: 1 - }, - v: match$1.hd, - r: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: match$2.hd, - r: /* Empty */ 0, - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; + + } + break; } const nl = n / 2 | 0; diff --git a/jscomp/test/dist/jscomp/test/parser_api.js b/jscomp/test/dist/jscomp/test/parser_api.js index 6afbe22059..f99f5e2c1c 100644 --- a/jscomp/test/dist/jscomp/test/parser_api.js +++ b/jscomp/test/dist/jscomp/test/parser_api.js @@ -119,12 +119,12 @@ let default_executable_name; switch (Stdlib__Sys.os_type) { case "Unix" : - default_executable_name = "a.out"; - break; + default_executable_name = "a.out"; + break; case "Cygwin" : case "Win32" : - default_executable_name = "camlprog.exe"; - break; + default_executable_name = "camlprog.exe"; + break; default: default_executable_name = "camlprog"; } @@ -661,11 +661,11 @@ const no_assert_false = { function parse_color_setting(param) { switch (param) { case "always" : - return /* Always */ 1; + return /* Always */ 1; case "auto" : - return /* Auto */ 0; + return /* Auto */ 0; case "never" : - return /* Never */ 2; + return /* Never */ 2; default: return; } @@ -1452,21 +1452,21 @@ function cut_at(s, c) { function ansi_of_color(param) { switch (param) { case /* Black */ 0 : - return "0"; + return "0"; case /* Red */ 1 : - return "1"; + return "1"; case /* Green */ 2 : - return "2"; + return "2"; case /* Yellow */ 3 : - return "3"; + return "3"; case /* Blue */ 4 : - return "4"; + return "4"; case /* Magenta */ 5 : - return "5"; + return "5"; case /* Cyan */ 6 : - return "6"; + return "6"; case /* White */ 7 : - return "7"; + return "7"; } } @@ -1481,11 +1481,11 @@ function code_of_style(c) { } switch (c) { case /* Bold */ 0 : - return "1"; + return "1"; case /* Reset */ 1 : - return "0"; + return "0"; case /* Dim */ 2 : - return "2"; + return "2"; } } @@ -1540,35 +1540,35 @@ function style_of_tag(s) { if (s.MEL_EXN_ID === Stdlib__Format.String_tag) { switch (s._1) { case "dim" : - return { - hd: /* Dim */ 2, - tl: /* [] */ 0 - }; + return { + hd: /* Dim */ 2, + tl: /* [] */ 0 + }; case "error" : - return cur_styles.contents.error; + return cur_styles.contents.error; case "filename" : - return { + return { + hd: { + TAG: /* FG */ 0, + _0: /* Cyan */ 6 + }, + tl: /* [] */ 0 + }; + case "info" : + return { + hd: /* Bold */ 0, + tl: { hd: { TAG: /* FG */ 0, - _0: /* Cyan */ 6 + _0: /* Yellow */ 3 }, tl: /* [] */ 0 - }; - case "info" : - return { - hd: /* Bold */ 0, - tl: { - hd: { - TAG: /* FG */ 0, - _0: /* Yellow */ 3 - }, - tl: /* [] */ 0 - } - }; + } + }; case "loc" : - return cur_styles.contents.loc; + return cur_styles.contents.loc; case "warning" : - return cur_styles.contents.warning; + return cur_styles.contents.warning; default: throw new Caml_js_exceptions.MelangeError(Stdlib.Not_found, { MEL_EXN_ID: Stdlib.Not_found @@ -1669,12 +1669,12 @@ function setup(o) { if (o !== undefined) { switch (o) { case /* Always */ 1 : - tmp = true; - break; + tmp = true; + break; case /* Auto */ 0 : case /* Never */ 2 : - tmp = false; - break; + tmp = false; + break; } } else { @@ -1747,117 +1747,117 @@ function number(param) { if (/* tag */ typeof param === "number" || typeof param === "string") { switch (param) { case /* Comment_start */ 0 : - return 1; + return 1; case /* Comment_not_end */ 1 : - return 2; + return 2; case /* Partial_application */ 2 : - return 5; + return 5; case /* Labels_omitted */ 3 : - return 6; + return 6; case /* Statement_type */ 4 : - return 10; + return 10; case /* Unused_match */ 5 : - return 11; + return 11; case /* Unused_pat */ 6 : - return 12; + return 12; case /* Illegal_backslash */ 7 : - return 14; + return 14; case /* Unerasable_optional_argument */ 8 : - return 16; + return 16; case /* Unused_argument */ 9 : - return 20; + return 20; case /* Nonreturning_statement */ 10 : - return 21; + return 21; case /* Useless_record_with */ 11 : - return 23; + return 23; case /* All_clauses_guarded */ 12 : - return 25; + return 25; case /* Wildcard_arg_to_constant_constr */ 13 : - return 28; + return 28; case /* Eol_in_string */ 14 : - return 29; + return 29; case /* Unused_rec_flag */ 15 : - return 39; + return 39; case /* Bs_polymorphic_comparison */ 16 : - return 102; + return 102; } } else { switch (param.TAG) { case /* Deprecated */ 0 : - return 3; + return 3; case /* Fragile_match */ 1 : - return 4; + return 4; case /* Method_override */ 2 : - return 7; + return 7; case /* Partial_match */ 3 : - return 8; + return 8; case /* Non_closed_record_pattern */ 4 : - return 9; + return 9; case /* Instance_variable_override */ 5 : - return 13; + return 13; case /* Implicit_public_methods */ 6 : - return 15; + return 15; case /* Undeclared_virtual_method */ 7 : - return 17; + return 17; case /* Not_principal */ 8 : - return 18; + return 18; case /* Without_principality */ 9 : - return 19; + return 19; case /* Preprocessor */ 10 : - return 22; + return 22; case /* Bad_module_name */ 11 : - return 24; + return 24; case /* Unused_var */ 12 : - return 26; + return 26; case /* Unused_var_strict */ 13 : - return 27; + return 27; case /* Duplicate_definitions */ 14 : - return 30; + return 30; case /* Multiple_definition */ 15 : - return 31; + return 31; case /* Unused_value_declaration */ 16 : - return 32; + return 32; case /* Unused_open */ 17 : - return 33; + return 33; case /* Unused_type_declaration */ 18 : - return 34; + return 34; case /* Unused_for_index */ 19 : - return 35; + return 35; case /* Unused_ancestor */ 20 : - return 36; + return 36; case /* Unused_constructor */ 21 : - return 37; + return 37; case /* Unused_extension */ 22 : - return 38; + return 38; case /* Name_out_of_scope */ 23 : - return 40; + return 40; case /* Ambiguous_name */ 24 : - return 41; + return 41; case /* Disambiguated_name */ 25 : - return 42; + return 42; case /* Nonoptional_label */ 26 : - return 43; + return 43; case /* Open_shadow_identifier */ 27 : - return 44; + return 44; case /* Open_shadow_label_constructor */ 28 : - return 45; + return 45; case /* Bad_env_variable */ 29 : - return 46; + return 46; case /* Attribute_payload */ 30 : - return 47; + return 47; case /* Eliminated_optional_arguments */ 31 : - return 48; + return 48; case /* No_cmi_file */ 32 : - return 49; + return 49; case /* Bad_docstring */ 33 : - return 50; + return 50; case /* Mel_unused_attribute */ 34 : - return 101; + return 101; case /* Mel_ffi_warning */ 35 : - return 103; + return 103; case /* Bs_derive_warning */ 36 : - return 104; + return 104; } } @@ -1879,94 +1879,94 @@ const letter_all = loop(104); function letter(param) { switch (param) { case 97 : - return letter_all; + return letter_all; case 99 : - return { - hd: 1, - tl: { - hd: 2, - tl: /* [] */ 0 - } - }; - case 100 : - return { - hd: 3, + return { + hd: 1, + tl: { + hd: 2, tl: /* [] */ 0 - }; + } + }; + case 100 : + return { + hd: 3, + tl: /* [] */ 0 + }; case 101 : - return { - hd: 4, - tl: /* [] */ 0 - }; + return { + hd: 4, + tl: /* [] */ 0 + }; case 102 : - return { - hd: 5, - tl: /* [] */ 0 - }; + return { + hd: 5, + tl: /* [] */ 0 + }; case 107 : - return { - hd: 32, + return { + hd: 32, + tl: { + hd: 33, tl: { - hd: 33, + hd: 34, tl: { - hd: 34, + hd: 35, tl: { - hd: 35, + hd: 36, tl: { - hd: 36, + hd: 37, tl: { - hd: 37, + hd: 38, tl: { - hd: 38, - tl: { - hd: 39, - tl: /* [] */ 0 - } + hd: 39, + tl: /* [] */ 0 } } } } } } - }; + } + }; case 108 : - return { - hd: 6, - tl: /* [] */ 0 - }; + return { + hd: 6, + tl: /* [] */ 0 + }; case 109 : - return { - hd: 7, - tl: /* [] */ 0 - }; + return { + hd: 7, + tl: /* [] */ 0 + }; case 112 : - return { - hd: 8, - tl: /* [] */ 0 - }; + return { + hd: 8, + tl: /* [] */ 0 + }; case 114 : - return { - hd: 9, - tl: /* [] */ 0 - }; + return { + hd: 9, + tl: /* [] */ 0 + }; case 115 : - return { - hd: 10, - tl: /* [] */ 0 - }; + return { + hd: 10, + tl: /* [] */ 0 + }; case 117 : - return { - hd: 11, - tl: { - hd: 12, - tl: /* [] */ 0 - } - }; - case 118 : - return { - hd: 13, + return { + hd: 11, + tl: { + hd: 12, tl: /* [] */ 0 - }; + } + }; + case 118 : + return { + hd: 13, + tl: /* [] */ 0 + }; case 98 : case 103 : case 104 : @@ -1977,36 +1977,35 @@ function letter(param) { case 113 : case 116 : case 119 : - return /* [] */ 0; + return /* [] */ 0; case 120 : - return { - hd: 14, + return { + hd: 14, + tl: { + hd: 15, tl: { - hd: 15, + hd: 16, tl: { - hd: 16, + hd: 17, tl: { - hd: 17, + hd: 18, tl: { - hd: 18, + hd: 19, tl: { - hd: 19, + hd: 20, tl: { - hd: 20, + hd: 21, tl: { - hd: 21, + hd: 22, tl: { - hd: 22, + hd: 23, tl: { - hd: 23, + hd: 24, tl: { - hd: 24, + hd: 25, tl: { - hd: 25, - tl: { - hd: 30, - tl: /* [] */ 0 - } + hd: 30, + tl: /* [] */ 0 } } } @@ -2018,17 +2017,18 @@ function letter(param) { } } } - }; + } + }; case 121 : - return { - hd: 26, - tl: /* [] */ 0 - }; + return { + hd: 26, + tl: /* [] */ 0 + }; case 122 : - return { - hd: 27, - tl: /* [] */ 0 - }; + return { + hd: 27, + tl: /* [] */ 0 + }; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", @@ -2163,14 +2163,14 @@ function parse_opt(error, active, flags, s) { if (c >= 43) { switch (c) { case 43 : - return loop_letter_num(set, i + 1 | 0); + return loop_letter_num(set, i + 1 | 0); case 44 : - throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { - MEL_EXN_ID: Stdlib__Arg.Bad, - _1: "Ill-formed list of warnings" - }); + throw new Caml_js_exceptions.MelangeError(Stdlib__Arg.Bad, { + MEL_EXN_ID: Stdlib__Arg.Bad, + _1: "Ill-formed list of warnings" + }); case 45 : - return loop_letter_num(clear, i + 1 | 0); + return loop_letter_num(clear, i + 1 | 0); } } else { @@ -2246,162 +2246,161 @@ function message(s) { if (/* tag */ typeof s === "number" || typeof s === "string") { switch (s) { case /* Comment_start */ 0 : - return "this is the start of a comment."; + return "this is the start of a comment."; case /* Comment_not_end */ 1 : - return "this is not the end of a comment."; + return "this is not the end of a comment."; case /* Partial_application */ 2 : - return "this function application is partial,\nmaybe some arguments are missing."; + return "this function application is partial,\nmaybe some arguments are missing."; case /* Labels_omitted */ 3 : - return "labels were omitted in the application of this function."; + return "labels were omitted in the application of this function."; case /* Statement_type */ 4 : - return "this expression should have type unit."; + return "this expression should have type unit."; case /* Unused_match */ 5 : - return "this match case is unused."; + return "this match case is unused."; case /* Unused_pat */ 6 : - return "this sub-pattern is unused."; + return "this sub-pattern is unused."; case /* Illegal_backslash */ 7 : - return "illegal backslash escape in string."; + return "illegal backslash escape in string."; case /* Unerasable_optional_argument */ 8 : - return "this optional argument cannot be erased."; + return "this optional argument cannot be erased."; case /* Unused_argument */ 9 : - return "this argument will not be used by the function."; + return "this argument will not be used by the function."; case /* Nonreturning_statement */ 10 : - return "this statement never returns (or has an unsound type.)"; + return "this statement never returns (or has an unsound type.)"; case /* Useless_record_with */ 11 : - return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; + return "all the fields are explicitly listed in this record:\nthe 'with' clause is useless."; case /* All_clauses_guarded */ 12 : - return "bad style, all clauses in this pattern-matching are guarded."; + return "bad style, all clauses in this pattern-matching are guarded."; case /* Wildcard_arg_to_constant_constr */ 13 : - return "wildcard pattern given as argument to a constant constructor"; + return "wildcard pattern given as argument to a constant constructor"; case /* Eol_in_string */ 14 : - return "unescaped end-of-line in a string constant (non-portable code)"; + return "unescaped end-of-line in a string constant (non-portable code)"; case /* Unused_rec_flag */ 15 : - return "unused rec flag."; + return "unused rec flag."; case /* Bs_polymorphic_comparison */ 16 : - return "polymorphic comparison introduced (maybe unsafe)"; + return "polymorphic comparison introduced (maybe unsafe)"; } } else { switch (s.TAG) { case /* Deprecated */ 0 : - return "deprecated: " + s._0; + return "deprecated: " + s._0; case /* Fragile_match */ 1 : - const s$1 = s._0; - if (s$1 === "") { - return "this pattern-matching is fragile."; - } else { - return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); - } + const s$1 = s._0; + if (s$1 === "") { + return "this pattern-matching is fragile."; + } else { + return "this pattern-matching is fragile.\nIt will remain exhaustive when constructors are added to type " + (s$1 + "."); + } case /* Method_override */ 2 : - const match = s._0; - if (match) { - const lab = match.hd; - if (match.tl) { - return Stdlib__String.concat(" ", { - hd: "the following methods are overridden by the class", + const match = s._0; + if (match) { + const lab = match.hd; + if (match.tl) { + return Stdlib__String.concat(" ", { + hd: "the following methods are overridden by the class", + tl: { + hd: lab, tl: { - hd: lab, - tl: { - hd: ":\n ", - tl: match.tl - } + hd: ":\n ", + tl: match.tl } - }); - } else { - return "the method " + (lab + " is overridden."); - } - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 283, - 26 - ] - }); - case /* Partial_match */ 3 : - const s$2 = s._0; - if (s$2 === "") { - return "this pattern-matching is not exhaustive."; + } + }); } else { - return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + return "the method " + (lab + " is overridden."); } + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 283, + 26 + ] + }); + case /* Partial_match */ 3 : + const s$2 = s._0; + if (s$2 === "") { + return "this pattern-matching is not exhaustive."; + } else { + return "this pattern-matching is not exhaustive.\nHere is an example of a value that is not matched:\n" + s$2; + } case /* Non_closed_record_pattern */ 4 : - return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); + return "the following labels are not bound in this record pattern:\n" + (s._0 + "\nEither bind these labels explicitly or add '; _' to the pattern."); case /* Instance_variable_override */ 5 : - const match$1 = s._0; - if (match$1) { - const lab$1 = match$1.hd; - if (match$1.tl) { - return Stdlib__String.concat(" ", { - hd: "the following instance variables are overridden by the class", + const match$1 = s._0; + if (match$1) { + const lab$1 = match$1.hd; + if (match$1.tl) { + return Stdlib__String.concat(" ", { + hd: "the following instance variables are overridden by the class", + tl: { + hd: lab$1, tl: { - hd: lab$1, - tl: { - hd: ":\n ", - tl: match$1.tl - } + hd: ":\n ", + tl: match$1.tl } - }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; - } else { - return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); - } + } + }) + "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"; + } else { + return "the instance variable " + (lab$1 + " is overridden.\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)"); } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 303, - 37 - ] - }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 303, + 37 + ] + }); case /* Implicit_public_methods */ 6 : - return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); + return "the following private methods were made public implicitly:\n " + (Stdlib__String.concat(" ", s._0) + "."); case /* Undeclared_virtual_method */ 7 : - return "the virtual method " + (s._0 + " is not declared."); + return "the virtual method " + (s._0 + " is not declared."); case /* Not_principal */ 8 : - return s._0 + " is not principal."; + return s._0 + " is not principal."; case /* Without_principality */ 9 : - return s._0 + " without principality."; + return s._0 + " without principality."; case /* Preprocessor */ 10 : - return s._0; + return s._0; case /* Bad_module_name */ 11 : - return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); + return "bad source file name: \"" + (s._0 + "\" is not a valid module name."); case /* Unused_var */ 12 : case /* Unused_var_strict */ 13 : - return "unused variable " + (s._0 + "."); + return "unused variable " + (s._0 + "."); case /* Duplicate_definitions */ 14 : - return Curry._4(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "the ", + return Curry._4(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is defined in both types ", _1: { - TAG: /* String_literal */ 11, - _0: " is defined in both types ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } @@ -2409,239 +2408,240 @@ function message(s) { } } } - }, - _1: "the %s %s is defined in both types %s and %s." - }), s._0, s._1, s._2, s._3); + } + }, + _1: "the %s %s is defined in both types %s and %s." + }), s._0, s._1, s._2, s._3); case /* Multiple_definition */ 15 : - return Curry._3(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "files ", + return Curry._3(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "files ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " and ", _1: { - TAG: /* String_literal */ 11, - _0: " and ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " both define a module named ", _1: { - TAG: /* String_literal */ 11, - _0: " both define a module named ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } } } - }, - _1: "files %s and %s both define a module named %s" - }), s._1, s._2, s._0); + } + }, + _1: "files %s and %s both define a module named %s" + }), s._1, s._2, s._0); case /* Unused_value_declaration */ 16 : - return "unused value " + (s._0 + "."); + return "unused value " + (s._0 + "."); case /* Unused_open */ 17 : - return "unused open " + (s._0 + "."); + return "unused open " + (s._0 + "."); case /* Unused_type_declaration */ 18 : - return "unused type " + (s._0 + "."); + return "unused type " + (s._0 + "."); case /* Unused_for_index */ 19 : - return "unused for-loop index " + (s._0 + "."); + return "unused for-loop index " + (s._0 + "."); case /* Unused_ancestor */ 20 : - return "unused ancestor variable " + (s._0 + "."); + return "unused ancestor variable " + (s._0 + "."); case /* Unused_constructor */ 21 : - const s$3 = s._0; - if (s._1) { - return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); - } else { - return "unused constructor " + (s$3 + "."); - } + const s$3 = s._0; + if (s._1) { + return "constructor " + (s$3 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "constructor " + (s$3 + " is never used to build values.\nIts type is exported as a private type."); + } else { + return "unused constructor " + (s$3 + "."); + } case /* Unused_extension */ 22 : - const s$4 = s._0; - if (s._1) { - return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); - } else if (s._2) { - return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); - } else { - return "unused extension constructor " + (s$4 + "."); - } + const s$4 = s._0; + if (s._1) { + return "extension constructor " + (s$4 + " is never used to build values.\n(However, this constructor appears in patterns.)"); + } else if (s._2) { + return "extension constructor " + (s$4 + " is never used to build values.\nIt is exported or rebound as a private extension."); + } else { + return "unused extension constructor " + (s$4 + "."); + } case /* Name_out_of_scope */ 23 : - const slist = s._1; - const ty = s._0; - if (slist && !slist.tl && !s._2) { - return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); - } - if (s._2) { - return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 365, - 39 - ] - }); - break; - case /* Ambiguous_name */ 24 : - const slist$1 = s._0; - if (slist$1 && !slist$1.tl && !s._2) { - return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); - } - if (s._2) { - return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "warnings.ml", - 374, - 36 - ] - }); - break; + const slist = s._1; + const ty = s._0; + if (slist && !slist.tl && !s._2) { + return slist.hd + (" was selected from type " + (ty + ".\nIt is not visible in the current scope, and will not \nbe selected if the type becomes unknown.")); + } + if (s._2) { + return "this record of type " + (ty + (" contains fields that are \nnot visible in the current scope: " + (Stdlib__String.concat(" ", slist) + ".\nThey will not be selected if the type becomes unknown."))); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 365, + 39 + ] + }); + break; + case /* Ambiguous_name */ 24 : + const slist$1 = s._0; + if (slist$1 && !slist$1.tl && !s._2) { + return slist$1.hd + (" belongs to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong.")); + } + if (s._2) { + return "these field labels belong to several types: " + (Stdlib__String.concat(" ", s._1) + "\nThe first one was selected. Please disambiguate if this is wrong."); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "warnings.ml", + 374, + 36 + ] + }); + break; case /* Disambiguated_name */ 25 : - return "this use of " + (s._0 + " required disambiguation."); + return "this use of " + (s._0 + " required disambiguation."); case /* Nonoptional_label */ 26 : - return "the label " + (s._0 + " is not optional."); + return "the label " + (s._0 + " is not optional."); case /* Open_shadow_identifier */ 27 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " identifier ", _1: { - TAG: /* String_literal */ 11, - _0: " identifier ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s identifier %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s identifier %s (which is later used)" + }), s._0, s._1); case /* Open_shadow_label_constructor */ 28 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "this open statement shadows the ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "this open statement shadows the ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " (which is later used)", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " (which is later used)", + _1: /* End_of_format */ 0 } } } - }, - _1: "this open statement shadows the %s %s (which is later used)" - }), s._0, s._1); + } + }, + _1: "this open statement shadows the %s %s (which is later used)" + }), s._0, s._1); case /* Bad_env_variable */ 29 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal environment variable ", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal environment variable ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " : ", _1: { - TAG: /* String_literal */ 11, - _0: " : ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal environment variable %s : %s" - }), s._0, s._1); + } + }, + _1: "illegal environment variable %s : %s" + }), s._0, s._1); case /* Attribute_payload */ 30 : - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "illegal payload for attribute '", + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "illegal payload for attribute '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "'.\n", _1: { - TAG: /* String_literal */ 11, - _0: "'.\n", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "illegal payload for attribute '%s'.\n%s" - }), s._0, s._1); + } + }, + _1: "illegal payload for attribute '%s'.\n%s" + }), s._0, s._1); case /* Eliminated_optional_arguments */ 31 : - const sl = s._0; - return Curry._2(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "implicit elimination of optional argument", + const sl = s._0; + return Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "implicit elimination of optional argument", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ' ' */32, _1: { - TAG: /* Char_literal */ 12, - _0: /* ' ' */32, - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 } } - }, - _1: "implicit elimination of optional argument%s %s" - }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); + } + }, + _1: "implicit elimination of optional argument%s %s" + }), Stdlib__List.length(sl) === 1 ? "" : "s", Stdlib__String.concat(", ", sl)); case /* No_cmi_file */ 32 : - return "no cmi file was found in path for module " + s._0; + return "no cmi file was found in path for module " + s._0; case /* Bad_docstring */ 33 : - if (s._0) { - return "unattached documentation comment (ignored)"; - } else { - return "ambiguous documentation comment"; - } + if (s._0) { + return "unattached documentation comment (ignored)"; + } else { + return "ambiguous documentation comment"; + } case /* Mel_unused_attribute */ 34 : - return "Unused BuckleScript attribute: " + s._0; + return "Unused BuckleScript attribute: " + s._0; case /* Mel_ffi_warning */ 35 : - return "BuckleScript FFI warning: " + s._0; + return "BuckleScript FFI warning: " + s._0; case /* Bs_derive_warning */ 36 : - return "BuckleScript bs.deriving warning: " + s._0; + return "BuckleScript bs.deriving warning: " + s._0; } } @@ -4169,19 +4169,19 @@ function flatten(lid) { const accu = _accu; switch (s.TAG) { case /* Lident */ 0 : - return { - hd: s._0, - tl: accu - }; + return { + hd: s._0, + tl: accu + }; case /* Ldot */ 1 : - _s = s._0; - _accu = { - hd: s._1, - tl: accu - }; - continue; + _s = s._0; + _accu = { + hd: s._1, + tl: accu + }; + continue; case /* Lapply */ 2 : - return fatal_error("Longident.flat"); + return fatal_error("Longident.flat"); } }; @@ -4190,11 +4190,11 @@ function flatten(lid) { function last(s) { switch (s.TAG) { case /* Lident */ 0 : - return s._0; + return s._0; case /* Ldot */ 1 : - return s._1; + return s._1; case /* Lapply */ 2 : - return fatal_error("Longident.last"); + return fatal_error("Longident.last"); } } @@ -4261,25 +4261,25 @@ function warn_bad_docstrings(param) { const match = ds.ds_attached; switch (match) { case /* Unattached */ 0 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: true - }); + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: true + }); case /* Info */ 1 : - return; + return; case /* Docs */ 2 : - const match$1 = ds.ds_associated; - switch (match$1) { - case /* Zero */ 0 : - case /* One */ 1 : - return; - case /* Many */ 2 : - return prerr_warning(ds.ds_loc, { - TAG: /* Bad_docstring */ 33, - _0: false - }); - - } + const match$1 = ds.ds_associated; + switch (match$1) { + case /* Zero */ 0 : + case /* One */ 1 : + return; + case /* Many */ 2 : + return prerr_warning(ds.ds_loc, { + TAG: /* Bad_docstring */ 33, + _0: false + }); + + } } }), Stdlib__List.rev(docstrings.contents)); @@ -4441,11 +4441,11 @@ function get_docstring(info, dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = info ? /* Info */ 1 : /* Docs */ 2; @@ -4466,11 +4466,11 @@ function get_docstrings(dsl) { const match = ds.ds_attached; switch (match) { case /* Info */ 1 : - _param = param.tl; - continue; + _param = param.tl; + continue; case /* Unattached */ 0 : case /* Docs */ 2 : - break; + break; } ds.ds_attached = /* Docs */ 2; @@ -4488,12 +4488,12 @@ function associate_docstrings(dsl) { const match = ds.ds_associated; switch (match) { case /* Zero */ 0 : - ds.ds_associated = /* One */ 1; - return; + ds.ds_associated = /* One */ 1; + return; case /* One */ 1 : case /* Many */ 2 : - ds.ds_associated = /* Many */ 2; - return; + ds.ds_associated = /* Many */ 2; + return; } }), dsl); @@ -6603,165 +6603,165 @@ const Escape_error = /* @__PURE__ */ Caml_exceptions.create("Parser_api.Syntaxer function prepare_error(loc) { switch (loc.TAG) { case /* Unclosed */ 0 : - const closing = loc._3; - const opening = loc._1; - return Curry._1(errorf(loc._2, { - hd: Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This '", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } - } - }, - _1: "This '%s' might be unmatched" - }), opening), - tl: /* [] */ 0 - }, Curry._2(Stdlib__Printf.sprintf({ + const closing = loc._3; + const opening = loc._1; + return Curry._1(errorf(loc._2, { + hd: Curry._1(errorf(loc._0, undefined, undefined, { TAG: /* Format */ 0, _0: { TAG: /* String_literal */ 11, - _0: "Syntax error: '", + _0: "This '", _1: { TAG: /* String */ 2, _0: /* No_padding */ 0, _1: { TAG: /* String_literal */ 11, - _0: "' expected, the highlighted '", + _0: "' might be unmatched", + _1: /* End_of_format */ 0 + } + } + }, + _1: "This '%s' might be unmatched" + }), opening), + tl: /* [] */ 0 + }, Curry._2(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: "' expected, the highlighted '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' might be unmatched", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' might be unmatched", + _1: /* End_of_format */ 0 } } } - }, - _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" - }), closing, opening), { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: '", + } + }, + _1: "Syntax error: '%s' expected, the highlighted '%s' might be unmatched" + }), closing, opening), { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "' expected", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "' expected", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: '%s' expected" - }), closing); + } + }, + _1: "Syntax error: '%s' expected" + }), closing); case /* Expecting */ 1 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " expected.", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: " expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s expected." - }), loc._1); + } + }, + _1: "Syntax error: %s expected." + }), loc._1); case /* Not_expecting */ 2 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: " not expected.", - _1: /* End_of_format */ 0 - } + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: { + TAG: /* String_literal */ 11, + _0: " not expected.", + _1: /* End_of_format */ 0 } - }, - _1: "Syntax error: %s not expected." - }), loc._1); + } + }, + _1: "Syntax error: %s not expected." + }), loc._1); case /* Applicative_path */ 3 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set.", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error: applicative paths of the form F(X).t are not supported when the option -no-app-func is set." + }); case /* Variable_in_scope */ 4 : - const $$var = loc._1; - return Curry._2(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "In this scoped type, variable '", + const $$var = loc._1; + return Curry._2(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "In this scoped type, variable '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: " is reserved for the local type ", _1: { - TAG: /* String_literal */ 11, - _0: " is reserved for the local type ", + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '.' */46, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '.' */46, + _1: /* End_of_format */ 0 } } } - }, - _1: "In this scoped type, variable '%s is reserved for the local type %s." - }), $$var, $$var); + } + }, + _1: "In this scoped type, variable '%s is reserved for the local type %s." + }), $$var, $$var); case /* Other */ 5 : - return errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Syntax error", - _1: /* End_of_format */ 0 - }, - _1: "Syntax error" - }); + return errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Syntax error", + _1: /* End_of_format */ 0 + }, + _1: "Syntax error" + }); case /* Ill_formed_ast */ 6 : - return Curry._1(errorf(loc._0, undefined, undefined, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "broken invariant in parsetree: ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "broken invariant in parsetree: %s" - }), loc._1); + return Curry._1(errorf(loc._0, undefined, undefined, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "broken invariant in parsetree: ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "broken invariant in parsetree: %s" + }), loc._1); } } @@ -7254,135 +7254,135 @@ function varify_constructors(var_names, t) { } else { switch (x.TAG) { case /* Ptyp_var */ 0 : - const x$1 = x._0; - check_variable(var_names, t.ptyp_loc, x$1); - desc = { - TAG: /* Ptyp_var */ 0, - _0: x$1 - }; - break; + const x$1 = x._0; + check_variable(var_names, t.ptyp_loc, x$1); + desc = { + TAG: /* Ptyp_var */ 0, + _0: x$1 + }; + break; case /* Ptyp_arrow */ 1 : - desc = { - TAG: /* Ptyp_arrow */ 1, - _0: x._0, - _1: loop(x._1), - _2: loop(x._2) - }; - break; + desc = { + TAG: /* Ptyp_arrow */ 1, + _0: x._0, + _1: loop(x._1), + _2: loop(x._2) + }; + break; case /* Ptyp_tuple */ 2 : - desc = { - TAG: /* Ptyp_tuple */ 2, - _0: Stdlib__List.map(loop, x._0) - }; - break; + desc = { + TAG: /* Ptyp_tuple */ 2, + _0: Stdlib__List.map(loop, x._0) + }; + break; case /* Ptyp_constr */ 3 : - const longident = x._0; - let exit = 0; - const s = longident.txt; - switch (s.TAG) { - case /* Lident */ 0 : - if (x._1) { - exit = 1; - } else { - const s$1 = s._0; - if (Stdlib__List.mem(s$1, var_names)) { - desc = { - TAG: /* Ptyp_var */ 0, - _0: s$1 - }; - } else { - exit = 1; - } - } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + const longident = x._0; + let exit = 0; + const s = longident.txt; + switch (s.TAG) { + case /* Lident */ 0 : + if (x._1) { + exit = 1; + } else { + const s$1 = s._0; + if (Stdlib__List.mem(s$1, var_names)) { + desc = { + TAG: /* Ptyp_var */ 0, + _0: s$1 + }; + } else { exit = 1; - break; - - } - if (exit === 1) { - desc = { - TAG: /* Ptyp_constr */ 3, - _0: longident, - _1: Stdlib__List.map(loop, x._1) - }; - } - break; - case /* Ptyp_object */ 4 : - desc = { - TAG: /* Ptyp_object */ 4, - _0: Stdlib__List.map((function (param) { - return [ - param[0], - param[1], - loop(param[2]) - ]; - }), x._0), - _1: x._1 - }; - break; - case /* Ptyp_class */ 5 : + } + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + exit = 1; + break; + + } + if (exit === 1) { desc = { - TAG: /* Ptyp_class */ 5, - _0: x._0, + TAG: /* Ptyp_constr */ 3, + _0: longident, _1: Stdlib__List.map(loop, x._1) }; - break; + } + break; + case /* Ptyp_object */ 4 : + desc = { + TAG: /* Ptyp_object */ 4, + _0: Stdlib__List.map((function (param) { + return [ + param[0], + param[1], + loop(param[2]) + ]; + }), x._0), + _1: x._1 + }; + break; + case /* Ptyp_class */ 5 : + desc = { + TAG: /* Ptyp_class */ 5, + _0: x._0, + _1: Stdlib__List.map(loop, x._1) + }; + break; case /* Ptyp_alias */ 6 : - const string = x._1; - check_variable(var_names, t.ptyp_loc, string); - desc = { - TAG: /* Ptyp_alias */ 6, - _0: loop(x._0), - _1: string - }; - break; + const string = x._1; + check_variable(var_names, t.ptyp_loc, string); + desc = { + TAG: /* Ptyp_alias */ 6, + _0: loop(x._0), + _1: string + }; + break; case /* Ptyp_variant */ 7 : - desc = { - TAG: /* Ptyp_variant */ 7, - _0: Stdlib__List.map(loop_row_field, x._0), - _1: x._1, - _2: x._2 - }; - break; + desc = { + TAG: /* Ptyp_variant */ 7, + _0: Stdlib__List.map(loop_row_field, x._0), + _1: x._1, + _2: x._2 + }; + break; case /* Ptyp_poly */ 8 : - const string_lst = x._0; - const partial_arg = t.ptyp_loc; - Stdlib__List.iter((function (param) { - return check_variable(var_names, partial_arg, param); - }), string_lst); - desc = { - TAG: /* Ptyp_poly */ 8, - _0: string_lst, - _1: loop(x._1) - }; - break; + const string_lst = x._0; + const partial_arg = t.ptyp_loc; + Stdlib__List.iter((function (param) { + return check_variable(var_names, partial_arg, param); + }), string_lst); + desc = { + TAG: /* Ptyp_poly */ 8, + _0: string_lst, + _1: loop(x._1) + }; + break; case /* Ptyp_package */ 9 : - const match = x._0; - desc = { - TAG: /* Ptyp_package */ 9, - _0: [ - match[0], - Stdlib__List.map((function (param) { - return [ - param[0], - loop(param[1]) - ]; - }), match[1]) - ] - }; - break; + const match = x._0; + desc = { + TAG: /* Ptyp_package */ 9, + _0: [ + match[0], + Stdlib__List.map((function (param) { + return [ + param[0], + loop(param[1]) + ]; + }), match[1]) + ] + }; + break; case /* Ptyp_extension */ 10 : - const match$1 = x._0; - desc = { - TAG: /* Ptyp_extension */ 10, - _0: [ - match$1[0], - match$1[1] - ] - }; - break; + const match$1 = x._0; + desc = { + TAG: /* Ptyp_extension */ 10, + _0: [ + match$1[0], + match$1[1] + ] + }; + break; } } @@ -9865,51 +9865,51 @@ const yyact = [ let exit = 0; switch (_1) { case "-" : - if (match.TAG === /* Pexp_constant */ 1) { - const n = match._0; - switch (n.TAG) { - case /* Const_int */ 0 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int */ 0, - _0: -n._0 | 0 - } - }); - case /* Const_int32 */ 4 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int32 */ 4, - _0: -n._0 | 0 - } - }); - case /* Const_int64 */ 5 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_int64 */ 5, - _0: Caml_int64.neg(n._0) - } - }); - case /* Const_nativeint */ 6 : - return mkexp({ - TAG: /* Pexp_constant */ 1, - _0: { - TAG: /* Const_nativeint */ 6, - _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) - } - }); - default: - exit = 2; - } - } else { - exit = 2; + if (match.TAG === /* Pexp_constant */ 1) { + const n = match._0; + switch (n.TAG) { + case /* Const_int */ 0 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int */ 0, + _0: -n._0 | 0 + } + }); + case /* Const_int32 */ 4 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int32 */ 4, + _0: -n._0 | 0 + } + }); + case /* Const_int64 */ 5 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_int64 */ 5, + _0: Caml_int64.neg(n._0) + } + }); + case /* Const_nativeint */ 6 : + return mkexp({ + TAG: /* Pexp_constant */ 1, + _0: { + TAG: /* Const_nativeint */ 6, + _0: Caml_external_polyfill.resolve("nativeint_neg")(n._0) + } + }); + default: + exit = 2; } - break; - case "-." : + } else { exit = 2; - break; + } + break; + case "-." : + exit = 2; + break; } if (exit === 2 && match.TAG === /* Pexp_constant */ 1) { @@ -9944,23 +9944,23 @@ const yyact = [ let exit = 0; switch (_1) { case "+" : - if (desc.TAG === /* Pexp_constant */ 1) { - switch (desc._0.TAG) { - case /* Const_char */ 1 : - case /* Const_string */ 2 : - case /* Const_float */ 3 : - exit = 2; - break; - default: - return mkexp(desc); - } - } else { - exit = 2; + if (desc.TAG === /* Pexp_constant */ 1) { + switch (desc._0.TAG) { + case /* Const_char */ 1 : + case /* Const_string */ 2 : + case /* Const_float */ 3 : + exit = 2; + break; + default: + return mkexp(desc); } - break; - case "+." : + } else { exit = 2; - break; + } + break; + case "+." : + exit = 2; + break; } if (exit === 2 && desc.TAG === /* Pexp_constant */ 1 && desc._0.TAG === /* Const_float */ 3) { @@ -13780,13 +13780,13 @@ function type_of_directive(x) { } switch (x.TAG) { case /* Dir_bool */ 0 : - return /* Dir_type_bool */ 0; + return /* Dir_type_bool */ 0; case /* Dir_float */ 1 : - return /* Dir_type_float */ 1; + return /* Dir_type_float */ 1; case /* Dir_int */ 2 : - return /* Dir_type_int */ 2; + return /* Dir_type_int */ 2; case /* Dir_string */ 3 : - return /* Dir_type_string */ 3; + return /* Dir_type_string */ 3; } } @@ -13794,15 +13794,15 @@ function type_of_directive(x) { function string_of_type_directive(x) { switch (x) { case /* Dir_type_bool */ 0 : - return "bool"; + return "bool"; case /* Dir_type_float */ 1 : - return "float"; + return "float"; case /* Dir_type_int */ 2 : - return "int"; + return "int"; case /* Dir_type_string */ 3 : - return "string"; + return "string"; case /* Dir_type_null */ 4 : - return "null"; + return "null"; } } @@ -13974,46 +13974,46 @@ function semver(loc, lhs, str) { } else if (v >= 60) { switch (v) { case 60 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: loc - }); - } - match = str[1] === "=" ? [ - "Le", - semantic_version_parse(str, 2, last_index) - ] : [ - "Lt", - semantic_version_parse(str, 1, last_index) - ]; - break; + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: loc + }); + } + match = str[1] === "=" ? [ + "Le", + semantic_version_parse(str, 2, last_index) + ] : [ + "Lt", + semantic_version_parse(str, 1, last_index) + ]; + break; case 61 : - exit = 1; - break; + exit = 1; + break; case 62 : - if (last_index === 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_semver */ 6, - _0: str - }, - _2: loc - }); - } - match = str[1] === "=" ? [ - "Ge", - semantic_version_parse(str, 2, last_index) - ] : [ - "Gt", - semantic_version_parse(str, 1, last_index) - ]; - break; + if (last_index === 0) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_semver */ 6, + _0: str + }, + _2: loc + }); + } + match = str[1] === "=" ? [ + "Ge", + semantic_version_parse(str, 2, last_index) + ] : [ + "Gt", + semantic_version_parse(str, 1, last_index) + ]; + break; } } else { @@ -14067,21 +14067,21 @@ function pp_directive_value(fmt, x) { } switch (x.TAG) { case /* Dir_bool */ 0 : - return Stdlib__Format.pp_print_bool(fmt, x._0); + return Stdlib__Format.pp_print_bool(fmt, x._0); case /* Dir_float */ 1 : - return Stdlib__Format.pp_print_float(fmt, x._0); + return Stdlib__Format.pp_print_float(fmt, x._0); case /* Dir_int */ 2 : - return Stdlib__Format.pp_print_int(fmt, x._0); + return Stdlib__Format.pp_print_int(fmt, x._0); case /* Dir_string */ 3 : - return Curry._1(Stdlib__Format.fprintf(fmt)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Caml_string */ 3, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - }, - _1: "%S" - }), x._0); + return Curry._1(Stdlib__Format.fprintf(fmt)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Caml_string */ 3, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + }, + _1: "%S" + }), x._0); } } @@ -14262,15 +14262,15 @@ function value_of_token(loc, t) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* FALSE */ 29 : - return { - TAG: /* Dir_bool */ 0, - _0: false - }; + return { + TAG: /* Dir_bool */ 0, + _0: false + }; case /* TRUE */ 91 : - return { - TAG: /* Dir_bool */ 0, - _0: true - }; + return { + TAG: /* Dir_bool */ 0, + _0: true + }; default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -14281,22 +14281,22 @@ function value_of_token(loc, t) { } else { switch (t.TAG) { case /* FLOAT */ 1 : - return { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(t._0) - }; + return { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(t._0) + }; case /* INT */ 7 : - return { - TAG: /* Dir_int */ 2, - _0: t._0 - }; + return { + TAG: /* Dir_int */ 2, + _0: t._0 + }; case /* STRING */ 16 : - return { - TAG: /* Dir_string */ 3, - _0: t._0[0] - }; + return { + TAG: /* Dir_string */ 3, + _0: t._0[0] + }; case /* UIDENT */ 17 : - return query(loc, t._0); + return query(loc, t._0); default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -14323,14 +14323,14 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof t === "number" || typeof t === "string") { switch (t) { case /* EOF */ 25 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_if */ 2, + _2: curr(lexbuf) + }); case /* EOL */ 100 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -14338,8 +14338,8 @@ function directive_parse(token_with_comments, lexbuf) { switch (t.TAG) { case /* COMMENT */ 18 : case /* DOCSTRING */ 19 : - _param = undefined; - continue; + _param = undefined; + continue; default: return t; } @@ -14367,8 +14367,8 @@ function directive_parse(token_with_comments, lexbuf) { case /* EQUAL */ 26 : case /* GREATER */ 34 : case /* LESS */ 51 : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -14378,38 +14378,25 @@ function directive_parse(token_with_comments, lexbuf) { } switch (op._0) { case "=~" : - if (!calc) { - return true; - } - let exit$1 = 0; - if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { - exit$1 = 2; + if (!calc) { + return true; + } + let exit$1 = 0; + if (/* tag */ typeof lhs === "number" || typeof lhs === "string" || lhs.TAG !== /* Dir_string */ 3) { + exit$1 = 2; + } else { + const curr_loc = curr(lexbuf); + const rhs = value_of_token(curr_loc, token(undefined)); + let exit$2 = 0; + if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { + exit$2 = 3; } else { - const curr_loc = curr(lexbuf); - const rhs = value_of_token(curr_loc, token(undefined)); - let exit$2 = 0; - if (/* tag */ typeof rhs === "number" || typeof rhs === "string") { - exit$2 = 3; - } else { - if (rhs.TAG === /* Dir_string */ 3) { - return semver(curr_loc, lhs._0, rhs._0); - } - exit$2 = 3; - } - if (exit$2 === 3) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_string */ 3, - _1: type_of_directive(lhs) - }, - _2: curr(lexbuf) - }); + if (rhs.TAG === /* Dir_string */ 3) { + return semver(curr_loc, lhs._0, rhs._0); } - + exit$2 = 3; } - if (exit$1 === 2) { + if (exit$2 === 3) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: { @@ -14420,12 +14407,25 @@ function directive_parse(token_with_comments, lexbuf) { _2: curr(lexbuf) }); } - break; + + } + if (exit$1 === 2) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_string */ 3, + _1: type_of_directive(lhs) + }, + _2: curr(lexbuf) + }); + } + break; case "<=" : case "<>" : case ">=" : - exit = 1; - break; + exit = 1; + break; default: return Curry._1(no, op); } @@ -14436,25 +14436,25 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof op === "number" || typeof op === "string") { switch (op) { case /* EQUAL */ 26 : - f = Caml_obj.caml_equal; - break; + f = Caml_obj.caml_equal; + break; case /* GREATER */ 34 : - f = Caml_obj.caml_greaterthan; - break; + f = Caml_obj.caml_greaterthan; + break; case /* LESS */ 51 : - f = Caml_obj.caml_lessthan; - break; + f = Caml_obj.caml_lessthan; + break; default: exit$3 = 2; } } else if (op.TAG === /* INFIXOP0 */ 2) { switch (op._0) { case "<=" : - f = Caml_obj.caml_lessequal; - break; + f = Caml_obj.caml_lessequal; + break; case "<>" : - f = Caml_obj.caml_notequal; - break; + f = Caml_obj.caml_notequal; + break; default: exit$3 = 2; } @@ -14487,28 +14487,28 @@ function directive_parse(token_with_comments, lexbuf) { if (/* tag */ typeof curr_token === "number" || typeof curr_token === "string") { switch (curr_token) { case /* FALSE */ 29 : - return false; + return false; case /* LPAREN */ 54 : - const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); - const match = token(undefined); - if (/* tag */ typeof match === "number" || typeof match === "string") { - if (match === /* RPAREN */ 81) { - return v; - } - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); - } else { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_paren_in_conditional */ 1, - _2: curr(lexbuf) - }); + const v = parse_or_aux(calc, parse_and_aux(calc, parse_relation(calc))); + const match = token(undefined); + if (/* tag */ typeof match === "number" || typeof match === "string") { + if (match === /* RPAREN */ 81) { + return v; } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } else { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_paren_in_conditional */ 1, + _2: curr(lexbuf) + }); + } case /* TRUE */ 91 : - return true; + return true; default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -14519,102 +14519,102 @@ function directive_parse(token_with_comments, lexbuf) { } else { switch (curr_token.TAG) { case /* FLOAT */ 1 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_float */ 1 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_float */ 1, - _0: Caml_format.caml_float_of_string(curr_token._0) - }); - case /* INT */ 7 : - const v$1 = curr_token._0; - return token_op(calc, (function (e) { - push(e); - return v$1 !== 0; - }), { - TAG: /* Dir_int */ 2, - _0: v$1 - }); - case /* LIDENT */ 11 : - const r = curr_token._0; - switch (r) { - case "defined" : - case "undefined" : - break; - default: + return token_op(calc, (function (e) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_token_in_conditional */ 4, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_float */ 1 + }, _2: curr_loc }); - } - const t = token(undefined); - const loc = curr(lexbuf); - if (/* tag */ typeof t === "number" || typeof t === "string") { + }), { + TAG: /* Dir_float */ 1, + _0: Caml_format.caml_float_of_string(curr_token._0) + }); + case /* INT */ 7 : + const v$1 = curr_token._0; + return token_op(calc, (function (e) { + push(e); + return v$1 !== 0; + }), { + TAG: /* Dir_int */ 2, + _0: v$1 + }); + case /* LIDENT */ 11 : + const r = curr_token._0; + switch (r) { + case "defined" : + case "undefined" : + break; + default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: /* Unexpected_token_in_conditional */ 4, - _2: loc + _2: curr_loc }); - } - if (t.TAG === /* UIDENT */ 17) { - const s = t._0; - if (calc) { - if (Caml_string.get(r, 0) === /* 'u' */117) { - return !defined(s); - } else { - return defined(s); - } - } else { - return true; - } - } + } + const t = token(undefined); + const loc = curr(lexbuf); + if (/* tag */ typeof t === "number" || typeof t === "string") { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, _1: /* Unexpected_token_in_conditional */ 4, _2: loc }); - break; + } + if (t.TAG === /* UIDENT */ 17) { + const s = t._0; + if (calc) { + if (Caml_string.get(r, 0) === /* 'u' */117) { + return !defined(s); + } else { + return defined(s); + } + } else { + return true; + } + } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_token_in_conditional */ 4, + _2: loc + }); + break; case /* STRING */ 16 : - return token_op(calc, (function (e) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: /* Dir_type_string */ 3 - }, - _2: curr_loc - }); - }), { - TAG: /* Dir_string */ 3, - _0: curr_token._0[0] - }); + return token_op(calc, (function (e) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: /* Dir_type_string */ 3 + }, + _2: curr_loc + }); + }), { + TAG: /* Dir_string */ 3, + _0: curr_token._0[0] + }); case /* UIDENT */ 17 : - const value_v = query(curr_loc, curr_token._0); - return token_op(calc, (function (e) { - push(e); - if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { - return value_v._0; - } - const ty = type_of_directive(value_v); - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Conditional_expr_expected_type */ 7, - _0: /* Dir_type_bool */ 0, - _1: ty - }, - _2: curr_loc - }); - }), value_v); + const value_v = query(curr_loc, curr_token._0); + return token_op(calc, (function (e) { + push(e); + if (!/* tag */ (typeof value_v === "number" || typeof value_v === "string") && value_v.TAG === /* Dir_bool */ 0) { + return value_v._0; + } + const ty = type_of_directive(value_v); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Conditional_expr_expected_type */ 7, + _0: /* Dir_type_bool */ 0, + _1: ty + }, + _2: curr_loc + }); + }), value_v); default: throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, @@ -15155,16 +15155,16 @@ function char_for_backslash(c) { } switch (c) { case 110 : - return /* '\n' */10; + return /* '\n' */10; case 114 : - return /* '\r' */13; + return /* '\r' */13; case 111 : case 112 : case 113 : case 115 : - return c; + return c; case 116 : - return /* '\t' */9; + return /* '\t' */9; } } @@ -15310,218 +15310,218 @@ function report_error$2(ppf, c) { if (/* tag */ typeof c === "number" || typeof c === "string") { switch (c) { case /* Unterminated_string */ 0 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal not terminated", - _1: /* End_of_format */ 0 - }, - _1: "String literal not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "String literal not terminated", + _1: /* End_of_format */ 0 + }, + _1: "String literal not terminated" + }); case /* Unterminated_paren_in_conditional */ 1 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unterminated parens in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unterminated parens in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unterminated parens in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unterminated parens in conditional predicate" + }); case /* Unterminated_if */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#if not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#if not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#if not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#if not terminated" + }); case /* Unterminated_else */ 3 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "#else not terminated", - _1: /* End_of_format */ 0 - }, - _1: "#else not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "#else not terminated", + _1: /* End_of_format */ 0 + }, + _1: "#else not terminated" + }); case /* Unexpected_token_in_conditional */ 4 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected token in conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected token in conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected token in conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected token in conditional predicate" + }); case /* Expect_hash_then_in_conditional */ 5 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Expect `then` after conditional predicate", - _1: /* End_of_format */ 0 - }, - _1: "Expect `then` after conditional predicate" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Expect `then` after conditional predicate", + _1: /* End_of_format */ 0 + }, + _1: "Expect `then` after conditional predicate" + }); case /* Unexpected_directive */ 6 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Unexpected directive", - _1: /* End_of_format */ 0 - }, - _1: "Unexpected directive" - }); - - } - } else { + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Unexpected directive", + _1: /* End_of_format */ 0 + }, + _1: "Unexpected directive" + }); + + } + } else { switch (c.TAG) { case /* Illegal_character */ 0 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal character (%s)" - }), Stdlib__Char.escaped(c._0)); + } + }, + _1: "Illegal character (%s)" + }), Stdlib__Char.escaped(c._0)); case /* Illegal_escape */ 1 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal backslash escape in string or character (", + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal backslash escape in string or character (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } - }, - _1: "Illegal backslash escape in string or character (%s)" - }), c._0); + } + }, + _1: "Illegal backslash escape in string or character (%s)" + }), c._0); case /* Unterminated_comment */ 2 : - return Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Comment not terminated", - _1: /* End_of_format */ 0 - }, - _1: "Comment not terminated" - }); + return Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Comment not terminated", + _1: /* End_of_format */ 0 + }, + _1: "Comment not terminated" + }); case /* Unterminated_string_in_comment */ 3 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "This comment contains an unterminated string literal", - _1: { - TAG: /* Formatting_lit */ 17, - _0: /* Flush_newline */ 4, - _1: { - TAG: /* Alpha */ 15, - _0: { - TAG: /* String_literal */ 11, - _0: "String literal begins here", - _1: /* End_of_format */ 0 - } - } - } - }, - _1: "This comment contains an unterminated string literal@.%aString literal begins here" - }), print_error, c._1); - case /* Keyword_as_label */ 4 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* Char_literal */ 12, - _0: /* '`' */96, + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "This comment contains an unterminated string literal", + _1: { + TAG: /* Formatting_lit */ 17, + _0: /* Flush_newline */ 4, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { + TAG: /* Alpha */ 15, + _0: { TAG: /* String_literal */ 11, - _0: "' is a keyword, it cannot be used as label name", + _0: "String literal begins here", _1: /* End_of_format */ 0 } } - }, - _1: "`%s' is a keyword, it cannot be used as label name" - }), c._0); - case /* Literal_overflow */ 5 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Integer literal exceeds the range of representable integers of type ", + } + }, + _1: "This comment contains an unterminated string literal@.%aString literal begins here" + }), print_error, c._1); + case /* Keyword_as_label */ 4 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* Char_literal */ 12, + _0: /* '`' */96, + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "' is a keyword, it cannot be used as label name", _1: /* End_of_format */ 0 } - }, - _1: "Integer literal exceeds the range of representable integers of type %s" - }), c._0); + } + }, + _1: "`%s' is a keyword, it cannot be used as label name" + }), c._0); + case /* Literal_overflow */ 5 : + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Integer literal exceeds the range of representable integers of type ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Integer literal exceeds the range of representable integers of type %s" + }), c._0); case /* Illegal_semver */ 6 : - return Curry._1(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Illegal semantic version string ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "Illegal semantic version string %s" - }), c._0); + return Curry._1(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Illegal semantic version string ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "Illegal semantic version string %s" + }), c._0); case /* Conditional_expr_expected_type */ 7 : - return Curry._2(Stdlib__Format.fprintf(ppf)({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Conditional expression type mismatch (", + return Curry._2(Stdlib__Format.fprintf(ppf)({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Conditional expression type mismatch (", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* Char_literal */ 12, + _0: /* ',' */44, _1: { - TAG: /* Char_literal */ 12, - _0: /* ',' */44, + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* ')' */41, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* ')' */41, + _1: /* End_of_format */ 0 } } } - }, - _1: "Conditional expression type mismatch (%s,%s)" - }), string_of_type_directive(c._0), string_of_type_directive(c._1)); + } + }, + _1: "Conditional expression type mismatch (%s,%s)" + }), string_of_type_directive(c._0), string_of_type_directive(c._1)); } } @@ -15556,479 +15556,479 @@ function token(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - if (!escaped_newlines.contents) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); - } - update_loc(lexbuf, undefined, 1, false, 0); - return token(lexbuf); + if (!escaped_newlines.contents) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); + } + update_loc(lexbuf, undefined, 1, false, 0); + return token(lexbuf); case 1 : - update_loc(lexbuf, undefined, 1, false, 0); - return /* EOL */ 100; + update_loc(lexbuf, undefined, 1, false, 0); + return /* EOL */ 100; case 2 : - return token(lexbuf); + return token(lexbuf); case 3 : - return /* UNDERSCORE */ 94; + return /* UNDERSCORE */ 94; case 4 : - return /* TILDE */ 89; + return /* TILDE */ 89; case 5 : - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 6 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LABEL */ 10, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LABEL */ 10, + _0: get_label_name(lexbuf) + }; case 7 : - return /* QUESTION */ 76; + return /* QUESTION */ 76; case 8 : - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 9 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* OPTLABEL */ 13, - _0: get_label_name(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* OPTLABEL */ 13, + _0: get_label_name(lexbuf) + }; case 10 : - const s = Stdlib__Lexing.lexeme(lexbuf); - try { - return Stdlib__Hashtbl.find(keyword_table, s); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === Stdlib.Not_found) { - return { - TAG: /* LIDENT */ 11, - _0: s - }; - } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + const s = Stdlib__Lexing.lexeme(lexbuf); + try { + return Stdlib__Hashtbl.find(keyword_table, s); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === Stdlib.Not_found) { + return { + TAG: /* LIDENT */ 11, + _0: s + }; } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + } case 11 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); - return { - TAG: /* LIDENT */ 11, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* LIDENT */ 11, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 12 : - return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 13 : - prerr_warning(curr(lexbuf), { - TAG: /* Deprecated */ 0, - _0: "ISO-Latin1 characters in identifiers" - }); + prerr_warning(curr(lexbuf), { + TAG: /* Deprecated */ 0, + _0: "ISO-Latin1 characters in identifiers" + }); + return { + TAG: /* UIDENT */ 17, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; + case 14 : + try { return { - TAG: /* UIDENT */ 17, - _0: Stdlib__Lexing.lexeme(lexbuf) + TAG: /* INT */ 7, + _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 14 : - try { - return { - TAG: /* INT */ 7, - _0: cvt_int_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int" + }, + _2: curr(lexbuf) + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + } case 15 : - return { - TAG: /* FLOAT */ 1, - _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) - }; + return { + TAG: /* FLOAT */ 1, + _0: remove_underscores(Stdlib__Lexing.lexeme(lexbuf)) + }; case 16 : - try { - return { - TAG: /* INT32 */ 8, - _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$2){ - const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); - if (exn$2.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int32" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); - } - case 17 : - try { - return { - TAG: /* INT64 */ 9, - _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$3){ - const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); - if (exn$3.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "int64" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); - } - case 18 : - try { - return { - TAG: /* NATIVEINT */ 12, - _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) - }; - } - catch (raw_exn$4){ - const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); - if (exn$4.MEL_EXN_ID === Stdlib.Failure) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Literal_overflow */ 5, - _0: "nativeint" - }, - _2: curr(lexbuf) - }); - } - throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); - } - case 19 : - reset_string_buffer(undefined); - is_in_string.contents = true; - const string_start = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - string(lexbuf); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start; + try { return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - undefined - ] + TAG: /* INT32 */ 8, + _0: cvt_int32_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 20 : - reset_string_buffer(undefined); - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - is_in_string.contents = true; - const string_start$1 = lexbuf.lex_start_p; - string_start_loc.contents = curr(lexbuf); - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - is_in_string.contents = false; - lexbuf.lex_start_p = string_start$1; + } + catch (raw_exn$2){ + const exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); + if (exn$2.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int32" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$2.MEL_EXN_ID, exn$2); + } + case 17 : + try { return { - TAG: /* STRING */ 16, - _0: [ - get_stored_string(undefined), - delim$1 - ] + TAG: /* INT64 */ 9, + _0: cvt_int64_literal(Stdlib__Lexing.lexeme(lexbuf)) }; - case 21 : - update_loc(lexbuf, undefined, 1, false, 1); + } + catch (raw_exn$3){ + const exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); + if (exn$3.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "int64" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$3.MEL_EXN_ID, exn$3); + } + case 18 : + try { return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + TAG: /* NATIVEINT */ 12, + _0: cvt_nativeint_literal(Stdlib__Lexing.lexeme(lexbuf)) }; + } + catch (raw_exn$4){ + const exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); + if (exn$4.MEL_EXN_ID === Stdlib.Failure) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Literal_overflow */ 5, + _0: "nativeint" + }, + _2: curr(lexbuf) + }); + } + throw new Caml_js_exceptions.MelangeError(exn$4.MEL_EXN_ID, exn$4); + } + case 19 : + reset_string_buffer(undefined); + is_in_string.contents = true; + const string_start = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + string(lexbuf); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + undefined + ] + }; + case 20 : + reset_string_buffer(undefined); + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + is_in_string.contents = true; + const string_start$1 = lexbuf.lex_start_p; + string_start_loc.contents = curr(lexbuf); + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + is_in_string.contents = false; + lexbuf.lex_start_p = string_start$1; + return { + TAG: /* STRING */ 16, + _0: [ + get_stored_string(undefined), + delim$1 + ] + }; + case 21 : + update_loc(lexbuf, undefined, 1, false, 1); + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 22 : - return { - TAG: /* CHAR */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) - }; + return { + TAG: /* CHAR */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 1) + }; case 23 : - return { - TAG: /* CHAR */ 0, - _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 2)) + }; case 24 : - return { - TAG: /* CHAR */ 0, - _0: char_for_decimal_code(lexbuf, 2) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_decimal_code(lexbuf, 2) + }; case 25 : - return { - TAG: /* CHAR */ 0, - _0: char_for_hexadecimal_code(lexbuf, 3) - }; + return { + TAG: /* CHAR */ 0, + _0: char_for_hexadecimal_code(lexbuf, 3) + }; case 26 : - const l = Stdlib__Lexing.lexeme(lexbuf); - const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_escape */ 1, - _0: esc - }, - _2: curr(lexbuf) - }); + const l = Stdlib__Lexing.lexeme(lexbuf); + const esc = Stdlib__String.sub(l, 1, l.length - 1 | 0); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_escape */ 1, + _0: esc + }, + _2: curr(lexbuf) + }); case 27 : - const match = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match[0], - match[1] - ] - }; + const match = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match[0], + match[1] + ] + }; case 28 : - const match$1 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* DOCSTRING */ 19, - _0: docstring(match$1[0], match$1[1]) - }; + const match$1 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* DOCSTRING */ 19, + _0: docstring(match$1[0], match$1[1]) + }; case 29 : - const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); - const match$2 = with_comment_buffer((function (lexbuf) { - store_string("*" + stars); - return __ocaml_lex_comment_rec(lexbuf, 132); - }), lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$2[0], - match$2[1] - ] - }; + const stars = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos); + const match$2 = with_comment_buffer((function (lexbuf) { + store_string("*" + stars); + return __ocaml_lex_comment_rec(lexbuf, 132); + }), lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$2[0], + match$2[1] + ] + }; case 30 : - if (print_warnings.contents) { - prerr_warning(curr(lexbuf), /* Comment_start */ 0); - } - const match$3 = with_comment_buffer(comment, lexbuf); - return { - TAG: /* COMMENT */ 18, - _0: [ - match$3[0], - match$3[1] - ] - }; + if (print_warnings.contents) { + prerr_warning(curr(lexbuf), /* Comment_start */ 0); + } + const match$3 = with_comment_buffer(comment, lexbuf); + return { + TAG: /* COMMENT */ 18, + _0: [ + match$3[0], + match$3[1] + ] + }; case 31 : - const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); - return { - TAG: /* COMMENT */ 18, - _0: [ - stars$1, - curr(lexbuf) - ] - }; + const stars$1 = Stdlib__Lexing.sub_lexeme(lexbuf, lexbuf.lex_start_pos, lexbuf.lex_curr_pos - 2 | 0); + return { + TAG: /* COMMENT */ 18, + _0: [ + stars$1, + curr(lexbuf) + ] + }; case 32 : - const loc = curr(lexbuf); - prerr_warning(loc, /* Comment_not_end */ 1); - lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; - const curpos = lexbuf.lex_curr_p; - lexbuf.lex_curr_p = { - pos_fname: curpos.pos_fname, - pos_lnum: curpos.pos_lnum, - pos_bol: curpos.pos_bol, - pos_cnum: curpos.pos_cnum - 1 | 0 - }; - return /* STAR */ 86; + const loc = curr(lexbuf); + prerr_warning(loc, /* Comment_not_end */ 1); + lexbuf.lex_curr_pos = lexbuf.lex_curr_pos - 1 | 0; + const curpos = lexbuf.lex_curr_p; + lexbuf.lex_curr_p = { + pos_fname: curpos.pos_fname, + pos_lnum: curpos.pos_lnum, + pos_bol: curpos.pos_bol, + pos_cnum: curpos.pos_cnum - 1 | 0 + }; + return /* STAR */ 86; case 33 : - const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); - const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); - update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); - return token(lexbuf); + const num = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), Caml_array.get(lexbuf.lex_mem, 1)); + const name = Stdlib__Lexing.sub_lexeme_opt(lexbuf, Caml_array.get(lexbuf.lex_mem, 3), Caml_array.get(lexbuf.lex_mem, 2)); + update_loc(lexbuf, name, Caml_format.caml_int_of_string(num), true, 0); + return token(lexbuf); case 34 : - return /* SHARP */ 84; + return /* SHARP */ 84; case 35 : - return /* AMPERSAND */ 1; + return /* AMPERSAND */ 1; case 36 : - return /* AMPERAMPER */ 0; + return /* AMPERAMPER */ 0; case 37 : - return /* BACKQUOTE */ 5; + return /* BACKQUOTE */ 5; case 38 : - return /* QUOTE */ 77; + return /* QUOTE */ 77; case 39 : - return /* LPAREN */ 54; + return /* LPAREN */ 54; case 40 : - return /* RPAREN */ 81; + return /* RPAREN */ 81; case 41 : - return /* STAR */ 86; + return /* STAR */ 86; case 42 : - return /* COMMA */ 16; + return /* COMMA */ 16; case 43 : - return /* MINUSGREATER */ 62; + return /* MINUSGREATER */ 62; case 44 : - return /* DOT */ 20; + return /* DOT */ 20; case 45 : - return /* DOTDOT */ 21; + return /* DOTDOT */ 21; case 46 : - return /* COLON */ 12; + return /* COLON */ 12; case 47 : - return /* COLONCOLON */ 13; + return /* COLONCOLON */ 13; case 48 : - return /* COLONEQUAL */ 14; + return /* COLONEQUAL */ 14; case 49 : - return /* COLONGREATER */ 15; + return /* COLONGREATER */ 15; case 50 : - return /* SEMI */ 82; + return /* SEMI */ 82; case 51 : - return /* SEMISEMI */ 83; + return /* SEMISEMI */ 83; case 52 : - return /* LESS */ 51; + return /* LESS */ 51; case 53 : - return /* LESSMINUS */ 52; + return /* LESSMINUS */ 52; case 54 : - return /* EQUAL */ 26; + return /* EQUAL */ 26; case 55 : - return /* LBRACKET */ 45; + return /* LBRACKET */ 45; case 56 : - return /* LBRACKETBAR */ 46; + return /* LBRACKETBAR */ 46; case 57 : - return /* LBRACKETLESS */ 47; + return /* LBRACKETLESS */ 47; case 58 : - return /* LBRACKETGREATER */ 48; + return /* LBRACKETGREATER */ 48; case 59 : - return /* RBRACKET */ 79; + return /* RBRACKET */ 79; case 60 : - return /* LBRACE */ 43; + return /* LBRACE */ 43; case 61 : - return /* LBRACELESS */ 44; + return /* LBRACELESS */ 44; case 62 : - return /* BAR */ 7; + return /* BAR */ 7; case 63 : - return /* BARBAR */ 8; + return /* BARBAR */ 8; case 64 : - return /* BARRBRACKET */ 9; + return /* BARRBRACKET */ 9; case 65 : - return /* GREATER */ 34; + return /* GREATER */ 34; case 66 : - return /* GREATERRBRACKET */ 36; + return /* GREATERRBRACKET */ 36; case 67 : - return /* RBRACE */ 78; + return /* RBRACE */ 78; case 68 : - return /* GREATERRBRACE */ 35; + return /* GREATERRBRACE */ 35; case 69 : - return /* LBRACKETAT */ 55; + return /* LBRACKETAT */ 55; case 70 : - return /* LBRACKETPERCENT */ 49; + return /* LBRACKETPERCENT */ 49; case 71 : - return /* LBRACKETPERCENTPERCENT */ 50; + return /* LBRACKETPERCENTPERCENT */ 50; case 72 : - return /* LBRACKETATAT */ 56; + return /* LBRACKETATAT */ 56; case 73 : - return /* LBRACKETATATAT */ 57; + return /* LBRACKETATATAT */ 57; case 74 : - return /* BANG */ 6; + return /* BANG */ 6; case 75 : - return { - TAG: /* INFIXOP0 */ 2, - _0: "!=" - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: "!=" + }; case 76 : - return /* PLUS */ 72; + return /* PLUS */ 72; case 77 : - return /* PLUSDOT */ 73; + return /* PLUSDOT */ 73; case 78 : - return /* PLUSEQ */ 74; + return /* PLUSEQ */ 74; case 79 : - return /* MINUS */ 60; + return /* MINUS */ 60; case 80 : - return /* MINUSDOT */ 61; + return /* MINUSDOT */ 61; case 81 : case 82 : - return { - TAG: /* PREFIXOP */ 14, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* PREFIXOP */ 14, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 83 : - return { - TAG: /* INFIXOP0 */ 2, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP0 */ 2, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 84 : - return { - TAG: /* INFIXOP1 */ 3, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP1 */ 3, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 85 : - return { - TAG: /* INFIXOP2 */ 4, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP2 */ 4, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 86 : - return { - TAG: /* INFIXOP4 */ 6, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP4 */ 6, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 87 : - return /* PERCENT */ 71; + return /* PERCENT */ 71; case 88 : - return { - TAG: /* INFIXOP3 */ 5, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* INFIXOP3 */ 5, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 89 : - return { - TAG: /* SHARPOP */ 15, - _0: Stdlib__Lexing.lexeme(lexbuf) - }; + return { + TAG: /* SHARPOP */ 15, + _0: Stdlib__Lexing.lexeme(lexbuf) + }; case 90 : - if (if_then_else.contents === /* Dir_out */ 2) { - return /* EOF */ 25; - } - if (if_then_else.contents === /* Dir_if_true */ 0) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); - } + if (if_then_else.contents === /* Dir_out */ 2) { + return /* EOF */ 25; + } + if (if_then_else.contents === /* Dir_if_true */ 0) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_else */ 3, + _1: /* Unterminated_if */ 2, _2: curr(lexbuf) }); + } + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); case 91 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Illegal_character */ 0, - _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) - }, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Illegal_character */ 0, + _0: Stdlib__Lexing.lexeme_char(lexbuf, 0) + }, + _2: curr(lexbuf) + }); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -16045,46 +16045,46 @@ function string(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.new_engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return; + return; case 1 : - const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); - update_loc(lexbuf, undefined, 1, false, space.length); - return string(lexbuf); + const space = Stdlib__Lexing.sub_lexeme(lexbuf, Caml_array.get(lexbuf.lex_mem, 0), lexbuf.lex_curr_pos); + update_loc(lexbuf, undefined, 1, false, space.length); + return string(lexbuf); case 2 : - store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); - return string(lexbuf); + store_string_char(char_for_backslash(Stdlib__Lexing.lexeme_char(lexbuf, 1))); + return string(lexbuf); case 3 : - store_string_char(char_for_decimal_code(lexbuf, 1)); - return string(lexbuf); + store_string_char(char_for_decimal_code(lexbuf, 1)); + return string(lexbuf); case 4 : - store_string_char(char_for_hexadecimal_code(lexbuf, 2)); - return string(lexbuf); + store_string_char(char_for_hexadecimal_code(lexbuf, 2)); + return string(lexbuf); case 5 : - if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - return string(lexbuf); - } - const loc = curr(lexbuf); - prerr_warning(loc, /* Illegal_backslash */ 7); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + if (Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { return string(lexbuf); + } + const loc = curr(lexbuf); + prerr_warning(loc, /* Illegal_backslash */ 7); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 1)); + return string(lexbuf); case 6 : - if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { - prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); - } - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - return string(lexbuf); + if (!Caml_obj.caml_notequal(comment_start_loc.contents, /* [] */ 0)) { + prerr_warning(curr(lexbuf), /* Eol_in_string */ 14); + } + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + return string(lexbuf); case 7 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 8 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - return string(lexbuf); + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + return string(lexbuf); default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -16099,174 +16099,174 @@ function __ocaml_lex_comment_rec(lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - comment_start_loc.contents = { - hd: curr(lexbuf), - tl: comment_start_loc.contents - }; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + comment_start_loc.contents = { + hd: curr(lexbuf), + tl: comment_start_loc.contents + }; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 1 : - const match = comment_start_loc.contents; - if (match) { - if (match.tl) { - comment_start_loc.contents = match.tl; - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; - } - comment_start_loc.contents = /* [] */ 0; - return curr(lexbuf); + const match = comment_start_loc.contents; + if (match) { + if (match.tl) { + comment_start_loc.contents = match.tl; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 992, - 16 - ] - }); + comment_start_loc.contents = /* [] */ 0; + return curr(lexbuf); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 992, + 16 + ] + }); case 2 : - string_start_loc.contents = curr(lexbuf); - store_string_char(/* '"' */34); - is_in_string.contents = true; - try { - string(lexbuf); - } - catch (raw_exn){ - const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.MEL_EXN_ID === $$Error$2) { - let tmp = exn._1; - if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { - if (tmp === /* Unterminated_string */ 0) { - const match$1 = comment_start_loc.contents; - if (match$1) { - const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start, - _1: exn._2 - }, - _2: match$1.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1006, - 18 - ] + string_start_loc.contents = curr(lexbuf); + store_string_char(/* '"' */34); + is_in_string.contents = true; + try { + string(lexbuf); + } + catch (raw_exn){ + const exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.MEL_EXN_ID === $$Error$2) { + let tmp = exn._1; + if (/* tag */ typeof tmp === "number" || typeof tmp === "string") { + if (tmp === /* Unterminated_string */ 0) { + const match$1 = comment_start_loc.contents; + if (match$1) { + const start = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start, + _1: exn._2 + }, + _2: match$1.hd }); } - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); - } else { - throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1006, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } else { throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } + } else { + throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } - is_in_string.contents = false; - store_string_char(/* '"' */34); - ___ocaml_lex_state = 132; - continue; + } + is_in_string.contents = false; + store_string_char(/* '"' */34); + ___ocaml_lex_state = 132; + continue; case 3 : - const delim = Stdlib__Lexing.lexeme(lexbuf); - const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); - string_start_loc.contents = curr(lexbuf); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - is_in_string.contents = true; - try { - __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); - } - catch (raw_exn$1){ - const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); - if (exn$1.MEL_EXN_ID === $$Error$2) { - let tmp$1 = exn$1._1; - if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { - if (tmp$1 === /* Unterminated_string */ 0) { - const match$2 = comment_start_loc.contents; - if (match$2) { - const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_string_in_comment */ 3, - _0: start$1, - _1: exn$1._2 - }, - _2: match$2.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1026, - 18 - ] + const delim = Stdlib__Lexing.lexeme(lexbuf); + const delim$1 = Stdlib__String.sub(delim, 1, delim.length - 2 | 0); + string_start_loc.contents = curr(lexbuf); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + is_in_string.contents = true; + try { + __ocaml_lex_quoted_string_rec(delim$1, lexbuf, 183); + } + catch (raw_exn$1){ + const exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); + if (exn$1.MEL_EXN_ID === $$Error$2) { + let tmp$1 = exn$1._1; + if (/* tag */ typeof tmp$1 === "number" || typeof tmp$1 === "string") { + if (tmp$1 === /* Unterminated_string */ 0) { + const match$2 = comment_start_loc.contents; + if (match$2) { + const start$1 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_string_in_comment */ 3, + _0: start$1, + _1: exn$1._2 + }, + _2: match$2.hd }); } - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); - } else { - throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1026, + 18 + ] + }); } + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } else { throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } + } else { + throw new Caml_js_exceptions.MelangeError(exn$1.MEL_EXN_ID, exn$1); } - is_in_string.contents = false; - store_string_char(/* '|' */124); - store_string(delim$1); - store_string_char(/* '}' */125); - ___ocaml_lex_state = 132; - continue; + } + is_in_string.contents = false; + store_string_char(/* '|' */124); + store_string(delim$1); + store_string_char(/* '}' */125); + ___ocaml_lex_state = 132; + continue; case 5 : - update_loc(lexbuf, undefined, 1, false, 1); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + update_loc(lexbuf, undefined, 1, false, 1); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 10 : - const match$3 = comment_start_loc.contents; - if (match$3) { - const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); - comment_start_loc.contents = /* [] */ 0; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: { - TAG: /* Unterminated_comment */ 2, - _0: start$2 - }, - _2: match$3.hd - }); - } - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "parsing/lexer.mll", - 1056, - 16 - ] + const match$3 = comment_start_loc.contents; + if (match$3) { + const start$2 = Stdlib__List.hd(Stdlib__List.rev(comment_start_loc.contents)); + comment_start_loc.contents = /* [] */ 0; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: { + TAG: /* Unterminated_comment */ 2, + _0: start$2 + }, + _2: match$3.hd }); + } + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "parsing/lexer.mll", + 1056, + 16 + ] + }); case 11 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; case 4 : case 6 : case 7 : case 8 : case 9 : case 12 : - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 132; - continue; + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 132; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -16281,30 +16281,30 @@ function __ocaml_lex_quoted_string_rec(delim, lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - update_loc(lexbuf, undefined, 1, false, 0); - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + update_loc(lexbuf, undefined, 1, false, 0); + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 1 : - is_in_string.contents = false; - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_string */ 0, - _2: string_start_loc.contents - }); + is_in_string.contents = false; + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_string */ 0, + _2: string_start_loc.contents + }); case 2 : - const edelim = Stdlib__Lexing.lexeme(lexbuf); - const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); - if (delim === edelim$1) { - return; - } - store_string(Stdlib__Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 183; - continue; + const edelim = Stdlib__Lexing.lexeme(lexbuf); + const edelim$1 = Stdlib__String.sub(edelim, 1, edelim.length - 2 | 0); + if (delim === edelim$1) { + return; + } + store_string(Stdlib__Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 183; + continue; case 3 : - store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); - ___ocaml_lex_state = 183; - continue; + store_string_char(Stdlib__Lexing.lexeme_char(lexbuf, 0)); + ___ocaml_lex_state = 183; + continue; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -16324,11 +16324,11 @@ function skip_sharp_bang(lexbuf) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return update_loc(lexbuf, undefined, 3, false, 0); + return update_loc(lexbuf, undefined, 3, false, 0); case 1 : - return update_loc(lexbuf, undefined, 1, false, 0); + return update_loc(lexbuf, undefined, 1, false, 0); case 2 : - return; + return; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -16357,89 +16357,89 @@ function interpret_directive(lexbuf, cont, look_ahead) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* ELSE */ 23 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - break; - case /* Dir_if_false */ 1 : - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - break; + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + break; + case /* Dir_if_false */ 1 : + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + break; case /* END */ 24 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* Dir_out */ 2 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } case /* IF */ 37 : - switch (if_then_else$1) { - case /* Dir_if_true */ 0 : - case /* Dir_if_false */ 1 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - case /* Dir_out */ 2 : - if (directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; - return Curry._1(cont, lexbuf); - } else { - let _param; - while (true) { - const token = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token, /* EOF */ 25)) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_if */ 2, - _2: curr(lexbuf) - }); - } - if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$1 = token_with_comments(lexbuf); - if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { - switch (token$1) { - case /* ELSE */ 23 : - if_then_else.contents = /* Dir_if_false */ 1; - return Curry._1(cont, lexbuf); - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - } - if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { - if_then_else.contents = /* Dir_if_true */ 0; + switch (if_then_else$1) { + case /* Dir_if_true */ 0 : + case /* Dir_if_false */ 1 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + case /* Dir_out */ 2 : + if (directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } else { + let _param; + while (true) { + const token = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token, /* EOF */ 25)) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_if */ 2, + _2: curr(lexbuf) + }); + } + if (Caml_obj.caml_equal(token, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$1 = token_with_comments(lexbuf); + if (/* tag */ typeof token$1 === "number" || typeof token$1 === "string") { + switch (token$1) { + case /* ELSE */ 23 : + if_then_else.contents = /* Dir_if_false */ 1; return Curry._1(cont, lexbuf); - } - _param = undefined; - continue; + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + } - _param = undefined; - continue; - }; + } + if (is_elif(token$1) && directive_parse(token_with_comments, lexbuf)) { + if_then_else.contents = /* Dir_if_true */ 0; + return Curry._1(cont, lexbuf); + } + _param = undefined; + continue; } - - } + _param = undefined; + continue; + }; + } + + } default: return Curry._1(look_ahead, match); } @@ -16452,70 +16452,70 @@ function interpret_directive(lexbuf, cont, look_ahead) { } switch (if_then_else$1) { case /* Dir_if_true */ 0 : - break; + break; case /* Dir_if_false */ 1 : case /* Dir_out */ 2 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); } } switch (if_then_else$1) { case /* Dir_if_true */ 0 : - let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); - while (true) { - const else_seen = _else_seen; - const token$2 = token_with_comments(lexbuf); - if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { + let _else_seen = Caml_obj.caml_equal(match, /* ELSE */ 23); + while (true) { + const else_seen = _else_seen; + const token$2 = token_with_comments(lexbuf); + if (Caml_obj.caml_equal(token$2, /* EOF */ 25)) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unterminated_else */ 3, + _2: curr(lexbuf) + }); + } + if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { + const token$3 = token_with_comments(lexbuf); + if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { + switch (token$3) { + case /* ELSE */ 23 : + if (else_seen) { + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + } + _else_seen = true; + continue; + case /* END */ 24 : + if_then_else.contents = /* Dir_out */ 2; + return Curry._1(cont, lexbuf); + case /* IF */ 37 : + throw new Caml_js_exceptions.MelangeError($$Error$2, { + MEL_EXN_ID: $$Error$2, + _1: /* Unexpected_directive */ 6, + _2: curr(lexbuf) + }); + + } + } + if (else_seen && is_elif(token$3)) { throw new Caml_js_exceptions.MelangeError($$Error$2, { MEL_EXN_ID: $$Error$2, - _1: /* Unterminated_else */ 3, + _1: /* Unexpected_directive */ 6, _2: curr(lexbuf) }); } - if (Caml_obj.caml_equal(token$2, /* SHARP */ 84) && at_bol(lexbuf)) { - const token$3 = token_with_comments(lexbuf); - if (/* tag */ typeof token$3 === "number" || typeof token$3 === "string") { - switch (token$3) { - case /* ELSE */ 23 : - if (else_seen) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - } - _else_seen = true; - continue; - case /* END */ 24 : - if_then_else.contents = /* Dir_out */ 2; - return Curry._1(cont, lexbuf); - case /* IF */ 37 : - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - - } - } - if (else_seen && is_elif(token$3)) { - throw new Caml_js_exceptions.MelangeError($$Error$2, { - MEL_EXN_ID: $$Error$2, - _1: /* Unexpected_directive */ 6, - _2: curr(lexbuf) - }); - } - continue; - } continue; - }; + } + continue; + }; case /* Dir_if_false */ 1 : case /* Dir_out */ 2 : - return Curry._1(look_ahead, match); + return Curry._1(look_ahead, match); } } @@ -16531,10 +16531,10 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a)); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); + set_post_docstrings(post_pos, Stdlib__List.rev(a)); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a)); } set_post_docstrings(post_pos, Stdlib__List.rev(a)); @@ -16546,12 +16546,12 @@ function token$1(lexbuf) { switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - break; + break; case /* BlankLine */ 2 : - set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); - set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); - return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); + set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); + set_post_extra_docstrings(post_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + set_floating_docstrings(pre_pos, Stdlib__List.rev_append(f, Stdlib__List.rev(b))); + return set_pre_extra_docstrings(pre_pos, Stdlib__List.rev(a$1)); } set_post_docstrings(post_pos, Stdlib__List.rev(a$1)); @@ -16568,141 +16568,141 @@ function token$1(lexbuf) { if (/* tag */ typeof doc === "number" || typeof doc === "string") { switch (doc) { case /* SHARP */ 84 : - if (at_bol(lexbuf)) { - return interpret_directive(lexbuf, (function (lexbuf) { - return loop(lines, docs, lexbuf); - }), (function (token) { - sharp_look_ahead.contents = token; - return /* SHARP */ 84; - })); - } - break; + if (at_bol(lexbuf)) { + return interpret_directive(lexbuf, (function (lexbuf) { + return loop(lines, docs, lexbuf); + }), (function (token) { + sharp_look_ahead.contents = token; + return /* SHARP */ 84; + })); + } + break; case /* EOL */ 100 : - let lines$p; + let lines$p; + switch (lines) { + case /* NoLine */ 0 : + lines$p = /* NewLine */ 1; + break; + case /* NewLine */ 1 : + case /* BlankLine */ 2 : + lines$p = /* BlankLine */ 2; + break; + + } + _lines = lines$p; + continue; + + } + } else { + switch (doc.TAG) { + case /* COMMENT */ 18 : + const match = doc._0; + add_comment([ + match[0], + match[1] + ]); + let lines$p$1; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + lines$p$1 = /* NoLine */ 0; + break; + case /* BlankLine */ 2 : + lines$p$1 = /* BlankLine */ 2; + break; + + } + _lines = lines$p$1; + continue; + case /* DOCSTRING */ 19 : + const doc$1 = doc._0; + add_docstring_comment(doc$1); + let docs$p; + if (/* tag */ typeof docs === "number" || typeof docs === "string") { switch (lines) { case /* NoLine */ 0 : - lines$p = /* NewLine */ 1; - break; case /* NewLine */ 1 : + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; case /* BlankLine */ 2 : - lines$p = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: /* [] */ 0, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p; - continue; - - } - } else { - switch (doc.TAG) { - case /* COMMENT */ 18 : - const match = doc._0; - add_comment([ - match[0], - match[1] - ]); - let lines$p$1; + } else if (docs.TAG === /* After */ 0) { + const a = docs._0; switch (lines) { case /* NoLine */ 0 : case /* NewLine */ 1 : - lines$p$1 = /* NoLine */ 0; - break; + docs$p = { + TAG: /* After */ 0, + _0: { + hd: doc$1, + tl: a + } + }; + break; case /* BlankLine */ 2 : - lines$p$1 = /* BlankLine */ 2; - break; + docs$p = { + TAG: /* Before */ 1, + _0: a, + _1: /* [] */ 0, + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; } - _lines = lines$p$1; - continue; - case /* DOCSTRING */ 19 : - const doc$1 = doc._0; - add_docstring_comment(doc$1); - let docs$p; - if (/* tag */ typeof docs === "number" || typeof docs === "string") { - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: /* [] */ 0, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else if (docs.TAG === /* After */ 0) { - const a = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* After */ 0, - _0: { - hd: doc$1, - tl: a - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a, - _1: /* [] */ 0, - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } - } else { - const b = docs._2; - const f = docs._1; - const a$1 = docs._0; - switch (lines) { - case /* NoLine */ 0 : - case /* NewLine */ 1 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: f, - _2: { - hd: doc$1, - tl: b - } - }; - break; - case /* BlankLine */ 2 : - docs$p = { - TAG: /* Before */ 1, - _0: a$1, - _1: Stdlib.$at(b, f), - _2: { - hd: doc$1, - tl: /* [] */ 0 - } - }; - break; - - } + } else { + const b = docs._2; + const f = docs._1; + const a$1 = docs._0; + switch (lines) { + case /* NoLine */ 0 : + case /* NewLine */ 1 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: f, + _2: { + hd: doc$1, + tl: b + } + }; + break; + case /* BlankLine */ 2 : + docs$p = { + TAG: /* Before */ 1, + _0: a$1, + _1: Stdlib.$at(b, f), + _2: { + hd: doc$1, + tl: /* [] */ 0 + } + }; + break; + } - _docs = docs$p; - _lines = /* NoLine */ 0; - continue; + } + _docs = docs$p; + _lines = /* NoLine */ 0; + continue; } } @@ -16738,29 +16738,29 @@ function filter_directive(pos, acc, lexbuf) { if (/* tag */ typeof match === "number" || typeof match === "string") { switch (match) { case /* EOF */ 25 : - return { - hd: [ - pos, - lexbuf.lex_curr_p.pos_cnum - ], - tl: acc - }; + return { + hd: [ + pos, + lexbuf.lex_curr_p.pos_cnum + ], + tl: acc + }; case /* SHARP */ 84 : - if (at_bol(lexbuf)) { - const start_pos = lexbuf.lex_start_p.pos_cnum; - return interpret_directive(lexbuf, (function (lexbuf) { - return filter_directive(lexbuf.lex_curr_p.pos_cnum, { - hd: [ - pos, - start_pos - ], - tl: acc - }, lexbuf); - }), (function (_token) { - return filter_directive(pos, acc, lexbuf); - })); - } - continue; + if (at_bol(lexbuf)) { + const start_pos = lexbuf.lex_start_p.pos_cnum; + return interpret_directive(lexbuf, (function (lexbuf) { + return filter_directive(lexbuf.lex_curr_p.pos_cnum, { + hd: [ + pos, + start_pos + ], + tl: acc + }, lexbuf); + }), (function (_token) { + return filter_directive(pos, acc, lexbuf); + })); + } + continue; default: continue; } @@ -16814,7 +16814,7 @@ function skip_phrase(lexbuf) { switch (match) { case /* EOF */ 25 : case /* SEMISEMI */ 83 : - return; + return; default: return skip_phrase(lexbuf); } @@ -16833,7 +16833,7 @@ function skip_phrase(lexbuf) { case /* Illegal_character */ 0 : case /* Unterminated_comment */ 2 : case /* Unterminated_string_in_comment */ 3 : - continue; + continue; default: throw new Caml_js_exceptions.MelangeError(exn.MEL_EXN_ID, exn); } diff --git a/jscomp/test/dist/jscomp/test/parser_api_test.js b/jscomp/test/dist/jscomp/test/parser_api_test.js index 163a47fe0a..68d9aa1584 100644 --- a/jscomp/test/dist/jscomp/test/parser_api_test.js +++ b/jscomp/test/dist/jscomp/test/parser_api_test.js @@ -72,156 +72,135 @@ if (match) { const match$29 = match$28.txt; switch (match$29.TAG) { case /* Lident */ 0 : - if (match$29._0 === "|>") { - const match$30 = match$28.loc; - const match$31 = match$30.loc_start; - if (match$31.pos_fname === "" && !(match$31.pos_lnum !== 4 || match$31.pos_bol !== 46 || match$31.pos_cnum !== 48)) { - const match$32 = match$30.loc_end; - if (match$32.pos_fname === "" && !(match$32.pos_lnum !== 4 || match$32.pos_bol !== 46 || match$32.pos_cnum !== 50 || match$30.loc_ghost)) { - const match$33 = match$26.pexp_loc; - const match$34 = match$33.loc_start; - if (match$34.pos_fname === "" && !(match$34.pos_lnum !== 4 || match$34.pos_bol !== 46 || match$34.pos_cnum !== 48)) { - const match$35 = match$33.loc_end; - if (match$35.pos_fname === "" && !(match$35.pos_lnum !== 4 || match$35.pos_bol !== 46 || match$35.pos_cnum !== 50 || match$33.loc_ghost || match$26.pexp_attributes)) { - const match$36 = match$25._1; - if (match$36) { - const match$37 = match$36.hd; - if (match$37[0] === "") { - const match$38 = match$37[1]; - const match$39 = match$38.pexp_desc; - if (match$39.TAG === /* Pexp_apply */ 5) { - const match$40 = match$39._0; - const match$41 = match$40.pexp_desc; - if (match$41.TAG === /* Pexp_ident */ 0) { - const match$42 = match$41._0; - const match$43 = match$42.txt; - switch (match$43.TAG) { - case /* Lident */ 0 : - if (match$43._0 === "|>") { - const match$44 = match$42.loc; - const match$45 = match$44.loc_start; - if (match$45.pos_fname === "" && !(match$45.pos_lnum !== 3 || match$45.pos_bol !== 21 || match$45.pos_cnum !== 23)) { - const match$46 = match$44.loc_end; - if (match$46.pos_fname === "" && !(match$46.pos_lnum !== 3 || match$46.pos_bol !== 21 || match$46.pos_cnum !== 25 || match$44.loc_ghost)) { - const match$47 = match$40.pexp_loc; - const match$48 = match$47.loc_start; - if (match$48.pos_fname === "" && !(match$48.pos_lnum !== 3 || match$48.pos_bol !== 21 || match$48.pos_cnum !== 23)) { - const match$49 = match$47.loc_end; - if (match$49.pos_fname === "" && !(match$49.pos_lnum !== 3 || match$49.pos_bol !== 21 || match$49.pos_cnum !== 25 || match$47.loc_ghost || match$40.pexp_attributes)) { - const match$50 = match$39._1; - if (match$50) { - const match$51 = match$50.hd; - if (match$51[0] === "") { - const match$52 = match$51[1]; - const match$53 = match$52.pexp_desc; - if (match$53.TAG === /* Pexp_ident */ 0) { - const match$54 = match$53._0; - const match$55 = match$54.txt; - switch (match$55.TAG) { - case /* Lident */ 0 : - if (match$55._0 === "str") { - const match$56 = match$54.loc; - const match$57 = match$56.loc_start; - if (match$57.pos_fname === "" && !(match$57.pos_lnum !== 2 || match$57.pos_bol !== 13 || match$57.pos_cnum !== 15)) { - const match$58 = match$56.loc_end; - if (match$58.pos_fname === "" && !(match$58.pos_lnum !== 2 || match$58.pos_bol !== 13 || match$58.pos_cnum !== 18 || match$56.loc_ghost)) { - const match$59 = match$52.pexp_loc; - const match$60 = match$59.loc_start; - if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 2 || match$60.pos_bol !== 13 || match$60.pos_cnum !== 15)) { - const match$61 = match$59.loc_end; - if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 2 || match$61.pos_bol !== 13 || match$61.pos_cnum !== 18 || match$59.loc_ghost || match$52.pexp_attributes)) { - const match$62 = match$50.tl; - if (match$62) { - const match$63 = match$62.hd; - if (match$63[0] === "") { - const match$64 = match$63[1]; - const match$65 = match$64.pexp_desc; - if (match$65.TAG === /* Pexp_ident */ 0) { - const match$66 = match$65._0; - const match$67 = match$66.txt; - switch (match$67.TAG) { - case /* Ldot */ 1 : - const match$68 = match$67._0; - switch (match$68.TAG) { - case /* Lident */ 0 : - if (match$68._0 === "Lexing" && match$67._1 === "from_string") { - const match$69 = match$66.loc; - const match$70 = match$69.loc_start; - if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 21 || match$70.pos_cnum !== 26)) { - const match$71 = match$69.loc_end; - if (match$71.pos_fname === "" && !(match$71.pos_lnum !== 3 || match$71.pos_bol !== 21 || match$71.pos_cnum !== 44 || match$69.loc_ghost)) { - const match$72 = match$64.pexp_loc; - const match$73 = match$72.loc_start; - if (match$73.pos_fname === "" && !(match$73.pos_lnum !== 3 || match$73.pos_bol !== 21 || match$73.pos_cnum !== 26)) { - const match$74 = match$72.loc_end; - if (match$74.pos_fname === "" && !(match$74.pos_lnum !== 3 || match$74.pos_bol !== 21 || match$74.pos_cnum !== 44 || match$72.loc_ghost || match$64.pexp_attributes || match$62.tl)) { - const match$75 = match$38.pexp_loc; - const match$76 = match$75.loc_start; - if (match$76.pos_fname === "" && !(match$76.pos_lnum !== 2 || match$76.pos_bol !== 13 || match$76.pos_cnum !== 15)) { - const match$77 = match$75.loc_end; - if (match$77.pos_fname === "" && !(match$77.pos_lnum !== 3 || match$77.pos_bol !== 21 || match$77.pos_cnum !== 44 || match$75.loc_ghost || match$38.pexp_attributes)) { - const match$78 = match$36.tl; - if (match$78) { - const match$79 = match$78.hd; - if (match$79[0] === "") { - const match$80 = match$79[1]; - const match$81 = match$80.pexp_desc; - if (match$81.TAG === /* Pexp_ident */ 0) { - const match$82 = match$81._0; - const match$83 = match$82.txt; - switch (match$83.TAG) { - case /* Ldot */ 1 : - const match$84 = match$83._0; - switch (match$84.TAG) { - case /* Lident */ 0 : - if (match$84._0 === "Parse" && match$83._1 === "implementation") { - const match$85 = match$82.loc; - const match$86 = match$85.loc_start; - if (match$86.pos_fname === "" && !(match$86.pos_lnum !== 4 || match$86.pos_bol !== 46 || match$86.pos_cnum !== 51)) { - const match$87 = match$85.loc_end; - if (match$87.pos_fname === "" && !(match$87.pos_lnum !== 4 || match$87.pos_bol !== 46 || match$87.pos_cnum !== 71 || match$85.loc_ghost)) { - const match$88 = match$80.pexp_loc; - const match$89 = match$88.loc_start; - if (match$89.pos_fname === "" && !(match$89.pos_lnum !== 4 || match$89.pos_bol !== 46 || match$89.pos_cnum !== 51)) { - const match$90 = match$88.loc_end; - if (match$90.pos_fname === "" && !(match$90.pos_lnum !== 4 || match$90.pos_bol !== 46 || match$90.pos_cnum !== 71 || match$88.loc_ghost || match$80.pexp_attributes || match$78.tl)) { - const match$91 = match$24.pexp_loc; - const match$92 = match$91.loc_start; - if (match$92.pos_fname === "" && !(match$92.pos_lnum !== 2 || match$92.pos_bol !== 13 || match$92.pos_cnum !== 15)) { - const match$93 = match$91.loc_end; - if (match$93.pos_fname === "" && !(match$93.pos_lnum !== 4 || match$93.pos_bol !== 46 || match$93.pos_cnum !== 71 || match$91.loc_ghost || match$24.pexp_attributes)) { - const match$94 = match$13.pexp_loc; - const match$95 = match$94.loc_start; - if (match$95.pos_fname === "" && !(match$95.pos_lnum !== 1 || match$95.pos_bol !== 0 || match$95.pos_cnum !== 6)) { - const match$96 = match$94.loc_end; - if (match$96.pos_fname === "" && !(match$96.pos_lnum !== 4 || match$96.pos_bol !== 46 || match$96.pos_cnum !== 71 || !(match$94.loc_ghost && !(match$13.pexp_attributes || match$3.pvb_attributes)))) { - const match$97 = match$3.pvb_loc; - const match$98 = match$97.loc_start; - if (match$98.pos_fname === "" && !(match$98.pos_lnum !== 1 || match$98.pos_bol !== 0 || match$98.pos_cnum !== 0)) { - const match$99 = match$97.loc_end; - if (match$99.pos_fname === "" && !(match$99.pos_lnum !== 4 || match$99.pos_bol !== 46 || match$99.pos_cnum !== 71 || match$97.loc_ghost || match$2.tl)) { - eq("File \"jscomp/test/parser_api_test.ml\", line 210, characters 10-17", true, true); - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } + if (match$29._0 === "|>") { + const match$30 = match$28.loc; + const match$31 = match$30.loc_start; + if (match$31.pos_fname === "" && !(match$31.pos_lnum !== 4 || match$31.pos_bol !== 46 || match$31.pos_cnum !== 48)) { + const match$32 = match$30.loc_end; + if (match$32.pos_fname === "" && !(match$32.pos_lnum !== 4 || match$32.pos_bol !== 46 || match$32.pos_cnum !== 50 || match$30.loc_ghost)) { + const match$33 = match$26.pexp_loc; + const match$34 = match$33.loc_start; + if (match$34.pos_fname === "" && !(match$34.pos_lnum !== 4 || match$34.pos_bol !== 46 || match$34.pos_cnum !== 48)) { + const match$35 = match$33.loc_end; + if (match$35.pos_fname === "" && !(match$35.pos_lnum !== 4 || match$35.pos_bol !== 46 || match$35.pos_cnum !== 50 || match$33.loc_ghost || match$26.pexp_attributes)) { + const match$36 = match$25._1; + if (match$36) { + const match$37 = match$36.hd; + if (match$37[0] === "") { + const match$38 = match$37[1]; + const match$39 = match$38.pexp_desc; + if (match$39.TAG === /* Pexp_apply */ 5) { + const match$40 = match$39._0; + const match$41 = match$40.pexp_desc; + if (match$41.TAG === /* Pexp_ident */ 0) { + const match$42 = match$41._0; + const match$43 = match$42.txt; + switch (match$43.TAG) { + case /* Lident */ 0 : + if (match$43._0 === "|>") { + const match$44 = match$42.loc; + const match$45 = match$44.loc_start; + if (match$45.pos_fname === "" && !(match$45.pos_lnum !== 3 || match$45.pos_bol !== 21 || match$45.pos_cnum !== 23)) { + const match$46 = match$44.loc_end; + if (match$46.pos_fname === "" && !(match$46.pos_lnum !== 3 || match$46.pos_bol !== 21 || match$46.pos_cnum !== 25 || match$44.loc_ghost)) { + const match$47 = match$40.pexp_loc; + const match$48 = match$47.loc_start; + if (match$48.pos_fname === "" && !(match$48.pos_lnum !== 3 || match$48.pos_bol !== 21 || match$48.pos_cnum !== 23)) { + const match$49 = match$47.loc_end; + if (match$49.pos_fname === "" && !(match$49.pos_lnum !== 3 || match$49.pos_bol !== 21 || match$49.pos_cnum !== 25 || match$47.loc_ghost || match$40.pexp_attributes)) { + const match$50 = match$39._1; + if (match$50) { + const match$51 = match$50.hd; + if (match$51[0] === "") { + const match$52 = match$51[1]; + const match$53 = match$52.pexp_desc; + if (match$53.TAG === /* Pexp_ident */ 0) { + const match$54 = match$53._0; + const match$55 = match$54.txt; + switch (match$55.TAG) { + case /* Lident */ 0 : + if (match$55._0 === "str") { + const match$56 = match$54.loc; + const match$57 = match$56.loc_start; + if (match$57.pos_fname === "" && !(match$57.pos_lnum !== 2 || match$57.pos_bol !== 13 || match$57.pos_cnum !== 15)) { + const match$58 = match$56.loc_end; + if (match$58.pos_fname === "" && !(match$58.pos_lnum !== 2 || match$58.pos_bol !== 13 || match$58.pos_cnum !== 18 || match$56.loc_ghost)) { + const match$59 = match$52.pexp_loc; + const match$60 = match$59.loc_start; + if (match$60.pos_fname === "" && !(match$60.pos_lnum !== 2 || match$60.pos_bol !== 13 || match$60.pos_cnum !== 15)) { + const match$61 = match$59.loc_end; + if (match$61.pos_fname === "" && !(match$61.pos_lnum !== 2 || match$61.pos_bol !== 13 || match$61.pos_cnum !== 18 || match$59.loc_ghost || match$52.pexp_attributes)) { + const match$62 = match$50.tl; + if (match$62) { + const match$63 = match$62.hd; + if (match$63[0] === "") { + const match$64 = match$63[1]; + const match$65 = match$64.pexp_desc; + if (match$65.TAG === /* Pexp_ident */ 0) { + const match$66 = match$65._0; + const match$67 = match$66.txt; + switch (match$67.TAG) { + case /* Ldot */ 1 : + const match$68 = match$67._0; + switch (match$68.TAG) { + case /* Lident */ 0 : + if (match$68._0 === "Lexing" && match$67._1 === "from_string") { + const match$69 = match$66.loc; + const match$70 = match$69.loc_start; + if (match$70.pos_fname === "" && !(match$70.pos_lnum !== 3 || match$70.pos_bol !== 21 || match$70.pos_cnum !== 26)) { + const match$71 = match$69.loc_end; + if (match$71.pos_fname === "" && !(match$71.pos_lnum !== 3 || match$71.pos_bol !== 21 || match$71.pos_cnum !== 44 || match$69.loc_ghost)) { + const match$72 = match$64.pexp_loc; + const match$73 = match$72.loc_start; + if (match$73.pos_fname === "" && !(match$73.pos_lnum !== 3 || match$73.pos_bol !== 21 || match$73.pos_cnum !== 26)) { + const match$74 = match$72.loc_end; + if (match$74.pos_fname === "" && !(match$74.pos_lnum !== 3 || match$74.pos_bol !== 21 || match$74.pos_cnum !== 44 || match$72.loc_ghost || match$64.pexp_attributes || match$62.tl)) { + const match$75 = match$38.pexp_loc; + const match$76 = match$75.loc_start; + if (match$76.pos_fname === "" && !(match$76.pos_lnum !== 2 || match$76.pos_bol !== 13 || match$76.pos_cnum !== 15)) { + const match$77 = match$75.loc_end; + if (match$77.pos_fname === "" && !(match$77.pos_lnum !== 3 || match$77.pos_bol !== 21 || match$77.pos_cnum !== 44 || match$75.loc_ghost || match$38.pexp_attributes)) { + const match$78 = match$36.tl; + if (match$78) { + const match$79 = match$78.hd; + if (match$79[0] === "") { + const match$80 = match$79[1]; + const match$81 = match$80.pexp_desc; + if (match$81.TAG === /* Pexp_ident */ 0) { + const match$82 = match$81._0; + const match$83 = match$82.txt; + switch (match$83.TAG) { + case /* Ldot */ 1 : + const match$84 = match$83._0; + switch (match$84.TAG) { + case /* Lident */ 0 : + if (match$84._0 === "Parse" && match$83._1 === "implementation") { + const match$85 = match$82.loc; + const match$86 = match$85.loc_start; + if (match$86.pos_fname === "" && !(match$86.pos_lnum !== 4 || match$86.pos_bol !== 46 || match$86.pos_cnum !== 51)) { + const match$87 = match$85.loc_end; + if (match$87.pos_fname === "" && !(match$87.pos_lnum !== 4 || match$87.pos_bol !== 46 || match$87.pos_cnum !== 71 || match$85.loc_ghost)) { + const match$88 = match$80.pexp_loc; + const match$89 = match$88.loc_start; + if (match$89.pos_fname === "" && !(match$89.pos_lnum !== 4 || match$89.pos_bol !== 46 || match$89.pos_cnum !== 51)) { + const match$90 = match$88.loc_end; + if (match$90.pos_fname === "" && !(match$90.pos_lnum !== 4 || match$90.pos_bol !== 46 || match$90.pos_cnum !== 71 || match$88.loc_ghost || match$80.pexp_attributes || match$78.tl)) { + const match$91 = match$24.pexp_loc; + const match$92 = match$91.loc_start; + if (match$92.pos_fname === "" && !(match$92.pos_lnum !== 2 || match$92.pos_bol !== 13 || match$92.pos_cnum !== 15)) { + const match$93 = match$91.loc_end; + if (match$93.pos_fname === "" && !(match$93.pos_lnum !== 4 || match$93.pos_bol !== 46 || match$93.pos_cnum !== 71 || match$91.loc_ghost || match$24.pexp_attributes)) { + const match$94 = match$13.pexp_loc; + const match$95 = match$94.loc_start; + if (match$95.pos_fname === "" && !(match$95.pos_lnum !== 1 || match$95.pos_bol !== 0 || match$95.pos_cnum !== 6)) { + const match$96 = match$94.loc_end; + if (match$96.pos_fname === "" && !(match$96.pos_lnum !== 4 || match$96.pos_bol !== 46 || match$96.pos_cnum !== 71 || !(match$94.loc_ghost && !(match$13.pexp_attributes || match$3.pvb_attributes)))) { + const match$97 = match$3.pvb_loc; + const match$98 = match$97.loc_start; + if (match$98.pos_fname === "" && !(match$98.pos_lnum !== 1 || match$98.pos_bol !== 0 || match$98.pos_cnum !== 0)) { + const match$99 = match$97.loc_end; + if (match$99.pos_fname === "" && !(match$99.pos_lnum !== 4 || match$99.pos_bol !== 46 || match$99.pos_cnum !== 71 || match$97.loc_ghost || match$2.tl)) { + eq("File \"jscomp/test/parser_api_test.ml\", line 210, characters 10-17", true, true); } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } @@ -234,34 +213,40 @@ if (match) { } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Lident */ 0 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - } else { + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } - } else { + break; + case /* Lident */ 0 : + case /* Lapply */ 2 : eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); @@ -278,28 +263,34 @@ if (match) { } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Lident */ 0 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } - } else { + break; + case /* Lident */ 0 : + case /* Lapply */ 2 : eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); @@ -316,18 +307,21 @@ if (match) { } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - } else { + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); @@ -347,15 +341,18 @@ if (match) { } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; - case /* Ldot */ 1 : - case /* Lapply */ 2 : + } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; - - } - } else { - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + break; + case /* Ldot */ 1 : + case /* Lapply */ 2 : + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; + } } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); @@ -381,11 +378,14 @@ if (match) { } else { eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); } - break; + } else { + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + } + break; case /* Ldot */ 1 : case /* Lapply */ 2 : - eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); - break; + eq("File \"jscomp/test/parser_api_test.ml\", line 211, characters 12-19", true, false); + break; } } else { diff --git a/jscomp/test/dist/jscomp/test/qcc.js b/jscomp/test/dist/jscomp/test/qcc.js index 4578a1a9eb..7cc5c4917b 100644 --- a/jscomp/test/dist/jscomp/test/qcc.js +++ b/jscomp/test/dist/jscomp/test/qcc.js @@ -931,139 +931,139 @@ function unary(stk) { const i = Curry._1(next$1, undefined); switch (i.TAG) { case /* Op */ 0 : - const o = i._0; - switch (o) { - case "&" : - unary(stk); - return patchlval(undefined); - case "(" : - expr(stk); - Curry._1(next$1, undefined); - return postfix(stk); - case "*" : - Curry._1(next$1, undefined); - const t = Curry._1(next$1, undefined); - let match; - if (Caml_obj.caml_equal(t, tokint)) { - match = Caml_obj.caml_equal(Curry._1(next$1, undefined), { - TAG: /* Op */ 0, - _0: "*" - }) ? [ - /* Int */ 0, - 1 - ] : [ - /* Int */ 0, - 5 - ]; - } else if (Caml_obj.caml_equal(t, tokchar)) { - match = [ - /* Chr */ 1, - 2 - ]; - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "[cast] expected" - }); - } - for (let _k = 1, _k_finish = match[1]; _k <= _k_finish; ++_k) { - Curry._1(next$1, undefined); - } - unary(stk); - return read(match[0]); - default: - const unops = { + const o = i._0; + switch (o) { + case "&" : + unary(stk); + return patchlval(undefined); + case "(" : + expr(stk); + Curry._1(next$1, undefined); + return postfix(stk); + case "*" : + Curry._1(next$1, undefined); + const t = Curry._1(next$1, undefined); + let match; + if (Caml_obj.caml_equal(t, tokint)) { + match = Caml_obj.caml_equal(Curry._1(next$1, undefined), { + TAG: /* Op */ 0, + _0: "*" + }) ? [ + /* Int */ 0, + 1 + ] : [ + /* Int */ 0, + 5 + ]; + } else if (Caml_obj.caml_equal(t, tokchar)) { + match = [ + /* Chr */ 1, + 2 + ]; + } else { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "[cast] expected" + }); + } + for (let _k = 1, _k_finish = match[1]; _k <= _k_finish; ++_k) { + Curry._1(next$1, undefined); + } + unary(stk); + return read(match[0]); + default: + const unops = { + hd: [ + "+", + 0 + ], + tl: { hd: [ - "+", - 0 + "-", + 4782040 ], tl: { hd: [ - "-", - 4782040 + "~", + 4782032 ], tl: { hd: [ - "~", - 4782032 + "!", + 4752832 ], - tl: { - hd: [ - "!", - 4752832 - ], - tl: /* [] */ 0 - } + tl: /* [] */ 0 } } - }; - unary(stk); - if (!Stdlib__List.mem_assoc(o, unops)) { - const s = Curry._1(Stdlib__Printf.sprintf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unknown operator ", - _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: /* End_of_format */ 0 - } - }, - _1: "unknown operator %s" - }), o); - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: s - }); - } - out(Stdlib__List.assoc(o, unops)); - if (o === "!") { - return cmp(2); - } else { - return; } - } + }; + unary(stk); + if (!Stdlib__List.mem_assoc(o, unops)) { + const s = Curry._1(Stdlib__Printf.sprintf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unknown operator ", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, + _1: /* End_of_format */ 0 + } + }, + _1: "unknown operator %s" + }), o); + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: s + }); + } + out(Stdlib__List.assoc(o, unops)); + if (o === "!") { + return cmp(2); + } else { + return; + } + } case /* ILit */ 1 : - return load(0, i._0); + return load(0, i._0); case /* SLit */ 2 : - out(18616); - return le(64, i._0); + out(18616); + return le(64, i._0); case /* Sym */ 3 : - const i$1 = i._0; - if (Stdlib__List.mem_assoc(i$1, stk)) { - const l = Stdlib__List.assoc(i$1, stk); - if (l <= -256) { - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/qcc.ml", - 295, - 6 - ] - }); - } - out(4754245); - out(l & 255); - lval.contents = [ - { - TAG: /* Mov */ 0, - _0: 3 - }, - /* Int */ 0 - ]; - } else { - out(18616); - const g = Caml_array.get(globs, i$1); - const loc = opos.contents; - le(64, g.loc); - Caml_array.set(globs, i$1, { - loc: loc, - va: g.va + const i$1 = i._0; + if (Stdlib__List.mem_assoc(i$1, stk)) { + const l = Stdlib__List.assoc(i$1, stk); + if (l <= -256) { + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/qcc.ml", + 295, + 6 + ] }); - read(/* Int */ 0); } - return postfix(stk); + out(4754245); + out(l & 255); + lval.contents = [ + { + TAG: /* Mov */ 0, + _0: 3 + }, + /* Int */ 0 + ]; + } else { + out(18616); + const g = Caml_array.get(globs, i$1); + const loc = opos.contents; + le(64, g.loc); + Caml_array.set(globs, i$1, { + loc: loc, + va: g.va + }); + read(/* Int */ 0); + } + return postfix(stk); } } @@ -1076,67 +1076,67 @@ function postfix(stk) { const op$1 = op._0; switch (op$1) { case "(" : - const emitargs = function (_l, _rl) { - while (true) { - const rl = _rl; - const l = _l; - if (nextis({ - TAG: /* Op */ 0, - _0: ")" - })) { - Curry._1(next$1, undefined); - return Stdlib__List.iter(pop, l); - } - expr(stk); - push(0); - if (nextis({ - TAG: /* Op */ 0, - _0: "," - })) { - Curry._1(next$1, undefined); - } - _rl = Stdlib__List.tl(rl); - _l = { - hd: Stdlib__List.hd(rl), - tl: l - }; - continue; + const emitargs = function (_l, _rl) { + while (true) { + const rl = _rl; + const l = _l; + if (nextis({ + TAG: /* Op */ 0, + _0: ")" + })) { + Curry._1(next$1, undefined); + return Stdlib__List.iter(pop, l); + } + expr(stk); + push(0); + if (nextis({ + TAG: /* Op */ 0, + _0: "," + })) { + Curry._1(next$1, undefined); + } + _rl = Stdlib__List.tl(rl); + _l = { + hd: Stdlib__List.hd(rl), + tl: l }; + continue; }; - patchlval(undefined); - push(0); - emitargs(/* [] */ 0, { - hd: 7, + }; + patchlval(undefined); + push(0); + emitargs(/* [] */ 0, { + hd: 7, + tl: { + hd: 6, tl: { - hd: 6, + hd: 2, tl: { - hd: 2, + hd: 1, tl: { - hd: 1, + hd: 8, tl: { - hd: 8, - tl: { - hd: 9, - tl: /* [] */ 0 - } + hd: 9, + tl: /* [] */ 0 } } } } - }); - pop(0); - if (align.contents % 2 !== 0) { - out(1216605192); - } - out(65488); - if (align.contents % 2 !== 0) { - return out(1216594952); - } else { - return; - } + } + }); + pop(0); + if (align.contents % 2 !== 0) { + out(1216605192); + } + out(65488); + if (align.contents % 2 !== 0) { + return out(1216594952); + } else { + return; + } case "++" : case "--" : - break; + break; default: return Curry._1(unnext, op); } @@ -1465,9 +1465,9 @@ function stmt(brk, stk) { if (t.TAG === /* Op */ 0) { switch (t._0) { case ";" : - return; + return; case "{" : - return block(brk, stk); + return block(brk, stk); } } @@ -1531,40 +1531,40 @@ function top(_param) { const i = Curry._1(next$1, undefined); switch (i.TAG) { case /* Op */ 0 : - if (i._0 === ")") { - return stk; - } - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "[var] or ) expected" - }); + if (i._0 === ")") { + return stk; + } + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "[var] or ) expected" + }); case /* ILit */ 1 : case /* SLit */ 2 : - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "[var] or ) expected" - }); + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "[var] or ) expected" + }); case /* Sym */ 3 : - const r = Stdlib__List.hd(regs); - push(r); - if (nextis({ - TAG: /* Op */ 0, - _0: "," - })) { - Curry._1(next$1, undefined); - } - const stk$p_0 = [ - i._0, - ((-n | 0) << 3) - ]; - const stk$p = { - hd: stk$p_0, - tl: stk - }; - _stk = stk$p; - _n = n + 1 | 0; - _regs = Stdlib__List.tl(regs); - continue; + const r = Stdlib__List.hd(regs); + push(r); + if (nextis({ + TAG: /* Op */ 0, + _0: "," + })) { + Curry._1(next$1, undefined); + } + const stk$p_0 = [ + i._0, + ((-n | 0) << 3) + ]; + const stk$p = { + hd: stk$p_0, + tl: stk + }; + _stk = stk$p; + _n = n + 1 | 0; + _regs = Stdlib__List.tl(regs); + continue; } }; @@ -1872,134 +1872,134 @@ function main(param) { const ppsym = function (s) { switch (s.TAG) { case /* Op */ 0 : - return Curry._1(Stdlib__Printf.printf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Operator '", + return Curry._1(Stdlib__Printf.printf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Operator '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, - _1: { - TAG: /* String_literal */ 11, - _0: "'\n", - _1: /* End_of_format */ 0 - } + TAG: /* String_literal */ 11, + _0: "'\n", + _1: /* End_of_format */ 0 } - }, - _1: "Operator '%s'\n" - }), s._0); + } + }, + _1: "Operator '%s'\n" + }), s._0); case /* ILit */ 1 : - return Curry._1(Stdlib__Printf.printf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Int literal ", - _1: { - TAG: /* Int */ 4, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* Char_literal */ 12, - _0: /* '\n' */10, - _1: /* End_of_format */ 0 - } + return Curry._1(Stdlib__Printf.printf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Int literal ", + _1: { + TAG: /* Int */ 4, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* Char_literal */ 12, + _0: /* '\n' */10, + _1: /* End_of_format */ 0 } - }, - _1: "Int literal %d\n" - }), s._0); + } + }, + _1: "Int literal %d\n" + }), s._0); case /* SLit */ 2 : - return Curry._1(Stdlib__Printf.printf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Str literal ", + return Curry._1(Stdlib__Printf.printf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Str literal ", + _1: { + TAG: /* Caml_string */ 3, + _0: /* No_padding */ 0, _1: { - TAG: /* Caml_string */ 3, - _0: /* No_padding */ 0, - _1: { - TAG: /* Char_literal */ 12, - _0: /* '\n' */10, - _1: /* End_of_format */ 0 - } + TAG: /* Char_literal */ 12, + _0: /* '\n' */10, + _1: /* End_of_format */ 0 } - }, - _1: "Str literal %S\n" - }), s._1); + } + }, + _1: "Str literal %S\n" + }), s._1); case /* Sym */ 3 : - const i = s._0; - return Curry._2(Stdlib__Printf.printf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "Symbol '", + const i = s._0; + return Curry._2(Stdlib__Printf.printf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "Symbol '", + _1: { + TAG: /* String */ 2, + _0: /* No_padding */ 0, _1: { - TAG: /* String */ 2, - _0: /* No_padding */ 0, + TAG: /* String_literal */ 11, + _0: "' (", _1: { - TAG: /* String_literal */ 11, - _0: "' (", - _1: { - TAG: /* Int */ 4, - _0: /* Int_d */ 0, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: { - TAG: /* String_literal */ 11, - _0: ")\n", - _1: /* End_of_format */ 0 - } + TAG: /* Int */ 4, + _0: /* Int_d */ 0, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: { + TAG: /* String_literal */ 11, + _0: ")\n", + _1: /* End_of_format */ 0 } } } - }, - _1: "Symbol '%s' (%d)\n" - }), symstr(i), i); + } + }, + _1: "Symbol '%s' (%d)\n" + }), symstr(i), i); } }; const f = Caml_sys.caml_sys_argv(0).length < 2 ? "-blk" : Caml_array.get(Caml_sys.caml_sys_argv(0), 1); switch (f) { case "-blk" : - const partial_arg_0 = { - contents: 0 - }; - const partial_arg = [ - partial_arg_0, - 0 - ]; - const c = function (param) { - return block(partial_arg, param); - }; - let stk = /* [] */ 0; - opos.contents = 0; - Curry._1(c, stk); - return Stdlib.print_bytes(Stdlib__Bytes.sub(obuf, 0, opos.contents)); + const partial_arg_0 = { + contents: 0 + }; + const partial_arg = [ + partial_arg_0, + 0 + ]; + const c = function (param) { + return block(partial_arg, param); + }; + let stk = /* [] */ 0; + opos.contents = 0; + Curry._1(c, stk); + return Stdlib.print_bytes(Stdlib__Bytes.sub(obuf, 0, opos.contents)); case "-lex" : - let _param; - while (true) { - const tok = Curry._1(next$1, undefined); - if (tok.TAG === /* Op */ 0) { - if (tok._0 === "EOF!") { - return Stdlib__Printf.printf({ - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "End of input stream\n", - _1: /* End_of_format */ 0 - }, - _1: "End of input stream\n" - }); - } - ppsym(tok); - _param = undefined; - continue; + let _param; + while (true) { + const tok = Curry._1(next$1, undefined); + if (tok.TAG === /* Op */ 0) { + if (tok._0 === "EOF!") { + return Stdlib__Printf.printf({ + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "End of input stream\n", + _1: /* End_of_format */ 0 + }, + _1: "End of input stream\n" + }); } ppsym(tok); _param = undefined; continue; - }; + } + ppsym(tok); + _param = undefined; + continue; + }; default: const oc = Stdlib.open_out("a.out"); inch.contents = Stdlib.open_in_bin(f); diff --git a/jscomp/test/dist/jscomp/test/rbset.js b/jscomp/test/dist/jscomp/test/rbset.js index 93cfafb61b..1b679eee83 100644 --- a/jscomp/test/dist/jscomp/test/rbset.js +++ b/jscomp/test/dist/jscomp/test/rbset.js @@ -95,33 +95,33 @@ function balance_left(l, x, r) { } switch (exit) { case 1 : - return { + return { + TAG: /* Node */ 0, + _0: /* Black */ 0, + _1: l, + _2: x, + _3: r + }; + case 2 : + return { + TAG: /* Node */ 0, + _0: /* Red */ 1, + _1: { TAG: /* Node */ 0, _0: /* Black */ 0, - _1: l, - _2: x, - _3: r - }; - case 2 : - return { + _1: a, + _2: x$1, + _3: b + }, + _2: y, + _3: { TAG: /* Node */ 0, - _0: /* Red */ 1, - _1: { - TAG: /* Node */ 0, - _0: /* Black */ 0, - _1: a, - _2: x$1, - _3: b - }, - _2: y, - _3: { - TAG: /* Node */ 0, - _0: /* Black */ 0, - _1: c, - _2: z, - _3: d - } - }; + _0: /* Black */ 0, + _1: c, + _2: z, + _3: d + } + }; } } @@ -171,33 +171,33 @@ function balance_right(l, x, r) { } switch (exit) { case 1 : - return { + return { + TAG: /* Node */ 0, + _0: /* Black */ 0, + _1: l, + _2: x, + _3: r + }; + case 2 : + return { + TAG: /* Node */ 0, + _0: /* Red */ 1, + _1: { TAG: /* Node */ 0, _0: /* Black */ 0, - _1: l, - _2: x, - _3: r - }; - case 2 : - return { + _1: a, + _2: x$1, + _3: b + }, + _2: y, + _3: { TAG: /* Node */ 0, - _0: /* Red */ 1, - _1: { - TAG: /* Node */ 0, - _0: /* Black */ 0, - _1: a, - _2: x$1, - _3: b - }, - _2: y, - _3: { - TAG: /* Node */ 0, - _0: /* Black */ 0, - _1: c, - _2: z, - _3: d - } - }; + _0: /* Black */ 0, + _1: c, + _2: z, + _3: d + } + }; } } diff --git a/jscomp/test/dist/jscomp/test/re_or_res/reasonReact.js b/jscomp/test/dist/jscomp/test/re_or_res/reasonReact.js index eefd1af927..cb7d03edd5 100644 --- a/jscomp/test/dist/jscomp/test/re_or_res/reasonReact.js +++ b/jscomp/test/dist/jscomp/test/re_or_res/reasonReact.js @@ -270,20 +270,20 @@ function createClass(debugName) { } else { switch (reasonStateUpdate.TAG) { case /* Update */ 0 : - nextTotalState = { - reasonState: reasonStateUpdate._0 - }; - break; + nextTotalState = { + reasonState: reasonStateUpdate._0 + }; + break; case /* SideEffects */ 1 : - sideEffects.contents = reasonStateUpdate._0; - nextTotalState = curTotalState; - break; + sideEffects.contents = reasonStateUpdate._0; + nextTotalState = curTotalState; + break; case /* UpdateWithSideEffects */ 2 : - sideEffects.contents = reasonStateUpdate._1; - nextTotalState = { - reasonState: reasonStateUpdate._0 - }; - break; + sideEffects.contents = reasonStateUpdate._1; + nextTotalState = { + reasonState: reasonStateUpdate._0 + }; + break; } } diff --git a/jscomp/test/dist/jscomp/test/re_or_res/reasonReactRouter.js b/jscomp/test/dist/jscomp/test/re_or_res/reasonReactRouter.js index 3a57342f04..70c3dd8143 100644 --- a/jscomp/test/dist/jscomp/test/re_or_res/reasonReactRouter.js +++ b/jscomp/test/dist/jscomp/test/re_or_res/reasonReactRouter.js @@ -22,7 +22,7 @@ function path(param) { switch (raw) { case "" : case "/" : - return /* [] */ 0; + return /* [] */ 0; default: const raw$1 = raw.slice(1, undefined); const match = raw$1[raw$1.length - 1 | 0]; @@ -55,7 +55,7 @@ function hash(param) { switch (raw) { case "" : case "#" : - return ""; + return ""; default: return raw.slice(1, undefined); } @@ -70,7 +70,7 @@ function search(param) { switch (raw) { case "" : case "?" : - return ""; + return ""; default: return raw.slice(1, undefined); } diff --git a/jscomp/test/dist/jscomp/test/rec_module_test.js b/jscomp/test/dist/jscomp/test/rec_module_test.js index c50470c7f9..54cdf6009d 100644 --- a/jscomp/test/dist/jscomp/test/rec_module_test.js +++ b/jscomp/test/dist/jscomp/test/rec_module_test.js @@ -1043,28 +1043,54 @@ function of_list(l) { const sub = function (n, l) { switch (n) { case 0 : + return [ + /* Empty */ 0, + l + ]; + case 1 : + if (l) { return [ - /* Empty */ 0, - l + { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + const match = l.tl; + if (match) { return [ { TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, + l: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + v: match.hd, r: /* Empty */ 0, - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - const match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + const match$1 = l.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { return [ { TAG: /* Node */ 0, @@ -1075,50 +1101,24 @@ function of_list(l) { r: /* Empty */ 0, h: 1 }, - v: match.hd, - r: /* Empty */ 0, + v: match$1.hd, + r: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: match$2.hd, + r: /* Empty */ 0, + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - const match$1 = l.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: /* Node */ 0, - l: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, - r: /* Empty */ 0, - h: 1 - }, - v: match$1.hd, - r: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: match$2.hd, - r: /* Empty */ 0, - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; + + } + break; } const nl = n / 2 | 0; diff --git a/jscomp/test/dist/jscomp/test/rec_value_test.js b/jscomp/test/dist/jscomp/test/rec_value_test.js index 2778ab13ac..4985d50fd9 100644 --- a/jscomp/test/dist/jscomp/test/rec_value_test.js +++ b/jscomp/test/dist/jscomp/test/rec_value_test.js @@ -95,14 +95,14 @@ const v = { function fib(n) { switch (n) { case 0 : - return four.contents; + return four.contents; case 1 : - return 1; + return 1; case 2 : - return three.contents; + return three.contents; case 3 : - v.contents = CamlinternalLazy.force(h); - return 1; + v.contents = CamlinternalLazy.force(h); + return 1; default: return fib(n - 1 | 0) + fib(n - 2 | 0) | 0; } diff --git a/jscomp/test/dist/jscomp/test/scanf_reference_error_regression_test.js b/jscomp/test/dist/jscomp/test/scanf_reference_error_regression_test.js index 921e386fb1..03c4144a48 100644 --- a/jscomp/test/dist/jscomp/test/scanf_reference_error_regression_test.js +++ b/jscomp/test/dist/jscomp/test/scanf_reference_error_regression_test.js @@ -70,9 +70,9 @@ function scan_rest(ib, accu) { }), (function (param) { switch (param) { case ";" : - return scan_rest(ib, accu$1); + return scan_rest(ib, accu$1); case "]" : - return accu$1; + return accu$1; default: const s = Stdlib__Printf.sprintf({ TAG: /* Format */ 0, diff --git a/jscomp/test/dist/jscomp/test/set_gen.js b/jscomp/test/dist/jscomp/test/set_gen.js index 4e7f1e836c..62397faf19 100644 --- a/jscomp/test/dist/jscomp/test/set_gen.js +++ b/jscomp/test/dist/jscomp/test/set_gen.js @@ -436,28 +436,54 @@ function of_sorted_list(l) { const sub = function (n, l) { switch (n) { case 0 : + return [ + /* Empty */ 0, + l + ]; + case 1 : + if (l) { return [ - /* Empty */ 0, - l + { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: l.hd, + _2: /* Empty */ 0, + _3: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + const match = l.tl; + if (match) { return [ { TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: l.hd, + _0: { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: l.hd, + _2: /* Empty */ 0, + _3: 1 + }, + _1: match.hd, _2: /* Empty */ 0, - _3: 1 + _3: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - const match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + const match$1 = l.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { return [ { TAG: /* Node */ 0, @@ -468,50 +494,24 @@ function of_sorted_list(l) { _2: /* Empty */ 0, _3: 1 }, - _1: match.hd, - _2: /* Empty */ 0, + _1: match$1.hd, + _2: { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: match$2.hd, + _2: /* Empty */ 0, + _3: 1 + }, _3: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - const match$1 = l.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: /* Node */ 0, - _0: { - TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: l.hd, - _2: /* Empty */ 0, - _3: 1 - }, - _1: match$1.hd, - _2: { - TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: match$2.hd, - _2: /* Empty */ 0, - _3: 1 - }, - _3: 2 - }, - match$2.tl - ]; - } - - } - - } - break; + + } + break; } const nl = n / 2 | 0; diff --git a/jscomp/test/dist/jscomp/test/sexpm.js b/jscomp/test/dist/jscomp/test/sexpm.js index 3acd20af98..bb90efdacf 100644 --- a/jscomp/test/dist/jscomp/test/sexpm.js +++ b/jscomp/test/dist/jscomp/test/sexpm.js @@ -63,15 +63,15 @@ function _must_escape(s) { case 37 : case 38 : case 39 : - exit = 1; - break; + exit = 1; + break; case 32 : case 34 : case 40 : case 41 : - throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { - MEL_EXN_ID: Stdlib.Exit - }); + throw new Caml_js_exceptions.MelangeError(Stdlib.Exit, { + MEL_EXN_ID: Stdlib.Exit + }); } } else { @@ -550,35 +550,35 @@ function expr_starting_with(c, k, t) { if (c >= 32) { switch (c) { case 32 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/sexpm.ml", - 183, - 27 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/sexpm.ml", + 183, + 27 + ] + }); case 34 : - return quoted(k, t); + return quoted(k, t); case 33 : case 35 : case 36 : case 37 : case 38 : case 39 : - break; + break; case 40 : - return expr_list(/* [] */ 0, k, t); + return expr_list(/* [] */ 0, k, t); case 41 : - return _error(t, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unexpected ')'", - _1: /* End_of_format */ 0 - }, - _1: "unexpected ')'" - }); + return _error(t, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unexpected ')'", + _1: /* End_of_format */ 0 + }, + _1: "unexpected ')'" + }); } } @@ -692,21 +692,21 @@ function atom(k, t) { if (c >= 32) { switch (c) { case 32 : - exit = 2; - break; + exit = 2; + break; case 33 : - exit = 1; - break; + exit = 1; + break; case 34 : - return _error(t, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unexpected '\"' in the middle of an atom", - _1: /* End_of_format */ 0 - }, - _1: "unexpected '\"' in the middle of an atom" - }); + return _error(t, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unexpected '\"' in the middle of an atom", + _1: /* End_of_format */ 0 + }, + _1: "unexpected '\"' in the middle of an atom" + }); } } else { @@ -717,10 +717,10 @@ function atom(k, t) { } switch (exit) { case 1 : - Stdlib__Buffer.add_char(t.atom, c); - continue; + Stdlib__Buffer.add_char(t.atom, c); + continue; case 2 : - return _return_atom(c, k, t); + return _return_atom(c, k, t); } }; @@ -759,13 +759,13 @@ function escaped(k, t) { if (c < 117) { switch (c) { case 92 : - return Curry._1(k, /* '\\' */92); + return Curry._1(k, /* '\\' */92); case 98 : - return Curry._1(k, /* '\b' */8); + return Curry._1(k, /* '\b' */8); case 110 : - return Curry._1(k, /* '\n' */10); + return Curry._1(k, /* '\n' */10); case 114 : - return Curry._1(k, /* '\r' */13); + return Curry._1(k, /* '\r' */13); case 93 : case 94 : case 95 : @@ -786,9 +786,9 @@ function escaped(k, t) { case 112 : case 113 : case 115 : - break; + break; case 116 : - return Curry._1(k, /* '\t' */9); + return Curry._1(k, /* '\t' */9); } } @@ -1164,35 +1164,35 @@ function MakeDecode(funarg) { if (c >= 32) { switch (c) { case 32 : - throw new Caml_js_exceptions.MelangeError("Assert_failure", { - MEL_EXN_ID: "Assert_failure", - _1: [ - "jscomp/test/sexpm.ml", - 183, - 27 - ] - }); + throw new Caml_js_exceptions.MelangeError("Assert_failure", { + MEL_EXN_ID: "Assert_failure", + _1: [ + "jscomp/test/sexpm.ml", + 183, + 27 + ] + }); case 34 : - return quoted(k, t); + return quoted(k, t); case 33 : case 35 : case 36 : case 37 : case 38 : case 39 : - break; + break; case 40 : - return expr_list(/* [] */ 0, k, t); + return expr_list(/* [] */ 0, k, t); case 41 : - return _error(t, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unexpected ')'", - _1: /* End_of_format */ 0 - }, - _1: "unexpected ')'" - }); + return _error(t, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unexpected ')'", + _1: /* End_of_format */ 0 + }, + _1: "unexpected ')'" + }); } } @@ -1303,21 +1303,21 @@ function MakeDecode(funarg) { if (c >= 32) { switch (c) { case 32 : - exit = 2; - break; + exit = 2; + break; case 33 : - exit = 1; - break; + exit = 1; + break; case 34 : - return _error(t, { - TAG: /* Format */ 0, - _0: { - TAG: /* String_literal */ 11, - _0: "unexpected '\"' in the middle of an atom", - _1: /* End_of_format */ 0 - }, - _1: "unexpected '\"' in the middle of an atom" - }); + return _error(t, { + TAG: /* Format */ 0, + _0: { + TAG: /* String_literal */ 11, + _0: "unexpected '\"' in the middle of an atom", + _1: /* End_of_format */ 0 + }, + _1: "unexpected '\"' in the middle of an atom" + }); } } else { @@ -1328,10 +1328,10 @@ function MakeDecode(funarg) { } switch (exit) { case 1 : - Stdlib__Buffer.add_char(t.atom, c); - continue; + Stdlib__Buffer.add_char(t.atom, c); + continue; case 2 : - return _return_atom(c, k, t); + return _return_atom(c, k, t); } }; @@ -1368,13 +1368,13 @@ function MakeDecode(funarg) { if (c < 117) { switch (c) { case 92 : - return Curry._1(k, /* '\\' */92); + return Curry._1(k, /* '\\' */92); case 98 : - return Curry._1(k, /* '\b' */8); + return Curry._1(k, /* '\b' */8); case 110 : - return Curry._1(k, /* '\n' */10); + return Curry._1(k, /* '\n' */10); case 114 : - return Curry._1(k, /* '\r' */13); + return Curry._1(k, /* '\r' */13); case 93 : case 94 : case 95 : @@ -1395,9 +1395,9 @@ function MakeDecode(funarg) { case 112 : case 113 : case 115 : - break; + break; case 116 : - return Curry._1(k, /* '\t' */9); + return Curry._1(k, /* '\t' */9); } } diff --git a/jscomp/test/dist/jscomp/test/simple_lexer_test.js b/jscomp/test/dist/jscomp/test/simple_lexer_test.js index fb7ef2752b..813c627fb1 100644 --- a/jscomp/test/dist/jscomp/test/simple_lexer_test.js +++ b/jscomp/test/dist/jscomp/test/simple_lexer_test.js @@ -27,12 +27,12 @@ function __ocaml_lex_translate_rec(lexbuf, ___ocaml_lex_state) { const __ocaml_lex_state$1 = Stdlib__Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - return "." + __ocaml_lex_translate_rec(lexbuf, 0); + return "." + __ocaml_lex_translate_rec(lexbuf, 0); case 1 : - const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); - return Caml_bytes.bytes_to_string(Stdlib__Bytes.make(1, c)) + __ocaml_lex_translate_rec(lexbuf, 0); + const c = Caml_bytes.get(lexbuf.lex_buffer, lexbuf.lex_start_pos); + return Caml_bytes.bytes_to_string(Stdlib__Bytes.make(1, c)) + __ocaml_lex_translate_rec(lexbuf, 0); case 2 : - return ""; + return ""; default: Curry._1(lexbuf.refill_buff, lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; diff --git a/jscomp/test/dist/jscomp/test/simplify_lambda_632o.js b/jscomp/test/dist/jscomp/test/simplify_lambda_632o.js index 5e7208accd..beab46ada5 100644 --- a/jscomp/test/dist/jscomp/test/simplify_lambda_632o.js +++ b/jscomp/test/dist/jscomp/test/simplify_lambda_632o.js @@ -5,13 +5,13 @@ function f(x) { switch (x) { case /* X1 */ 0 : - return /* X1 */ 0; + return /* X1 */ 0; case /* X2 */ 1 : - return /* X2 */ 1; + return /* X2 */ 1; case /* X3 */ 2 : - return /* X3 */ 2; + return /* X3 */ 2; case /* X4 */ 3 : - return /* X4 */ 3; + return /* X4 */ 3; } } @@ -19,13 +19,13 @@ function f(x) { function f2(x) { switch (x) { case /* X1 */ 0 : - return /* X1 */ 0; + return /* X1 */ 0; case /* X2 */ 1 : - return /* X2 */ 1; + return /* X2 */ 1; case /* X3 */ 2 : - return /* X3 */ 2; + return /* X3 */ 2; case /* X4 */ 3 : - return /* X4 */ 3; + return /* X4 */ 3; } } diff --git a/jscomp/test/dist/jscomp/test/string_test.js b/jscomp/test/dist/jscomp/test/string_test.js index c6716b4271..7164b68eac 100644 --- a/jscomp/test/dist/jscomp/test/string_test.js +++ b/jscomp/test/dist/jscomp/test/string_test.js @@ -16,17 +16,17 @@ function ff(x) { case "0" : case "1" : case "2" : - a = 3; - break; + a = 3; + break; case "3" : - a = 4; - break; + a = 4; + break; case "4" : - a = 6; - break; + a = 6; + break; case "7" : - a = 7; - break; + a = 7; + break; default: a = 8; } @@ -39,17 +39,17 @@ function gg(x) { case 0 : case 1 : case 2 : - a = 3; - break; + a = 3; + break; case 3 : - a = 4; - break; + a = 4; + break; case 4 : - a = 6; - break; + a = 6; + break; case 8 : - a = 7; - break; + a = 7; + break; default: a = 8; } diff --git a/jscomp/test/dist/jscomp/test/stringmatch_test.js b/jscomp/test/dist/jscomp/test/stringmatch_test.js index 7830a980af..34198b9cb4 100644 --- a/jscomp/test/dist/jscomp/test/stringmatch_test.js +++ b/jscomp/test/dist/jscomp/test/stringmatch_test.js @@ -134,53 +134,53 @@ if (tst02("\0\0\0\x03") !== 3) { function tst03(s) { switch (s) { case "app_const" : - return 5; + return 5; case "app_const_const" : - return 9; + return 9; case "app_const_env" : - return 11; + return 11; case "app_const_meth" : - return 12; + return 12; case "app_const_var" : - return 10; + return 10; case "app_env" : - return 7; + return 7; case "app_env_const" : - return 14; + return 14; case "app_meth" : - return 8; + return 8; case "app_meth_const" : - return 15; + return 15; case "app_var" : - return 6; + return 6; case "app_var_const" : - return 13; + return 13; case "get_const" : - return 0; + return 0; case "get_env" : - return 2; + return 2; case "get_meth" : - return 3; + return 3; case "get_var" : - return 1; + return 1; case "meth_app_const" : - return 16; + return 16; case "meth_app_env" : - return 18; + return 18; case "meth_app_meth" : - return 19; + return 19; case "meth_app_var" : - return 17; + return 17; case "send_const" : - return 20; + return 20; case "send_env" : - return 22; + return 22; case "send_meth" : - return 23; + return 23; case "send_var" : - return 21; + return 21; case "set_var" : - return 4; + return 4; default: return -1; } @@ -717,29 +717,29 @@ if (tst03("tend_mesh") !== -1) { function tst04(s) { switch (s) { case "AAAAAAAA" : - return 0; + return 0; case "AAAAAAAAAAAAAAAA" : - return 1; + return 1; case "AAAAAAAAAAAAAAAAAAAAAAAA" : - return 2; + return 2; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 3; + return 3; case "BBBBBBBB" : - return 4; + return 4; case "BBBBBBBBBBBBBBBB" : - return 5; + return 5; case "BBBBBBBBBBBBBBBBBBBBBBBB" : - return 6; + return 6; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 7; + return 7; case "CCCCCCCC" : - return 8; + return 8; case "CCCCCCCCCCCCCCCC" : - return 9; + return 9; case "CCCCCCCCCCCCCCCCCCCCCCCC" : - return 10; + return 10; case "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" : - return 11; + return 11; default: return -1; } @@ -957,31 +957,31 @@ if (tst04("AAAAAAAAAAAAAAADDDD") !== -1) { function tst05(s) { switch (s) { case "AAA" : - return 0; + return 0; case "AAAA" : - return 1; + return 1; case "AAAAA" : - return 2; + return 2; case "AAAAAA" : - return 3; + return 3; case "AAAAAAA" : - return 4; + return 4; case "AAAAAAAAAAAA" : - return 5; + return 5; case "AAAAAAAAAAAAAAAA" : - return 6; + return 6; case "AAAAAAAAAAAAAAAAAAAA" : - return 7; + return 7; case "BBB" : - return 8; + return 8; case "BBBB" : - return 9; + return 9; case "BBBBB" : - return 10; + return 10; case "BBBBBB" : - return 11; + return 11; case "BBBBBBB" : - return 12; + return 12; default: return -1; } @@ -1600,189 +1600,189 @@ const t91 = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"; function tst06(s) { switch (s) { case "A" : - return 55; + return 55; case "AA" : - return 56; + return 56; case "AAA" : - return 57; + return 57; case "AAAA" : - return 58; + return 58; case "AAAAA" : - return 59; + return 59; case "AAAAAA" : - return 60; + return 60; case "AAAAAAA" : - return 61; + return 61; case "AAAAAAAA" : - return 62; + return 62; case "AAAAAAAAA" : - return 63; + return 63; case "AAAAAAAAAA" : - return 64; + return 64; case "AAAAAAAAAAA" : - return 65; + return 65; case "AAAAAAAAAAAA" : - return 66; + return 66; case "AAAAAAAAAAAAA" : - return 67; + return 67; case "AAAAAAAAAAAAAA" : - return 68; + return 68; case "AAAAAAAAAAAAAAA" : - return 69; + return 69; case "AAAAAAAAAAAAAAAA" : - return 70; + return 70; case "AAAAAAAAAAAAAAAAA" : - return 71; + return 71; case "AAAAAAAAAAAAAAAAAA" : - return 72; + return 72; case "AAAAAAAAAAAAAAAAAAA" : - return 73; + return 73; case "AAAAAAAAAAAAAAAAAAAA" : - return 74; + return 74; case "AAAAAAAAAAAAAAAAAAAAA" : - return 75; + return 75; case "AAAAAAAAAAAAAAAAAAAAAA" : - return 76; + return 76; case "AAAAAAAAAAAAAAAAAAAAAAA" : - return 77; + return 77; case "AAAAAAAAAAAAAAAAAAAAAAAA" : - return 78; + return 78; case "AAAAAAAAAAAAAAAAAAAAAAAAA" : - return 79; + return 79; case "AAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 80; + return 80; case "AAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 81; + return 81; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 82; + return 82; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 83; + return 83; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 84; + return 84; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 85; + return 85; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 86; + return 86; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 87; + return 87; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 88; + return 88; case "BBBBBBBBBBBBBBB" : - return 89; + return 89; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 90; + return 90; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 91; + return 91; case "and" : - return 0; + return 0; case "as" : - return 1; + return 1; case "asr" : - return 54; + return 54; case "assert" : - return 2; + return 2; case "begin" : - return 3; + return 3; case "class" : - return 4; + return 4; case "constraint" : - return 5; + return 5; case "do" : - return 6; + return 6; case "done" : - return 7; + return 7; case "downto" : - return 8; + return 8; case "else" : - return 9; + return 9; case "end" : - return 10; + return 10; case "exception" : - return 11; + return 11; case "external" : - return 12; + return 12; case "false" : - return 13; + return 13; case "for" : - return 14; + return 14; case "fun" : - return 15; + return 15; case "function" : - return 16; + return 16; case "functor" : - return 17; + return 17; case "if" : - return 18; + return 18; case "in" : - return 19; + return 19; case "include" : - return 20; + return 20; case "inherit" : - return 21; + return 21; case "initializer" : - return 22; + return 22; case "land" : - return 49; + return 49; case "lazy" : - return 23; + return 23; case "let" : - return 24; + return 24; case "lor" : - return 50; + return 50; case "lsl" : - return 52; + return 52; case "lsr" : - return 53; + return 53; case "lxor" : - return 51; + return 51; case "match" : - return 25; + return 25; case "method" : - return 26; + return 26; case "mod" : - return 48; + return 48; case "module" : - return 27; + return 27; case "mutable" : - return 28; + return 28; case "new" : - return 29; + return 29; case "object" : - return 30; + return 30; case "of" : - return 31; + return 31; case "open" : - return 32; + return 32; case "or" : - return 33; + return 33; case "private" : - return 34; + return 34; case "rec" : - return 35; + return 35; case "sig" : - return 36; + return 36; case "struct" : - return 37; + return 37; case "then" : - return 38; + return 38; case "to" : - return 39; + return 39; case "true" : - return 40; + return 40; case "try" : - return 41; + return 41; case "type" : - return 42; + return 42; case "val" : - return 43; + return 43; case "virtual" : - return 44; + return 44; case "when" : - return 45; + return 45; case "while" : - return 46; + return 46; case "with" : - return 47; + return 47; default: return -1; } diff --git a/jscomp/test/dist/jscomp/test/switch_case_test.js b/jscomp/test/dist/jscomp/test/switch_case_test.js index 10c1f6ba29..17882defee 100644 --- a/jscomp/test/dist/jscomp/test/switch_case_test.js +++ b/jscomp/test/dist/jscomp/test/switch_case_test.js @@ -31,13 +31,13 @@ function eq(loc, x, y) { function f(x) { switch (x) { case "xx\"" : - return 1; + return 1; case "xx'''" : - return 0; + return 0; case "xx\\\"" : - return 2; + return 2; case "xx\\\"\"" : - return 3; + return 3; default: return 4; } diff --git a/jscomp/test/dist/jscomp/test/test_bug.js b/jscomp/test/dist/jscomp/test/test_bug.js index ddd6758881..0f96d65a99 100644 --- a/jscomp/test/dist/jscomp/test/test_bug.js +++ b/jscomp/test/dist/jscomp/test/test_bug.js @@ -47,20 +47,20 @@ function escaped(s) { } else { switch (c$1) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -71,13 +71,13 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit$1 = 1; - break; + exit$1 = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } diff --git a/jscomp/test/dist/jscomp/test/test_incomplete.js b/jscomp/test/dist/jscomp/test/test_incomplete.js index aafb6d77b0..82a9f26404 100644 --- a/jscomp/test/dist/jscomp/test/test_incomplete.js +++ b/jscomp/test/dist/jscomp/test/test_incomplete.js @@ -29,10 +29,10 @@ function f3(x) { switch (x.TAG) { case /* A */ 0 : case /* C */ 2 : - return x._0 + 1 | 0; + return x._0 + 1 | 0; case /* B */ 1 : case /* D */ 3 : - return x._0 + 2 | 0; + return x._0 + 2 | 0; } } diff --git a/jscomp/test/dist/jscomp/test/test_internalOO.js b/jscomp/test/dist/jscomp/test/test_internalOO.js index 09a300739b..525ff5cee8 100644 --- a/jscomp/test/dist/jscomp/test/test_internalOO.js +++ b/jscomp/test/dist/jscomp/test/test_internalOO.js @@ -4099,120 +4099,120 @@ function method_impl(table, i, arr) { } switch (clo) { case /* GetConst */ 0 : - const x = next(undefined); - return function (obj) { - return x; - }; + const x = next(undefined); + return function (obj) { + return x; + }; case /* GetVar */ 1 : - const n = next(undefined); - return function (obj) { - return obj[n]; - }; + const n = next(undefined); + return function (obj) { + return obj[n]; + }; case /* GetEnv */ 2 : - const e = next(undefined); - const n$1 = next(undefined); - return get_env(e, n$1); + const e = next(undefined); + const n$1 = next(undefined); + return get_env(e, n$1); case /* GetMeth */ 3 : - return get_meth(next(undefined)); + return get_meth(next(undefined)); case /* SetVar */ 4 : - const n$2 = next(undefined); - return function (obj, x) { - obj[n$2] = x; - }; + const n$2 = next(undefined); + return function (obj, x) { + obj[n$2] = x; + }; case /* AppConst */ 5 : - const f = next(undefined); - const x$1 = next(undefined); - return function (obj) { - return Curry._1(f, x$1); - }; + const f = next(undefined); + const x$1 = next(undefined); + return function (obj) { + return Curry._1(f, x$1); + }; case /* AppVar */ 6 : - const f$1 = next(undefined); - const n$3 = next(undefined); - return function (obj) { - return Curry._1(f$1, obj[n$3]); - }; + const f$1 = next(undefined); + const n$3 = next(undefined); + return function (obj) { + return Curry._1(f$1, obj[n$3]); + }; case /* AppEnv */ 7 : - const f$2 = next(undefined); - const e$1 = next(undefined); - const n$4 = next(undefined); - return app_env(f$2, e$1, n$4); + const f$2 = next(undefined); + const e$1 = next(undefined); + const n$4 = next(undefined); + return app_env(f$2, e$1, n$4); case /* AppMeth */ 8 : - const f$3 = next(undefined); - const n$5 = next(undefined); - return app_meth(f$3, n$5); + const f$3 = next(undefined); + const n$5 = next(undefined); + return app_meth(f$3, n$5); case /* AppConstConst */ 9 : - const f$4 = next(undefined); - const x$2 = next(undefined); - const y = next(undefined); - return function (obj) { - return Curry._2(f$4, x$2, y); - }; + const f$4 = next(undefined); + const x$2 = next(undefined); + const y = next(undefined); + return function (obj) { + return Curry._2(f$4, x$2, y); + }; case /* AppConstVar */ 10 : - const f$5 = next(undefined); - const x$3 = next(undefined); - const n$6 = next(undefined); - return app_const_var(f$5, x$3, n$6); + const f$5 = next(undefined); + const x$3 = next(undefined); + const n$6 = next(undefined); + return app_const_var(f$5, x$3, n$6); case /* AppConstEnv */ 11 : - const f$6 = next(undefined); - const x$4 = next(undefined); - const e$2 = next(undefined); - const n$7 = next(undefined); - return app_const_env(f$6, x$4, e$2, n$7); + const f$6 = next(undefined); + const x$4 = next(undefined); + const e$2 = next(undefined); + const n$7 = next(undefined); + return app_const_env(f$6, x$4, e$2, n$7); case /* AppConstMeth */ 12 : - const f$7 = next(undefined); - const x$5 = next(undefined); - const n$8 = next(undefined); - return app_const_meth(f$7, x$5, n$8); + const f$7 = next(undefined); + const x$5 = next(undefined); + const n$8 = next(undefined); + return app_const_meth(f$7, x$5, n$8); case /* AppVarConst */ 13 : - const f$8 = next(undefined); - const n$9 = next(undefined); - const x$6 = next(undefined); - return app_var_const(f$8, n$9, x$6); + const f$8 = next(undefined); + const n$9 = next(undefined); + const x$6 = next(undefined); + return app_var_const(f$8, n$9, x$6); case /* AppEnvConst */ 14 : - const f$9 = next(undefined); - const e$3 = next(undefined); - const n$10 = next(undefined); - const x$7 = next(undefined); - return app_env_const(f$9, e$3, n$10, x$7); + const f$9 = next(undefined); + const e$3 = next(undefined); + const n$10 = next(undefined); + const x$7 = next(undefined); + return app_env_const(f$9, e$3, n$10, x$7); case /* AppMethConst */ 15 : - const f$10 = next(undefined); - const n$11 = next(undefined); - const x$8 = next(undefined); - return app_meth_const(f$10, n$11, x$8); + const f$10 = next(undefined); + const n$11 = next(undefined); + const x$8 = next(undefined); + return app_meth_const(f$10, n$11, x$8); case /* MethAppConst */ 16 : - const n$12 = next(undefined); - const x$9 = next(undefined); - return meth_app_const(n$12, x$9); + const n$12 = next(undefined); + const x$9 = next(undefined); + return meth_app_const(n$12, x$9); case /* MethAppVar */ 17 : - const n$13 = next(undefined); - const m = next(undefined); - return meth_app_var(n$13, m); + const n$13 = next(undefined); + const m = next(undefined); + return meth_app_var(n$13, m); case /* MethAppEnv */ 18 : - const n$14 = next(undefined); - const e$4 = next(undefined); - const m$1 = next(undefined); - return meth_app_env(n$14, e$4, m$1); + const n$14 = next(undefined); + const e$4 = next(undefined); + const m$1 = next(undefined); + return meth_app_env(n$14, e$4, m$1); case /* MethAppMeth */ 19 : - const n$15 = next(undefined); - const m$2 = next(undefined); - return meth_app_meth(n$15, m$2); + const n$15 = next(undefined); + const m$2 = next(undefined); + return meth_app_meth(n$15, m$2); case /* SendConst */ 20 : - const m$3 = next(undefined); - const x$10 = next(undefined); - return send_const(m$3, x$10, new_cache(table)); + const m$3 = next(undefined); + const x$10 = next(undefined); + return send_const(m$3, x$10, new_cache(table)); case /* SendVar */ 21 : - const m$4 = next(undefined); - const n$16 = next(undefined); - return send_var(m$4, n$16, new_cache(table)); + const m$4 = next(undefined); + const n$16 = next(undefined); + return send_var(m$4, n$16, new_cache(table)); case /* SendEnv */ 22 : - const m$5 = next(undefined); - const e$5 = next(undefined); - const n$17 = next(undefined); - return send_env(m$5, e$5, n$17, new_cache(table)); + const m$5 = next(undefined); + const e$5 = next(undefined); + const n$17 = next(undefined); + return send_env(m$5, e$5, n$17, new_cache(table)); case /* SendMeth */ 23 : - const m$6 = next(undefined); - const n$18 = next(undefined); - return send_meth(m$6, n$18, new_cache(table)); + const m$6 = next(undefined); + const n$18 = next(undefined); + return send_meth(m$6, n$18, new_cache(table)); } } diff --git a/jscomp/test/dist/jscomp/test/test_per.js b/jscomp/test/dist/jscomp/test/test_per.js index 11b3eb9719..9c59c3ff03 100644 --- a/jscomp/test/dist/jscomp/test/test_per.js +++ b/jscomp/test/dist/jscomp/test/test_per.js @@ -121,9 +121,9 @@ function string_of_bool(b) { function bool_of_string(param) { switch (param) { case "false" : - return false; + return false; case "true" : - return true; + return true; default: throw new Caml_js_exceptions.MelangeError(Stdlib.Invalid_argument, { MEL_EXN_ID: Stdlib.Invalid_argument, diff --git a/jscomp/test/dist/jscomp/test/test_ramification.js b/jscomp/test/dist/jscomp/test/test_ramification.js index 1d87373ad8..69a0024290 100644 --- a/jscomp/test/dist/jscomp/test/test_ramification.js +++ b/jscomp/test/dist/jscomp/test/test_ramification.js @@ -8,17 +8,17 @@ function ff(x) { case "0" : case "1" : case "2" : - a = 3; - break; + a = 3; + break; case "3" : - a = 4; - break; + a = 4; + break; case "4" : - a = 6; - break; + a = 6; + break; case "7" : - a = 7; - break; + a = 7; + break; default: a = 8; } diff --git a/jscomp/test/dist/jscomp/test/test_set.js b/jscomp/test/dist/jscomp/test/test_set.js index c62a3151e9..712dbd08b1 100644 --- a/jscomp/test/dist/jscomp/test/test_set.js +++ b/jscomp/test/dist/jscomp/test/test_set.js @@ -578,28 +578,54 @@ function Make(Ord) { const sub = function (n, l) { switch (n) { case 0 : + return [ + /* Empty */ 0, + l + ]; + case 1 : + if (l) { return [ - /* Empty */ 0, - l + { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: l.hd, + _2: /* Empty */ 0, + _3: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + const match = l.tl; + if (match) { return [ { TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: l.hd, + _0: { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: l.hd, + _2: /* Empty */ 0, + _3: 1 + }, + _1: match.hd, _2: /* Empty */ 0, - _3: 1 + _3: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - const match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + const match$1 = l.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { return [ { TAG: /* Node */ 0, @@ -610,50 +636,24 @@ function Make(Ord) { _2: /* Empty */ 0, _3: 1 }, - _1: match.hd, - _2: /* Empty */ 0, + _1: match$1.hd, + _2: { + TAG: /* Node */ 0, + _0: /* Empty */ 0, + _1: match$2.hd, + _2: /* Empty */ 0, + _3: 1 + }, _3: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - const match$1 = l.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: /* Node */ 0, - _0: { - TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: l.hd, - _2: /* Empty */ 0, - _3: 1 - }, - _1: match$1.hd, - _2: { - TAG: /* Node */ 0, - _0: /* Empty */ 0, - _1: match$2.hd, - _2: /* Empty */ 0, - _3: 1 - }, - _3: 2 - }, - match$2.tl - ]; - } - - } - - } - break; + + } + break; } const nl = n / 2 | 0; diff --git a/jscomp/test/dist/jscomp/test/test_simple_pattern_match.js b/jscomp/test/dist/jscomp/test/test_simple_pattern_match.js index c2ae8abf5c..11a536f4e7 100644 --- a/jscomp/test/dist/jscomp/test/test_simple_pattern_match.js +++ b/jscomp/test/dist/jscomp/test/test_simple_pattern_match.js @@ -8,11 +8,11 @@ let match; switch (Stdlib__Sys.os_type) { case "Cygwin" : case "Unix" : - match = [ - 1, - 2 - ]; - break; + match = [ + 1, + 2 + ]; + break; default: match = [ 3, diff --git a/jscomp/test/dist/jscomp/test/test_string.js b/jscomp/test/dist/jscomp/test/test_string.js index 83caeb7525..b46dcea415 100644 --- a/jscomp/test/dist/jscomp/test/test_string.js +++ b/jscomp/test/dist/jscomp/test/test_string.js @@ -8,9 +8,9 @@ const Caml_string = require("melange.js/caml_string.js"); function f(param) { switch (param) { case "aaaabb" : - return 0; + return 0; case "bbbb" : - return 1; + return 1; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", diff --git a/jscomp/test/dist/jscomp/test/test_string_case.js b/jscomp/test/dist/jscomp/test/test_string_case.js index 8bc5e8a00b..c817b237a1 100644 --- a/jscomp/test/dist/jscomp/test/test_string_case.js +++ b/jscomp/test/dist/jscomp/test/test_string_case.js @@ -6,9 +6,9 @@ const Caml_js_exceptions = require("melange.js/caml_js_exceptions.js"); function f(param) { switch (param) { case "abcd" : - return 0; + return 0; case "bcde" : - return 1; + return 1; default: throw new Caml_js_exceptions.MelangeError("Assert_failure", { MEL_EXN_ID: "Assert_failure", diff --git a/jscomp/test/dist/jscomp/test/test_string_switch.js b/jscomp/test/dist/jscomp/test/test_string_switch.js index 5fc6cba016..ef82f28a40 100644 --- a/jscomp/test/dist/jscomp/test/test_string_switch.js +++ b/jscomp/test/dist/jscomp/test/test_string_switch.js @@ -7,11 +7,11 @@ let os_version; switch (Stdlib__Sys.os_type) { case "Cygwin" : - os_version = 2; - break; + os_version = 2; + break; case "Unix" : - os_version = 1; - break; + os_version = 1; + break; default: os_version = 3; } diff --git a/jscomp/test/dist/jscomp/test/test_switch.js b/jscomp/test/dist/jscomp/test/test_switch.js index d7610d1e9b..93307ac038 100644 --- a/jscomp/test/dist/jscomp/test/test_switch.js +++ b/jscomp/test/dist/jscomp/test/test_switch.js @@ -13,13 +13,13 @@ function f(param) { } switch (param.TAG) { case /* A */ 0 : - return 0; + return 0; case /* B */ 1 : - return 1; + return 1; case /* C */ 2 : - return 2; + return 2; case /* F */ 3 : - return 3; + return 3; } } diff --git a/jscomp/test/dist/jscomp/test/ticker.js b/jscomp/test/dist/jscomp/test/ticker.js index ba1b258bd3..2464c04e3f 100644 --- a/jscomp/test/dist/jscomp/test/ticker.js +++ b/jscomp/test/dist/jscomp/test/ticker.js @@ -1407,98 +1407,74 @@ function process_input_line(ticker_map, all_tickers, line) { if (tokens) { switch (tokens.hd) { case "Q" : - const match = tokens.tl; - if (match) { - const match$1 = match.tl; - if (match$1) { - if (match$1.tl) { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - } - const ticker_map$1 = ticker_map !== undefined ? Caml_option.valFromOption(ticker_map) : compute_update_sequences(all_tickers); - const value = Caml_format.caml_float_of_string(match$1.hd); - process_quote(ticker_map$1, match.hd, value); - return [ - all_tickers, - Caml_option.some(ticker_map$1) - ]; + const match = tokens.tl; + if (match) { + const match$1 = match.tl; + if (match$1) { + if (match$1.tl) { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); } - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); + const ticker_map$1 = ticker_map !== undefined ? Caml_option.valFromOption(ticker_map) : compute_update_sequences(all_tickers); + const value = Caml_format.caml_float_of_string(match$1.hd); + process_quote(ticker_map$1, match.hd, value); + return [ + all_tickers, + Caml_option.some(ticker_map$1) + ]; } throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", _1: "Invalid input line" }); + } + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); case "R" : - const match$2 = tokens.tl; - if (match$2) { - const match$3 = match$2.tl; - if (match$3) { - const ticker_name = match$2.hd; - switch (match$3.hd) { - case "+" : - const match$4 = match$3.tl; - if (match$4) { - const match$5 = match$4.tl; - if (match$5) { - if (match$5.tl) { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - } - return [ - { - hd: make_binary_op(ticker_name, match$4.hd, match$5.hd, /* PLUS */ 0), - tl: all_tickers - }, - ticker_map - ]; - } - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - } - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - case "-" : - const match$6 = match$3.tl; - if (match$6) { - const match$7 = match$6.tl; - if (match$7) { - if (match$7.tl) { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - } - return [ - { - hd: make_binary_op(ticker_name, match$6.hd, match$7.hd, /* MINUS */ 1), - tl: all_tickers - }, - ticker_map - ]; - } + const match$2 = tokens.tl; + if (match$2) { + const match$3 = match$2.tl; + if (match$3) { + const ticker_name = match$2.hd; + switch (match$3.hd) { + case "+" : + const match$4 = match$3.tl; + if (match$4) { + const match$5 = match$4.tl; + if (match$5) { + if (match$5.tl) { throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", _1: "Invalid input line" }); } - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); - case "S" : - if (match$3.tl) { + return [ + { + hd: make_binary_op(ticker_name, match$4.hd, match$5.hd, /* PLUS */ 0), + tl: all_tickers + }, + ticker_map + ]; + } + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); + } + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); + case "-" : + const match$6 = match$3.tl; + if (match$6) { + const match$7 = match$6.tl; + if (match$7) { + if (match$7.tl) { throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", _1: "Invalid input line" @@ -1506,27 +1482,45 @@ function process_input_line(ticker_map, all_tickers, line) { } return [ { - hd: { - value: undefined, - rank: /* Uninitialized */ 0, - ticker_name: ticker_name, - type_: /* Market */ 0 - }, + hd: make_binary_op(ticker_name, match$6.hd, match$7.hd, /* MINUS */ 1), tl: all_tickers }, ticker_map ]; - default: + } throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", _1: "Invalid input line" }); - } - } else { - throw new Caml_js_exceptions.MelangeError("Failure", { - MEL_EXN_ID: "Failure", - _1: "Invalid input line" - }); + } + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); + case "S" : + if (match$3.tl) { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); + } + return [ + { + hd: { + value: undefined, + rank: /* Uninitialized */ 0, + ticker_name: ticker_name, + type_: /* Market */ 0 + }, + tl: all_tickers + }, + ticker_map + ]; + default: + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); } } else { throw new Caml_js_exceptions.MelangeError("Failure", { @@ -1534,6 +1528,12 @@ function process_input_line(ticker_map, all_tickers, line) { _1: "Invalid input line" }); } + } else { + throw new Caml_js_exceptions.MelangeError("Failure", { + MEL_EXN_ID: "Failure", + _1: "Invalid input line" + }); + } default: throw new Caml_js_exceptions.MelangeError("Failure", { MEL_EXN_ID: "Failure", diff --git a/jscomp/test/dist/jscomp/test/topsort_test.js b/jscomp/test/dist/jscomp/test/topsort_test.js index b0a54e415a..6128e806a2 100644 --- a/jscomp/test/dist/jscomp/test/topsort_test.js +++ b/jscomp/test/dist/jscomp/test/topsort_test.js @@ -1392,28 +1392,54 @@ function of_list(l) { const sub = function (n, l) { switch (n) { case 0 : + return [ + /* Empty */ 0, + l + ]; + case 1 : + if (l) { return [ - /* Empty */ 0, - l + { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + const match = l.tl; + if (match) { return [ { TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, + l: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: l.hd, + r: /* Empty */ 0, + h: 1 + }, + v: match.hd, r: /* Empty */ 0, - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - const match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + const match$1 = l.tl; + if (match$1) { + const match$2 = match$1.tl; + if (match$2) { return [ { TAG: /* Node */ 0, @@ -1424,50 +1450,24 @@ function of_list(l) { r: /* Empty */ 0, h: 1 }, - v: match.hd, - r: /* Empty */ 0, + v: match$1.hd, + r: { + TAG: /* Node */ 0, + l: /* Empty */ 0, + v: match$2.hd, + r: /* Empty */ 0, + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - const match$1 = l.tl; - if (match$1) { - const match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: /* Node */ 0, - l: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: l.hd, - r: /* Empty */ 0, - h: 1 - }, - v: match$1.hd, - r: { - TAG: /* Node */ 0, - l: /* Empty */ 0, - v: match$2.hd, - r: /* Empty */ 0, - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; + + } + break; } const nl = n / 2 | 0; diff --git a/jscomp/test/dist/jscomp/test/tscanf_test.js b/jscomp/test/dist/jscomp/test/tscanf_test.js index 35d0a56471..3db2a15557 100644 --- a/jscomp/test/dist/jscomp/test/tscanf_test.js +++ b/jscomp/test/dist/jscomp/test/tscanf_test.js @@ -1893,20 +1893,20 @@ function scan_elems$2(ib, accu) { if (c < 94) { switch (c) { case 91 : - if (Caml_obj.caml_equal(accu, /* [] */ 0)) { - return scan_elems$2(ib, { - hd: i, - tl: accu - }); - } - break; - case 92 : - break; - case 93 : - return Stdlib__List.rev({ + if (Caml_obj.caml_equal(accu, /* [] */ 0)) { + return scan_elems$2(ib, { hd: i, tl: accu }); + } + break; + case 92 : + break; + case 93 : + return Stdlib__List.rev({ + hd: i, + tl: accu + }); } } @@ -2014,10 +2014,10 @@ function scan_elems$3(ib, accu) { }), (function (i, s) { switch (s) { case ";" : - return scan_elems$3(ib, { - hd: i, - tl: accu - }); + return scan_elems$3(ib, { + hd: i, + tl: accu + }); default: return Stdlib__List.rev({ hd: i, @@ -2339,9 +2339,9 @@ function scan_rest$1(ib, accu) { }), (function (param) { switch (param) { case ";" : - return scan_rest$1(ib, accu$1); + return scan_rest$1(ib, accu$1); case "]" : - return accu$1; + return accu$1; default: const s = Stdlib__Printf.sprintf({ TAG: /* Format */ 0, @@ -4548,22 +4548,22 @@ function writer(ib, ob) { }), (function (s) { switch (s) { case "start" : - send_string(ob, "Hello World!"); - return reader(ib, ob); + send_string(ob, "Hello World!"); + return reader(ib, ob); case "stop" : - return Curry._1(Stdlib__Scanf.bscanf(ib, { - TAG: /* Format */ 0, - _0: { - TAG: /* Int */ 4, - _0: /* Int_i */ 3, - _1: /* No_padding */ 0, - _2: /* No_precision */ 0, - _3: /* End_of_format */ 0 - }, - _1: "%i" - }), (function (i) { - return i; - })); + return Curry._1(Stdlib__Scanf.bscanf(ib, { + TAG: /* Format */ 0, + _0: { + TAG: /* Int */ 4, + _0: /* Int_i */ 3, + _1: /* No_padding */ 0, + _2: /* No_precision */ 0, + _3: /* End_of_format */ 0 + }, + _1: "%i" + }), (function (i) { + return i; + })); default: const i = Caml_format.caml_int_of_string(s); send_string(ob, String(i)); diff --git a/jscomp/test/dist/jscomp/test/typeof_test.js b/jscomp/test/dist/jscomp/test/typeof_test.js index 4c24718adc..07197799c8 100644 --- a/jscomp/test/dist/jscomp/test/typeof_test.js +++ b/jscomp/test/dist/jscomp/test/typeof_test.js @@ -14,14 +14,14 @@ function string_or_number(x) { } else { switch (ty.TAG) { case /* JSNumber */ 0 : - console.log(ty._0 + 3); - return true; + console.log(ty._0 + 3); + return true; case /* JSString */ 1 : - console.log(ty._0 + "hei"); - return true; + console.log(ty._0 + "hei"); + return true; case /* JSFunction */ 2 : - console.log("Function"); - return false; + console.log("Function"); + return false; default: return false; } diff --git a/jscomp/test/dist/jscomp/test/variant.js b/jscomp/test/dist/jscomp/test/variant.js index 7e2ded09e1..34d566b01c 100644 --- a/jscomp/test/dist/jscomp/test/variant.js +++ b/jscomp/test/dist/jscomp/test/variant.js @@ -17,12 +17,12 @@ function foo(n) { } switch (n.TAG) { case /* B */ 0 : - return n._0; + return n._0; case /* C */ 1 : - return n._0 + n._1 | 0; + return n._0 + n._1 | 0; case /* D */ 2 : - const match = n._0; - return match[0] + match[1] | 0; + const match = n._0; + return match[0] + match[1] | 0; } } @@ -46,11 +46,11 @@ function fooC(param) { function switchNum(param) { switch (param) { case 0 : - return "0"; + return "0"; case 1 : - return "1"; + return "1"; case 2 : - return "2"; + return "2"; default: return "_"; } @@ -91,10 +91,10 @@ function rollback_path(subst, p) { if (exn.MEL_EXN_ID === Stdlib.Not_found) { switch (p.TAG) { case /* Pdot */ 1 : - return "Pdot"; + return "Pdot"; case /* Pident */ 0 : case /* Papply */ 2 : - return "Pident | Papply"; + return "Pident | Papply"; } } else { diff --git a/test/blackbox-tests/variants-as-strings.t b/test/blackbox-tests/variants-as-strings.t index cc95a93439..c2d5c7bb9d 100644 --- a/test/blackbox-tests/variants-as-strings.t +++ b/test/blackbox-tests/variants-as-strings.t @@ -28,10 +28,10 @@ function f(x) { switch (x) { case /* A */ 0 : - return "a"; + return "a"; case /* B */ "as-string" : case /* C */ 2 : - return "other"; + return "other"; } } @@ -39,10 +39,10 @@ function g(x) { switch (x) { case /* B */ "as-string" : - return "as-string"; + return "as-string"; case /* A */ 0 : case /* C */ 2 : - return "other"; + return "other"; } }