From e866b15355b093ddf9076eba7261f36df20ebaac Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 4 Dec 2023 15:55:08 +0100 Subject: [PATCH] Misc: promote to 5.3 --- .github/workflows/build.yml | 14 +- compiler/tests-check-prim/main.output5 | 2 - compiler/tests-check-prim/unix-unix.output | 1 + compiler/tests-check-prim/unix-unix.output5 | 2 - compiler/tests-check-prim/unix-win32.output | 1 + compiler/tests-full/dune | 6 +- compiler/tests-full/stdlib.cma.expected.js | 8072 ++++++++++--------- ppx/ppx_deriving_json/tests/gen.mlt | 4 - ppx/ppx_js/tests/ppx.mlt | 18 +- 9 files changed, 4371 insertions(+), 3749 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f7f35b87a..31ed27ce87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,7 @@ jobs: - "4.13" - "5.0" - "5.1" + - "5.2" skip-test: - true skip-doc: @@ -48,17 +49,17 @@ jobs: skip-test: false skip-doc: true - os: ubuntu-latest - ocaml-compiler: "5.2" + ocaml-compiler: "ocaml-variants.5.3.0~alpha1" skip-effects: false skip-test: false skip-doc: false - os: macos-latest - ocaml-compiler: "5.2" + ocaml-compiler: "ocaml-variants.5.3.0~alpha1" skip-effects: true skip-test: false skip-doc: true - os: windows-latest - ocaml-compiler: "5.2" + ocaml-compiler: "ocaml-variants.5.3.0~alpha1" skip-effects: false skip-test: false skip-doc: true @@ -91,6 +92,13 @@ jobs: - run: opam install conf-pkg-config if: runner.os == 'Windows' + - run: opam pin add ppxlib --dev --no-action + if: ${{ matrix.ocaml-compiler == 'ocaml-variants.5.3.0~alpha1' }} + - run: opam pin add ppxlib_jane git+https://github.com/hhugo/ppxlib_jane.git#trunk-support-503 --no-action + if: ${{ matrix.ocaml-compiler == 'ocaml-variants.5.3.0~alpha1' }} + + - run: opam pin add ./ --no-action + - run: opam install . --best-effort if: ${{ matrix.skip-test }} diff --git a/compiler/tests-check-prim/main.output5 b/compiler/tests-check-prim/main.output5 index c2501c6317..0eb366941a 100644 --- a/compiler/tests-check-prim/main.output5 +++ b/compiler/tests-check-prim/main.output5 @@ -4,7 +4,6 @@ Missing From main.bc: caml_alloc_dummy_function caml_continuation_use -caml_drop_continuation caml_dynlink_add_primitive caml_dynlink_close_lib caml_dynlink_get_current_libs @@ -171,7 +170,6 @@ caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked From +toplevel.js: -caml_get_section_table caml_static_alloc caml_static_free caml_terminfo_backup diff --git a/compiler/tests-check-prim/unix-unix.output b/compiler/tests-check-prim/unix-unix.output index 5e8889c2ff..d6abf966c5 100644 --- a/compiler/tests-check-prim/unix-unix.output +++ b/compiler/tests-check-prim/unix-unix.output @@ -136,6 +136,7 @@ Unused ------- From +array.js: +caml_array_create_float caml_check_bound From +bigarray.js: diff --git a/compiler/tests-check-prim/unix-unix.output5 b/compiler/tests-check-prim/unix-unix.output5 index 799210ad46..6ba27a9417 100644 --- a/compiler/tests-check-prim/unix-unix.output5 +++ b/compiler/tests-check-prim/unix-unix.output5 @@ -4,7 +4,6 @@ Missing From unix.bc: caml_alloc_dummy_function caml_continuation_use -caml_drop_continuation caml_dynlink_add_primitive caml_dynlink_close_lib caml_dynlink_get_current_libs @@ -282,7 +281,6 @@ caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked From +toplevel.js: -caml_get_section_table caml_static_alloc caml_static_free caml_terminfo_backup diff --git a/compiler/tests-check-prim/unix-win32.output b/compiler/tests-check-prim/unix-win32.output index 52ac92cf96..aecf71d99c 100644 --- a/compiler/tests-check-prim/unix-win32.output +++ b/compiler/tests-check-prim/unix-win32.output @@ -101,6 +101,7 @@ Unused ------- From +array.js: +caml_array_create_float caml_check_bound From +bigarray.js: diff --git a/compiler/tests-full/dune b/compiler/tests-full/dune index 5effacad3b..3c10ed243c 100644 --- a/compiler/tests-full/dune +++ b/compiler/tests-full/dune @@ -1,7 +1,7 @@ (rule (targets stdlib.cma.js) (enabled_if - (= %{ocaml_version} "5.2.0")) + (> %{ocaml_version} "5.2.0")) (action (run %{bin:js_of_ocaml} @@ -14,7 +14,7 @@ (rule (targets stdlib.cma.output.js) (enabled_if - (= %{ocaml_version} "5.2.0")) + (> %{ocaml_version} "5.2.0")) (action (with-stdout-to %{targets} @@ -23,7 +23,7 @@ (rule (alias runtest) (enabled_if - (= %{ocaml_version} "5.2.0")) + (> %{ocaml_version} "5.2.0")) (action (diff stdlib.cma.expected.js stdlib.cma.output.js))) diff --git a/compiler/tests-full/stdlib.cma.expected.js b/compiler/tests-full/stdlib.cma.expected.js index 254b13f11a..0b682baad8 100644 --- a/compiler/tests-full/stdlib.cma.expected.js +++ b/compiler/tests-full/stdlib.cma.expected.js @@ -1114,8 +1114,8 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception, global_data = runtime.caml_get_global_data(), - ocaml_version = "5.2.0", - ocaml_release = [0, 5, 2, 0, 0], + ocaml_version = "5.3.0~alpha1", + ocaml_release = [0, 5, 3, 0, [0, [0, 1, "alpha1"]]], Stdlib = global_data.Stdlib, /*<>*/ executable_name = /*<>*/ runtime.caml_sys_executable_name(0), @@ -1128,28 +1128,28 @@ max_floatarray_length = max_array_length / 2 | 0, max_string_length = (4 * max_array_length | 0) - 1 | 0; function getenv_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _d_ = [0, /*<>*/ runtime.caml_sys_getenv(s)]; - /*<>*/ return _d_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _d_ = [0, /*<>*/ runtime.caml_sys_getenv(s)]; + /*<>*/ return _d_; } catch(_e_){ var _c_ = caml_wrap_exception(_e_); - if(_c_ === Stdlib[8]) /*<>*/ return 0; + if(_c_ === Stdlib[8]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_c_, 0); } - /*<>*/ } - /*<>*/ /*<>*/ var interactive = [0, 0]; - function set_signal(sig_num, sig_beh){ /*<>*/ return 0; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var interactive = [0, 0]; + function set_signal(sig_num, sig_beh){ /*<>*/ return 0; + /*<>*/ } + /*<>*/ /*<>*/ var Break = [248, "Stdlib.Sys.Break", runtime.caml_fresh_oo_id(0)]; function catch_break(on){ - /*<>*/ return on ? 0 : 0; - /*<>*/ } - function Make(_b_, _a_){ /*<>*/ return [0, 1];} - /*<>*/ var - /*<>*/ Immediate64 = [0, Make], + /*<>*/ return on ? 0 : 0; + /*<>*/ } + function Make(_b_, _a_){ /*<>*/ return [0, 1];} + /*<>*/ var + /*<>*/ Immediate64 = [0, Make], Stdlib_Sys = [0, executable_name, @@ -1198,7 +1198,7 @@ Break, catch_break, ocaml_version, - 0, + 1, ocaml_release, runtime.caml_ml_enable_runtime_warnings, runtime.caml_ml_runtime_warnings_enabled, @@ -3046,6 +3046,7 @@ runtime = globalThis.jsoo_runtime, cst_uchar_ml = "uchar.ml", caml_format_int = runtime.caml_format_int, + caml_hash = runtime.caml_hash, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -3063,7 +3064,7 @@ err_no_succ = "U+10FFFF has no successor", Assert_failure = global_data.Assert_failure, Stdlib = global_data.Stdlib, - cst_is_not_an_Unicode_scalar_v = " is not an Unicode scalar value", + cst_is_not_a_Unicode_scalar_va = " is not a Unicode scalar value", cst_is_not_a_latin1_character = " is not a latin1 character", cst_U = "U+", lo_bound = 55295, @@ -3080,24 +3081,24 @@ /*<>*/ } function is_valid(i){ /*<>*/ var - _n_ = 0 <= i ? 1 : 0, - _o_ = _n_ ? i <= 55295 ? 1 : 0 : _n_; - if(_o_) - var _p_ = _o_; + _m_ = 0 <= i ? 1 : 0, + _n_ = _m_ ? i <= 55295 ? 1 : 0 : _m_; + if(_n_) + var _o_ = _n_; else - var _q_ = 57344 <= i ? 1 : 0, _p_ = _q_ ? i <= 1114111 ? 1 : 0 : _q_; - return _p_; + var _p_ = 57344 <= i ? 1 : 0, _o_ = _p_ ? i <= 1114111 ? 1 : 0 : _p_; + return _o_; /*<>*/ } function of_int(i){ /*<>*/ if(is_valid(i)) /*<>*/ return i; /*<>*/ /*<>*/ var - _m_ = + _l_ = /*<>*/ caml_call2 (Stdlib[28], /*<>*/ caml_format_int("%X", i), - cst_is_not_an_Unicode_scalar_v); + cst_is_not_a_Unicode_scalar_va); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], _m_); + (Stdlib[1], _l_); /*<>*/ } function is_char(u){ /*<>*/ return u < 256 ? 1 : 0; @@ -3108,62 +3109,69 @@ function to_char(u){ /*<>*/ if(255 >= u) /*<>*/ return u; /*<>*/ var - /*<>*/ _k_ = + /*<>*/ _j_ = /*<>*/ caml_call2 (Stdlib[28], /*<>*/ caml_format_int("%04X", u), cst_is_not_a_latin1_character), - /*<>*/ _l_ = - /*<>*/ caml_call2(Stdlib[28], cst_U, _k_); + /*<>*/ _k_ = + /*<>*/ caml_call2(Stdlib[28], cst_U, _j_); /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], _l_); + (Stdlib[1], _k_); /*<>*/ } - function unsafe_to_char(_j_){ /*<>*/ return _j_;} - function equal(_i_, _h_){ /*<>*/ return _i_ === _h_ ? 1 : 0;} + function unsafe_to_char(_i_){ /*<>*/ return _i_;} + function equal(_h_, _g_){ /*<>*/ return _h_ === _g_ ? 1 : 0;} var compare = runtime.caml_int_compare, - _a_ = [0, cst_uchar_ml, 85, 7], - _b_ = [0, cst_uchar_ml, 80, 18], - _c_ = [0, cst_uchar_ml, 91, 7], - _d_ = [0, cst_uchar_ml, 88, 18]; - function hash(_g_){ /*<>*/ return _g_;} + _a_ = [0, cst_uchar_ml, 89, 7], + _b_ = [0, cst_uchar_ml, 84, 18], + _c_ = [0, cst_uchar_ml, 95, 7], + _d_ = [0, cst_uchar_ml, 92, 18]; + function seeded_hash(seed, x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, seed, x); + /*<>*/ } + function hash(x){ + /*<>*/ return /*<>*/ caml_hash + (10, 100, 0, x); + /*<>*/ } function utf_decode_is_valid(d){ - /*<>*/ return 1 === (d >>> 27 | 0) ? 1 : 0; - /*<>*/ } + /*<>*/ return 1 === (d >>> 27 | 0) ? 1 : 0; + /*<>*/ } function utf_decode_length(d){ - /*<>*/ return (d >>> 24 | 0) & 7; - /*<>*/ } + /*<>*/ return (d >>> 24 | 0) & 7; + /*<>*/ } function utf_decode_uchar(d){ - /*<>*/ return d & 16777215; - /*<>*/ } + /*<>*/ return d & 16777215; + /*<>*/ } function utf_decode(n, u){ - /*<>*/ return (8 | n) << 24 | u; - /*<>*/ } + /*<>*/ return (8 | n) << 24 | u; + /*<>*/ } function utf_decode_invalid(n){ - /*<>*/ return n << 24 | 65533; - /*<>*/ } + /*<>*/ return n << 24 | 65533; + /*<>*/ } function utf_8_byte_length(u){ - /*<>*/ if(0 > u) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(0 > u) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _b_], 1); - /*<>*/ if(127 >= u) /*<>*/ return 1; - /*<>*/ if(2047 >= u) /*<>*/ return 2; - /*<>*/ if(65535 >= u) /*<>*/ return 3; - /*<>*/ if(1114111 < u) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(127 >= u) /*<>*/ return 1; + /*<>*/ if(2047 >= u) /*<>*/ return 2; + /*<>*/ if(65535 >= u) /*<>*/ return 3; + /*<>*/ if(1114111 < u) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); - /*<>*/ return 4; - /*<>*/ } + /*<>*/ return 4; + /*<>*/ } function utf_16_byte_length(u){ - /*<>*/ if(0 > u) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(0 > u) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _d_], 1); - /*<>*/ if(65535 >= u) /*<>*/ return 2; - /*<>*/ if(1114111 < u) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if(65535 >= u) /*<>*/ return 2; + /*<>*/ if(1114111 < u) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _c_], 1); - /*<>*/ return 4; - /*<>*/ } + /*<>*/ return 4; + /*<>*/ } var Stdlib_Uchar = [0, @@ -3183,6 +3191,7 @@ unsafe_to_char, equal, compare, + seeded_hash, hash, utf_decode_is_valid, utf_decode_uchar, @@ -3300,6 +3309,8 @@ cst_List_fold_right2 = "List.fold_right2", cst_List_for_all2 = "List.for_all2", cst_List_exists2 = "List.exists2", + cst_List_take = "List.take", + cst_List_drop = "List.drop", _a_ = [0, 0, 0], cst_List_combine = "List.combine"; function rev_append(l1, l2){ @@ -4054,117 +4065,203 @@ param$0 = xs; } } + function take(n, l){ + /*<>*/ if(n < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_List_take); + if(0 !== n && l){ + /*<>*/ var + l$0 = l[2], + x = l[1], + /*<>*/ block = [0, x, 24029], + /*<>*/ n$0 = n - 1 | 0, + dst = block, + offset = 1, + n$1 = n$0, + l$1 = l$0; + /*<>*/ for(;;){ + if(0 !== n$1 && l$1){ + /*<>*/ var + l$2 = l$1[2], + x$0 = l$1[1], + /*<>*/ dst$0 = [0, x$0, 24029]; + dst[1 + offset] = dst$0; + /*<>*/ /*<>*/ var n$2 = n$1 - 1 | 0; + dst = dst$0; + offset = 1; + n$1 = n$2; + l$1 = l$2; + continue; + } + dst[1 + offset] = 0; + /*<>*/ return block; + } + } + /*<>*/ return 0; + /*<>*/ } + function drop(n, rest){ + /*<>*/ if(n < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_List_drop); + var i = 0, rest$0 = rest; + for(;;){ + if(rest$0){ + var rest$1 = rest$0[2]; + if(i < n){var i$0 = i + 1 | 0; i = i$0; rest$0 = rest$1; continue;} + } + /*<>*/ return rest$0; + } + /*<>*/ } + function take_while(p, rest){ + /*<>*/ if(rest){ + var rest$0 = rest[2], x = rest[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x)){ + /*<>*/ var + /*<>*/ block = [0, x, 24029], + dst = block, + offset = 1, + rest$1 = rest$0; + /*<>*/ for(;;){ + if(rest$1){ + var rest$2 = rest$1[2], x$0 = rest$1[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x$0)){ + /*<>*/ /*<>*/ var + dst$0 = [0, x$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + rest$1 = rest$2; + continue; + } + } + dst[1 + offset] = 0; + /*<>*/ return block; + } + } + } + /*<>*/ return 0; + /*<>*/ } + function drop_while(p, rest){ + var rest$0 = rest; + for(;;){ + if(rest$0){ + var rest$1 = rest$0[2], x = rest$0[1]; + /*<>*/ if( /*<>*/ caml_call1(p, x)){rest$0 = rest$1; continue;} + } + /*<>*/ return rest$0; + } + } function fold_left_map(f, accu, l){ - /*<>*/ var accu$0 = accu, l_accu = 0, param = l; + /*<>*/ var accu$0 = accu, l_accu = 0, param = l; for(;;){ - if(! param) /*<>*/ return [0, accu$0, rev(l_accu)]; - /*<>*/ var + if(! param) /*<>*/ return [0, accu$0, rev(l_accu)]; + /*<>*/ var l$0 = param[2], x = param[1], - /*<>*/ match = - /*<>*/ caml_call2(f, accu$0, x), + /*<>*/ match = + /*<>*/ caml_call2(f, accu$0, x), x$0 = match[2], accu$1 = match[1], - /*<>*/ l_accu$0 = [0, x$0, l_accu]; + /*<>*/ l_accu$0 = [0, x$0, l_accu]; accu$0 = accu$1; l_accu = l_accu$0; param = l$0; } - /*<>*/ } + /*<>*/ } function partition(p, l){ - /*<>*/ var yes = 0, no = 0, param = l; + /*<>*/ var yes = 0, no = 0, param = l; for(;;){ if(! param){ - /*<>*/ /*<>*/ var _x_ = rev(no); - /*<>*/ return [0, rev(yes), _x_]; + /*<>*/ /*<>*/ var _x_ = rev(no); + /*<>*/ return [0, rev(yes), _x_]; } var l$0 = param[2], x = param[1]; - /*<>*/ if( /*<>*/ caml_call1(p, x)){ - /*<>*/ /*<>*/ var yes$0 = [0, x, yes]; + /*<>*/ if( /*<>*/ caml_call1(p, x)){ + /*<>*/ /*<>*/ var yes$0 = [0, x, yes]; yes = yes$0; param = l$0; } else{ - /*<>*/ /*<>*/ var no$0 = [0, x, no]; + /*<>*/ /*<>*/ var no$0 = [0, x, no]; no = no$0; param = l$0; } } - /*<>*/ } + /*<>*/ } function partition_map(p, l){ - /*<>*/ var left = 0, right = 0, param = l; + /*<>*/ var left = 0, right = 0, param = l; for(;;){ if(! param){ - /*<>*/ /*<>*/ var _w_ = rev(right); - /*<>*/ return [0, rev(left), _w_]; + /*<>*/ /*<>*/ var _w_ = rev(right); + /*<>*/ return [0, rev(left), _w_]; } - /*<>*/ var + /*<>*/ var l$0 = param[2], x = param[1], - /*<>*/ match = /*<>*/ caml_call1(p, x); + /*<>*/ match = /*<>*/ caml_call1(p, x); if(0 === match[0]){ - /*<>*/ var + /*<>*/ var v = match[1], - /*<>*/ left$0 = [0, v, left]; + /*<>*/ left$0 = [0, v, left]; left = left$0; param = l$0; } else{ - /*<>*/ var + /*<>*/ var v$0 = match[1], - /*<>*/ right$0 = [0, v$0, right]; + /*<>*/ right$0 = [0, v$0, right]; right = right$0; param = l$0; } } - /*<>*/ } + /*<>*/ } function split(param){ - /*<>*/ if(! param) /*<>*/ return _a_; - /*<>*/ var + /*<>*/ if(! param) /*<>*/ return _a_; + /*<>*/ var l = param[2], match = param[1], y = match[2], x = match[1], - /*<>*/ match$0 = split(l), + /*<>*/ match$0 = split(l), ry = match$0[2], rx = match$0[1]; - /*<>*/ return [0, [0, x, rx], [0, y, ry]]; - /*<>*/ } + /*<>*/ return [0, [0, x, rx], [0, y, ry]]; + /*<>*/ } function combine(l1, l2){ - /*<>*/ if(l1){ + /*<>*/ if(l1){ if(l2){ var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1]; - /*<>*/ return [0, [0, a1, a2], combine(l1$0, l2$0)]; + /*<>*/ return [0, [0, a1, a2], combine(l1$0, l2$0)]; } } - else if(! l2) /*<>*/ return 0; - /*<>*/ return /*<>*/ caml_call1 + else if(! l2) /*<>*/ return 0; + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_List_combine); - /*<>*/ } + /*<>*/ } function merge(cmp, l1, l2){ - /*<>*/ if(! l1) /*<>*/ return l2; - if(! l2) /*<>*/ return l1; + /*<>*/ if(! l1) /*<>*/ return l2; + if(! l2) /*<>*/ return l1; var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ return 0 - < /*<>*/ caml_call2(cmp, h1, h2) + /*<>*/ return 0 + < /*<>*/ caml_call2(cmp, h1, h2) ? [0, h2, merge(cmp, l1, t2)] : [0, h1, merge(cmp, t1, l2)]; - /*<>*/ } + /*<>*/ } function stable_sort(cmp, l){ function sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ s = - 0 < /*<>*/ caml_call2(cmp, x1, x2) + /*<>*/ s = + 0 < /*<>*/ caml_call2(cmp, x1, x2) ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } @@ -4173,56 +4270,56 @@ if(_v_){ var match$2 = _v_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], x2$0 = _v_[1], x1$0 = l[1], - /*<>*/ s$0 = - 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) + /*<>*/ s$0 = + 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) ? 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x3, [0, x2$0, [0, x1$0, 0]]] : [0, x2$0, [0, x3, [0, x1$0, 0]]] : [0, x2$0, [0, x1$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x3, [0, x1$0, [0, x2$0, 0]]] : [0, x1$0, [0, x3, [0, x2$0, 0]]] : [0, x1$0, [0, x2$0, [0, x3, 0]]]; - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = rev_sort(n1, l), + /*<>*/ match$0 = rev_sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = rev_sort(n2, l2$0), + /*<>*/ match$1 = rev_sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, h1, h2)){ - /*<>*/ /*<>*/ var + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, h1, h2)){ + /*<>*/ /*<>*/ var accu$0 = [0, h1, accu]; l1 = t1; accu = accu$0; continue; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$1 = [0, h2, accu]; l2 = t2; accu = accu$1; @@ -4232,23 +4329,23 @@ } else var _u_ = rev_append(l2, accu); - /*<>*/ return [0, _u_, tl$0]; + /*<>*/ return [0, _u_, tl$0]; } - /*<>*/ } + /*<>*/ } function rev_sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ s = - 0 < /*<>*/ caml_call2(cmp, x1, x2) + /*<>*/ s = + 0 < /*<>*/ caml_call2(cmp, x1, x2) ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } @@ -4257,56 +4354,56 @@ if(_t_){ var match$2 = _t_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], x2$0 = _t_[1], x1$0 = l[1], - /*<>*/ s$0 = - 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) + /*<>*/ s$0 = + 0 < /*<>*/ caml_call2(cmp, x1$0, x2$0) ? 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x1$0, [0, x2$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x1$0, [0, x3, [0, x2$0, 0]]] : [0, x3, [0, x1$0, [0, x2$0, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x1$0, x3) + < /*<>*/ caml_call2(cmp, x1$0, x3) ? [0, x2$0, [0, x1$0, [0, x3, 0]]] : 0 - < /*<>*/ caml_call2(cmp, x2$0, x3) + < /*<>*/ caml_call2(cmp, x2$0, x3) ? [0, x2$0, [0, x3, [0, x1$0, 0]]] : [0, x3, [0, x2$0, [0, x1$0, 0]]]; - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = sort(n1, l), + /*<>*/ match$0 = sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = sort(n2, l2$0), + /*<>*/ match$1 = sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, h1, h2)){ - /*<>*/ /*<>*/ var + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, h1, h2)){ + /*<>*/ /*<>*/ var accu$0 = [0, h2, accu]; l2 = t2; accu = accu$0; continue; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$1 = [0, h1, accu]; l1 = t1; accu = accu$1; @@ -4316,29 +4413,29 @@ } else var _s_ = rev_append(l2, accu); - /*<>*/ return [0, _s_, tl$0]; + /*<>*/ return [0, _s_, tl$0]; } - /*<>*/ } - /*<>*/ /*<>*/ var len = length(l); - /*<>*/ return 2 <= len ? sort(len, l)[1] : l; - /*<>*/ } + /*<>*/ } + /*<>*/ /*<>*/ var len = length(l); + /*<>*/ return 2 <= len ? sort(len, l)[1] : l; + /*<>*/ } function sort_uniq(cmp, l){ function sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ c$0 = - /*<>*/ caml_call2(cmp, x1, x2), - /*<>*/ s = + /*<>*/ c$0 = + /*<>*/ caml_call2(cmp, x1, x2), + /*<>*/ s = 0 === c$0 ? [0, x1, 0] : 0 <= c$0 ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } @@ -4347,32 +4444,32 @@ if(_m_){ var match$2 = _m_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], x2$0 = _m_[1], x1$0 = l[1], - /*<>*/ c$1 = - /*<>*/ caml_call2(cmp, x1$0, x2$0); - /*<>*/ if(0 === c$1) - /*<>*/ var - /*<>*/ c$2 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _n_ = + /*<>*/ c$1 = + /*<>*/ caml_call2(cmp, x1$0, x2$0); + /*<>*/ if(0 === c$1) + /*<>*/ var + /*<>*/ c$2 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _n_ = 0 === c$2 ? [0, x2$0, 0] : 0 <= c$2 ? [0, x3, [0, x2$0, 0]] : [0, x2$0, [0, x3, 0]], s$0 = _n_; else if(0 <= c$1){ - /*<>*/ /*<>*/ var - c$3 = /*<>*/ caml_call2(cmp, x1$0, x3); - /*<>*/ if(0 === c$3) + /*<>*/ /*<>*/ var + c$3 = /*<>*/ caml_call2(cmp, x1$0, x3); + /*<>*/ if(0 === c$3) var _o_ = [0, x2$0, [0, x1$0, 0]]; else if(0 <= c$3) - /*<>*/ var - /*<>*/ c$4 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _p_ = + /*<>*/ var + /*<>*/ c$4 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _p_ = 0 === c$4 ? [0, x2$0, [0, x1$0, 0]] : 0 @@ -4385,15 +4482,15 @@ var s$0 = _o_; } else{ - /*<>*/ /*<>*/ var - c$5 = /*<>*/ caml_call2(cmp, x2$0, x3); - /*<>*/ if(0 === c$5) + /*<>*/ /*<>*/ var + c$5 = /*<>*/ caml_call2(cmp, x2$0, x3); + /*<>*/ if(0 === c$5) var _q_ = [0, x1$0, [0, x2$0, 0]]; else if(0 <= c$5) - /*<>*/ var - /*<>*/ c$6 = - /*<>*/ caml_call2(cmp, x1$0, x3), - /*<>*/ _r_ = + /*<>*/ var + /*<>*/ c$6 = + /*<>*/ caml_call2(cmp, x1$0, x3), + /*<>*/ _r_ = 0 === c$6 ? [0, x1$0, [0, x2$0, 0]] : 0 @@ -4405,34 +4502,34 @@ var _q_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; var s$0 = _q_; } - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = rev_sort(n1, l), + /*<>*/ match$0 = rev_sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = rev_sort(n2, l2$0), + /*<>*/ match$1 = rev_sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ - /*<>*/ var + /*<>*/ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, h1, h2); - /*<>*/ if(0 === c){ - /*<>*/ /*<>*/ var + /*<>*/ c = + /*<>*/ caml_call2(cmp, h1, h2); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var accu$0 = [0, h1, accu]; l1 = t1; l2 = t2; @@ -4440,13 +4537,13 @@ continue; } if(0 < c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$1 = [0, h1, accu]; l1 = t1; accu = accu$1; continue; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$2 = [0, h2, accu]; l2 = t2; accu = accu$2; @@ -4456,25 +4553,25 @@ } else var _l_ = rev_append(l2, accu); - /*<>*/ return [0, _l_, tl$0]; + /*<>*/ return [0, _l_, tl$0]; } - /*<>*/ } + /*<>*/ } function rev_sort(n, l){ - /*<>*/ if(2 === n){ + /*<>*/ if(2 === n){ if(l){ var match = l[2]; if(match){ - /*<>*/ var + /*<>*/ var tl = match[2], x2 = match[1], x1 = l[1], - /*<>*/ c$0 = - /*<>*/ caml_call2(cmp, x1, x2), - /*<>*/ s = + /*<>*/ c$0 = + /*<>*/ caml_call2(cmp, x1, x2), + /*<>*/ s = 0 === c$0 ? [0, x1, 0] : 0 < c$0 ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]]; - /*<>*/ return [0, s, tl]; + /*<>*/ return [0, s, tl]; } } } @@ -4483,34 +4580,34 @@ if(_f_){ var match$2 = _f_[2]; if(match$2){ - /*<>*/ var + /*<>*/ var tl$1 = match$2[2], x3 = match$2[1], x2$0 = _f_[1], x1$0 = l[1], - /*<>*/ c$1 = - /*<>*/ caml_call2(cmp, x1$0, x2$0); - /*<>*/ if(0 === c$1) - /*<>*/ var - /*<>*/ c$2 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _g_ = + /*<>*/ c$1 = + /*<>*/ caml_call2(cmp, x1$0, x2$0); + /*<>*/ if(0 === c$1) + /*<>*/ var + /*<>*/ c$2 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _g_ = 0 === c$2 ? [0, x2$0, 0] : 0 < c$2 ? [0, x2$0, [0, x3, 0]] : [0, x3, [0, x2$0, 0]], s$0 = _g_; else if(0 < c$1){ - /*<>*/ /*<>*/ var - c$3 = /*<>*/ caml_call2(cmp, x2$0, x3); - /*<>*/ if(0 === c$3) + /*<>*/ /*<>*/ var + c$3 = /*<>*/ caml_call2(cmp, x2$0, x3); + /*<>*/ if(0 === c$3) var _h_ = [0, x1$0, [0, x2$0, 0]]; else if(0 < c$3) var _h_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; else - /*<>*/ var - /*<>*/ c$4 = - /*<>*/ caml_call2(cmp, x1$0, x3), - /*<>*/ _i_ = + /*<>*/ var + /*<>*/ c$4 = + /*<>*/ caml_call2(cmp, x1$0, x3), + /*<>*/ _i_ = 0 === c$4 ? [0, x1$0, [0, x2$0, 0]] : 0 @@ -4521,17 +4618,17 @@ var s$0 = _h_; } else{ - /*<>*/ /*<>*/ var - c$5 = /*<>*/ caml_call2(cmp, x1$0, x3); - /*<>*/ if(0 === c$5) + /*<>*/ /*<>*/ var + c$5 = /*<>*/ caml_call2(cmp, x1$0, x3); + /*<>*/ if(0 === c$5) var _j_ = [0, x2$0, [0, x1$0, 0]]; else if(0 < c$5) var _j_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; else - /*<>*/ var - /*<>*/ c$6 = - /*<>*/ caml_call2(cmp, x2$0, x3), - /*<>*/ _k_ = + /*<>*/ var + /*<>*/ c$6 = + /*<>*/ caml_call2(cmp, x2$0, x3), + /*<>*/ _k_ = 0 === c$6 ? [0, x2$0, [0, x1$0, 0]] : 0 @@ -4541,34 +4638,34 @@ _j_ = _k_; var s$0 = _j_; } - /*<>*/ return [0, s$0, tl$1]; + /*<>*/ return [0, s$0, tl$1]; } } } - /*<>*/ var + /*<>*/ var n1 = n >> 1, n2 = n - n1 | 0, - /*<>*/ match$0 = sort(n1, l), + /*<>*/ match$0 = sort(n1, l), l2$0 = match$0[2], s1 = match$0[1], - /*<>*/ match$1 = sort(n2, l2$0), + /*<>*/ match$1 = sort(n2, l2$0), tl$0 = match$1[2], s2 = match$1[1], l1 = s1, l2 = s2, accu = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(l1){ if(l2){ - /*<>*/ var + /*<>*/ var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, h1, h2); - /*<>*/ if(0 === c){ - /*<>*/ /*<>*/ var + /*<>*/ c = + /*<>*/ caml_call2(cmp, h1, h2); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var accu$0 = [0, h1, accu]; l1 = t1; l2 = t2; @@ -4576,13 +4673,13 @@ continue; } if(0 <= c){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$1 = [0, h2, accu]; l2 = t2; accu = accu$1; continue; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var accu$2 = [0, h1, accu]; l1 = t1; accu = accu$2; @@ -4592,116 +4689,116 @@ } else var _e_ = rev_append(l2, accu); - /*<>*/ return [0, _e_, tl$0]; + /*<>*/ return [0, _e_, tl$0]; } - /*<>*/ } - /*<>*/ /*<>*/ var len = length(l); - /*<>*/ return 2 <= len ? sort(len, l)[1] : l; - /*<>*/ } + /*<>*/ } + /*<>*/ /*<>*/ var len = length(l); + /*<>*/ return 2 <= len ? sort(len, l)[1] : l; + /*<>*/ } function compare_lengths(l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(! l1$0) return l2$0 ? -1 : 0; - if(! l2$0) /*<>*/ return 1; + if(! l2$0) /*<>*/ return 1; var l2$1 = l2$0[2], l1$1 = l1$0[2]; l1$0 = l1$1; l2$0 = l2$1; } - /*<>*/ } + /*<>*/ } function compare_length_with(l, n){ - /*<>*/ var l$0 = l, n$0 = n; - /*<>*/ for(;;){ + /*<>*/ var l$0 = l, n$0 = n; + /*<>*/ for(;;){ if(! l$0) return 0 === n$0 ? 0 : 0 < n$0 ? -1 : 1; var l$1 = l$0[2]; - /*<>*/ if(0 >= n$0) /*<>*/ return 1; - /*<>*/ /*<>*/ var n$1 = n$0 - 1 | 0; + /*<>*/ if(0 >= n$0) /*<>*/ return 1; + /*<>*/ /*<>*/ var n$1 = n$0 - 1 | 0; l$0 = l$1; n$0 = n$1; } - /*<>*/ } + /*<>*/ } function is_empty(param){ - /*<>*/ return param ? 0 : 1; - /*<>*/ } + /*<>*/ return param ? 0 : 1; + /*<>*/ } function equal(eq, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(l1$0){ if(l2$0){ - /*<>*/ var + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1], - /*<>*/ _d_ = - /*<>*/ caml_call2(eq, a1, a2); - /*<>*/ if(! _d_) /*<>*/ return _d_; + /*<>*/ _d_ = + /*<>*/ caml_call2(eq, a1, a2); + /*<>*/ if(! _d_) /*<>*/ return _d_; l1$0 = l1$1; l2$0 = l2$1; continue; } } - else if(! l2$0) /*<>*/ return 1; - /*<>*/ return 0; + else if(! l2$0) /*<>*/ return 1; + /*<>*/ return 0; } - /*<>*/ } + /*<>*/ } function compare(cmp, l1, l2){ - /*<>*/ var l1$0 = l1, l2$0 = l2; - /*<>*/ for(;;){ + /*<>*/ var l1$0 = l1, l2$0 = l2; + /*<>*/ for(;;){ if(! l1$0) return l2$0 ? -1 : 0; var l1$1 = l1$0[2], a1 = l1$0[1]; - if(! l2$0) /*<>*/ return 1; - /*<>*/ var + if(! l2$0) /*<>*/ return 1; + /*<>*/ var l2$1 = l2$0[2], a2 = l2$0[1], - /*<>*/ c = - /*<>*/ caml_call2(cmp, a1, a2); - /*<>*/ if(0 !== c) /*<>*/ return c; + /*<>*/ c = + /*<>*/ caml_call2(cmp, a1, a2); + /*<>*/ if(0 !== c) /*<>*/ return c; l1$0 = l1$1; l2$0 = l2$1; } - /*<>*/ } + /*<>*/ } function to_seq(l){ - /*<>*/ function aux(l, param){ - /*<>*/ if(! l) /*<>*/ return 0; + /*<>*/ function aux(l, param){ + /*<>*/ if(! l) /*<>*/ return 0; var tail = l[2], x = l[1]; - /*<>*/ return [0, + /*<>*/ return [0, x, function(_c_){ /*<>*/ return aux(tail, _c_);}]; - /*<>*/ } - /*<>*/ return function(_b_){ + /*<>*/ } + /*<>*/ return function(_b_){ /*<>*/ return aux(l, _b_);}; - /*<>*/ } + /*<>*/ } function of_seq(seq){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(seq, 0); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(seq, 0); + if(! match) /*<>*/ return 0; + /*<>*/ var seq$0 = match[2], x1 = match[1], - /*<>*/ match$0 = - /*<>*/ caml_call1(seq$0, 0); - if(! match$0) /*<>*/ return [0, x1, 0]; - /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call1(seq$0, 0); + if(! match$0) /*<>*/ return [0, x1, 0]; + /*<>*/ var seq$1 = match$0[2], x2 = match$0[1], - /*<>*/ block = [0, x2, 24029], + /*<>*/ block = [0, x2, 24029], dst = block, offset = 1, seq$2 = seq$1; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match$1 = /*<>*/ caml_call1(seq$2, 0); + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match$1 = /*<>*/ caml_call1(seq$2, 0); if(match$1){ - /*<>*/ var + /*<>*/ var seq$3 = match$1[2], x1$0 = match$1[1], - /*<>*/ match$2 = - /*<>*/ caml_call1(seq$3, 0); + /*<>*/ match$2 = + /*<>*/ caml_call1(seq$3, 0); if(match$2){ - /*<>*/ var + /*<>*/ var seq$4 = match$2[2], x2$0 = match$2[1], - /*<>*/ dst$0 = [0, x2$0, 24029]; + /*<>*/ dst$0 = [0, x2$0, 24029]; dst[1 + offset] = [0, x1$0, dst$0]; dst = dst$0; offset = 1; @@ -4712,9 +4809,9 @@ } else dst[1 + offset] = 0; - /*<>*/ return [0, x1, block]; + /*<>*/ return [0, x1, block]; } - /*<>*/ } + /*<>*/ } var Stdlib_List = [0, @@ -4764,6 +4861,10 @@ find_all, find_all, filteri, + take, + drop, + take_while, + drop_while, partition, partition_map, assoc, @@ -4783,7 +4884,7 @@ merge, to_seq, of_seq]; - runtime.caml_register_global(17, Stdlib_List, "Stdlib__List"); + runtime.caml_register_global(19, Stdlib_List, "Stdlib__List"); return; /*<>*/ } (globalThis)); @@ -5759,7 +5860,7 @@ var set_uint8 = caml_bytes_set, set_uint16_ne = caml_bytes_set16, - dec_invalid = Stdlib_Uchar[22], + dec_invalid = Stdlib_Uchar[23], _a_ = [0, cst_bytes_ml, 679, 9], _b_ = [0, cst_bytes_ml, 654, 20], cst_index_out_of_bounds = cst_index_out_of_bounds$3, @@ -5774,7 +5875,7 @@ /*<>*/ /*<>*/ var _l_ = /*<>*/ caml_call1(Stdlib_Uchar[9], u); /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Uchar[21], n, _l_); + (Stdlib_Uchar[22], n, _l_); /*<>*/ } function not_in_x80_to_xBF(b){ /*<>*/ return 2 !== (b >>> 6 | 0) ? 1 : 0; @@ -7126,15 +7227,15 @@ (globalThis)); //# unitInfo: Provides: Stdlib__Array -//# unitInfo: Requires: Stdlib, Stdlib__Seq +//# unitInfo: Requires: Stdlib, Stdlib__Seq, Stdlib__String (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_array_sub = runtime.caml_array_sub, caml_check_bound = runtime.caml_check_bound, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ @@ -7154,9 +7255,11 @@ } /*<>*/ var global_data = runtime.caml_get_global_data(), + cst = "", Stdlib_Seq = global_data.Stdlib__Seq, - Assert_failure = global_data.Assert_failure, Stdlib = global_data.Stdlib, + Stdlib_String = global_data.Stdlib__String, + Assert_failure = global_data.Assert_failure, /*<>*/ Floatarray = [0], cst_Array_init = "Array.init", cst_Array_make_matrix = "Array.make_matrix", @@ -7178,18 +7281,18 @@ (Stdlib[1], cst_Array_init); /*<>*/ var /*<>*/ res = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make (l, /*<>*/ caml_call1(f, 0)), - /*<>*/ _aE_ = l - 1 | 0, - /*<>*/ _aD_ = 1; - if(_aE_ >= 1){ - var i = _aD_; + /*<>*/ _aL_ = l - 1 | 0, + /*<>*/ _aK_ = 1; + if(_aL_ >= 1){ + var i = _aK_; for(;;){ /*<>*/ res[1 + i] = /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _aF_ = i + 1 | 0; - if(_aE_ === i) break; - i = _aF_; + /*<>*/ /*<>*/ var _aM_ = i + 1 | 0; + if(_aL_ === i) break; + i = _aM_; } } /*<>*/ return res; @@ -7199,18 +7302,18 @@ /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Array_make_matrix); /*<>*/ /*<>*/ var - res = /*<>*/ caml_make_vect(sx, [0]); + res = /*<>*/ caml_array_make(sx, [0]); if(0 < sy){ /*<>*/ var - _aB_ = sx - 1 | 0, - /*<>*/ _aA_ = 0; - if(_aB_ >= 0){ - var x = _aA_; + _aI_ = sx - 1 | 0, + /*<>*/ _aH_ = 0; + if(_aI_ >= 0){ + var x = _aH_; for(;;){ - res[1 + x] = /*<>*/ caml_make_vect(sy, init); - /*<>*/ /*<>*/ var _aC_ = x + 1 | 0; - if(_aB_ === x) break; - x = _aC_; + res[1 + x] = /*<>*/ caml_array_make(sy, init); + /*<>*/ /*<>*/ var _aJ_ = x + 1 | 0; + if(_aI_ === x) break; + x = _aJ_; } } } @@ -7221,34 +7324,34 @@ /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Array_init_matrix); /*<>*/ /*<>*/ var - res = /*<>*/ caml_make_vect(sx, [0]); + res = /*<>*/ caml_array_make(sx, [0]); if(0 < sy){ /*<>*/ var - _av_ = sx - 1 | 0, - /*<>*/ _au_ = 0; - if(_av_ >= 0){ - var x = _au_; + _aC_ = sx - 1 | 0, + /*<>*/ _aB_ = 0; + if(_aC_ >= 0){ + var x = _aB_; for(;;){ /*<>*/ var /*<>*/ row = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make (sy, /*<>*/ caml_call2(f, x, 0)), - /*<>*/ _ax_ = sy - 1 | 0, - /*<>*/ _aw_ = 1; - if(_ax_ >= 1){ - var y = _aw_; + /*<>*/ _aE_ = sy - 1 | 0, + /*<>*/ _aD_ = 1; + if(_aE_ >= 1){ + var y = _aD_; for(;;){ /*<>*/ row[1 + y] = /*<>*/ caml_call2(f, x, y); - /*<>*/ /*<>*/ var _az_ = y + 1 | 0; - if(_ax_ === y) break; - y = _az_; + /*<>*/ /*<>*/ var _aG_ = y + 1 | 0; + if(_aE_ === y) break; + y = _aG_; } } res[1 + x] = row; - /*<>*/ /*<>*/ var _ay_ = x + 1 | 0; - if(_av_ === x) break; - x = _ay_; + /*<>*/ /*<>*/ var _aF_ = x + 1 | 0; + if(_aC_ === x) break; + x = _aF_; } } } @@ -7300,16 +7403,16 @@ /*<>*/ } function iter(f, a){ /*<>*/ var - _as_ = a.length - 2 | 0, - /*<>*/ _ar_ = 0; - if(_as_ >= 0){ - var i = _ar_; + _az_ = a.length - 2 | 0, + /*<>*/ _ay_ = 0; + if(_az_ >= 0){ + var i = _ay_; for(;;){ /*<>*/ /*<>*/ caml_call1 (f, a[1 + i]); - /*<>*/ /*<>*/ var _at_ = i + 1 | 0; - if(_as_ === i) break; - i = _at_; + /*<>*/ /*<>*/ var _aA_ = i + 1 | 0; + if(_az_ === i) break; + i = _aA_; } } return 0; @@ -7319,16 +7422,16 @@ /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_iter2_arrays_must_ha); /*<>*/ var - _ap_ = a.length - 2 | 0, - /*<>*/ _ao_ = 0; - if(_ap_ >= 0){ - var i = _ao_; + _aw_ = a.length - 2 | 0, + /*<>*/ _av_ = 0; + if(_aw_ >= 0){ + var i = _av_; for(;;){ /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; - if(_ap_ === i) break; - i = _aq_; + /*<>*/ /*<>*/ var _ax_ = i + 1 | 0; + if(_aw_ === i) break; + i = _ax_; } } return 0; @@ -7338,50 +7441,50 @@ /*<>*/ if(0 === l) /*<>*/ return [0]; /*<>*/ var /*<>*/ r = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _am_ = l - 1 | 0, - /*<>*/ _al_ = 1; - if(_am_ >= 1){ - var i = _al_; + /*<>*/ _at_ = l - 1 | 0, + /*<>*/ _as_ = 1; + if(_at_ >= 1){ + var i = _as_; for(;;){ /*<>*/ r[1 + i] = /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _an_ = i + 1 | 0; - if(_am_ === i) break; - i = _an_; + /*<>*/ /*<>*/ var _au_ = i + 1 | 0; + if(_at_ === i) break; + i = _au_; } } /*<>*/ return r; /*<>*/ } function map_inplace(f, a){ /*<>*/ var - _aj_ = a.length - 2 | 0, - /*<>*/ _ai_ = 0; - if(_aj_ >= 0){ - var i = _ai_; + _aq_ = a.length - 2 | 0, + /*<>*/ _ap_ = 0; + if(_aq_ >= 0){ + var i = _ap_; for(;;){ /*<>*/ a[1 + i] = /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; - if(_aj_ === i) break; - i = _ak_; + /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; + if(_aq_ === i) break; + i = _ar_; } } return 0; /*<>*/ } function mapi_inplace(f, a){ /*<>*/ var - _ag_ = a.length - 2 | 0, - /*<>*/ _af_ = 0; - if(_ag_ >= 0){ - var i = _af_; + _an_ = a.length - 2 | 0, + /*<>*/ _am_ = 0; + if(_an_ >= 0){ + var i = _am_; for(;;){ /*<>*/ a[1 + i] = /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; - if(_ag_ === i) break; - i = _ah_; + /*<>*/ /*<>*/ var _ao_ = i + 1 | 0; + if(_an_ === i) break; + i = _ao_; } } return 0; @@ -7396,34 +7499,34 @@ if(0 === la) /*<>*/ return [0]; /*<>*/ var /*<>*/ r = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make (la, /*<>*/ caml_call2(f, a[1], b[1])), - /*<>*/ _ad_ = la - 1 | 0, - /*<>*/ _ac_ = 1; - if(_ad_ >= 1){ - var i = _ac_; + /*<>*/ _ak_ = la - 1 | 0, + /*<>*/ _aj_ = 1; + if(_ak_ >= 1){ + var i = _aj_; for(;;){ /*<>*/ r[1 + i] = /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; - if(_ad_ === i) break; - i = _ae_; + /*<>*/ /*<>*/ var _al_ = i + 1 | 0; + if(_ak_ === i) break; + i = _al_; } } /*<>*/ return r; /*<>*/ } function iteri(f, a){ /*<>*/ var - _aa_ = a.length - 2 | 0, - /*<>*/ _$_ = 0; - if(_aa_ >= 0){ - var i = _$_; + _ah_ = a.length - 2 | 0, + /*<>*/ _ag_ = 0; + if(_ah_ >= 0){ + var i = _ag_; for(;;){ /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; - if(_aa_ === i) break; - i = _ab_; + /*<>*/ /*<>*/ var _ai_ = i + 1 | 0; + if(_ah_ === i) break; + i = _ai_; } } return 0; @@ -7433,18 +7536,18 @@ /*<>*/ if(0 === l) /*<>*/ return [0]; /*<>*/ var /*<>*/ r = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make (l, /*<>*/ caml_call2(f, 0, a[1])), - /*<>*/ _Z_ = l - 1 | 0, - /*<>*/ _Y_ = 1; - if(_Z_ >= 1){ - var i = _Y_; + /*<>*/ _ae_ = l - 1 | 0, + /*<>*/ _ad_ = 1; + if(_ae_ >= 1){ + var i = _ad_; for(;;){ /*<>*/ r[1 + i] = /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var ___ = i + 1 | 0; - if(_Z_ === i) break; - i = ___; + /*<>*/ /*<>*/ var _af_ = i + 1 | 0; + if(_ae_ === i) break; + i = _af_; } } /*<>*/ return r; @@ -7477,7 +7580,7 @@ tl = l[2], hd = l[1], /*<>*/ a = - /*<>*/ caml_make_vect(list_length(0, l), hd), + /*<>*/ caml_array_make(list_length(0, l), hd), i = 1, param = tl; for(;;){ @@ -7492,15 +7595,15 @@ function fold_left(f, x, a){ /*<>*/ var /*<>*/ r = [0, x], - _W_ = a.length - 2 | 0, - /*<>*/ _V_ = 0; - if(_W_ >= 0){ - var i = _V_; + _ab_ = a.length - 2 | 0, + /*<>*/ _aa_ = 0; + if(_ab_ >= 0){ + var i = _aa_; for(;;){ r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _X_ = i + 1 | 0; - if(_W_ === i) break; - i = _X_; + /*<>*/ /*<>*/ var _ac_ = i + 1 | 0; + if(_ab_ === i) break; + i = _ac_; } } return r[1]; @@ -7515,12 +7618,12 @@ elt = match[2], acc$0 = match[1], /*<>*/ output_array = - /*<>*/ caml_make_vect(len, elt), + /*<>*/ caml_array_make(len, elt), /*<>*/ acc$1 = [0, acc$0], - /*<>*/ _T_ = len - 1 | 0, - /*<>*/ _S_ = 1; - if(_T_ >= 1){ - var i = _S_; + /*<>*/ ___ = len - 1 | 0, + /*<>*/ _Z_ = 1; + if(___ >= 1){ + var i = _Z_; for(;;){ /*<>*/ var /*<>*/ match$0 = @@ -7529,9 +7632,9 @@ acc$2 = match$0[1]; acc$1[1] = acc$2; /*<>*/ output_array[1 + i] = elt$0; - /*<>*/ /*<>*/ var _U_ = i + 1 | 0; - if(_T_ === i) break; - i = _U_; + /*<>*/ /*<>*/ var _$_ = i + 1 | 0; + if(___ === i) break; + i = _$_; } } /*<>*/ return [0, acc$1[1], output_array]; @@ -7539,14 +7642,14 @@ function fold_right(f, a, x){ /*<>*/ var /*<>*/ r = [0, x], - /*<>*/ _Q_ = a.length - 2 | 0; - if(_Q_ >= 0){ - var i = _Q_; + /*<>*/ _X_ = a.length - 2 | 0; + if(_X_ >= 0){ + var i = _X_; for(;;){ r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _R_ = i - 1 | 0; + /*<>*/ /*<>*/ var _Y_ = i - 1 | 0; if(0 === i) break; - i = _R_; + i = _Y_; } } return r[1]; @@ -7677,20 +7780,20 @@ a0 = match[1], /*<>*/ n = x.length - 1, /*<>*/ a = - /*<>*/ caml_make_vect(n, a0), + /*<>*/ caml_array_make(n, a0), /*<>*/ b = - /*<>*/ caml_make_vect(n, b0), - /*<>*/ _O_ = n - 1 | 0, - /*<>*/ _N_ = 1; - if(_O_ >= 1){ - var i = _N_; + /*<>*/ caml_array_make(n, b0), + /*<>*/ _V_ = n - 1 | 0, + /*<>*/ _U_ = 1; + if(_V_ >= 1){ + var i = _U_; for(;;){ var match$0 = x[1 + i], bi = match$0[2], ai = match$0[1]; /*<>*/ a[1 + i] = ai; /*<>*/ b[1 + i] = bi; - /*<>*/ /*<>*/ var _P_ = i + 1 | 0; - if(_O_ === i) break; - i = _P_; + /*<>*/ /*<>*/ var _W_ = i + 1 | 0; + if(_V_ === i) break; + i = _W_; } } /*<>*/ return [0, a, b]; @@ -7705,16 +7808,16 @@ if(0 === na) /*<>*/ return [0]; /*<>*/ var /*<>*/ x = - /*<>*/ caml_make_vect(na, [0, a[1], b[1]]), - /*<>*/ _L_ = na - 1 | 0, - /*<>*/ _K_ = 1; - if(_L_ >= 1){ - var i = _K_; + /*<>*/ caml_array_make(na, [0, a[1], b[1]]), + /*<>*/ _S_ = na - 1 | 0, + /*<>*/ _R_ = 1; + if(_S_ >= 1){ + var i = _R_; for(;;){ x[1 + i] = [0, a[1 + i], b[1 + i]]; - /*<>*/ /*<>*/ var _M_ = i + 1 | 0; - if(_L_ === i) break; - i = _M_; + /*<>*/ /*<>*/ var _T_ = i + 1 | 0; + if(_S_ === i) break; + i = _T_; } } /*<>*/ return x; @@ -7722,7 +7825,11 @@ /*<>*/ var /*<>*/ Bottom = [248, "Stdlib.Array.Bottom", runtime.caml_fresh_oo_id(0)], - _a_ = [0, "array.ml", 369, 4]; + _a_ = [0, "array.ml", 369, 4], + _b_ = [0, "]", 0], + cst_out_of_expected_range_0 = ", out of expected range [0; ", + cst_returned = "' returned ", + cst_Array_shuffle_rand = "Array.shuffle: 'rand "; function sort(cmp, a){ function maxson(l, i){ /*<>*/ var @@ -7730,42 +7837,42 @@ /*<>*/ x = [0, i31]; if((i31 + 2 | 0) < l){ /*<>*/ var - /*<>*/ _D_ = i31 + 1 | 0, - /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_]; + /*<>*/ _K_ = i31 + 1 | 0, + /*<>*/ _L_ = caml_check_bound(a, _K_)[1 + _K_]; if ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _E_) + (cmp, caml_check_bound(a, i31)[1 + i31], _L_) < 0) x[1] = i31 + 1 | 0; /*<>*/ var - /*<>*/ _F_ = i31 + 2 | 0, - /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_], - _H_ = x[1]; + /*<>*/ _M_ = i31 + 2 | 0, + /*<>*/ _N_ = caml_check_bound(a, _M_)[1 + _M_], + _O_ = x[1]; if ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, _H_)[1 + _H_], _G_) + (cmp, caml_check_bound(a, _O_)[1 + _O_], _N_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ /*<>*/ var - _I_ = i31 + 1 | 0, - /*<>*/ _J_ = caml_check_bound(a, _I_)[1 + _I_]; + _P_ = i31 + 1 | 0, + /*<>*/ _Q_ = caml_check_bound(a, _P_)[1 + _P_]; /*<>*/ if (0 > /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _J_)) + (cmp, caml_check_bound(a, i31)[1 + i31], _Q_)) /*<>*/ return i31 + 1 | 0; } if(i31 < l) /*<>*/ return i31; /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Bottom, i], 1); /*<>*/ } - var l = a.length - 1, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_x_ >= 0){ - var i$6 = _x_; + var l = a.length - 1, _E_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_E_ >= 0){ + var i$6 = _E_; for(;;){ /*<>*/ /*<>*/ var e$1 = caml_check_bound(a, i$6)[1 + i$6]; @@ -7781,8 +7888,8 @@ (cmp, caml_check_bound(a, j)[1 + j], e$1)) break; /*<>*/ /*<>*/ var - _u_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _u_; + _B_ = caml_check_bound(a, j)[1 + j]; + /*<>*/ caml_check_bound(a, i)[1 + i] = _B_; i = j; } /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; @@ -7793,14 +7900,14 @@ var i$0 = exn[2]; /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; } - /*<>*/ /*<>*/ var _C_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _J_ = i$6 - 1 | 0; if(0 === i$6) break; - i$6 = _C_; + i$6 = _J_; } } - /*<>*/ /*<>*/ var _y_ = l - 1 | 0; - if(_y_ >= 2){ - var i$4 = _y_; + /*<>*/ /*<>*/ var _F_ = l - 1 | 0; + if(_F_ >= 2){ + var i$4 = _F_; for(;;){ /*<>*/ /*<>*/ var e$0 = caml_check_bound(a, i$4)[1 + i$4]; @@ -7811,8 +7918,8 @@ /*<>*/ for(;;){ /*<>*/ var /*<>*/ j$0 = maxson(i$4, i$1), - /*<>*/ _v_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _v_; + /*<>*/ _C_ = caml_check_bound(a, j$0)[1 + j$0]; + /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _C_; i$1 = j$0; } } @@ -7837,8 +7944,8 @@ (cmp, caml_check_bound(a, father)[1 + father], e$0)) break; /*<>*/ /*<>*/ var - _w_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _w_; + _D_ = caml_check_bound(a, father)[1 + father]; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _D_; if(0 >= father) break b; i$3 = father; } @@ -7847,23 +7954,23 @@ } /*<>*/ caml_check_bound(a, 0)[1] = e$0; } - /*<>*/ /*<>*/ var _B_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _I_ = i$4 - 1 | 0; if(2 === i$4) break; - i$4 = _B_; + i$4 = _I_; } } } - var _z_ = 1 < l ? 1 : 0; - if(_z_){ + var _G_ = 1 < l ? 1 : 0; + if(_G_){ /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; /*<>*/ a[2] = caml_check_bound(a, 0)[1]; /*<>*/ a[1] = e; - var _A_ = 0; + var _H_ = 0; } else - var _A_ = _z_; - /*<>*/ return _A_; + var _H_ = _G_; + /*<>*/ return _H_; /*<>*/ } function stable_sort(cmp, a){ function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){ @@ -7907,36 +8014,36 @@ /*<>*/ } function isortto(srcofs, dst, dstofs, len){ /*<>*/ var - _m_ = len - 1 | 0, - /*<>*/ _l_ = 0; - if(_m_ >= 0){ - var i = _l_; + _t_ = len - 1 | 0, + /*<>*/ _s_ = 0; + if(_t_ >= 0){ + var i = _s_; for(;;){ /*<>*/ var - _n_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _n_)[1 + _n_], + _u_ = srcofs + i | 0, + /*<>*/ e = caml_check_bound(a, _u_)[1 + _u_], /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ if(dstofs > j[1]) break; - var _o_ = j[1]; + var _v_ = j[1]; /*<>*/ if (0 >= /*<>*/ caml_call2 - (cmp, caml_check_bound(dst, _o_)[1 + _o_], e)) + (cmp, caml_check_bound(dst, _v_)[1 + _v_], e)) break; /*<>*/ var - _p_ = j[1], - /*<>*/ _q_ = caml_check_bound(dst, _p_)[1 + _p_], - _r_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _r_)[1 + _r_] = _q_; + _w_ = j[1], + /*<>*/ _x_ = caml_check_bound(dst, _w_)[1 + _w_], + _y_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _y_)[1 + _y_] = _x_; j[1]--; } - var _s_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _s_)[1 + _s_] = e; - /*<>*/ /*<>*/ var _t_ = i + 1 | 0; - if(_m_ === i) break; - i = _t_; + var _z_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _z_)[1 + _z_] = e; + /*<>*/ /*<>*/ var _A_ = i + 1 | 0; + if(_t_ === i) break; + i = _A_; } } return 0; @@ -7956,88 +8063,110 @@ l1 = l / 2 | 0, l2 = l - l1 | 0, /*<>*/ t = - /*<>*/ caml_make_vect(l2, caml_check_bound(a, 0)[1]); + /*<>*/ caml_array_make(l2, caml_check_bound(a, 0)[1]); /*<>*/ sortto(l1, t, 0, l2); /*<>*/ sortto(0, a, l2, l1); /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); /*<>*/ } function shuffle(rand, a){ - /*<>*/ var _j_ = a.length - 2 | 0; - if(_j_ >= 1){ - var i = _j_; + /*<>*/ var _o_ = a.length - 2 | 0; + if(_o_ >= 1){ + var i = _o_; for(;;){ - /*<>*/ var - /*<>*/ j = - /*<>*/ caml_call1(rand, i + 1 | 0), - /*<>*/ v = a[1 + i]; - /*<>*/ a[1 + i] = caml_check_bound(a, j)[1 + j]; - /*<>*/ a[1 + j] = v; - var _k_ = i - 1 | 0; + /*<>*/ var + /*<>*/ j = + /*<>*/ caml_call1(rand, i + 1 | 0), + _p_ = 0 <= j ? 1 : 0, + _q_ = _p_ ? j <= i ? 1 : 0 : _p_; + if(1 - _q_){ + /*<>*/ var + /*<>*/ int$0 = Stdlib[33], + _k_ = + [0, + cst_out_of_expected_range_0, + [0, /*<>*/ caml_call1(int$0, i), _b_]], + _l_ = + [0, + cst_returned, + [0, /*<>*/ caml_call1(int$0, j), _k_]], + /*<>*/ _m_ = + [0, + cst_Array_shuffle_rand, + [0, /*<>*/ caml_call1(int$0, i + 1 | 0), _l_]], + /*<>*/ _n_ = + /*<>*/ caml_call2(Stdlib_String[7], cst, _m_); + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], _n_); + } + /*<>*/ /*<>*/ var v = a[1 + i]; + /*<>*/ a[1 + i] = a[1 + j]; + /*<>*/ a[1 + j] = v; + var _r_ = i - 1 | 0; if(1 === i) break; - i = _k_; + i = _r_; } } return 0; - /*<>*/ } + /*<>*/ } function to_seq(a){ - function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _h_ = i + 1 | 0; - /*<>*/ return [0, - x, - function(_i_){ /*<>*/ return aux(_h_, _i_);}]; - /*<>*/ } - /*<>*/ var _f_ = 0; - /*<>*/ return function(_g_){ - /*<>*/ return aux(_f_, _g_);}; - /*<>*/ } - function to_seqi(a){ function aux(i, param){ /*<>*/ if(i >= a.length - 1) /*<>*/ return 0; /*<>*/ var /*<>*/ x = a[1 + i], - /*<>*/ _d_ = i + 1 | 0; + /*<>*/ _i_ = i + 1 | 0; /*<>*/ return [0, - [0, i, x], - function(_e_){ /*<>*/ return aux(_d_, _e_);}]; + x, + function(_j_){ /*<>*/ return aux(_i_, _j_);}]; /*<>*/ } - /*<>*/ var _b_ = 0; - /*<>*/ return function(_c_){ - /*<>*/ return aux(_b_, _c_);}; + /*<>*/ var _g_ = 0; + /*<>*/ return function(_h_){ + /*<>*/ return aux(_g_, _h_);}; /*<>*/ } + function to_seqi(a){ + function aux(i, param){ + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _e_ = i + 1 | 0; + /*<>*/ return [0, + [0, i, x], + function(_f_){ /*<>*/ return aux(_e_, _f_);}]; + /*<>*/ } + /*<>*/ var _c_ = 0; + /*<>*/ return function(_d_){ + /*<>*/ return aux(_c_, _d_);}; + /*<>*/ } function of_seq(i$2){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var l = - /*<>*/ caml_call3 + /*<>*/ caml_call3 (Stdlib_Seq[5], function(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ }, + /*<>*/ return [0, x, acc]; + /*<>*/ }, 0, i$2); - if(! l) /*<>*/ return [0]; - /*<>*/ var + if(! l) /*<>*/ return [0]; + /*<>*/ var tl = l[2], hd = l[1], - /*<>*/ len = list_length(0, l), - /*<>*/ a = - /*<>*/ caml_make_vect(len, hd), - /*<>*/ i$1 = len - 2 | 0, + /*<>*/ len = list_length(0, l), + /*<>*/ a = + /*<>*/ caml_array_make(len, hd), + /*<>*/ i$1 = len - 2 | 0, i = i$1, param = tl; for(;;){ - if(! param) /*<>*/ return a; + if(! param) /*<>*/ return a; var tl$0 = param[2], hd$0 = param[1]; - /*<>*/ a[1 + i] = hd$0; - /*<>*/ /*<>*/ var i$0 = i - 1 | 0; + /*<>*/ a[1 + i] = hd$0; + /*<>*/ /*<>*/ var i$0 = i - 1 | 0; i = i$0; param = tl$0; } - /*<>*/ } + /*<>*/ } var Stdlib_Array = [0, @@ -8083,7 +8212,7 @@ to_seqi, of_seq, Floatarray]; - runtime.caml_register_global(16, Stdlib_Array, "Stdlib__Array"); + runtime.caml_register_global(22, Stdlib_Array, "Stdlib__Array"); return; /*<>*/ } (globalThis)); @@ -8097,12 +8226,14 @@ runtime = globalThis.jsoo_runtime, cst_Float_array_blit$1 = "Float.array.blit", cst_float_ml = "float.ml", + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, caml_float_compare = runtime.caml_float_compare, caml_floatarray_blit = runtime.caml_floatarray_blit, caml_floatarray_create = runtime.caml_floatarray_create, + caml_floatarray_make = runtime.caml_floatarray_make, + caml_floatarray_sub = runtime.caml_floatarray_sub, caml_hash = runtime.caml_hash, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_nextafter_float = runtime.caml_nextafter_float, caml_signbit_float = runtime.caml_signbit_float, @@ -8148,24 +8279,11 @@ min_float = Stdlib[26], epsilon = Stdlib[27], of_string_opt = Stdlib[36], - to_string = Stdlib[35], - cst_Float_Array_init = "Float.Array.init", - cst_Float_Array_make_matrix = "Float.Array.make_matrix", - cst_Float_Array_init_matrix = "Float.Array.init_matrix", - cst_Float_Array_concat = "Float.Array.concat", - _a_ = [0, cst_float_ml, 254, 14], - cst_Float_Array_sub = "Float.Array.sub", - cst_Float_Array_fill = "Float.Array.fill", - cst_Float_array_blit = cst_Float_array_blit$1, - cst_Float_array_blit$0 = cst_Float_array_blit$1, - cst_Float_Array_iter2_arrays_m = - "Float.Array.iter2: arrays must have the same length", - cst_Float_Array_map2_arrays_mu = - "Float.Array.map2: arrays must have the same length"; + to_string = Stdlib[35]; function is_integer(x){ /*<>*/ var - _aX_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; - return _aX_ ? is_finite(x) : _aX_; + _aV_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; + return _aV_ ? is_finite(x) : _aV_; /*<>*/ } function succ(x){ /*<>*/ return /*<>*/ caml_nextafter_float @@ -8265,21 +8383,8 @@ /*<>*/ return /*<>*/ caml_hash (10, 100, 0, x); /*<>*/ } - function unsafe_fill(a, ofs, len, v){ - /*<>*/ var _aV_ = (ofs + len | 0) - 1 | 0; - if(_aV_ >= ofs){ - var i = ofs; - for(;;){ - /*<>*/ a[1 + i] = v; - /*<>*/ /*<>*/ var _aW_ = i + 1 | 0; - if(_aV_ === i) break; - i = _aW_; - } - } - return 0; - /*<>*/ } function check(a, ofs, len, msg){ - /*<>*/ var _aR_ = ofs < 0 ? 1 : 0; + /*<>*/ var _aR_ = ofs < 0 ? 1 : 0; if(_aR_) var _aS_ = _aR_; else{ @@ -8291,113 +8396,112 @@ _aU_ = (ofs + len | 0) < 0 ? 1 : 0, _aS_ = _aU_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); } - return _aS_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _aS_; - /*<>*/ } - function make(n, v){ - /*<>*/ /*<>*/ var - result = /*<>*/ caml_floatarray_create(n); - /*<>*/ unsafe_fill(result, 0, n, v); - /*<>*/ return result; - /*<>*/ } + return _aS_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _aS_; + /*<>*/ } + /*<>*/ var + /*<>*/ empty = + /*<>*/ caml_floatarray_create(0), + cst_Float_Array_init = "Float.Array.init", + cst_Float_Array_make_matrix = "Float.Array.make_matrix", + cst_Float_Array_init_matrix = "Float.Array.init_matrix", + cst_Float_Array_concat = "Float.Array.concat", + _a_ = [0, cst_float_ml, 250, 14], + cst_Float_Array_sub = "Float.Array.sub", + cst_Float_Array_fill = "Float.Array.fill", + cst_Float_array_blit = cst_Float_array_blit$1, + cst_Float_array_blit$0 = cst_Float_array_blit$1, + cst_Float_Array_iter2_arrays_m = + "Float.Array.iter2: arrays must have the same length", + cst_Float_Array_map2_arrays_mu = + "Float.Array.map2: arrays must have the same length"; function init(l, f){ - /*<>*/ if(0 > l) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 > l) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_init); - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _aP_ = l - 1 | 0, - /*<>*/ _aO_ = 0; + /*<>*/ var + /*<>*/ res = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _aP_ = l - 1 | 0, + /*<>*/ _aO_ = 0; if(_aP_ >= 0){ var i = _aO_; for(;;){ - /*<>*/ res[1 + i] = - /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _aQ_ = i + 1 | 0; + /*<>*/ res[1 + i] = + /*<>*/ caml_call1(f, i); + /*<>*/ /*<>*/ var _aQ_ = i + 1 | 0; if(_aP_ === i) break; i = _aQ_; } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function make_matrix(sx, sy, v){ - /*<>*/ if(sy < 0) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_make_matrix); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var res = - /*<>*/ caml_make_vect - (sx, /*<>*/ caml_floatarray_create(0)); + /*<>*/ caml_array_make + (sx, /*<>*/ caml_floatarray_create(0)); if(0 < sy){ - /*<>*/ var + /*<>*/ var _aM_ = sx - 1 | 0, - /*<>*/ _aL_ = 0; + /*<>*/ _aL_ = 0; if(_aM_ >= 0){ var x = _aL_; for(;;){ - /*<>*/ res[1 + x] = make(sy, v); - /*<>*/ /*<>*/ var _aN_ = x + 1 | 0; + /*<>*/ res[1 + x] = + /*<>*/ caml_floatarray_make(sy, v); + /*<>*/ /*<>*/ var _aN_ = x + 1 | 0; if(_aM_ === x) break; x = _aN_; } } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function init_matrix(sx, sy, f){ - /*<>*/ if(sy < 0) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_init_matrix); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var res = - /*<>*/ caml_make_vect - (sx, /*<>*/ caml_floatarray_create(0)); + /*<>*/ caml_array_make + (sx, /*<>*/ caml_floatarray_create(0)); if(0 < sy){ - /*<>*/ var + /*<>*/ var _aG_ = sx - 1 | 0, - /*<>*/ _aF_ = 0; + /*<>*/ _aF_ = 0; if(_aG_ >= 0){ var x = _aF_; for(;;){ - /*<>*/ var - /*<>*/ row = - /*<>*/ caml_floatarray_create(sy), - /*<>*/ _aI_ = sy - 1 | 0, - /*<>*/ _aH_ = 0; + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_floatarray_create(sy), + /*<>*/ _aI_ = sy - 1 | 0, + /*<>*/ _aH_ = 0; if(_aI_ >= 0){ var y = _aH_; for(;;){ - /*<>*/ row[1 + y] = - /*<>*/ caml_call2(f, x, y); - /*<>*/ /*<>*/ var + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var _aK_ = y + 1 | 0; if(_aI_ === y) break; y = _aK_; } } - /*<>*/ res[1 + x] = row; - /*<>*/ /*<>*/ var _aJ_ = x + 1 | 0; + /*<>*/ res[1 + x] = row; + /*<>*/ /*<>*/ var _aJ_ = x + 1 | 0; if(_aG_ === x) break; x = _aJ_; } } } - /*<>*/ return res; - /*<>*/ } - function append(a1, a2){ - /*<>*/ var - l1 = a1.length - 1, - /*<>*/ l2 = a2.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l1 + l2 | 0); - /*<>*/ /*<>*/ caml_floatarray_blit - (a1, 0, result, 0, l1); - /*<>*/ /*<>*/ caml_floatarray_blit - (a2, 0, result, l1, l2); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function concat(l){ - /*<>*/ var acc = 0, param = l; + /*<>*/ var acc = 0, param = l; for(;;){ if(! param) break; var @@ -8407,437 +8511,441 @@ acc$0 = acc <= x ? x - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_concat); acc = acc$0; param = tl; } - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_floatarray_create(acc), + /*<>*/ var + /*<>*/ result = + /*<>*/ caml_floatarray_create(acc), l$0 = l, i = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! l$0){ - if(i === acc) /*<>*/ return result; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(i === acc) /*<>*/ return result; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); } - /*<>*/ var + /*<>*/ var tl$0 = l$0[2], hd$0 = l$0[1], - /*<>*/ hlen = hd$0.length - 1; - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ hlen = hd$0.length - 1; + /*<>*/ /*<>*/ caml_floatarray_blit (hd$0, 0, result, i, hlen); var i$0 = i + hlen | 0; l$0 = tl$0; i = i$0; } - /*<>*/ } + /*<>*/ } function sub(a, ofs, len){ - /*<>*/ check(a, ofs, len, cst_Float_Array_sub); - /*<>*/ /*<>*/ var - result = /*<>*/ caml_floatarray_create(len); - /*<>*/ /*<>*/ caml_floatarray_blit - (a, ofs, result, 0, len); - /*<>*/ return result; - /*<>*/ } + /*<>*/ check(a, ofs, len, cst_Float_Array_sub); + /*<>*/ return /*<>*/ caml_floatarray_sub + (a, ofs, len); + /*<>*/ } function copy(a){ - /*<>*/ var - l = a.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l); - /*<>*/ /*<>*/ caml_floatarray_blit - (a, 0, result, 0, l); - /*<>*/ return result; - /*<>*/ } + /*<>*/ var l = a.length - 1; + /*<>*/ return 0 === l + ? empty + : /*<>*/ caml_floatarray_sub(a, 0, l); + /*<>*/ } + function append(a1, a2){ + /*<>*/ var l1 = a1.length - 1; + /*<>*/ return 0 === l1 + ? copy(a2) + : 0 + === a2.length - 1 + ? /*<>*/ caml_floatarray_sub(a1, 0, l1) + : /*<>*/ runtime.caml_floatarray_append(a1, a2); + /*<>*/ } function fill(a, ofs, len, v){ - /*<>*/ check(a, ofs, len, cst_Float_Array_fill); - /*<>*/ return unsafe_fill(a, ofs, len, v); - /*<>*/ } + /*<>*/ check(a, ofs, len, cst_Float_Array_fill); + /*<>*/ return /*<>*/ runtime.caml_floatarray_fill + (a, ofs, len, v); + /*<>*/ } function blit(src, sofs, dst, dofs, len){ - /*<>*/ check(src, sofs, len, cst_Float_array_blit); - /*<>*/ check(dst, dofs, len, cst_Float_array_blit$0); - /*<>*/ return /*<>*/ caml_floatarray_blit + /*<>*/ check(src, sofs, len, cst_Float_array_blit); + /*<>*/ check(dst, dofs, len, cst_Float_array_blit$0); + /*<>*/ return /*<>*/ caml_floatarray_blit (src, sofs, dst, dofs, len); - /*<>*/ } + /*<>*/ } function to_list(a){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_List[11], a.length - 1, function(_aE_){ /*<>*/ return a[1 + _aE_];}); - /*<>*/ } + /*<>*/ } function of_list(l){ - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_floatarray_create - ( /*<>*/ caml_call1(Stdlib_List[1], l)), + /*<>*/ var + /*<>*/ result = + /*<>*/ caml_floatarray_create + ( /*<>*/ caml_call1(Stdlib_List[1], l)), i = 0, l$0 = l; - /*<>*/ for(;;){ - if(! l$0) /*<>*/ return result; + /*<>*/ for(;;){ + if(! l$0) /*<>*/ return result; var t = l$0[2], h = l$0[1]; - /*<>*/ result[1 + i] = h; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ result[1 + i] = h; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; l$0 = t; } - /*<>*/ } + /*<>*/ } function iter(f, a){ - /*<>*/ var + /*<>*/ var _aC_ = a.length - 2 | 0, - /*<>*/ _aB_ = 0; + /*<>*/ _aB_ = 0; if(_aC_ >= 0){ var i = _aB_; for(;;){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (f, a[1 + i]); - /*<>*/ /*<>*/ var _aD_ = i + 1 | 0; + /*<>*/ /*<>*/ var _aD_ = i + 1 | 0; if(_aC_ === i) break; i = _aD_; } } return 0; - /*<>*/ } + /*<>*/ } function iter2(f, a, b){ - /*<>*/ if(a.length - 1 !== b.length - 1) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(a.length - 1 !== b.length - 1) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_iter2_arrays_m); - /*<>*/ var + /*<>*/ var _az_ = a.length - 2 | 0, - /*<>*/ _ay_ = 0; + /*<>*/ _ay_ = 0; if(_az_ >= 0){ var i = _ay_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _aA_ = i + 1 | 0; + /*<>*/ /*<>*/ var _aA_ = i + 1 | 0; if(_az_ === i) break; i = _aA_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _aw_ = l - 1 | 0, - /*<>*/ _av_ = 0; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _aw_ = l - 1 | 0, + /*<>*/ _av_ = 0; if(_aw_ >= 0){ var i = _av_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ax_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ax_ = i + 1 | 0; if(_aw_ === i) break; i = _ax_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_inplace(f, a){ - /*<>*/ var + /*<>*/ var _at_ = a.length - 2 | 0, - /*<>*/ _as_ = 0; + /*<>*/ _as_ = 0; if(_at_ >= 0){ var i = _as_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _au_ = i + 1 | 0; + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _au_ = i + 1 | 0; if(_at_ === i) break; i = _au_; } } return 0; - /*<>*/ } + /*<>*/ } function map2(f, a, b){ - /*<>*/ var + /*<>*/ var la = a.length - 1, - /*<>*/ lb = b.length - 1; + /*<>*/ lb = b.length - 1; if(la !== lb) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_map2_arrays_mu); - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_floatarray_create(la), - /*<>*/ _aq_ = la - 1 | 0, - /*<>*/ _ap_ = 0; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_floatarray_create(la), + /*<>*/ _aq_ = la - 1 | 0, + /*<>*/ _ap_ = 0; if(_aq_ >= 0){ var i = _ap_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; if(_aq_ === i) break; i = _ar_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var + /*<>*/ var _an_ = a.length - 2 | 0, - /*<>*/ _am_ = 0; + /*<>*/ _am_ = 0; if(_an_ >= 0){ var i = _am_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ao_ = i + 1 | 0; + /*<>*/ /*<>*/ var _ao_ = i + 1 | 0; if(_an_ === i) break; i = _ao_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _ak_ = l - 1 | 0, - /*<>*/ _aj_ = 0; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _ak_ = l - 1 | 0, + /*<>*/ _aj_ = 0; if(_ak_ >= 0){ var i = _aj_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _al_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _al_ = i + 1 | 0; if(_ak_ === i) break; i = _al_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function mapi_inplace(f, a){ - /*<>*/ var + /*<>*/ var _ah_ = a.length - 2 | 0, - /*<>*/ _ag_ = 0; + /*<>*/ _ag_ = 0; if(_ah_ >= 0){ var i = _ag_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ai_ = i + 1 | 0; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _ai_ = i + 1 | 0; if(_ah_ === i) break; i = _ai_; } } return 0; - /*<>*/ } + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], + /*<>*/ var + /*<>*/ r = [0, x], _ae_ = a.length - 2 | 0, - /*<>*/ _ad_ = 0; + /*<>*/ _ad_ = 0; if(_ae_ >= 0){ var i = _ad_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _af_ = i + 1 | 0; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _af_ = i + 1 | 0; if(_ae_ === i) break; i = _af_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _ab_ = a.length - 2 | 0; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _ab_ = a.length - 2 | 0; if(_ab_ >= 0){ var i = _ab_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _ac_ = i - 1 | 0; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _ac_ = i - 1 | 0; if(0 === i) break; i = _ac_; } } return r[1]; - /*<>*/ } + /*<>*/ } function exists(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 1; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function for_all(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 1; - /*<>*/ if - (! /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return 0; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 1; + /*<>*/ if + (! /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return 0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function mem(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - if(0 === /*<>*/ caml_float_compare(a[1 + i], x)) - /*<>*/ return 1; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + if(0 === /*<>*/ caml_float_compare(a[1 + i], x)) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function mem_ieee(x, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - if(x == a[1 + i]) /*<>*/ return 1; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + if(x == a[1 + i]) /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function find_opt(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ /*<>*/ var x = a[1 + i]; - /*<>*/ if( /*<>*/ caml_call1(p, x)) - /*<>*/ return [0, x]; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var x = a[1 + i]; + /*<>*/ if( /*<>*/ caml_call1(p, x)) + /*<>*/ return [0, x]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function find_index(p, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call1(p, a[1 + i])) - /*<>*/ return [0, i]; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call1(p, a[1 + i])) + /*<>*/ return [0, i]; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function find_map(f, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ /*<>*/ var - r = /*<>*/ caml_call1(f, a[1 + i]); - if(r) /*<>*/ return r; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call1(f, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function find_mapi(f, a){ - /*<>*/ var n = a.length - 1, i = 0; - /*<>*/ for(;;){ - if(i === n) /*<>*/ return 0; - /*<>*/ /*<>*/ var - r = /*<>*/ caml_call2(f, i, a[1 + i]); - if(r) /*<>*/ return r; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ var n = a.length - 1, i = 0; + /*<>*/ for(;;){ + if(i === n) /*<>*/ return 0; + /*<>*/ /*<>*/ var + r = /*<>*/ caml_call2(f, i, a[1 + i]); + if(r) /*<>*/ return r; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } - /*<>*/ var - /*<>*/ Bottom = + /*<>*/ } + /*<>*/ var + /*<>*/ Bottom = [248, "Stdlib.Float.Array.Bottom", runtime.caml_fresh_oo_id(0)], - _b_ = [0, cst_float_ml, 484, 6]; + _b_ = [0, cst_float_ml, 483, 6]; function sort(cmp, a){ function maxson(l, i){ - /*<>*/ var + /*<>*/ var i31 = ((i + i | 0) + i | 0) + 1 | 0, - /*<>*/ x = [0, i31]; + /*<>*/ x = [0, i31]; if((i31 + 2 | 0) < l){ - /*<>*/ var - /*<>*/ _W_ = i31 + 1 | 0, - /*<>*/ _X_ = caml_check_bound(a, _W_)[1 + _W_]; + /*<>*/ var + /*<>*/ _W_ = i31 + 1 | 0, + /*<>*/ _X_ = caml_check_bound(a, _W_)[1 + _W_]; if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, caml_check_bound(a, i31)[1 + i31], _X_) < 0) x[1] = i31 + 1 | 0; - /*<>*/ var - /*<>*/ _Y_ = i31 + 2 | 0, - /*<>*/ _Z_ = caml_check_bound(a, _Y_)[1 + _Y_], + /*<>*/ var + /*<>*/ _Y_ = i31 + 2 | 0, + /*<>*/ _Z_ = caml_check_bound(a, _Y_)[1 + _Y_], ___ = x[1]; if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, caml_check_bound(a, ___)[1 + ___], _Z_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ - /*<>*/ var + /*<>*/ var _$_ = i31 + 1 | 0, - /*<>*/ _aa_ = caml_check_bound(a, _$_)[1 + _$_]; - /*<>*/ if + /*<>*/ _aa_ = caml_check_bound(a, _$_)[1 + _$_]; + /*<>*/ if (0 > - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(a, i31)[1 + i31], _aa_)) - /*<>*/ return i31 + 1 | 0; + /*<>*/ return i31 + 1 | 0; } - if(i31 < l) /*<>*/ return i31; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(i31 < l) /*<>*/ return i31; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Bottom, i], 1); - /*<>*/ } + /*<>*/ } var l = a.length - 1, _Q_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; if(_Q_ >= 0){ var i$6 = _Q_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$1 = caml_check_bound(a, i$6)[1 + i$6]; - /*<>*/ try{ + /*<>*/ try{ var i = i$6; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var j = maxson(l, i); - /*<>*/ if + /*<>*/ if (0 >= - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(a, j)[1 + j], e$1)) break; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _N_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _N_; + /*<>*/ caml_check_bound(a, i)[1 + i] = _N_; i = j; } - /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; + /*<>*/ caml_check_bound(a, i)[1 + i] = e$1; } catch(exn$0){ var exn = caml_wrap_exception(exn$0); if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0); var i$0 = exn[2]; - /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; + /*<>*/ caml_check_bound(a, i$0)[1 + i$0] = e$1; } - /*<>*/ /*<>*/ var _V_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _V_ = i$6 - 1 | 0; if(0 === i$6) break; i$6 = _V_; } } - /*<>*/ /*<>*/ var _R_ = l - 1 | 0; + /*<>*/ /*<>*/ var _R_ = l - 1 | 0; if(_R_ >= 2){ var i$4 = _R_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e$0 = caml_check_bound(a, i$4)[1 + i$4]; - /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1 + i$4] = caml_check_bound(a, 0)[1]; var i$5 = 0; - /*<>*/ try{ + /*<>*/ try{ var i$1 = i$5; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ j$0 = maxson(i$4, i$1), - /*<>*/ _O_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _O_; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ j$0 = maxson(i$4, i$1), + /*<>*/ _O_ = caml_check_bound(a, j$0)[1 + j$0]; + /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _O_; i$1 = j$0; } } @@ -8850,29 +8958,29 @@ b: { var i$3 = i$2; - /*<>*/ for(;;){ + /*<>*/ for(;;){ var father = (i$3 - 1 | 0) / 3 | 0; if(i$3 === father) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _b_], 1); - /*<>*/ if + /*<>*/ if (0 <= - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(a, father)[1 + father], e$0)) break; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _P_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _P_; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _P_; if(0 >= father) break b; i$3 = father; } - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = e$0; break a; } - /*<>*/ caml_check_bound(a, 0)[1] = e$0; + /*<>*/ caml_check_bound(a, 0)[1] = e$0; } - /*<>*/ /*<>*/ var _U_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _U_ = i$4 - 1 | 0; if(2 === i$4) break; i$4 = _U_; } @@ -8880,228 +8988,228 @@ } var _S_ = 1 < l ? 1 : 0; if(_S_){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; - /*<>*/ a[2] = caml_check_bound(a, 0)[1]; - /*<>*/ a[1] = e; + /*<>*/ a[2] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1] = e; var _T_ = 0; } else var _T_ = _S_; - /*<>*/ return _T_; - /*<>*/ } + /*<>*/ return _T_; + /*<>*/ } function stable_sort(cmp, a){ function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){ - /*<>*/ var + /*<>*/ var src1r = src1ofs + src1len | 0, src2r = src2ofs + src2len | 0, - /*<>*/ s2$1 = + /*<>*/ s2$1 = caml_check_bound(src2, src2ofs)[1 + src2ofs], - /*<>*/ s1$1 = + /*<>*/ s1$1 = caml_check_bound(a, src1ofs)[1 + src1ofs], i1 = src1ofs, s1 = s1$1, i2 = src2ofs, s2 = s2$1, d = dstofs; - /*<>*/ for(;;) - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, s1, s2)){ - /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; - /*<>*/ /*<>*/ var + /*<>*/ for(;;) + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, s1, s2)){ + /*<>*/ caml_check_bound(dst, d)[1 + d] = s2; + /*<>*/ /*<>*/ var i2$0 = i2 + 1 | 0; if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0); - /*<>*/ var - /*<>*/ d$0 = d + 1 | 0, - /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0]; + /*<>*/ var + /*<>*/ d$0 = d + 1 | 0, + /*<>*/ s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0]; i2 = i2$0; s2 = s2$0; d = d$0; } else{ - /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; - /*<>*/ /*<>*/ var + /*<>*/ caml_check_bound(dst, d)[1 + d] = s1; + /*<>*/ /*<>*/ var i1$0 = i1 + 1 | 0; if(i1$0 >= src1r) return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); - /*<>*/ var - /*<>*/ d$1 = d + 1 | 0, - /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0]; + /*<>*/ var + /*<>*/ d$1 = d + 1 | 0, + /*<>*/ s1$0 = caml_check_bound(a, i1$0)[1 + i1$0]; i1 = i1$0; s1 = s1$0; d = d$1; } - /*<>*/ } + /*<>*/ } function isortto(srcofs, dst, dstofs, len){ - /*<>*/ var + /*<>*/ var _F_ = len - 1 | 0, - /*<>*/ _E_ = 0; + /*<>*/ _E_ = 0; if(_F_ >= 0){ var i = _E_; for(;;){ - /*<>*/ var + /*<>*/ var _G_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _G_)[1 + _G_], - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ e = caml_check_bound(a, _G_)[1 + _G_], + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ if(dstofs > j[1]) break; var _H_ = j[1]; - /*<>*/ if + /*<>*/ if (0 >= - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(dst, _H_)[1 + _H_], e)) break; - /*<>*/ var + /*<>*/ var _I_ = j[1], - /*<>*/ _J_ = caml_check_bound(dst, _I_)[1 + _I_], + /*<>*/ _J_ = caml_check_bound(dst, _I_)[1 + _I_], _K_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _K_)[1 + _K_] = _J_; + /*<>*/ caml_check_bound(dst, _K_)[1 + _K_] = _J_; j[1]--; } var _L_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _L_)[1 + _L_] = e; - /*<>*/ /*<>*/ var _M_ = i + 1 | 0; + /*<>*/ caml_check_bound(dst, _L_)[1 + _L_] = e; + /*<>*/ /*<>*/ var _M_ = i + 1 | 0; if(_F_ === i) break; i = _M_; } } return 0; - /*<>*/ } + /*<>*/ } function sortto(srcofs, dst, dstofs, len){ - /*<>*/ if(len <= 5) - /*<>*/ return isortto(srcofs, dst, dstofs, len); + /*<>*/ if(len <= 5) + /*<>*/ return isortto(srcofs, dst, dstofs, len); var l1 = len / 2 | 0, l2 = len - l1 | 0; - /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); - /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); - /*<>*/ return merge + /*<>*/ sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); + /*<>*/ sortto(srcofs, a, srcofs + l2 | 0, l1); + /*<>*/ return merge (srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs); - /*<>*/ } + /*<>*/ } var l = a.length - 1; - if(l <= 5) /*<>*/ return isortto(0, a, 0, l); - /*<>*/ var + if(l <= 5) /*<>*/ return isortto(0, a, 0, l); + /*<>*/ var l1 = l / 2 | 0, l2 = l - l1 | 0, - /*<>*/ t = - /*<>*/ caml_floatarray_create(l2); - /*<>*/ sortto(l1, t, 0, l2); - /*<>*/ sortto(0, a, l2, l1); - /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); - /*<>*/ } + /*<>*/ t = + /*<>*/ caml_floatarray_create(l2); + /*<>*/ sortto(l1, t, 0, l2); + /*<>*/ sortto(0, a, l2, l1); + /*<>*/ return merge(l2, l1, t, 0, l2, a, 0); + /*<>*/ } function shuffle(rand, a){ - /*<>*/ var _C_ = a.length - 2 | 0; + /*<>*/ var _C_ = a.length - 2 | 0; if(_C_ >= 1){ var i = _C_; for(;;){ - /*<>*/ var - /*<>*/ j = - /*<>*/ caml_call1(rand, i + 1 | 0), - /*<>*/ v = a[1 + i]; - /*<>*/ a[1 + i] = caml_check_bound(a, j)[1 + j]; - /*<>*/ a[1 + j] = v; + /*<>*/ var + /*<>*/ j = + /*<>*/ caml_call1(rand, i + 1 | 0), + /*<>*/ v = a[1 + i]; + /*<>*/ a[1 + i] = caml_check_bound(a, j)[1 + j]; + /*<>*/ a[1 + j] = v; var _D_ = i - 1 | 0; if(1 === i) break; i = _D_; } } return 0; - /*<>*/ } + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _A_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _A_ = i + 1 | 0; + /*<>*/ return [0, x, function(_B_){ /*<>*/ return aux(_A_, _B_);}]; - /*<>*/ } - /*<>*/ var _y_ = 0; - /*<>*/ return function(_z_){ + /*<>*/ } + /*<>*/ var _y_ = 0; + /*<>*/ return function(_z_){ /*<>*/ return aux(_y_, _z_);}; - /*<>*/ } + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _w_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _w_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_x_){ /*<>*/ return aux(_w_, _x_);}]; - /*<>*/ } - /*<>*/ var _u_ = 0; - /*<>*/ return function(_v_){ + /*<>*/ } + /*<>*/ var _u_ = 0; + /*<>*/ return function(_v_){ /*<>*/ return aux(_u_, _v_);}; - /*<>*/ } + /*<>*/ } function of_seq(i$2){ - /*<>*/ var - /*<>*/ l = - /*<>*/ caml_call3 + /*<>*/ var + /*<>*/ l = + /*<>*/ caml_call3 (Stdlib_Seq[5], function(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ }, + /*<>*/ return [0, x, acc]; + /*<>*/ }, 0, i$2), - /*<>*/ len = - /*<>*/ caml_call1(Stdlib_List[1], l), - /*<>*/ a = - /*<>*/ caml_floatarray_create(len), - /*<>*/ i$1 = len - 1 | 0, + /*<>*/ len = + /*<>*/ caml_call1(Stdlib_List[1], l), + /*<>*/ a = + /*<>*/ caml_floatarray_create(len), + /*<>*/ i$1 = len - 1 | 0, i = i$1, param = l; for(;;){ - if(! param) /*<>*/ return a; + if(! param) /*<>*/ return a; var tl = param[2], hd = param[1]; - /*<>*/ a[1 + i] = hd; - /*<>*/ /*<>*/ var i$0 = i - 1 | 0; + /*<>*/ a[1 + i] = hd; + /*<>*/ /*<>*/ var i$0 = i - 1 | 0; i = i$0; param = tl; } - /*<>*/ } + /*<>*/ } function map_to_array(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _s_ = l - 1 | 0, - /*<>*/ _r_ = 1; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_array_make + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _s_ = l - 1 | 0, + /*<>*/ _r_ = 1; if(_s_ >= 1){ var i = _r_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _t_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _t_ = i + 1 | 0; if(_s_ === i) break; i = _t_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_from_array(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _p_ = l - 1 | 0, - /*<>*/ _o_ = 0; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _p_ = l - 1 | 0, + /*<>*/ _o_ = 0; if(_p_ >= 0){ var i = _o_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _q_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _q_ = i + 1 | 0; if(_p_ === i) break; i = _q_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } var Stdlib_Float = [0, @@ -9144,7 +9252,7 @@ /*<>*/ caml_check_bound(_k_, _j_)[1 + _j_] = _i_; return 0; }, - make, + caml_floatarray_make, caml_floatarray_create, init, make_matrix, @@ -9193,7 +9301,7 @@ /*<>*/ caml_check_bound(_e_, _d_)[1 + _d_] = _c_; return 0; }, - make, + caml_floatarray_make, caml_floatarray_create, init, make_matrix, @@ -10000,9 +10108,9 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, caml_fresh_oo_id = runtime.caml_fresh_oo_id, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ @@ -10031,10 +10139,10 @@ [248, "Stdlib.Parsing.Parse_error", caml_fresh_oo_id(0)], /*<>*/ env = [0, - /*<>*/ caml_make_vect(100, 0), - /*<>*/ caml_make_vect(100, 0), - /*<>*/ caml_make_vect(100, Stdlib_Lexing[1]), - /*<>*/ caml_make_vect(100, Stdlib_Lexing[1]), + /*<>*/ caml_array_make(100, 0), + /*<>*/ caml_array_make(100, 0), + /*<>*/ caml_array_make(100, Stdlib_Lexing[1]), + /*<>*/ caml_array_make(100, Stdlib_Lexing[1]), 100, 0, 0, @@ -10053,13 +10161,13 @@ oldsize = env[5], newsize = oldsize * 2 | 0, /*<>*/ new_s = - /*<>*/ caml_make_vect(newsize, 0), + /*<>*/ caml_array_make(newsize, 0), /*<>*/ new_v = - /*<>*/ caml_make_vect(newsize, 0), + /*<>*/ caml_array_make(newsize, 0), /*<>*/ new_start = - /*<>*/ caml_make_vect(newsize, Stdlib_Lexing[1]), + /*<>*/ caml_array_make(newsize, Stdlib_Lexing[1]), /*<>*/ new_end = - /*<>*/ caml_make_vect(newsize, Stdlib_Lexing[1]); + /*<>*/ caml_array_make(newsize, Stdlib_Lexing[1]); /*<>*/ /*<>*/ caml_call5 (Stdlib_Array[9], env[1], 0, new_s, 0, oldsize); env[1] = new_s; @@ -11063,7 +11171,7 @@ if(_q_[2]){ /*<>*/ var /*<>*/ l$0 = - /*<>*/ caml_call2(Stdlib_List[62], Ord[1], l), + /*<>*/ caml_call2(Stdlib_List[66], Ord[1], l), sub = function(n, l){ /*<>*/ if(3 >= n >>> 0) @@ -12377,7 +12485,7 @@ /*<>*/ return caml_call3(Stdlib_List[26], f, acc, s[1]); /*<>*/ } function to_seq(s){ - /*<>*/ return caml_call1(Stdlib_List[64], s[1]); + /*<>*/ return caml_call1(Stdlib_List[68], s[1]); /*<>*/ } function add_seq(q, i){ /*<>*/ return /*<>*/ caml_call2 @@ -12472,13 +12580,13 @@ /*<>*/ return [0, content]; /*<>*/ } function take(q){ - /*<>*/ var _f_ = q[2]; - if(! _f_) + /*<>*/ var _g_ = q[2]; + if(! _g_) /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (Empty, 1); - var content = _f_[1]; - if(_f_[2]){ - var next = _f_[2]; + var content = _g_[1]; + if(_g_[2]){ + var next = _g_[2]; q[1] = q[1] - 1 | 0; q[2] = next; /*<>*/ return content; @@ -12487,11 +12595,11 @@ /*<>*/ return content; /*<>*/ } function take_opt(q){ - /*<>*/ var _e_ = q[2]; - if(! _e_) /*<>*/ return 0; - var content = _e_[1]; - if(_e_[2]){ - var next = _e_[2]; + /*<>*/ var _f_ = q[2]; + if(! _f_) /*<>*/ return 0; + var content = _f_[1]; + if(_f_[2]){ + var next = _f_[2]; q[1] = q[1] - 1 | 0; q[2] = next; /*<>*/ return [0, content]; @@ -12499,56 +12607,67 @@ /*<>*/ clear(q); /*<>*/ return [0, content]; /*<>*/ } + function drop(q){ + /*<>*/ var _e_ = q[2]; + if(! _e_) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Empty, 1); + if(! _e_[2]) /*<>*/ return clear(q); + var next = _e_[2]; + q[1] = q[1] - 1 | 0; + q[2] = next; + return 0; + /*<>*/ } function copy(q){ - /*<>*/ var + /*<>*/ var cell$0 = q[2], - /*<>*/ q_res = [0, q[1], 0, 0], + /*<>*/ q_res = [0, q[1], 0, 0], prev = 0, cell = cell$0; - /*<>*/ for(;;){ - if(! cell){q_res[3] = prev; /*<>*/ return q_res;} - /*<>*/ var + /*<>*/ for(;;){ + if(! cell){q_res[3] = prev; /*<>*/ return q_res;} + /*<>*/ var content = cell[1], next = cell[2], - /*<>*/ prev$0 = [0, content, 0]; - /*<>*/ if(prev) + /*<>*/ prev$0 = [0, content, 0]; + /*<>*/ if(prev) prev[2] = prev$0; else q_res[2] = prev$0; prev = prev$0; cell = next; } - /*<>*/ } + /*<>*/ } function is_empty(q){ - /*<>*/ return 0 === q[1] ? 1 : 0; - /*<>*/ } + /*<>*/ return 0 === q[1] ? 1 : 0; + /*<>*/ } function length(q){ - /*<>*/ return q[1]; - /*<>*/ } + /*<>*/ return q[1]; + /*<>*/ } function iter(f, q){ - /*<>*/ var cell$0 = q[2], cell = cell$0; - /*<>*/ for(;;){ - if(! cell) /*<>*/ return 0; + /*<>*/ var cell$0 = q[2], cell = cell$0; + /*<>*/ for(;;){ + if(! cell) /*<>*/ return 0; var content = cell[1], next = cell[2]; - /*<>*/ /*<>*/ caml_call1(f, content); + /*<>*/ /*<>*/ caml_call1(f, content); cell = next; } - /*<>*/ } + /*<>*/ } function fold(f, accu$1, q){ - /*<>*/ var cell$0 = q[2], accu = accu$1, cell = cell$0; - /*<>*/ for(;;){ - if(! cell) /*<>*/ return accu; - /*<>*/ var + /*<>*/ var cell$0 = q[2], accu = accu$1, cell = cell$0; + /*<>*/ for(;;){ + if(! cell) /*<>*/ return accu; + /*<>*/ var content = cell[1], next = cell[2], - /*<>*/ accu$0 = - /*<>*/ caml_call2(f, accu, content); + /*<>*/ accu$0 = + /*<>*/ caml_call2(f, accu, content); accu = accu$0; cell = next; } - /*<>*/ } + /*<>*/ } function transfer(q1, q2){ - /*<>*/ var _d_ = 0 < q1[1] ? 1 : 0; + /*<>*/ var _d_ = 0 < q1[1] ? 1 : 0; if(! _d_) return _d_; var match = q2[3]; return match @@ -12559,32 +12678,32 @@ q2[3] = q1[3], clear(q1)) : (q2[1] = q1[1], q2[2] = q1[2], q2[3] = q1[3], clear(q1)); - /*<>*/ } + /*<>*/ } function to_seq(q){ - /*<>*/ function aux(c, param){ - /*<>*/ if(! c) /*<>*/ return 0; + /*<>*/ function aux(c, param){ + /*<>*/ if(! c) /*<>*/ return 0; var x = c[1], next = c[2]; - /*<>*/ return [0, + /*<>*/ return [0, x, function(_c_){ /*<>*/ return aux(next, _c_);}]; - /*<>*/ } + /*<>*/ } var _a_ = q[2]; - /*<>*/ return function(_b_){ + /*<>*/ return function(_b_){ /*<>*/ return aux(_a_, _b_);}; - /*<>*/ } + /*<>*/ } function add_seq(q, i){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Seq[4], function(x){ - /*<>*/ return add(x, q); - /*<>*/ }, + /*<>*/ return add(x, q); + /*<>*/ }, i); - /*<>*/ } + /*<>*/ } function of_seq(g){ - /*<>*/ /*<>*/ var q = create(0); - /*<>*/ add_seq(q, g); - /*<>*/ return q; - /*<>*/ } + /*<>*/ /*<>*/ var q = create(0); + /*<>*/ add_seq(q, g); + /*<>*/ return q; + /*<>*/ } var Stdlib_Queue = [0, @@ -12598,6 +12717,7 @@ peek, peek_opt, peek, + drop, clear, copy, is_empty, @@ -13436,9 +13556,9 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, caml_domain_dls_get = runtime.caml_domain_dls_get, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_domain_id = runtime.caml_ml_domain_id, caml_wrap_exception = runtime.caml_wrap_exception; @@ -13479,7 +13599,7 @@ /*<>*/ /*<>*/ var none = [0, 0]; function create_dls(param){ /*<>*/ /*<>*/ var - st = /*<>*/ caml_make_vect(8, none); + st = /*<>*/ caml_array_make(8, none); /*<>*/ /*<>*/ runtime.caml_domain_dls_set (st); /*<>*/ } @@ -13526,7 +13646,7 @@ new_sz = s; } /*<>*/ /*<>*/ var - new_st = /*<>*/ caml_make_vect(new_sz, none); + new_st = /*<>*/ caml_array_make(new_sz, none); /*<>*/ /*<>*/ caml_call5 (Stdlib_Array[9], st, 0, new_st, 0, sz); /*<>*/ if @@ -13579,65 +13699,65 @@ ? 1 : 0; /*<>*/ } - /*<>*/ var - /*<>*/ first_domain_spawned = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0), - /*<>*/ first_spawn_function = - [0, function(param){ /*<>*/ }], + /*<>*/ var + /*<>*/ first_domain_spawned = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + /*<>*/ first_spawn_function = + [0, function(param){ /*<>*/ }], cst_first_domain_already_spawn = "first domain already spawned"; function before_first_spawn(f){ - /*<>*/ if - ( /*<>*/ caml_call1 + /*<>*/ if + ( /*<>*/ caml_call1 (Stdlib_Atomic[3], first_domain_spawned)) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stdlib[6], cst_first_domain_already_spawn], 1); var old_f = first_spawn_function[1]; function new_f(param){ - /*<>*/ /*<>*/ caml_call1(old_f, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1(old_f, 0); + /*<>*/ return /*<>*/ caml_call1 (f, 0); - /*<>*/ } + /*<>*/ } first_spawn_function[1] = new_f; return 0; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var at_exit_key = new_key (0, function(param){ - /*<>*/ return function(param){ - /*<>*/ return 0; /*<>*/ }; - /*<>*/ }); + /*<>*/ return function(param){ + /*<>*/ return 0; /*<>*/ }; + /*<>*/ }); function at_exit(f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var old_exit = get(at_exit_key); function new_exit(param){ - /*<>*/ /*<>*/ caml_call1(f, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1(f, 0); + /*<>*/ return /*<>*/ caml_call1 (old_exit, 0); - /*<>*/ } - /*<>*/ return set(at_exit_key, new_exit); - /*<>*/ } + /*<>*/ } + /*<>*/ return set(at_exit_key, new_exit); + /*<>*/ } function do_at_exit(param){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var f = get(at_exit_key); - /*<>*/ return /*<>*/ caml_call1(f, 0); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call1(f, 0); + /*<>*/ } Stdlib[104][1] = do_at_exit; function spawn(f){ - /*<>*/ if + /*<>*/ if (1 - - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Atomic[3], first_domain_spawned)){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (Stdlib_Atomic[4], first_domain_spawned, 1); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (first_spawn_function[1], 0); first_spawn_function[1] = function(param){ - /*<>*/ return 0; - /*<>*/ }; + /*<>*/ return 0; + /*<>*/ }; } /*<>*/ var /*<>*/ _b_ = @@ -13652,13 +13772,13 @@ /*<>*/ caml_call1(split, get(k))]; /*<>*/ }, _b_), - /*<>*/ _c_ = - /*<>*/ caml_call1(Stdlib_Condition[1], 0), - /*<>*/ term_sync = - [0, 0, /*<>*/ caml_call1(Stdlib_Mutex[1], 0), _c_]; + /*<>*/ _c_ = + /*<>*/ caml_call1(Stdlib_Condition[1], 0), + /*<>*/ term_sync = + [0, 0, /*<>*/ caml_call1(Stdlib_Mutex[1], 0), _c_]; function body(param){ - /*<>*/ try{ - /*<>*/ create_dls(0); + /*<>*/ try{ + /*<>*/ create_dls(0); /*<>*/ /*<>*/ caml_call2 (Stdlib_List[18], function(param){ @@ -13666,41 +13786,41 @@ /*<>*/ return set(k, v); /*<>*/ }, pk); - /*<>*/ /*<>*/ var - res = /*<>*/ caml_call1(f, 0); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_call1(f, 0); } catch(exn$0){ var exn = caml_wrap_exception(exn$0); - /*<>*/ try{ /*<>*/ do_at_exit(0);} + /*<>*/ try{ /*<>*/ do_at_exit(0);} catch(_d_){} - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (exn, 0); } - /*<>*/ do_at_exit(0); - /*<>*/ return res; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ do_at_exit(0); + /*<>*/ return res; + /*<>*/ } + /*<>*/ /*<>*/ var domain = - /*<>*/ runtime.caml_domain_spawn(body, term_sync); - /*<>*/ return [0, domain, term_sync]; - /*<>*/ } + /*<>*/ runtime.caml_domain_spawn(body, term_sync); + /*<>*/ return [0, domain, term_sync]; + /*<>*/ } function join(param){ var term_sync = param[2]; - /*<>*/ function loop(param){ - /*<>*/ for(;;){ + /*<>*/ function loop(param){ + /*<>*/ for(;;){ var match = term_sync[1]; - if(match){var res = match[1]; /*<>*/ return res;} - /*<>*/ /*<>*/ caml_call2 + if(match){var res = match[1]; /*<>*/ return res;} + /*<>*/ /*<>*/ caml_call2 (Stdlib_Condition[2], term_sync[3], term_sync[2]); } - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var match = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_Mutex[5], term_sync[2], loop); - if(0 === match[0]){var x = match[1]; /*<>*/ return x;} + if(0 === match[0]){var x = match[1]; /*<>*/ return x;} var ex = match[1]; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (ex, 1); } var @@ -13716,6 +13836,7 @@ cpu_relax, is_main_domain, recommended_domain_count, + runtime.caml_ml_domain_index, [0, new_key, get, set]]; runtime.caml_register_global(9, Stdlib_Domain, "Stdlib__Domain"); return; @@ -20479,22 +20600,29 @@ /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Dynarray -//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Printf, Stdlib__Seq, Stdlib__Sys +//# unitInfo: Provides: Stdlib__Arg +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Buffer, Stdlib__Int, Stdlib__List, Stdlib__Printf, Stdlib__String, Stdlib__Sys (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, - cst_requested = " requested", - cst_index = ": index ", - cst_Dynarray = "Dynarray.", - cst_append$1 = "append", - cst_dynarray_ml = "dynarray.ml", - cst_ensure_capacity$0 = "ensure_capacity", + cst$8 = "", + cst$10 = " ", + cst_Display_this_list_of_optio$1 = " Display this list of options", + cst_s = "%s", + cst_help$4 = "--help", + cst_help$3 = "-help", + cst$9 = ".\n", + cst_a_float$1 = "a float", + cst_an_integer$1 = "an integer", caml_check_bound = runtime.caml_check_bound, - caml_make_vect = runtime.caml_make_vect, + caml_equal = runtime.caml_equal, + caml_fresh_oo_id = runtime.caml_fresh_oo_id, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get, + caml_sys_argv = runtime.caml_sys_argv, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -20521,1159 +20649,254 @@ ? f(a0, a1, a2, a3, a4) : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); } - var + /*<>*/ function caml_call6(f, a0, a1, a2, a3, a4, a5){ + return (f.l >= 0 ? f.l : f.l = f.length) == 6 + ? f(a0, a1, a2, a3, a4, a5) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]); + } + /*<>*/ var global_data = runtime.caml_get_global_data(), - f$0 = cst_ensure_capacity$0, - f = "get_last", - invalid_state_description = - "Invalid dynarray (unsynchronized concurrent length change)", - Stdlib_List = global_data.Stdlib__List, - Stdlib_Array = global_data.Stdlib__Array, - Stdlib_Seq = global_data.Stdlib__Seq, + cst$7 = "\n", + cst$4 = cst$8, + cst$5 = " ", + cst$6 = cst$8, + cst$2 = "(?)", + cst$3 = "-", + cst = "}", + cst$0 = "|", + cst$1 = "{", Stdlib = global_data.Stdlib, - Stdlib_Sys = global_data.Stdlib__Sys, - Assert_failure = global_data.Assert_failure, Stdlib_Printf = global_data.Stdlib__Printf, + Stdlib_Array = global_data.Stdlib__Array, + Stdlib_Buffer = global_data.Stdlib__Buffer, + Stdlib_List = global_data.Stdlib__List, + Stdlib_String = global_data.Stdlib__String, + Stdlib_Int = global_data.Stdlib__Int, + /*<>*/ Bad = [248, "Stdlib.Arg.Bad", caml_fresh_oo_id(0)], + /*<>*/ Help = [248, "Stdlib.Arg.Help", caml_fresh_oo_id(0)], + /*<>*/ Stop = [248, "Stdlib.Arg.Stop", caml_fresh_oo_id(0)], + cst_none = "", _a_ = - [0, - [11, - cst_Dynarray, - [2, - 0, - [11, - cst_index, - [4, 0, 0, 0, [11, " out of bounds (empty dynarray)", 0]]]]], - "Dynarray.%s: index %d out of bounds (empty dynarray)"], + [0, [11, cst$10, [2, 0, [12, 32, [2, 0, [12, 10, 0]]]]], " %s %s\n"], _b_ = [0, - [11, - cst_Dynarray, - [2, - 0, - [11, - cst_index, - [4, 0, 0, 0, [11, " out of bounds (0..", [4, 0, 0, 0, [12, 41, 0]]]]]]], - "Dynarray.%s: index %d out of bounds (0..%d)"], - _c_ = - [0, - [11, - cst_Dynarray, - [2, - 0, - [11, ": negative length ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], - "Dynarray.%s: negative length %d requested"], - _d_ = - [0, - [11, - cst_Dynarray, - [2, - 0, - [11, ": negative capacity ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], - "Dynarray.%s: negative capacity %d requested"], - _e_ = - [0, - [11, - cst_Dynarray, - [2, - 0, - [11, - ": cannot grow to requested length ", - [4, - 0, - 0, - 0, - [11, " (max_array_length is ", [4, 0, 0, 0, [12, 41, 0]]]]]]], - "Dynarray.%s: cannot grow to requested length %d (max_array_length is %d)"], + [11, cst$10, [2, 0, [12, 32, [2, 0, [2, 0, [12, 10, 0]]]]]], + " %s %s%s\n"], + _c_ = [0, cst_help$3], + cst_Display_this_list_of_optio = cst_Display_this_list_of_optio$1, + cst_help = cst_help$3, + cst_Display_this_list_of_optio$0 = cst_Display_this_list_of_optio$1, + cst_help$0 = cst_help$4, + cst_help$1 = cst_help$4, + cst_help$2 = cst_help$3, + _d_ = [0, [2, 0, [12, 10, 0]], "%s\n"], + _e_ = [0, [2, 0, 0], cst_s]; + function assoc3(x, l){ + /*<>*/ var l$0 = l; + /*<>*/ for(;;){ + if(! l$0) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + var match = l$0[1], y2 = match[2], y1 = match[1]; + /*<>*/ if( /*<>*/ caml_equal(y1, x)) + /*<>*/ return y2; + var t = l$0[2]; + l$0 = t; + } + /*<>*/ } + function make_symlist(prefix, sep, suffix, l){ + /*<>*/ if(! l) /*<>*/ return cst_none; + /*<>*/ var + t = l[2], + h = l[1], + /*<>*/ _az_ = + /*<>*/ caml_call2(Stdlib[28], prefix, h), + /*<>*/ _aA_ = + /*<>*/ caml_call3 + (Stdlib_List[26], + function(x, y){ + /*<>*/ /*<>*/ var + _aB_ = /*<>*/ caml_call2(Stdlib[28], sep, y); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], x, _aB_); + /*<>*/ }, + _az_, + t); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], _aA_, suffix); + /*<>*/ } + function help_action(param){ + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stop, _c_], 1); + /*<>*/ } + function add_help(speclist){ + /*<>*/ try{ + /*<>*/ assoc3(cst_help$2, speclist); + /*<>*/ var /*<>*/ _aw_ = 0, add1 = _aw_; + } + catch(_ay_){ + var _as_ = caml_wrap_exception(_ay_); + if(_as_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_as_, 0); + var + add1 = + [0, + [0, cst_help, [0, help_action], cst_Display_this_list_of_optio], + 0]; + } + try{ + /*<>*/ assoc3(cst_help$1, speclist); + /*<>*/ var /*<>*/ _av_ = 0, add2 = _av_; + } + catch(_ax_){ + var _at_ = caml_wrap_exception(_ax_); + if(_at_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_at_, 0); + var + add2 = + [0, + [0, cst_help$0, [0, help_action], cst_Display_this_list_of_optio$0], + 0]; + } + /*<>*/ /*<>*/ var + _au_ = /*<>*/ caml_call2(Stdlib[37], add1, add2); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[37], speclist, _au_); + /*<>*/ } + function usage_b(buf, speclist, errmsg){ + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[5], buf, _d_, errmsg); + /*<>*/ /*<>*/ var + _ap_ = add_help(speclist); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[18], + function(param){ + var + doc = param[3], + spec = param[2], + key = param[1], + _aq_ = + 0 < /*<>*/ caml_ml_string_length(doc) ? 1 : 0; + if(! _aq_) return _aq_; + if(11 !== spec[0]) + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[5], buf, _a_, key, doc); + /*<>*/ var + l = spec[1], + /*<>*/ _ar_ = make_symlist(cst$1, cst$0, cst, l); + /*<>*/ return /*<>*/ caml_call5 + (Stdlib_Printf[5], buf, _b_, key, _ar_, doc); + }, + _ap_); + /*<>*/ } + function usage_string(speclist, errmsg){ + /*<>*/ /*<>*/ var + b = /*<>*/ caml_call1(Stdlib_Buffer[1], 200); + /*<>*/ usage_b(b, speclist, errmsg); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Buffer[2], b); + /*<>*/ } + function usage(speclist, errmsg){ + /*<>*/ /*<>*/ var + _ao_ = usage_string(speclist, errmsg); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Printf[3], _e_, _ao_); + /*<>*/ } + /*<>*/ var + /*<>*/ current = [0, 0], _f_ = [0, - [2, - 0, - [11, - ": missing element at position ", - [4, 0, 0, 0, [11, " < length ", [4, 0, 0, 0, 0]]]]], - "%s: missing element at position %d < length %d"], - _g_ = + [2, 0, [11, ": unknown option '", [2, 0, [11, "'.\n", 0]]]], + "%s: unknown option '%s'.\n"], + _g_ = [0, cst_help$3], + _h_ = [0, cst_help$4], + _i_ = [0, [2, 0, - [11, ": length ", [4, 0, 0, 0, [11, " > capacity ", [4, 0, 0, 0, 0]]]]], - "%s: length %d > capacity %d"], - _h_ = - [0, - [11, - cst_Dynarray, - [2, - 0, - [11, - ": a length change from ", - [4, - 0, - 0, - 0, - [11, " to ", [4, 0, 0, 0, [11, " occurred during iteration", 0]]]]]]], - "Dynarray.%s: a length change from %d to %d occurred during iteration"], - _i_ = + [11, + ": wrong argument '", + [2, + 0, + [11, + "'; option '", + [2, 0, [11, "' expects ", [2, 0, [11, cst$9, 0]]]]]]]], + "%s: wrong argument '%s'; option '%s' expects %s.\n"], + _j_ = [0, - [11, cst_Dynarray, [2, 0, [11, ": empty array", 0]]], - "Dynarray.%s: empty array"], - cst_make = "make", - cst_init = "init", - cst_get = "get", - cst_set = "set", - cst_truncate = "truncate", - _j_ = [0, cst_dynarray_ml, 381, 4], - _k_ = [0, cst_dynarray_ml, 380, 4], - cst_ensure_capacity = cst_ensure_capacity$0, - cst_set_capacity = "set_capacity", - cst_append = cst_append$1, - cst_append$0 = cst_append$1, - cst_iter = "iter", - cst_iteri = "iteri", - cst_map = "map", - cst_mapi = "mapi", - cst_fold_left = "fold_left", - cst_fold_right = "fold_right", - cst_exists = "exists", - cst_for_all = "for_all", - cst_filter = "filter", - cst_filter_map = "filter_map", - cst_to_array = "to_array", - cst_to_list = "to_list", - cst_to_seq = "to_seq", - cst_to_seq_rev = "to_seq_rev"; - function negative_length_requested(f, n){ - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Printf[10], Stdlib[1], _c_, f, n); - /*<>*/ } - function negative_capacity_requested(f, n){ - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Printf[10], Stdlib[1], _d_, f, n); - /*<>*/ } - function missing_element(i, length){ - /*<>*/ return /*<>*/ caml_call5 - (Stdlib_Printf[10], - Stdlib[1], - _f_, - invalid_state_description, - i, - length); - /*<>*/ } - function unexpected_empty_element(f, i, length){ - /*<>*/ return i < length - ? missing_element(i, length) - : 0 - === length - ? /*<>*/ caml_call4 - (Stdlib_Printf[10], Stdlib[1], _a_, f, i) - : /*<>*/ caml_call5 - (Stdlib_Printf[10], Stdlib[1], _b_, f, i, length - 1 | 0); - /*<>*/ } - function check_same_length(f, a, expected){ - /*<>*/ var - length_a = a[1], - _W_ = expected !== length_a ? 1 : 0; - return _W_ - ? /*<>*/ caml_call5 - (Stdlib_Printf[10], Stdlib[1], _h_, f, expected, length_a) - : _W_; - /*<>*/ } - function check_valid_length(length, arr){ - /*<>*/ var - capacity = arr.length - 1, - _V_ = capacity < length ? 1 : 0; - return _V_ - ? /*<>*/ caml_call5 - (Stdlib_Printf[10], - Stdlib[1], - _g_, - invalid_state_description, - length, - capacity) - : _V_; - /*<>*/ } - function unsafe_get(arr, i, length){ - /*<>*/ var match = arr[1 + i]; - if(! match) /*<>*/ return missing_element(i, length); - var v = match[1]; - /*<>*/ return v; - /*<>*/ } - function create(param){ - /*<>*/ return [0, 0, [0]]; - /*<>*/ } - function make(n, x){ - /*<>*/ if(n < 0) - /*<>*/ negative_length_requested(cst_make, n); - /*<>*/ return [0, - n, - /*<>*/ caml_call2 - (Stdlib_Array[1], - n, - function(param){ - /*<>*/ return [0, x]; - /*<>*/ })]; - /*<>*/ } - function init(n, f){ - /*<>*/ if(n < 0) - /*<>*/ negative_length_requested(cst_init, n); - /*<>*/ return [0, - n, - /*<>*/ caml_call2 - (Stdlib_Array[1], - n, - function(i){ - /*<>*/ return [0, - /*<>*/ caml_call1(f, i)]; - /*<>*/ })]; - /*<>*/ } - function get(a, i){ - /*<>*/ /*<>*/ var - match = caml_check_bound(a[2], i)[1 + i]; - return match ? match[1] : unexpected_empty_element(cst_get, i, a[1]); - /*<>*/ } - function set(a, i, x){ - /*<>*/ /*<>*/ var - match = caml_check_bound(a[2], i)[1 + i]; - return match - ? (match[1] = x, 0) - : unexpected_empty_element(cst_set, i, a[1]); - /*<>*/ } - function length(a){ - /*<>*/ return a[1]; - /*<>*/ } - function is_empty(a){ - /*<>*/ return 0 === a[1] ? 1 : 0; - /*<>*/ } - function copy(param){ - var length = param[1], arr = param[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ return [0, - length, - /*<>*/ caml_call2 - (Stdlib_Array[1], - length, - function(i){ - /*<>*/ /*<>*/ var - v = unsafe_get(arr, i, length); - /*<>*/ return [0, v]; - /*<>*/ })]; - } - function get_last(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - if(0 === length) - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[10], Stdlib[1], _i_, f); - /*<>*/ return unsafe_get(arr, length - 1 | 0, length); - /*<>*/ } - function find_last(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - return 0 === length ? 0 : [0, unsafe_get(arr, length - 1 | 0, length)]; - /*<>*/ } - function pop_last(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - if(0 === length) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - /*<>*/ var - /*<>*/ last = length - 1 | 0, - match = arr[1 + last]; - return match - ? (arr[1 + last] = 0, a[1] = last, match[1]) - : missing_element(last, length); - /*<>*/ } - function pop_last_opt(a){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - x = pop_last(a); - } - catch(_U_){ - var _T_ = caml_wrap_exception(_U_); - if(_T_ === Stdlib[8]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_T_, 0); + [2, 0, [11, ": option '", [2, 0, [11, "' needs an argument.\n", 0]]]], + "%s: option '%s' needs an argument.\n"], + _k_ = [0, [2, 0, [11, ": ", [2, 0, [11, cst$9, 0]]]], "%s: %s.\n"], + cst_no_argument = "no argument", + cst_a_boolean = "a boolean", + cst_an_integer = cst_an_integer$1, + cst_an_integer$0 = cst_an_integer$1, + cst_a_float = cst_a_float$1, + cst_a_float$0 = cst_a_float$1, + cst_one_of = "one of: ", + cst_Arg_Expand_is_is_only_allo = + "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic", + _l_ = [0, [2, 0, 0], cst_s], + _m_ = [0, [2, 0, 0], cst_s], + _n_ = [0, [2, 0, 0], cst_s], + _o_ = [0, [2, 0, 0], cst_s], + _p_ = [0, [2, 0, 0], cst_s], + _q_ = [0, [2, 0, 0], cst_s], + dummy = 0; + function int_of_string_opt(x){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + _am_ = [0, /*<>*/ runtime.caml_int_of_string(x)]; + /*<>*/ return _am_; } - /*<>*/ return [0, x]; - /*<>*/ } - function remove_last(a){ - /*<>*/ var - /*<>*/ last = a[1] - 1 | 0, - _R_ = 0 <= last ? 1 : 0, - _S_ = - _R_ - ? (a[1] = last, caml_check_bound(a[2], last)[1 + last] = 0, 0) - : _R_; - /*<>*/ return _S_; - /*<>*/ } - function truncate(a, n){ - /*<>*/ if(n < 0) - /*<>*/ negative_length_requested(cst_truncate, n); - var length = a[1], arr = a[2]; - return length <= n - ? 0 - : (a - [1] - = n, - /*<>*/ caml_call4 - (Stdlib_Array[8], arr, n, length - n | 0, 0)); - /*<>*/ } - function clear(a){ - /*<>*/ return truncate(a, 0); - /*<>*/ } - function capacity(a){ - /*<>*/ return a[2].length - 1; - /*<>*/ } - function ensure_capacity(a, capacity_request){ - /*<>*/ var - arr = a[2], - /*<>*/ cur_capacity = arr.length - 1; - /*<>*/ if(0 > capacity_request) - /*<>*/ return negative_capacity_requested - (cst_ensure_capacity, capacity_request); - if(capacity_request <= cur_capacity) /*<>*/ return 0; - if(Stdlib_Sys[13] < capacity_request) - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Printf[10], - Stdlib[1], - _e_, - f$0, - capacity_request, - Stdlib_Sys[13]); - /*<>*/ var - n = - 512 < cur_capacity - ? cur_capacity + (cur_capacity / 2 | 0) | 0 - : cur_capacity * 2 | 0, - _O_ = Stdlib_Sys[13], - /*<>*/ _P_ = - /*<>*/ caml_call2(Stdlib[17], 8, n), - /*<>*/ _Q_ = - /*<>*/ caml_call2(Stdlib[16], _P_, _O_), - /*<>*/ new_capacity = - /*<>*/ caml_call2 - (Stdlib[17], _Q_, capacity_request), - /*<>*/ new_arr = - /*<>*/ caml_make_vect(new_capacity, 0); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[9], arr, 0, new_arr, 0, a[1]); - a[2] = new_arr; - if(0 > capacity_request) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _k_], 1); - if(capacity_request <= new_arr.length - 1) return 0; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _j_], 1); - /*<>*/ } - function ensure_extra_capacity(a, extra_capacity_request){ - /*<>*/ return ensure_capacity - (a, a[1] + extra_capacity_request | 0); - /*<>*/ } - function fit_capacity(a){ - /*<>*/ var _N_ = a[1]; - return capacity(a) === _N_ - ? 0 - : (a - [2] - = - /*<>*/ caml_call3 - (Stdlib_Array[6], a[2], 0, a[1]), - 0); - /*<>*/ } - function set_capacity(a, n){ - /*<>*/ if(n < 0) - /*<>*/ negative_capacity_requested - (cst_set_capacity, n); - /*<>*/ var - arr = a[2], - /*<>*/ cur_capacity = arr.length - 1; - if(n < cur_capacity){ - a[1] = /*<>*/ caml_call2(Stdlib[16], a[1], n); - a[2] = /*<>*/ caml_call3(Stdlib_Array[6], arr, 0, n); - return 0; - } - var _L_ = cur_capacity < n ? 1 : 0; - if(_L_){ - /*<>*/ /*<>*/ var - new_arr = /*<>*/ caml_make_vect(n, 0); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[9], arr, 0, new_arr, 0, a[1]); - a[2] = new_arr; - var _M_ = 0; - } - else - var _M_ = _L_; - return _M_; - /*<>*/ } - function reset(a){ - /*<>*/ a[1] = 0; - a[2] = [0]; - return 0; - /*<>*/ } - function add_last_if_room(a, elem){ - /*<>*/ var length = a[1], arr = a[2]; - return arr.length - 1 <= length - ? 0 - : (a[1] = length + 1 | 0, arr[1 + length] = elem, 1); - /*<>*/ } - function add_last(a, x){ - /*<>*/ /*<>*/ var elem = [0, x]; - /*<>*/ if(add_last_if_room(a, elem)) - /*<>*/ return 0; - /*<>*/ for(;;){ - /*<>*/ ensure_extra_capacity(a, 1); - /*<>*/ /*<>*/ var - _K_ = 1 - add_last_if_room(a, elem); - if(! _K_) /*<>*/ return _K_; - } - /*<>*/ } - function append_list(a, li){ - /*<>*/ var li$0 = li; - /*<>*/ for(;;){ - if(! li$0) /*<>*/ return 0; - var xs = li$0[2], x = li$0[1]; - /*<>*/ add_last(a, x); - li$0 = xs; - } - /*<>*/ } - function append_iter(a, iter, b){ - /*<>*/ return /*<>*/ caml_call2 - (iter, - function(x){ - /*<>*/ return add_last(a, x); - /*<>*/ }, - b); - /*<>*/ } - function append_seq(a, seq){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Seq[4], - function(x){ - /*<>*/ return add_last(a, x); - /*<>*/ }, - seq); - /*<>*/ } - function append_array_if_room(a, b){ - /*<>*/ var - length_a = a[1], - arr = a[2], - /*<>*/ length_b = b.length - 1; - if(arr.length - 1 < (length_a + length_b | 0)) - /*<>*/ return 0; - a[1] = length_a + length_b | 0; - /*<>*/ var - /*<>*/ _I_ = length_b - 1 | 0, - /*<>*/ _H_ = 0; - if(_I_ >= 0){ - var i = _H_; - for(;;){ - /*<>*/ /*<>*/ var - x = b[1 + i]; - arr[1 + (length_a + i | 0)] = [0, x]; - /*<>*/ /*<>*/ var - _J_ = i + 1 | 0; - if(_I_ === i) break; - i = _J_; - } - } - /*<>*/ return 1; - /*<>*/ } - function append_array(a, b){ - /*<>*/ if(append_array_if_room(a, b)) - /*<>*/ return 0; - /*<>*/ for(;;){ - /*<>*/ ensure_extra_capacity(a, b.length - 1); - /*<>*/ /*<>*/ var - _G_ = 1 - append_array_if_room(a, b); - if(! _G_) /*<>*/ return _G_; - } - /*<>*/ } - function append_if_room(a, b, length_b){ - /*<>*/ var length_a = a[1], arr_a = a[2]; - if(arr_a.length - 1 < (length_a + length_b | 0)) - /*<>*/ return 0; - a[1] = length_a + length_b | 0; - var arr_b = b[2]; - /*<>*/ check_valid_length(length_b, arr_b); - /*<>*/ var - _E_ = length_b - 1 | 0, - /*<>*/ _D_ = 0; - if(_E_ >= 0){ - var i = _D_; - for(;;){ - /*<>*/ /*<>*/ var - x = unsafe_get(arr_b, i, length_b); - arr_a[1 + (length_a + i | 0)] = [0, x]; - /*<>*/ /*<>*/ var - _F_ = i + 1 | 0; - if(_E_ === i) break; - i = _F_; - } - } - /*<>*/ check_same_length(cst_append, b, length_b); - /*<>*/ return 1; - /*<>*/ } - function append(a, b){ - /*<>*/ var length_b = b[1]; - /*<>*/ if(append_if_room(a, b, length_b)) - /*<>*/ return 0; - /*<>*/ for(;;){ - /*<>*/ ensure_extra_capacity(a, length_b); - /*<>*/ check_same_length(cst_append$0, b, length_b); - /*<>*/ /*<>*/ var - _C_ = 1 - append_if_room(a, b, length_b); - if(! _C_) /*<>*/ return _C_; - } - /*<>*/ } - function iter(f, k, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ var - _A_ = length - 1 | 0, - /*<>*/ _z_ = 0; - if(_A_ >= 0){ - var i = _z_; - for(;;){ - /*<>*/ /*<>*/ caml_call1 - (k, unsafe_get(arr, i, length)); - /*<>*/ /*<>*/ var - _B_ = i + 1 | 0; - if(_A_ === i) break; - i = _B_; - } - } - /*<>*/ return check_same_length(f, a, length); - /*<>*/ } - function iter$0(k, a){ - /*<>*/ return iter(cst_iter, k, a); - /*<>*/ } - function iteri(k, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ var - _x_ = length - 1 | 0, - /*<>*/ _w_ = 0; - if(_x_ >= 0){ - var i = _w_; - for(;;){ - /*<>*/ /*<>*/ caml_call2 - (k, i, unsafe_get(arr, i, length)); - /*<>*/ /*<>*/ var - _y_ = i + 1 | 0; - if(_x_ === i) break; - i = _y_; - } - } - /*<>*/ return check_same_length(cst_iteri, a, length); - /*<>*/ } - function map(f, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ /*<>*/ var - res = - [0, - length, - /*<>*/ caml_call2 - (Stdlib_Array[1], - length, - function(i){ - /*<>*/ return [0, - /*<>*/ caml_call1 - (f, unsafe_get(arr, i, length))]; - /*<>*/ })]; - /*<>*/ check_same_length(cst_map, a, length); - /*<>*/ return res; - /*<>*/ } - function mapi(f, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ /*<>*/ var - res = - [0, - length, - /*<>*/ caml_call2 - (Stdlib_Array[1], - length, - function(i){ - /*<>*/ return [0, - /*<>*/ caml_call2 - (f, i, unsafe_get(arr, i, length))]; - /*<>*/ })]; - /*<>*/ check_same_length(cst_mapi, a, length); - /*<>*/ return res; - /*<>*/ } - function fold_left(f, acc, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ var - /*<>*/ r = [0, acc], - /*<>*/ _u_ = length - 1 | 0, - /*<>*/ _t_ = 0; - if(_u_ >= 0){ - var i = _t_; - for(;;){ - /*<>*/ /*<>*/ var - v = unsafe_get(arr, i, length); - r[1] = /*<>*/ caml_call2(f, r[1], v); - /*<>*/ /*<>*/ var - _v_ = i + 1 | 0; - if(_u_ === i) break; - i = _v_; - } - } - /*<>*/ check_same_length(cst_fold_left, a, length); - return r[1]; - /*<>*/ } - function fold_right(f, a, acc){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ var - /*<>*/ r = [0, acc], - /*<>*/ _r_ = length - 1 | 0; - if(_r_ >= 0){ - var i = _r_; - for(;;){ - /*<>*/ /*<>*/ var - v = unsafe_get(arr, i, length); - r[1] = /*<>*/ caml_call2(f, v, r[1]); - /*<>*/ /*<>*/ var - _s_ = i - 1 | 0; - if(0 === i) break; - i = _s_; - } + catch(_an_){ + var _al_ = caml_wrap_exception(_an_); + if(_al_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_al_, 0); } - /*<>*/ check_same_length(cst_fold_right, a, length); - return r[1]; - /*<>*/ } - function exists(p, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - var i = 0; - /*<>*/ for(;;){ - if(i === length) - var res = 0; - else{ - /*<>*/ /*<>*/ var - _q_ = - /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); - /*<>*/ if(! _q_){ - var i$0 = i + 1 | 0; - i = i$0; - continue; - } - var res = _q_; - } - /*<>*/ check_same_length(cst_exists, a, length); - /*<>*/ return res; + /*<>*/ } + function float_of_string_opt(x){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + _aj_ = [0, /*<>*/ runtime.caml_float_of_string(x)]; + /*<>*/ return _aj_; } - /*<>*/ } - function for_all(p, a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - var i = 0; - /*<>*/ for(;;){ - if(i === length) - var res = 1; - else{ - /*<>*/ /*<>*/ var - _p_ = - /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); - /*<>*/ if(_p_){ - var i$0 = i + 1 | 0; - i = i$0; - continue; - } - var res = _p_; - } - /*<>*/ check_same_length(cst_for_all, a, length); - /*<>*/ return res; + catch(_ak_){ + var _ai_ = caml_wrap_exception(_ak_); + if(_ai_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_ai_, 0); } - /*<>*/ } - function filter(f, a){ - /*<>*/ /*<>*/ var b = create(0); - /*<>*/ iter - (cst_filter, - function(x){ - /*<>*/ /*<>*/ var - _o_ = /*<>*/ caml_call1(f, x); - /*<>*/ return _o_ ? add_last(b, x) : _o_; - /*<>*/ }, - a); - /*<>*/ return b; - /*<>*/ } - function filter_map(f, a){ - /*<>*/ /*<>*/ var b = create(0); - /*<>*/ iter - (cst_filter_map, - function(x){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(f, x); - if(! match) /*<>*/ return 0; - var y = match[1]; - /*<>*/ return add_last(b, y); - /*<>*/ }, - a); - /*<>*/ return b; - /*<>*/ } - function of_array(a){ - /*<>*/ var length = a.length - 1; - /*<>*/ return [0, - length, - /*<>*/ caml_call2 - (Stdlib_Array[1], - length, - function(i){ - /*<>*/ return [0, a[1 + i]]; - /*<>*/ })]; - /*<>*/ } - function to_array(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ /*<>*/ var - res = - /*<>*/ caml_call2 - (Stdlib_Array[1], - length, - function(i){ - /*<>*/ return unsafe_get(arr, i, length); - /*<>*/ }); - /*<>*/ check_same_length(cst_to_array, a, length); - /*<>*/ return res; - /*<>*/ } - function of_list(li){ - /*<>*/ /*<>*/ var a = create(0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_List[18], - function(x){ - /*<>*/ return add_last(a, x); - /*<>*/ }, - li); - /*<>*/ return a; - /*<>*/ } - function to_list(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - /*<>*/ var - /*<>*/ l = [0, 0], - /*<>*/ _l_ = length - 1 | 0; - if(_l_ >= 0){ - var i = _l_; - for(;;){ - var _m_ = l[1]; - l[1] = [0, unsafe_get(arr, i, length), _m_]; - /*<>*/ /*<>*/ var - _n_ = i - 1 | 0; - if(0 === i) break; - i = _n_; - } - } - /*<>*/ check_same_length(cst_to_list, a, length); - return l[1]; - /*<>*/ } - function of_seq(seq){ - /*<>*/ /*<>*/ var - init = create(0); - /*<>*/ append_seq(init, seq); - /*<>*/ return init; - /*<>*/ } - function to_seq(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - function aux(i){ - /*<>*/ return function(param){ - /*<>*/ check_same_length(cst_to_seq, a, length); - if(length <= i) /*<>*/ return 0; - /*<>*/ /*<>*/ var - v = unsafe_get(arr, i, length); - /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; - /*<>*/ } - /*<>*/ return aux(0); - /*<>*/ } - function to_seq_reentrant(a){ - function aux(i){ - /*<>*/ return function(param){ - /*<>*/ if(a[1] <= i) - /*<>*/ return 0; - /*<>*/ /*<>*/ var - v = get(a, i); - /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; - /*<>*/ } - /*<>*/ return aux(0); - /*<>*/ } - function to_seq_rev(a){ - /*<>*/ var length = a[1], arr = a[2]; - /*<>*/ check_valid_length(length, arr); - function aux(i){ - /*<>*/ return function(param){ - /*<>*/ check_same_length(cst_to_seq_rev, a, length); - if(0 > i) /*<>*/ return 0; - /*<>*/ /*<>*/ var - v = unsafe_get(arr, i, length); - /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; - /*<>*/ } - /*<>*/ return aux(length - 1 | 0); - /*<>*/ } - function to_seq_rev_reentrant(a){ - function aux(i){ - /*<>*/ return function(param){ - /*<>*/ if(0 > i) - /*<>*/ return 0; - if(a[1] <= i) /*<>*/ return aux(a[1] - 1 | 0)(0); - /*<>*/ /*<>*/ var - v = get(a, i); - /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; - /*<>*/ } - /*<>*/ return aux(a[1] - 1 | 0); - /*<>*/ } - var - Stdlib_Dynarray = - [0, - create, - make, - init, - get, - set, - length, - is_empty, - get_last, - find_last, - copy, - add_last, - append_array, - append_list, - append, - append_seq, - append_iter, - pop_last_opt, - pop_last, - remove_last, - truncate, - clear, - iter$0, - iteri, - map, - mapi, - fold_left, - fold_right, - exists, - for_all, - filter, - filter_map, - of_array, - to_array, - of_list, - to_list, - of_seq, - to_seq, - to_seq_reentrant, - to_seq_rev, - to_seq_rev_reentrant, - capacity, - ensure_capacity, - ensure_extra_capacity, - fit_capacity, - set_capacity, - reset]; - runtime.caml_register_global(44, Stdlib_Dynarray, "Stdlib__Dynarray"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: Stdlib__Arg -//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Buffer, Stdlib__Int, Stdlib__List, Stdlib__Printf, Stdlib__String, Stdlib__Sys -(function - (globalThis){ - "use strict"; - var - runtime = globalThis.jsoo_runtime, - cst$8 = "", - cst$10 = " ", - cst_Display_this_list_of_optio$1 = " Display this list of options", - cst_s = "%s", - cst_help$4 = "--help", - cst_help$3 = "-help", - cst$9 = ".\n", - cst_a_float$1 = "a float", - cst_an_integer$1 = "an integer", - caml_check_bound = runtime.caml_check_bound, - caml_equal = runtime.caml_equal, - caml_fresh_oo_id = runtime.caml_fresh_oo_id, - caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_get = runtime.caml_string_get, - caml_sys_argv = runtime.caml_sys_argv, - caml_wrap_exception = runtime.caml_wrap_exception; - /*<>*/ function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) == 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); - } - /*<>*/ function caml_call2(f, a0, a1){ - return (f.l >= 0 ? f.l : f.l = f.length) == 2 - ? f(a0, a1) - : runtime.caml_call_gen(f, [a0, a1]); - } - /*<>*/ function caml_call3(f, a0, a1, a2){ - return (f.l >= 0 ? f.l : f.l = f.length) == 3 - ? f(a0, a1, a2) - : runtime.caml_call_gen(f, [a0, a1, a2]); - } - /*<>*/ function caml_call4(f, a0, a1, a2, a3){ - return (f.l >= 0 ? f.l : f.l = f.length) == 4 - ? f(a0, a1, a2, a3) - : runtime.caml_call_gen(f, [a0, a1, a2, a3]); - } - /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ - return (f.l >= 0 ? f.l : f.l = f.length) == 5 - ? f(a0, a1, a2, a3, a4) - : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); - } - /*<>*/ function caml_call6(f, a0, a1, a2, a3, a4, a5){ - return (f.l >= 0 ? f.l : f.l = f.length) == 6 - ? f(a0, a1, a2, a3, a4, a5) - : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]); - } - /*<>*/ var - global_data = runtime.caml_get_global_data(), - cst$7 = "\n", - cst$4 = cst$8, - cst$5 = " ", - cst$6 = cst$8, - cst$2 = "(?)", - cst$3 = "-", - cst = "}", - cst$0 = "|", - cst$1 = "{", - Stdlib = global_data.Stdlib, - Stdlib_Printf = global_data.Stdlib__Printf, - Stdlib_Array = global_data.Stdlib__Array, - Stdlib_Buffer = global_data.Stdlib__Buffer, - Stdlib_List = global_data.Stdlib__List, - Stdlib_String = global_data.Stdlib__String, - Stdlib_Int = global_data.Stdlib__Int, - /*<>*/ Bad = [248, "Stdlib.Arg.Bad", caml_fresh_oo_id(0)], - /*<>*/ Help = [248, "Stdlib.Arg.Help", caml_fresh_oo_id(0)], - /*<>*/ Stop = [248, "Stdlib.Arg.Stop", caml_fresh_oo_id(0)], - cst_none = "", - _a_ = - [0, [11, cst$10, [2, 0, [12, 32, [2, 0, [12, 10, 0]]]]], " %s %s\n"], - _b_ = - [0, - [11, cst$10, [2, 0, [12, 32, [2, 0, [2, 0, [12, 10, 0]]]]]], - " %s %s%s\n"], - _c_ = [0, cst_help$3], - cst_Display_this_list_of_optio = cst_Display_this_list_of_optio$1, - cst_help = cst_help$3, - cst_Display_this_list_of_optio$0 = cst_Display_this_list_of_optio$1, - cst_help$0 = cst_help$4, - cst_help$1 = cst_help$4, - cst_help$2 = cst_help$3, - _d_ = [0, [2, 0, [12, 10, 0]], "%s\n"], - _e_ = [0, [2, 0, 0], cst_s]; - function assoc3(x, l){ - /*<>*/ var l$0 = l; - /*<>*/ for(;;){ - if(! l$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - var match = l$0[1], y2 = match[2], y1 = match[1]; - /*<>*/ if( /*<>*/ caml_equal(y1, x)) - /*<>*/ return y2; - var t = l$0[2]; - l$0 = t; - } - /*<>*/ } - function make_symlist(prefix, sep, suffix, l){ - /*<>*/ if(! l) /*<>*/ return cst_none; - /*<>*/ var - t = l[2], - h = l[1], - /*<>*/ _az_ = - /*<>*/ caml_call2(Stdlib[28], prefix, h), - /*<>*/ _aA_ = - /*<>*/ caml_call3 - (Stdlib_List[26], - function(x, y){ - /*<>*/ /*<>*/ var - _aB_ = /*<>*/ caml_call2(Stdlib[28], sep, y); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], x, _aB_); - /*<>*/ }, - _az_, - t); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], _aA_, suffix); - /*<>*/ } - function help_action(param){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stop, _c_], 1); - /*<>*/ } - function add_help(speclist){ - /*<>*/ try{ - /*<>*/ assoc3(cst_help$2, speclist); - /*<>*/ var /*<>*/ _aw_ = 0, add1 = _aw_; - } - catch(_ay_){ - var _as_ = caml_wrap_exception(_ay_); - if(_as_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_as_, 0); - var - add1 = - [0, - [0, cst_help, [0, help_action], cst_Display_this_list_of_optio], - 0]; - } - try{ - /*<>*/ assoc3(cst_help$1, speclist); - /*<>*/ var /*<>*/ _av_ = 0, add2 = _av_; - } - catch(_ax_){ - var _at_ = caml_wrap_exception(_ax_); - if(_at_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_at_, 0); - var - add2 = - [0, - [0, cst_help$0, [0, help_action], cst_Display_this_list_of_optio$0], - 0]; - } - /*<>*/ /*<>*/ var - _au_ = /*<>*/ caml_call2(Stdlib[37], add1, add2); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[37], speclist, _au_); - /*<>*/ } - function usage_b(buf, speclist, errmsg){ - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[5], buf, _d_, errmsg); - /*<>*/ /*<>*/ var - _ap_ = add_help(speclist); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[18], - function(param){ - var - doc = param[3], - spec = param[2], - key = param[1], - _aq_ = - 0 < /*<>*/ caml_ml_string_length(doc) ? 1 : 0; - if(! _aq_) return _aq_; - if(11 !== spec[0]) - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Printf[5], buf, _a_, key, doc); - /*<>*/ var - l = spec[1], - /*<>*/ _ar_ = make_symlist(cst$1, cst$0, cst, l); - /*<>*/ return /*<>*/ caml_call5 - (Stdlib_Printf[5], buf, _b_, key, _ar_, doc); - }, - _ap_); - /*<>*/ } - function usage_string(speclist, errmsg){ - /*<>*/ /*<>*/ var - b = /*<>*/ caml_call1(Stdlib_Buffer[1], 200); - /*<>*/ usage_b(b, speclist, errmsg); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Buffer[2], b); - /*<>*/ } - function usage(speclist, errmsg){ - /*<>*/ /*<>*/ var - _ao_ = usage_string(speclist, errmsg); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Printf[3], _e_, _ao_); - /*<>*/ } - /*<>*/ var - /*<>*/ current = [0, 0], - _f_ = - [0, - [2, 0, [11, ": unknown option '", [2, 0, [11, "'.\n", 0]]]], - "%s: unknown option '%s'.\n"], - _g_ = [0, cst_help$3], - _h_ = [0, cst_help$4], - _i_ = - [0, - [2, - 0, - [11, - ": wrong argument '", - [2, - 0, - [11, - "'; option '", - [2, 0, [11, "' expects ", [2, 0, [11, cst$9, 0]]]]]]]], - "%s: wrong argument '%s'; option '%s' expects %s.\n"], - _j_ = - [0, - [2, 0, [11, ": option '", [2, 0, [11, "' needs an argument.\n", 0]]]], - "%s: option '%s' needs an argument.\n"], - _k_ = [0, [2, 0, [11, ": ", [2, 0, [11, cst$9, 0]]]], "%s: %s.\n"], - cst_no_argument = "no argument", - cst_a_boolean = "a boolean", - cst_an_integer = cst_an_integer$1, - cst_an_integer$0 = cst_an_integer$1, - cst_a_float = cst_a_float$1, - cst_a_float$0 = cst_a_float$1, - cst_one_of = "one of: ", - cst_Arg_Expand_is_is_only_allo = - "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic", - _l_ = [0, [2, 0, 0], cst_s], - _m_ = [0, [2, 0, 0], cst_s], - _n_ = [0, [2, 0, 0], cst_s], - _o_ = [0, [2, 0, 0], cst_s], - _p_ = [0, [2, 0, 0], cst_s], - _q_ = [0, [2, 0, 0], cst_s], - dummy = 0; - function int_of_string_opt(x){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _am_ = [0, /*<>*/ runtime.caml_int_of_string(x)]; - /*<>*/ return _am_; - } - catch(_an_){ - var _al_ = caml_wrap_exception(_an_); - if(_al_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_al_, 0); - } - /*<>*/ } - function float_of_string_opt(x){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _aj_ = [0, /*<>*/ runtime.caml_float_of_string(x)]; - /*<>*/ return _aj_; - } - catch(_ak_){ - var _ai_ = caml_wrap_exception(_ak_); - if(_ai_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_ai_, 0); - } - /*<>*/ } - function parse_and_expand_argv_dynamic_ - (allow_expand, current, argv, speclist, anonfun, errmsg){ - var initpos = current[1]; - function convert_error(error){ - /*<>*/ var - /*<>*/ b = - /*<>*/ caml_call1(Stdlib_Buffer[1], 200), - progname = - initpos < argv[1].length - 1 - ? caml_check_bound(argv[1], initpos)[1 + initpos] - : cst$2; - /*<>*/ switch(error[0]){ - case 0: - var s = error[1]; - if(s !== cst_help$4 && s !== cst_help$3) - /*<>*/ /*<>*/ caml_call4 - (Stdlib_Printf[5], b, _f_, progname, s); - break; - case 1: - var expected = error[3], arg = error[2], opt = error[1]; - /*<>*/ /*<>*/ caml_call6 - (Stdlib_Printf[5], b, _i_, progname, arg, opt, expected); - break; - case 2: - var s$0 = error[1]; - /*<>*/ /*<>*/ caml_call4 - (Stdlib_Printf[5], b, _j_, progname, s$0); - break; - default: - var s$1 = error[1]; - /*<>*/ /*<>*/ caml_call4 - (Stdlib_Printf[5], b, _k_, progname, s$1); + /*<>*/ } + function parse_and_expand_argv_dynamic_ + (allow_expand, current, argv, speclist, anonfun, errmsg){ + var initpos = current[1]; + function convert_error(error){ + /*<>*/ var + /*<>*/ b = + /*<>*/ caml_call1(Stdlib_Buffer[1], 200), + progname = + initpos < argv[1].length - 1 + ? caml_check_bound(argv[1], initpos)[1 + initpos] + : cst$2; + /*<>*/ switch(error[0]){ + case 0: + var s = error[1]; + if(s !== cst_help$4 && s !== cst_help$3) + /*<>*/ /*<>*/ caml_call4 + (Stdlib_Printf[5], b, _f_, progname, s); + break; + case 1: + var expected = error[3], arg = error[2], opt = error[1]; + /*<>*/ /*<>*/ caml_call6 + (Stdlib_Printf[5], b, _i_, progname, arg, opt, expected); + break; + case 2: + var s$0 = error[1]; + /*<>*/ /*<>*/ caml_call4 + (Stdlib_Printf[5], b, _j_, progname, s$0); + break; + default: + var s$1 = error[1]; + /*<>*/ /*<>*/ caml_call4 + (Stdlib_Printf[5], b, _k_, progname, s$1); } /*<>*/ usage_b(b, speclist[1], errmsg); /*<>*/ if @@ -23167,26 +22390,26 @@ (Stdlib_Atomic[4], a, 0); /*<>*/ } function create_alarm(f){ - /*<>*/ /*<>*/ var - _y_ = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ var + alarm = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); + /*<>*/ /*<>*/ caml_call1 (Stdlib_Domain[6], function(param){ - /*<>*/ return delete_alarm(_y_); - /*<>*/ }); - return _y_; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return delete_alarm(alarm); + /*<>*/ }); + /*<>*/ return alarm; + /*<>*/ } + /*<>*/ /*<>*/ var null_tracker = [0, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }, - function(param){ /*<>*/ return 0; /*<>*/ }]; + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }]; function start(sampling_rate, opt, tracker){ var callstack_size = opt ? opt[1] : Stdlib[19]; - /*<>*/ return /*<>*/ runtime.caml_memprof_start + /*<>*/ return /*<>*/ runtime.caml_memprof_start (sampling_rate, callstack_size, tracker); } var @@ -24041,6 +23264,7 @@ runtime = globalThis.jsoo_runtime, cst_Bigarray_Array3_of_array_n$1 = "Bigarray.Array3.of_array: non-cubic data", + caml_array_make = runtime.caml_array_make, caml_ba_change_layout = runtime.caml_ba_change_layout, caml_ba_create = runtime.caml_ba_create, caml_ba_dim_1 = runtime.caml_ba_dim_1, @@ -24054,7 +23278,6 @@ caml_ba_set_generic = runtime.caml_ba_set_generic, caml_ba_slice = runtime.caml_ba_slice, caml_check_bound = runtime.caml_check_bound, - caml_make_vect = runtime.caml_make_vect, caml_mul = runtime.caml_mul; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -24168,14 +23391,14 @@ /*<>*/ return layout ? (floop (arr, - /*<>*/ caml_make_vect(dlen, 1), + /*<>*/ caml_array_make(dlen, 1), f, dlen - 1 | 0, dims), arr) : (cloop (arr, - /*<>*/ caml_make_vect(dlen, 0), + /*<>*/ caml_array_make(dlen, 0), f, 0, dims), @@ -24186,7 +23409,7 @@ /*<>*/ n = /*<>*/ caml_ba_num_dims(a), /*<>*/ d = - /*<>*/ caml_make_vect(n, 0), + /*<>*/ caml_array_make(n, 0), /*<>*/ _af_ = n - 1 | 0, /*<>*/ _ae_ = 0; if(_af_ >= 0){ @@ -25158,101 +24381,101 @@ /*<>*/ /*<>*/ var random_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], [0, split], mk_default); + (Stdlib_Domain[11][1], [0, split], mk_default); function bits$0(param){ /*<>*/ return bits ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function int$1(bound){ /*<>*/ return int$0 ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), bound); /*<>*/ } function full_int$0(bound){ /*<>*/ return full_int ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), bound); /*<>*/ } function int_in_range$0(min, max){ /*<>*/ return int_in_range ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), min, max); /*<>*/ } function int32$0(bound){ /*<>*/ return int32 ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), bound); /*<>*/ } function int32_in_range$0(min, max){ /*<>*/ return int32_in_range ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), min, max); /*<>*/ } function nativeint$0(bound){ /*<>*/ return nativeint ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), bound); /*<>*/ } function nativeint_in_range$0(min, max){ /*<>*/ return nativeint_in_range ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), min, max); /*<>*/ } function int64$0(bound){ /*<>*/ return int64 ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), bound); /*<>*/ } function int64_in_range$0(min, max){ /*<>*/ return int64_in_range ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), min, max); /*<>*/ } function float$1(scale){ /*<>*/ return float$0 ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), scale); /*<>*/ } function bool$0(param){ /*<>*/ return bool ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function bits32$0(param){ /*<>*/ return bits32 ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function bits64$0(param){ /*<>*/ /*<>*/ var s = - /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ caml_call1(Stdlib_Domain[11][2], random_key); /*<>*/ return /*<>*/ caml_lxm_next(s); /*<>*/ } function nativebits$0(param){ /*<>*/ return nativebits ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function full_init(seed){ /*<>*/ return reinit ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key), + (Stdlib_Domain[11][2], random_key), seed); /*<>*/ } function init(seed){ @@ -25265,17 +24488,17 @@ function split$0(param){ /*<>*/ return split ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function get_state(param){ /*<>*/ return copy ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], random_key)); + (Stdlib_Domain[11][2], random_key)); /*<>*/ } function set_state(src){ /*<>*/ /*<>*/ var dst = - /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ caml_call1(Stdlib_Domain[11][2], random_key); /*<>*/ return /*<>*/ caml_ba_blit (src, dst); /*<>*/ } @@ -25337,10 +24560,10 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, caml_compare = runtime.caml_compare, caml_hash = runtime.caml_hash, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_sys_getenv = runtime.caml_sys_getenv, caml_wrap_exception = runtime.caml_wrap_exception; @@ -25428,7 +24651,7 @@ /*<>*/ /*<>*/ var prng_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]); + (Stdlib_Domain[11][1], 0, Stdlib_Random[19][2]); function power_2_above(x, n){ /*<>*/ var x$0 = x; /*<>*/ for(;;){ @@ -25448,13 +24671,13 @@ /*<>*/ if(random) /*<>*/ var /*<>*/ _ak_ = - /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), + /*<>*/ caml_call1(Stdlib_Domain[11][2], prng_key), seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _ak_); else var seed = 0; /*<>*/ return [0, 0, - /*<>*/ caml_make_vect(s, 0), + /*<>*/ caml_array_make(s, 0), seed, s]; } @@ -25475,7 +24698,7 @@ && len !== /*<>*/ caml_call1(Stdlib[18], h[4])){ h[1] = 0; h[2] = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make ( /*<>*/ caml_call1(Stdlib[18], h[4]), 0); return 0; } @@ -25518,7 +24741,7 @@ /*<>*/ var nsize = ndata.length - 1, /*<>*/ ndata_tail = - /*<>*/ caml_make_vect(nsize, 0), + /*<>*/ caml_array_make(nsize, 0), _aa_ = odata.length - 2 | 0, /*<>*/ _$_ = 0; if(_aa_ >= 0){ @@ -25584,7 +24807,7 @@ if(! ___) return ___; /*<>*/ var /*<>*/ ndata = - /*<>*/ caml_make_vect(nsize, 0), + /*<>*/ caml_array_make(nsize, 0), /*<>*/ inplace = 1 - ongoing_traversal(h); h[2] = ndata; /*<>*/ return insert_all_buckets @@ -25758,7 +24981,7 @@ 0, h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0); + /*<>*/ caml_array_make(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Array[12], function(b){ @@ -26328,14 +25551,14 @@ /*<>*/ if(random) /*<>*/ var /*<>*/ _g_ = - /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), + /*<>*/ caml_call1(Stdlib_Domain[11][2], prng_key), seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _g_); else var seed = 4 <= h.length - 1 ? h[3] : 0; /*<>*/ var _h_ = 4 <= h.length - 1 ? h[4] : s, /*<>*/ h$0 = - [0, h[1], /*<>*/ caml_make_vect(s, 0), seed, _h_]; + [0, h[1], /*<>*/ caml_array_make(s, 0), seed, _h_]; /*<>*/ insert_all_buckets (function(_i_){ /*<>*/ return key_index(h$0, _i_);}, 0, h[2], h$0[2]); /*<>*/ return h$0; @@ -26386,8 +25609,8 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_mod = runtime.caml_mod; /*<>*/ function caml_call1(f, a0){ @@ -26522,8 +25745,8 @@ sz$0 = 7 <= sz ? sz : 7, sz$1 = Stdlib_Sys[13] < sz$0 ? Stdlib_Sys[13] : sz$0; /*<>*/ return [0, - /*<>*/ caml_make_vect(sz$1, emptybucket), - /*<>*/ caml_make_vect(sz$1, [0]), + /*<>*/ caml_array_make(sz$1, emptybucket), + /*<>*/ caml_array_make(sz$1, [0]), limit, 0, 0]; @@ -26646,7 +25869,7 @@ /*<>*/ var /*<>*/ newbucket$0 = create(newsz), /*<>*/ newhashes = - /*<>*/ caml_make_vect(newsz, 0); + /*<>*/ caml_array_make(newsz, 0); /*<>*/ blit(bucket$0, 0, newbucket$0, 0, sz); /*<>*/ /*<>*/ caml_call5 (Stdlib_Array[9], hashes, 0, newhashes, 0, sz); @@ -27010,15 +26233,15 @@ Stdlib_Int = global_data.Stdlib__Int, Stdlib_Bytes = global_data.Stdlib__Bytes; function id(x){ /*<>*/ return x; /*<>*/ } - /*<>*/ var + /*<>*/ var zero = 0, unknown = -1, - /*<>*/ String_tag = + /*<>*/ String_tag = [248, "Stdlib.Format.String_tag", runtime.caml_fresh_oo_id(0)]; function pp_enqueue(state, token){ - /*<>*/ state[13] = state[13] + token[3] | 0; + /*<>*/ state[13] = state[13] + token[3] | 0; return caml_call2(Stdlib_Queue[3], token, state[28]); - /*<>*/ } + /*<>*/ } var pp_infinity = 1000000010, _b_ = [0, cst$16], @@ -27028,64 +26251,64 @@ _f_ = [1, "max_indent < 2"], cst_Format_pp_set_geometry = "Format.pp_set_geometry: "; function pp_output_string(state, s){ - /*<>*/ return caml_call3 + /*<>*/ return caml_call3 (state[17], s, 0, caml_ml_string_length(s)); - /*<>*/ } + /*<>*/ } function pp_output_newline(state){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (state[19], 0); - /*<>*/ } + /*<>*/ } function format_pp_text(state, size, text){ - /*<>*/ state[9] = state[9] - size | 0; - /*<>*/ pp_output_string(state, text); + /*<>*/ state[9] = state[9] - size | 0; + /*<>*/ pp_output_string(state, text); state[11] = 0; - /*<>*/ } + /*<>*/ } function format_string(state, s){ - /*<>*/ /*<>*/ var - _a__ = s !== cst$16 ? 1 : 0; - /*<>*/ return _a__ + /*<>*/ /*<>*/ var + _a$_ = s !== cst$16 ? 1 : 0; + /*<>*/ return _a$_ ? format_pp_text(state, caml_ml_string_length(s), s) - : _a__; - /*<>*/ } + : _a$_; + /*<>*/ } function break_new_line(state, param, width){ var after = param[3], offset = param[2], before = param[1]; - /*<>*/ format_string(state, before); - /*<>*/ pp_output_newline(state); + /*<>*/ format_string(state, before); + /*<>*/ pp_output_newline(state); state[11] = 1; - /*<>*/ var + /*<>*/ var indent = (state[6] - width | 0) + offset | 0, - /*<>*/ real_indent = - /*<>*/ caml_call2(Stdlib_Int[10], state[8], indent); + /*<>*/ real_indent = + /*<>*/ caml_call2(Stdlib_Int[10], state[8], indent); state[10] = real_indent; state[9] = state[6] - state[10] | 0; var n = state[10]; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (state[21], n); - /*<>*/ return format_string(state, after); + /*<>*/ return format_string(state, after); } function break_same_line(state, param){ var after = param[3], width = param[2], before = param[1]; - /*<>*/ format_string(state, before); + /*<>*/ format_string(state, before); state[9] = state[9] - width | 0; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (state[20], width); - /*<>*/ return format_string(state, after); + /*<>*/ return format_string(state, after); } function format_pp_token(state, size$0, param){ /*<>*/ if(typeof param === "number") switch(param){ case 0: - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match$3 = - /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); - if(! match$3) /*<>*/ return; - /*<>*/ var + /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); + if(! match$3) /*<>*/ return; + /*<>*/ var tabs = match$3[1][1], - /*<>*/ add_tab = + /*<>*/ add_tab = function(n, ls){ - /*<>*/ if(! ls) /*<>*/ return [0, n, 0]; + /*<>*/ if(! ls) /*<>*/ return [0, n, 0]; var l = ls[2], x = ls[1]; - /*<>*/ return /*<>*/ runtime.caml_lessthan + /*<>*/ return /*<>*/ runtime.caml_lessthan (n, x) ? [0, n, ls] : [0, x, add_tab(n, l)]; @@ -27093,68 +26316,75 @@ tabs[1] = add_tab(state[6] - state[9] | 0, tabs[1]); return; case 1: - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[2]); - /*<>*/ return; + /*<>*/ return; case 2: - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[3]); - /*<>*/ return; + /*<>*/ return; case 3: - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match$4 = - /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); if(! match$4) - /*<>*/ return pp_output_newline(state); + /*<>*/ return pp_output_newline(state); var width$0 = match$4[1][2]; - /*<>*/ return break_new_line(state, _a_, width$0); + /*<>*/ return break_new_line(state, _a_, width$0); case 4: - var _a8_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; - if(! _a8_) return _a8_; - /*<>*/ /*<>*/ var + var _a9_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; + if(! _a9_) return _a9_; + /*<>*/ /*<>*/ var match$1 = - /*<>*/ caml_call1(Stdlib_Queue[6], state[28]); - if(! match$1) /*<>*/ return; + /*<>*/ caml_call1(Stdlib_Queue[6], state[28]); + if(! match$1) /*<>*/ return; var match$2 = match$1[1], size = match$2[1], length = match$2[3]; state[12] = state[12] - length | 0; state[9] = state[9] + size | 0; return; default: - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match$5 = - /*<>*/ caml_call1(Stdlib_Stack[5], state[5]); - if(! match$5) /*<>*/ return; - /*<>*/ var + /*<>*/ caml_call1(Stdlib_Stack[5], state[5]); + if(! match$5) /*<>*/ return; + /*<>*/ var tag_name = match$5[1], - /*<>*/ marker = - /*<>*/ caml_call1(state[25], tag_name); - /*<>*/ return pp_output_string(state, marker); + /*<>*/ marker = + /*<>*/ caml_call1(state[25], tag_name); + /*<>*/ return pp_output_string(state, marker); } switch(param[0]){ case 0: var s = param[1]; - /*<>*/ return format_pp_text(state, size$0, s); + /*<>*/ return format_pp_text(state, size$0, s); case 1: - /*<>*/ var + var len = param[3], pos = param[2], source = param[1]; + state[9] = state[9] - size$0 | 0; + /*<>*/ /*<>*/ caml_call3 + (state[17], source, pos, len); + state[11] = 0; + return; + case 2: + /*<>*/ var breaks = param[2], fits = param[1], - /*<>*/ off = breaks[2], + /*<>*/ off = breaks[2], before = breaks[1], - /*<>*/ match$6 = - /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); - if(! match$6) /*<>*/ return; + /*<>*/ match$6 = + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); + if(! match$6) /*<>*/ return; var match$7 = match$6[1], width$1 = match$7[2], box_type$0 = match$7[1]; - /*<>*/ switch(box_type$0){ + /*<>*/ switch(box_type$0){ case 0: - /*<>*/ return break_same_line(state, fits); + /*<>*/ return break_same_line(state, fits); case 1: - /*<>*/ return break_new_line + /*<>*/ return break_new_line (state, breaks, width$1); case 2: - /*<>*/ return break_new_line + /*<>*/ return break_new_line (state, breaks, width$1); case 3: return state[9] < (size$0 + caml_ml_string_length(before) | 0) @@ -27177,239 +26407,239 @@ ? break_new_line(state, breaks, width$1) : break_same_line(state, fits); default: - /*<>*/ return break_same_line(state, fits); + /*<>*/ return break_same_line(state, fits); } - case 2: - /*<>*/ var + case 3: + /*<>*/ var off$0 = param[2], n = param[1], insertion_point = state[6] - state[9] | 0, - /*<>*/ match$8 = - /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); - if(! match$8) /*<>*/ return; - /*<>*/ var + /*<>*/ match$8 = + /*<>*/ caml_call1(Stdlib_Stack[8], state[3]); + if(! match$8) /*<>*/ return; + /*<>*/ var tabs$0 = match$8[1][1], - /*<>*/ match$9 = tabs$0[1]; + /*<>*/ match$9 = tabs$0[1]; if(match$9){ var first = match$9[1], param$0 = tabs$0[1]; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(param$0){ var tail = param$0[2], head = param$0[1]; if(insertion_point > head){param$0 = tail; continue;} - var _a9_ = head; + var _a__ = head; } else - var _a9_ = first; - var tab = _a9_; + var _a__ = first; + var tab = _a__; break; } } else var tab = insertion_point; var offset = tab - insertion_point | 0; - /*<>*/ return 0 <= offset + /*<>*/ return 0 <= offset ? break_same_line(state, [0, cst$0, offset + n | 0, cst]) : break_new_line (state, [0, cst$2, tab + off$0 | 0, cst$1], state[6]); - case 3: + case 4: var ty = param[2], off$1 = param[1], insertion_point$0 = state[6] - state[9] | 0; if(state[8] < insertion_point$0){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = - /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); + /*<>*/ caml_call1(Stdlib_Stack[8], state[2]); if(match){ var match$0 = match[1], width = match$0[2], box_type = match$0[1]; if(state[9] < width && 3 >= box_type - 1 >>> 0) - /*<>*/ break_new_line(state, _a_, width); + /*<>*/ break_new_line(state, _a_, width); } else - /*<>*/ pp_output_newline(state); + /*<>*/ pp_output_newline(state); } - /*<>*/ var + /*<>*/ var width$2 = state[9] - off$1 | 0, - /*<>*/ box_type$1 = + /*<>*/ box_type$1 = 1 === ty ? 1 : state[9] < size$0 ? ty : 5; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Stack[3], [0, box_type$1, width$2], state[2]); - case 4: + case 5: var tbox = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Stack[3], tbox, state[3]); default: - /*<>*/ var + /*<>*/ var tag_name$0 = param[1], - /*<>*/ marker$0 = - /*<>*/ caml_call1(state[24], tag_name$0); - /*<>*/ pp_output_string(state, marker$0); + /*<>*/ marker$0 = + /*<>*/ caml_call1(state[24], tag_name$0); + /*<>*/ pp_output_string(state, marker$0); return caml_call2(Stdlib_Stack[3], tag_name$0, state[5]); } } function advance_left(state){ - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(Stdlib_Queue[9], state[28]); - if(! match) /*<>*/ return 0; - /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(Stdlib_Queue[9], state[28]); + if(! match) /*<>*/ return 0; + /*<>*/ var match$0 = match[1], size = match$0[1], length = match$0[3], token = match$0[2], pending_count = state[13] - state[12] | 0, - _a6_ = 0 <= size ? 1 : 0, - /*<>*/ _a7_ = - _a6_ || (state[9] <= pending_count ? 1 : 0); - if(! _a7_) /*<>*/ return _a7_; - /*<>*/ /*<>*/ caml_call1 + _a7_ = 0 <= size ? 1 : 0, + /*<>*/ _a8_ = + _a7_ || (state[9] <= pending_count ? 1 : 0); + if(! _a8_) /*<>*/ return _a8_; + /*<>*/ /*<>*/ caml_call1 (Stdlib_Queue[5], state[28]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var size$0 = 0 <= size ? size : pp_infinity; - /*<>*/ format_pp_token(state, size$0, token); + /*<>*/ format_pp_token(state, size$0, token); state[12] = length + state[12] | 0; } - /*<>*/ } + /*<>*/ } function enqueue_advance(state, tok){ - /*<>*/ pp_enqueue(state, tok); - /*<>*/ return advance_left(state); - /*<>*/ } + /*<>*/ pp_enqueue(state, tok); + /*<>*/ return advance_left(state); + /*<>*/ } function enqueue_string_as(state, size, s){ - /*<>*/ return enqueue_advance + /*<>*/ return enqueue_advance (state, [0, size, [0, s], size]); - /*<>*/ } + /*<>*/ } function initialize_scan_stack(stack){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[9], stack); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var queue_elem = [0, unknown, _b_, 0]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Stack[3], [0, -1, queue_elem], stack); - /*<>*/ } + /*<>*/ } function set_size(state, ty){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(Stdlib_Stack[8], state[1]); - if(! match) /*<>*/ return; - /*<>*/ var + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(Stdlib_Stack[8], state[1]); + if(! match) /*<>*/ return; + /*<>*/ var match$0 = match[1], queue_elem = match$0[2], left_total = match$0[1], - /*<>*/ size = queue_elem[1]; + /*<>*/ size = queue_elem[1]; if(left_total < state[12]) return initialize_scan_stack(state[1]); - var _a5_ = queue_elem[2]; - if(typeof _a5_ !== "number") - switch(_a5_[0]){ - case 3: + var _a6_ = queue_elem[2]; + if(typeof _a6_ !== "number") + switch(_a6_[0]){ + case 4: if(1 - ty){ var x$0 = state[13] + size | 0; queue_elem[1] = x$0; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[1]); } - /*<>*/ return; - case 1: + /*<>*/ return; case 2: + case 3: if(ty){ var x = state[13] + size | 0; queue_elem[1] = x; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[5], state[1]); } - /*<>*/ return; + /*<>*/ return; } - /*<>*/ } + /*<>*/ } function scan_push(state, b, token){ - /*<>*/ pp_enqueue(state, token); - if(b) /*<>*/ set_size(state, 1); - /*<>*/ /*<>*/ var + /*<>*/ pp_enqueue(state, token); + if(b) /*<>*/ set_size(state, 1); + /*<>*/ /*<>*/ var elem = [0, state[13], token]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Stack[3], elem, state[1]); - /*<>*/ } + /*<>*/ } function pp_open_box_gen(state, indent, br_ty){ - /*<>*/ state[14] = state[14] + 1 | 0; + /*<>*/ state[14] = state[14] + 1 | 0; if(state[14] < state[15]){ - /*<>*/ var + /*<>*/ var size = - state[13] | 0, - /*<>*/ elem = [0, size, [3, indent, br_ty], 0]; - /*<>*/ return scan_push(state, 0, elem); + /*<>*/ elem = [0, size, [4, indent, br_ty], 0]; + /*<>*/ return scan_push(state, 0, elem); } - var _a4_ = state[14] === state[15] ? 1 : 0; - if(! _a4_) return _a4_; + var _a5_ = state[14] === state[15] ? 1 : 0; + if(! _a5_) return _a5_; var s = state[16], x = caml_ml_string_length(s); - /*<>*/ return enqueue_string_as(state, x, s); - /*<>*/ } + /*<>*/ return enqueue_string_as(state, x, s); + /*<>*/ } function pp_close_box(state, param){ - /*<>*/ var _a2_ = 1 < state[14] ? 1 : 0; - if(_a2_){ + /*<>*/ var _a3_ = 1 < state[14] ? 1 : 0; + if(_a3_){ if(state[14] < state[15]){ - /*<>*/ pp_enqueue(state, [0, zero, 1, 0]); - /*<>*/ set_size(state, 1); - /*<>*/ set_size(state, 0); + /*<>*/ pp_enqueue(state, [0, zero, 1, 0]); + /*<>*/ set_size(state, 1); + /*<>*/ set_size(state, 0); } state[14] = state[14] - 1 | 0; - var _a3_ = 0; + var _a4_ = 0; } else - var _a3_ = _a2_; - return _a3_; - /*<>*/ } + var _a4_ = _a3_; + return _a4_; + /*<>*/ } function pp_open_stag(state, tag_name){ - /*<>*/ if(state[22]){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ if(state[22]){ + /*<>*/ /*<>*/ caml_call2 (Stdlib_Stack[3], tag_name, state[4]); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (state[26], tag_name); } - var _a1_ = state[23]; - if(! _a1_) return _a1_; - /*<>*/ /*<>*/ var - token = [5, tag_name]; - /*<>*/ return pp_enqueue(state, [0, zero, token, 0]); - /*<>*/ } + var _a2_ = state[23]; + if(! _a2_) return _a2_; + /*<>*/ /*<>*/ var + token = [6, tag_name]; + /*<>*/ return pp_enqueue(state, [0, zero, token, 0]); + /*<>*/ } function pp_close_stag(state, param){ - /*<>*/ if(state[23]) - /*<>*/ pp_enqueue(state, [0, zero, 5, 0]); - var _aZ_ = state[22]; - if(_aZ_){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(Stdlib_Stack[5], state[4]); + /*<>*/ if(state[23]) + /*<>*/ pp_enqueue(state, [0, zero, 5, 0]); + var _a0_ = state[22]; + if(_a0_){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(Stdlib_Stack[5], state[4]); if(match){ var tag_name = match[1]; - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (state[27], tag_name); } - var _a0_ = 0; + var _a1_ = 0; } else - var _a0_ = _aZ_; - /*<>*/ return _a0_; - /*<>*/ } + var _a1_ = _a0_; + /*<>*/ return _a1_; + /*<>*/ } function pp_set_print_tags(state, b){ - /*<>*/ state[22] = b; + /*<>*/ state[22] = b; return 0; - /*<>*/ } + /*<>*/ } function pp_set_mark_tags(state, b){ - /*<>*/ state[23] = b; + /*<>*/ state[23] = b; return 0; - /*<>*/ } + /*<>*/ } function pp_get_print_tags(state, param){ - /*<>*/ return state[22]; - /*<>*/ } + /*<>*/ return state[22]; + /*<>*/ } function pp_get_mark_tags(state, param){ - /*<>*/ return state[23]; - /*<>*/ } + /*<>*/ return state[23]; + /*<>*/ } function pp_set_tags(state, b){ - /*<>*/ pp_set_print_tags(state, b); - /*<>*/ return pp_set_mark_tags(state, b); - /*<>*/ } + /*<>*/ pp_set_print_tags(state, b); + /*<>*/ return pp_set_mark_tags(state, b); + /*<>*/ } function pp_get_formatter_stag_function(state, param){ - /*<>*/ return [0, + /*<>*/ return [0, state[24], state[25], state[26], state[27]]; - /*<>*/ } + /*<>*/ } function pp_set_formatter_stag_function(state, param){ var pct = param[4], pot = param[3], mct = param[2], mot = param[1]; state[24] = mot; @@ -27419,153 +26649,165 @@ return 0; } function pp_rinit(state){ - /*<>*/ state[12] = 1; + /*<>*/ state[12] = 1; state[13] = 1; - caml_call1(Stdlib_Queue[11], state[28]); - /*<>*/ initialize_scan_stack(state[1]); - /*<>*/ /*<>*/ caml_call1 + caml_call1(Stdlib_Queue[12], state[28]); + /*<>*/ initialize_scan_stack(state[1]); + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[9], state[2]); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[9], state[3]); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[9], state[4]); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Stack[9], state[5]); state[10] = 0; state[14] = 0; state[9] = state[6]; - /*<>*/ return pp_open_box_gen(state, 0, 3); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, 0, 3); + /*<>*/ } function pp_flush_queue(state, end_with_newline){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (Stdlib_Stack[13], function(param){ - /*<>*/ return pp_close_stag(state, 0); - /*<>*/ }, + /*<>*/ return pp_close_stag(state, 0); + /*<>*/ }, state[4]); - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(1 >= state[14]){ state[13] = pp_infinity; - /*<>*/ advance_left(state); - if(end_with_newline) /*<>*/ pp_output_newline(state); - /*<>*/ return pp_rinit(state); + /*<>*/ advance_left(state); + if(end_with_newline) /*<>*/ pp_output_newline(state); + /*<>*/ return pp_rinit(state); } - /*<>*/ pp_close_box(state, 0); + /*<>*/ pp_close_box(state, 0); } - /*<>*/ } + /*<>*/ } function pp_print_as_size(state, size, s){ - /*<>*/ var _aY_ = state[14] < state[15] ? 1 : 0; - return _aY_ ? enqueue_string_as(state, size, s) : _aY_; - /*<>*/ } + /*<>*/ var _aZ_ = state[14] < state[15] ? 1 : 0; + return _aZ_ ? enqueue_string_as(state, size, s) : _aZ_; + /*<>*/ } function pp_print_as(state, isize, s){ - /*<>*/ return pp_print_as_size(state, isize, s); - /*<>*/ } + /*<>*/ return pp_print_as_size(state, isize, s); + /*<>*/ } function pp_print_string(state, s){ - /*<>*/ var isize = caml_ml_string_length(s); - /*<>*/ return pp_print_as_size(state, isize, s); - /*<>*/ } + /*<>*/ var isize = caml_ml_string_length(s); + /*<>*/ return pp_print_as_size(state, isize, s); + /*<>*/ } + function pp_print_substring_as(pos, len, state, size, source){ + /*<>*/ var _aY_ = state[14] < state[15] ? 1 : 0; + if(! _aY_) return _aY_; + /*<>*/ /*<>*/ var + token = [1, source, pos, len]; + /*<>*/ return enqueue_advance + (state, [0, size, token, size]); + /*<>*/ } + function pp_print_substring(pos, len, state, s){ + /*<>*/ return pp_print_substring_as + (pos, len, state, len, s); + /*<>*/ } function pp_print_bytes(state, s){ - /*<>*/ var - /*<>*/ s$0 = - /*<>*/ caml_call1(Stdlib_Bytes[6], s), + /*<>*/ var + /*<>*/ s$0 = + /*<>*/ caml_call1(Stdlib_Bytes[6], s), isize = runtime.caml_ml_bytes_length(s); - /*<>*/ return pp_print_as_size(state, isize, s$0); - /*<>*/ } + /*<>*/ return pp_print_as_size(state, isize, s$0); + /*<>*/ } function pp_print_int(state, i){ - /*<>*/ return pp_print_string - (state, /*<>*/ caml_call1(Stdlib_Int[12], i)); - /*<>*/ } + /*<>*/ return pp_print_string + (state, /*<>*/ caml_call1(Stdlib_Int[12], i)); + /*<>*/ } function pp_print_float(state, f){ - /*<>*/ return pp_print_string - (state, /*<>*/ caml_call1(Stdlib[35], f)); - /*<>*/ } + /*<>*/ return pp_print_string + (state, /*<>*/ caml_call1(Stdlib[35], f)); + /*<>*/ } function pp_print_bool(state, b){ - /*<>*/ return pp_print_string - (state, /*<>*/ caml_call1(Stdlib[30], b)); - /*<>*/ } + /*<>*/ return pp_print_string + (state, /*<>*/ caml_call1(Stdlib[30], b)); + /*<>*/ } function pp_print_char(state, c){ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call2(Stdlib_String[1], 1, c); - /*<>*/ return pp_print_as_size(state, 1, s); - /*<>*/ } - function pp_print_nothing(state, param){ /*<>*/ return 0; - /*<>*/ } + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call2(Stdlib_String[1], 1, c); + /*<>*/ return pp_print_as_size(state, 1, s); + /*<>*/ } + function pp_print_nothing(state, param){ /*<>*/ return 0; + /*<>*/ } function pp_open_hbox(state, param){ - /*<>*/ return pp_open_box_gen(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, 0, 0); + /*<>*/ } function pp_open_vbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 1); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 1); + /*<>*/ } function pp_open_hvbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 2); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 2); + /*<>*/ } function pp_open_hovbox(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 3); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 3); + /*<>*/ } function pp_open_box(state, indent){ - /*<>*/ return pp_open_box_gen(state, indent, 4); - /*<>*/ } + /*<>*/ return pp_open_box_gen(state, indent, 4); + /*<>*/ } function pp_print_newline(state, param){ - /*<>*/ pp_flush_queue(state, 1); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(state, 1); + /*<>*/ return /*<>*/ caml_call1 (state[18], 0); - /*<>*/ } + /*<>*/ } function pp_print_flush(state, param){ - /*<>*/ pp_flush_queue(state, 0); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(state, 0); + /*<>*/ return /*<>*/ caml_call1 (state[18], 0); - /*<>*/ } + /*<>*/ } function pp_force_newline(state, param){ - /*<>*/ var _aX_ = state[14] < state[15] ? 1 : 0; + /*<>*/ var _aX_ = state[14] < state[15] ? 1 : 0; return _aX_ ? enqueue_advance(state, [0, zero, 3, 0]) : _aX_; - /*<>*/ } + /*<>*/ } function pp_print_if_newline(state, param){ - /*<>*/ var _aW_ = state[14] < state[15] ? 1 : 0; + /*<>*/ var _aW_ = state[14] < state[15] ? 1 : 0; return _aW_ ? enqueue_advance(state, [0, zero, 4, 0]) : _aW_; - /*<>*/ } + /*<>*/ } function pp_print_custom_break(state, fits, breaks){ - /*<>*/ var + /*<>*/ var after = fits[3], width = fits[2], before = fits[1], _aV_ = state[14] < state[15] ? 1 : 0; if(! _aV_) return _aV_; - /*<>*/ var + /*<>*/ var size = - state[13] | 0, - /*<>*/ token = [1, fits, breaks], + /*<>*/ token = [2, fits, breaks], length = (caml_ml_string_length(before) + width | 0) - + /*<>*/ caml_ml_string_length(after) + + /*<>*/ caml_ml_string_length(after) | 0, - /*<>*/ elem = [0, size, token, length]; - /*<>*/ return scan_push(state, 1, elem); - /*<>*/ } + /*<>*/ elem = [0, size, token, length]; + /*<>*/ return scan_push(state, 1, elem); + /*<>*/ } function pp_print_break(state, width, offset){ - /*<>*/ return pp_print_custom_break + /*<>*/ return pp_print_custom_break (state, [0, cst$6, width, cst$5], [0, cst$4, offset, cst$3]); - /*<>*/ } + /*<>*/ } function pp_print_space(state, param){ - /*<>*/ return pp_print_break(state, 1, 0); - /*<>*/ } + /*<>*/ return pp_print_break(state, 1, 0); + /*<>*/ } function pp_print_cut(state, param){ - /*<>*/ return pp_print_break(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_print_break(state, 0, 0); + /*<>*/ } function pp_open_tbox(state, param){ - /*<>*/ state[14] = state[14] + 1 | 0; + /*<>*/ state[14] = state[14] + 1 | 0; var _aU_ = state[14] < state[15] ? 1 : 0; if(! _aU_) return _aU_; - /*<>*/ /*<>*/ var - elem = [0, zero, [4, [0, [0, 0]]], 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ /*<>*/ var + elem = [0, zero, [5, [0, [0, 0]]], 0]; + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_close_tbox(state, param){ - /*<>*/ var _aR_ = 1 < state[14] ? 1 : 0; + /*<>*/ var _aR_ = 1 < state[14] ? 1 : 0; if(_aR_){ var _aS_ = state[14] < state[15] ? 1 : 0; if(_aS_){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var elem = [0, zero, 2, 0]; - /*<>*/ enqueue_advance(state, elem); + /*<>*/ enqueue_advance(state, elem); state[14] = state[14] - 1 | 0; var _aT_ = 0; } @@ -27575,126 +26817,126 @@ else var _aT_ = _aR_; return _aT_; - /*<>*/ } + /*<>*/ } function pp_print_tbreak(state, width, offset){ - /*<>*/ var _aQ_ = state[14] < state[15] ? 1 : 0; + /*<>*/ var _aQ_ = state[14] < state[15] ? 1 : 0; if(! _aQ_) return _aQ_; - /*<>*/ var + /*<>*/ var size = - state[13] | 0, - /*<>*/ elem = [0, size, [2, width, offset], width]; - /*<>*/ return scan_push(state, 1, elem); - /*<>*/ } + /*<>*/ elem = [0, size, [3, width, offset], width]; + /*<>*/ return scan_push(state, 1, elem); + /*<>*/ } function pp_print_tab(state, param){ - /*<>*/ return pp_print_tbreak(state, 0, 0); - /*<>*/ } + /*<>*/ return pp_print_tbreak(state, 0, 0); + /*<>*/ } function pp_set_tab(state, param){ - /*<>*/ var _aP_ = state[14] < state[15] ? 1 : 0; + /*<>*/ var _aP_ = state[14] < state[15] ? 1 : 0; if(! _aP_) return _aP_; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var elem = [0, zero, 0, 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_set_max_boxes(state, n){ - /*<>*/ var + /*<>*/ var _aN_ = 1 < n ? 1 : 0, _aO_ = _aN_ ? (state[15] = n, 0) : _aN_; return _aO_; - /*<>*/ } + /*<>*/ } function pp_get_max_boxes(state, param){ - /*<>*/ return state[15]; - /*<>*/ } + /*<>*/ return state[15]; + /*<>*/ } function pp_over_max_boxes(state, param){ - /*<>*/ return state[14] === state[15] ? 1 : 0; - /*<>*/ } + /*<>*/ return state[14] === state[15] ? 1 : 0; + /*<>*/ } function pp_set_ellipsis_text(state, s){ - /*<>*/ state[16] = s; + /*<>*/ state[16] = s; return 0; - /*<>*/ } + /*<>*/ } function pp_get_ellipsis_text(state, param){ - /*<>*/ return state[16]; - /*<>*/ } + /*<>*/ return state[16]; + /*<>*/ } function pp_limit(n){ - /*<>*/ return n < 1000000010 ? n : 1000000009; - /*<>*/ } + /*<>*/ return n < 1000000010 ? n : 1000000009; + /*<>*/ } function pp_set_max_indent(state, n$0){ - /*<>*/ var _aM_ = 1 < n$0 ? 1 : 0; + /*<>*/ var _aM_ = 1 < n$0 ? 1 : 0; if(! _aM_) return _aM_; var n$1 = state[6] - n$0 | 0, _aL_ = 1 <= n$1 ? 1 : 0; if(! _aL_) return _aL_; - /*<>*/ /*<>*/ var n = pp_limit(n$1); + /*<>*/ /*<>*/ var n = pp_limit(n$1); state[7] = n; state[8] = state[6] - state[7] | 0; - /*<>*/ return pp_rinit(state); - /*<>*/ } + /*<>*/ return pp_rinit(state); + /*<>*/ } function pp_get_max_indent(state, param){ - /*<>*/ return state[8]; - /*<>*/ } + /*<>*/ return state[8]; + /*<>*/ } function pp_set_margin(state, n){ - /*<>*/ var _aJ_ = 1 <= n ? 1 : 0; + /*<>*/ var _aJ_ = 1 <= n ? 1 : 0; if(! _aJ_) return _aJ_; - /*<>*/ /*<>*/ var n$0 = pp_limit(n); + /*<>*/ /*<>*/ var n$0 = pp_limit(n); state[6] = n$0; if(state[8] <= state[6]) var new_max_indent = state[8]; else - /*<>*/ var - /*<>*/ _aK_ = - /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ _aK_ = + /*<>*/ caml_call2 (Stdlib_Int[11], state[6] - state[7] | 0, state[6] / 2 | 0), new_max_indent = - /*<>*/ caml_call2(Stdlib_Int[11], _aK_, 1); - /*<>*/ return pp_set_max_indent(state, new_max_indent); - /*<>*/ } + /*<>*/ caml_call2(Stdlib_Int[11], _aK_, 1); + /*<>*/ return pp_set_max_indent(state, new_max_indent); + /*<>*/ } function validate_geometry(param){ var margin = param[2], max_indent = param[1]; - /*<>*/ return 2 <= max_indent + /*<>*/ return 2 <= max_indent ? margin <= max_indent ? _c_ : 1000000010 <= margin ? _d_ : _e_ : _f_; } function check_geometry(geometry){ - /*<>*/ return 0 === validate_geometry(geometry)[0] + /*<>*/ return 0 === validate_geometry(geometry)[0] ? 1 : 0; - /*<>*/ } + /*<>*/ } function pp_get_margin(state, param){ - /*<>*/ return state[6]; - /*<>*/ } + /*<>*/ return state[6]; + /*<>*/ } function pp_set_full_geometry(state, param){ var margin = param[2], max_indent = param[1]; - /*<>*/ pp_set_margin(state, margin); - /*<>*/ pp_set_max_indent(state, max_indent); - /*<>*/ return 0; + /*<>*/ pp_set_margin(state, margin); + /*<>*/ pp_set_max_indent(state, max_indent); + /*<>*/ return 0; } function pp_set_geometry(state, max_indent, margin){ - /*<>*/ var - /*<>*/ geometry = [0, max_indent, margin], - /*<>*/ match = validate_geometry(geometry); + /*<>*/ var + /*<>*/ geometry = [0, max_indent, margin], + /*<>*/ match = validate_geometry(geometry); if(0 === match[0]) - /*<>*/ return pp_set_full_geometry(state, geometry); - /*<>*/ var + /*<>*/ return pp_set_full_geometry(state, geometry); + /*<>*/ var msg = match[1], - /*<>*/ _aI_ = - /*<>*/ caml_call2 + /*<>*/ _aI_ = + /*<>*/ caml_call2 (Stdlib[28], cst_Format_pp_set_geometry, msg); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stdlib[6], _aI_], 1); - /*<>*/ } + /*<>*/ } function pp_safe_set_geometry(state, max_indent, margin){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var geometry = [0, max_indent, margin]; return 0 === validate_geometry(geometry)[0] ? pp_set_full_geometry(state, geometry) : 0; - /*<>*/ } + /*<>*/ } function pp_get_geometry(state, param){ - /*<>*/ return [0, state[8], state[6]]; - /*<>*/ } + /*<>*/ return [0, state[8], state[6]]; + /*<>*/ } function pp_update_geometry(state, update){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var geometry = pp_get_geometry(state, 0); - /*<>*/ return pp_set_full_geometry - (state, /*<>*/ caml_call1(update, geometry)); - /*<>*/ } + /*<>*/ return pp_set_full_geometry + (state, /*<>*/ caml_call1(update, geometry)); + /*<>*/ } function pp_set_formatter_out_functions(state, param){ var j = param[5], i = param[4], h = param[3], g = param[2], f = param[1]; state[17] = f; @@ -27705,103 +26947,103 @@ return 0; } function pp_get_formatter_out_functions(state, param){ - /*<>*/ return [0, + /*<>*/ return [0, state[17], state[18], state[19], state[20], state[21]]; - /*<>*/ } + /*<>*/ } function pp_set_formatter_output_functi(state, f, g){ - /*<>*/ state[17] = f; + /*<>*/ state[17] = f; state[18] = g; return 0; - /*<>*/ } + /*<>*/ } function pp_get_formatter_output_functi(state, param){ - /*<>*/ return [0, state[17], state[18]]; - /*<>*/ } + /*<>*/ return [0, state[17], state[18]]; + /*<>*/ } function display_newline(state, param){ - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (state[17], cst$7, 0, 1); - /*<>*/ } - /*<>*/ var - /*<>*/ blank_line = - /*<>*/ caml_call2(Stdlib_String[1], 80, 32), - _g_ = [3, 0, 3]; + /*<>*/ } + /*<>*/ var + /*<>*/ blank_line = + /*<>*/ caml_call2(Stdlib_String[1], 80, 32), + _g_ = [4, 0, 3]; function display_blanks(state, n){ - /*<>*/ var n$0 = n; - /*<>*/ for(;;){ + /*<>*/ var n$0 = n; + /*<>*/ for(;;){ var _aH_ = 0 < n$0 ? 1 : 0; if(! _aH_) return _aH_; if(80 >= n$0) - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (state[17], blank_line, 0, n$0); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ /*<>*/ caml_call3 (state[17], blank_line, 0, 80); - /*<>*/ /*<>*/ var n$1 = n$0 - 80 | 0; + /*<>*/ /*<>*/ var n$1 = n$0 - 80 | 0; n$0 = n$1; } - /*<>*/ } + /*<>*/ } function pp_set_formatter_out_channel(state, oc){ - /*<>*/ state[17] = - /*<>*/ caml_call1(Stdlib[69], oc); + /*<>*/ state[17] = + /*<>*/ caml_call1(Stdlib[69], oc); state[18] = function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ }; + /*<>*/ }; state[19] = function(_aG_){ /*<>*/ return display_newline(state, _aG_);}; state[20] = function(_aF_){ /*<>*/ return display_blanks(state, _aF_);}; state[21] = function(_aE_){ /*<>*/ return display_blanks(state, _aE_);}; return 0; - /*<>*/ } + /*<>*/ } function default_pp_mark_open_tag(param){ - /*<>*/ if(param[1] !== String_tag) - /*<>*/ return cst$10; - /*<>*/ var + /*<>*/ if(param[1] !== String_tag) + /*<>*/ return cst$10; + /*<>*/ var s = param[2], - /*<>*/ _aD_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$8); - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ _aD_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$8); + /*<>*/ return /*<>*/ caml_call2 (Stdlib[28], cst$9, _aD_); - /*<>*/ } + /*<>*/ } function default_pp_mark_close_tag(param){ - /*<>*/ if(param[1] !== String_tag) - /*<>*/ return cst$13; - /*<>*/ var + /*<>*/ if(param[1] !== String_tag) + /*<>*/ return cst$13; + /*<>*/ var s = param[2], - /*<>*/ _aC_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$11); - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ _aC_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$11); + /*<>*/ return /*<>*/ caml_call2 (Stdlib[28], cst$12, _aC_); - /*<>*/ } + /*<>*/ } function default_pp_print_open_tag(_aB_){ /*<>*/ return 0;} function default_pp_print_close_tag(_aA_){ /*<>*/ return 0;} function pp_make_formatter(f, g, h, i, j){ - /*<>*/ var - /*<>*/ pp_queue = - /*<>*/ caml_call1(Stdlib_Queue[2], 0), - /*<>*/ sys_tok = [0, unknown, _g_, 0]; - /*<>*/ /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ pp_queue = + /*<>*/ caml_call1(Stdlib_Queue[2], 0), + /*<>*/ sys_tok = [0, unknown, _g_, 0]; + /*<>*/ /*<>*/ caml_call2 (Stdlib_Queue[3], sys_tok, pp_queue); - /*<>*/ /*<>*/ var - scan_stack = /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ initialize_scan_stack(scan_stack); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ var + scan_stack = /*<>*/ caml_call1(Stdlib_Stack[2], 0); + /*<>*/ initialize_scan_stack(scan_stack); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Stack[3], [0, 1, sys_tok], scan_stack); - /*<>*/ var - /*<>*/ pp_margin = 78, + /*<>*/ var + /*<>*/ pp_margin = 78, _aw_ = Stdlib[19], - /*<>*/ _ax_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _ay_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _az_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ return [0, + /*<>*/ _ax_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _ay_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _az_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0); + /*<>*/ return [0, scan_stack, - /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ caml_call1(Stdlib_Stack[2], 0), _az_, _ay_, _ax_, @@ -27830,11 +27072,11 @@ pp_queue]; } function formatter_of_out_functions(out_funs){ - /*<>*/ return pp_make_formatter + /*<>*/ return pp_make_formatter (out_funs[1], out_funs[2], out_funs[3], out_funs[4], out_funs[5]); - /*<>*/ } + /*<>*/ } function make_formatter(output, flush){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var ppf = pp_make_formatter (output, @@ -27845,96 +27087,96 @@ ppf[19] = function(_as_){ /*<>*/ return display_newline(ppf, _as_);}; ppf[20] = function(_ar_){ /*<>*/ return display_blanks(ppf, _ar_);}; ppf[21] = function(_aq_){ /*<>*/ return display_blanks(ppf, _aq_);}; - /*<>*/ return ppf; - /*<>*/ } + /*<>*/ return ppf; + /*<>*/ } function formatter_of_out_channel(oc){ - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ }); - /*<>*/ } + /*<>*/ }); + /*<>*/ } function formatter_of_buffer(b){ - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), function(_ap_){ /*<>*/ return 0;}); - /*<>*/ } + /*<>*/ } var pp_buffer_size = 512; function pp_make_buffer(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ var - /*<>*/ stdbuf = pp_make_buffer(0), - /*<>*/ std_formatter = + /*<>*/ } + /*<>*/ var + /*<>*/ stdbuf = pp_make_buffer(0), + /*<>*/ std_formatter = formatter_of_out_channel(Stdlib[39]), - /*<>*/ err_formatter = + /*<>*/ err_formatter = formatter_of_out_channel(Stdlib[40]), - /*<>*/ str_formatter = formatter_of_buffer(stdbuf), - /*<>*/ stdbuf_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, pp_make_buffer); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Domain[10][3], stdbuf_key, stdbuf); - /*<>*/ /*<>*/ var + /*<>*/ str_formatter = formatter_of_buffer(stdbuf), + /*<>*/ stdbuf_key = + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, pp_make_buffer); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Domain[11][3], stdbuf_key, stdbuf); + /*<>*/ /*<>*/ var str_formatter_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ return formatter_of_buffer - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], stdbuf_key)); - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Domain[10][3], str_formatter_key, str_formatter); - /*<>*/ function buffered_out_string(key, str, ofs, len){ - /*<>*/ /*<>*/ var - _ao_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); - /*<>*/ return /*<>*/ caml_call4 + /*<>*/ return formatter_of_buffer + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], stdbuf_key)); + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Domain[11][3], str_formatter_key, str_formatter); + /*<>*/ function buffered_out_string(key, str, ofs, len){ + /*<>*/ /*<>*/ var + _ao_ = /*<>*/ caml_call1(Stdlib_Domain[11][2], key); + /*<>*/ return /*<>*/ caml_call4 (Stdlib_Buffer[18], _ao_, str, ofs, len); - /*<>*/ } + /*<>*/ } function buffered_out_flush(oc, key, param){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1(Stdlib_Domain[10][2], key), - /*<>*/ len = - /*<>*/ caml_call1(Stdlib_Buffer[7], buf), - /*<>*/ str = - /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ /*<>*/ caml_call4 + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1(Stdlib_Domain[11][2], key), + /*<>*/ len = + /*<>*/ caml_call1(Stdlib_Buffer[7], buf), + /*<>*/ str = + /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ /*<>*/ caml_call4 (Stdlib[69], oc, str, 0, len); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[8], buf); - /*<>*/ } - /*<>*/ var - /*<>*/ std_buf_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ } + /*<>*/ var + /*<>*/ std_buf_key = + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ }), - /*<>*/ err_buf_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ }), + /*<>*/ err_buf_key = + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ }), - /*<>*/ std_formatter_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ }), + /*<>*/ std_formatter_key = + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ var + /*<>*/ var _ac_ = Stdlib[39], - /*<>*/ ppf = + /*<>*/ ppf = pp_make_formatter (function(_al_, _am_, _an_){ /*<>*/ return buffered_out_string @@ -27952,22 +27194,22 @@ function(_af_){ /*<>*/ return display_blanks(ppf, _af_);}; ppf[21] = function(_ae_){ /*<>*/ return display_blanks(ppf, _ae_);}; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Domain[6], function(_ad_){ /*<>*/ return pp_print_flush(ppf, _ad_);}); - /*<>*/ return ppf; - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Domain[10][3], std_formatter_key, std_formatter); - /*<>*/ /*<>*/ var + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Domain[11][3], std_formatter_key, std_formatter); + /*<>*/ /*<>*/ var err_formatter_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ var + /*<>*/ var _S_ = Stdlib[40], - /*<>*/ ppf = + /*<>*/ ppf = pp_make_formatter (function(_$_, _aa_, _ab_){ /*<>*/ return buffered_out_string @@ -27982,513 +27224,530 @@ ppf[19] = function(_W_){ /*<>*/ return display_newline(ppf, _W_);}; ppf[20] = function(_V_){ /*<>*/ return display_blanks(ppf, _V_);}; ppf[21] = function(_U_){ /*<>*/ return display_blanks(ppf, _U_);}; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Domain[6], function(_T_){ /*<>*/ return pp_print_flush(ppf, _T_);}); - /*<>*/ return ppf; - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Domain[10][3], err_formatter_key, err_formatter); + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Domain[11][3], err_formatter_key, err_formatter); function get_std_formatter(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); + /*<>*/ } function get_err_formatter(param){ - /*<>*/ return caml_call1 - (Stdlib_Domain[10][2], err_formatter_key); - /*<>*/ } + /*<>*/ return caml_call1 + (Stdlib_Domain[11][2], err_formatter_key); + /*<>*/ } function get_str_formatter(param){ - /*<>*/ return caml_call1 - (Stdlib_Domain[10][2], str_formatter_key); - /*<>*/ } + /*<>*/ return caml_call1 + (Stdlib_Domain[11][2], str_formatter_key); + /*<>*/ } function get_stdbuf(param){ - /*<>*/ return caml_call1 - (Stdlib_Domain[10][2], stdbuf_key); - /*<>*/ } + /*<>*/ return caml_call1 + (Stdlib_Domain[11][2], stdbuf_key); + /*<>*/ } function flush_buffer_formatter(buf, ppf){ - /*<>*/ pp_flush_queue(ppf, 0); - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ pp_flush_queue(ppf, 0); + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ /*<>*/ caml_call1 (Stdlib_Buffer[9], buf); - /*<>*/ return s; - /*<>*/ } + /*<>*/ return s; + /*<>*/ } function flush_str_formatter(param){ - /*<>*/ var - /*<>*/ stdbuf = - /*<>*/ caml_call1(Stdlib_Domain[10][2], stdbuf_key), - /*<>*/ str_formatter = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], str_formatter_key); - /*<>*/ return flush_buffer_formatter + /*<>*/ var + /*<>*/ stdbuf = + /*<>*/ caml_call1(Stdlib_Domain[11][2], stdbuf_key), + /*<>*/ str_formatter = + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], str_formatter_key); + /*<>*/ return flush_buffer_formatter (stdbuf, str_formatter); - /*<>*/ } + /*<>*/ } function make_synchronized_formatter(output, flush){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, function(param){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1 (Stdlib_Buffer[1], pp_buffer_size), - /*<>*/ output$0 = - /*<>*/ caml_call1(Stdlib_Buffer[18], buf); + /*<>*/ output$0 = + /*<>*/ caml_call1(Stdlib_Buffer[18], buf); function flush$0(param){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _R_ = - /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ /*<>*/ caml_call3 (output, - /*<>*/ caml_call1(Stdlib_Buffer[2], buf), + /*<>*/ caml_call1(Stdlib_Buffer[2], buf), 0, _R_); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Buffer[8], buf); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (flush, 0); - /*<>*/ } - /*<>*/ return make_formatter + /*<>*/ } + /*<>*/ return make_formatter (output$0, flush$0); - /*<>*/ }); - /*<>*/ } + /*<>*/ }); + /*<>*/ } function synchronized_formatter_of_out_(oc){ - /*<>*/ return make_synchronized_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), + /*<>*/ return make_synchronized_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ }); - /*<>*/ } - function make_symbolic_output_buffer(param){ /*<>*/ return [0, 0]; - /*<>*/ } + /*<>*/ }); + /*<>*/ } + function make_symbolic_output_buffer(param){ /*<>*/ return [0, 0]; + /*<>*/ } function clear_symbolic_output_buffer(sob){ - /*<>*/ sob[1] = 0; + /*<>*/ sob[1] = 0; return 0; - /*<>*/ } + /*<>*/ } function get_symbolic_output_buffer(sob){ - /*<>*/ return caml_call1(Stdlib_List[10], sob[1]); - /*<>*/ } + /*<>*/ return caml_call1(Stdlib_List[10], sob[1]); + /*<>*/ } function flush_symbolic_output_buffer(sob){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var items = get_symbolic_output_buffer(sob); - /*<>*/ clear_symbolic_output_buffer(sob); - /*<>*/ return items; - /*<>*/ } + /*<>*/ clear_symbolic_output_buffer(sob); + /*<>*/ return items; + /*<>*/ } function add_symbolic_output_item(sob, item){ - /*<>*/ sob[1] = [0, item, sob[1]]; + /*<>*/ sob[1] = [0, item, sob[1]]; return 0; - /*<>*/ } + /*<>*/ } function formatter_of_symbolic_output_b(sob){ - /*<>*/ function f(s, i, n){ - /*<>*/ return add_symbolic_output_item + /*<>*/ function f(s, i, n){ + /*<>*/ return add_symbolic_output_item (sob, [0, - /*<>*/ caml_call3 + /*<>*/ caml_call3 (Stdlib_String[16], s, i, n)]); } - /*<>*/ function g(_Q_){ - /*<>*/ return add_symbolic_output_item(sob, 0); + /*<>*/ function g(_Q_){ + /*<>*/ return add_symbolic_output_item(sob, 0); } - /*<>*/ function h(_P_){ - /*<>*/ return add_symbolic_output_item(sob, 1); + /*<>*/ function h(_P_){ + /*<>*/ return add_symbolic_output_item(sob, 1); } - /*<>*/ function i(n){ - /*<>*/ return add_symbolic_output_item(sob, [1, n]); + /*<>*/ function i(n){ + /*<>*/ return add_symbolic_output_item(sob, [1, n]); } - /*<>*/ function j(n){ - /*<>*/ return add_symbolic_output_item(sob, [2, n]); + /*<>*/ function j(n){ + /*<>*/ return add_symbolic_output_item(sob, [2, n]); } - /*<>*/ return pp_make_formatter(f, g, h, i, j); - /*<>*/ } + /*<>*/ return pp_make_formatter(f, g, h, i, j); + /*<>*/ } function open_hbox(v){ - /*<>*/ return pp_open_hbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_hbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_vbox(v){ - /*<>*/ return pp_open_vbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_vbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hvbox(v){ - /*<>*/ return pp_open_hvbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_hvbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hovbox(v){ - /*<>*/ return pp_open_hovbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_hovbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_box(v){ - /*<>*/ return pp_open_box - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_box + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_box(v){ - /*<>*/ return pp_close_box - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_close_box + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_stag(v){ - /*<>*/ return pp_open_stag - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_stag + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_stag(v){ - /*<>*/ return pp_close_stag - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_close_stag + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_as(isize, w){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); - /*<>*/ return pp_print_as_size(state, isize, w); - /*<>*/ } + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); + /*<>*/ return pp_print_as_size(state, isize, w); + /*<>*/ } function print_string(v){ - /*<>*/ return pp_print_string - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_string + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), + v); + /*<>*/ } + function print_substring(pos, len, v){ + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); + /*<>*/ return pp_print_substring_as + (pos, len, state, len, v); + /*<>*/ } + function print_substring_as(pos, len, as_len, v){ + /*<>*/ return pp_print_substring_as + (pos, + len, + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), + as_len, v); - /*<>*/ } + /*<>*/ } function print_bytes(v){ - /*<>*/ return pp_print_bytes - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_bytes + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_int(v){ - /*<>*/ return pp_print_int - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_int + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_float(v){ - /*<>*/ return pp_print_float - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_float + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_char(v){ - /*<>*/ return pp_print_char - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_char + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_bool(v){ - /*<>*/ return pp_print_bool - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_bool + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_break(v, w){ - /*<>*/ return pp_print_break - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_break + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function print_cut(v){ - /*<>*/ return pp_print_cut - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_cut + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_space(v){ - /*<>*/ return pp_print_space - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_space + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function force_newline(v){ - /*<>*/ return pp_force_newline - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_force_newline + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_flush(v){ - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_newline(v){ - /*<>*/ return pp_print_newline - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_newline + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_if_newline(v){ - /*<>*/ return pp_print_if_newline - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_if_newline + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_tbox(v){ - /*<>*/ return pp_open_tbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_open_tbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_tbox(v){ - /*<>*/ return pp_close_tbox - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_close_tbox + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tbreak(v, w){ - /*<>*/ return pp_print_tbreak - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_tbreak + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function set_tab(v){ - /*<>*/ return pp_set_tab - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_tab + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tab(v){ - /*<>*/ return pp_print_tab - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_print_tab + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_margin(v){ - /*<>*/ return pp_set_margin - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_margin + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_margin(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[6]; - /*<>*/ } + /*<>*/ } function set_max_indent(v){ - /*<>*/ return pp_set_max_indent - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_max_indent + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_indent(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[8]; - /*<>*/ } + /*<>*/ } function set_geometry(max_indent, margin){ - /*<>*/ return pp_set_geometry - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_geometry + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function safe_set_geometry(max_indent, margin){ - /*<>*/ return pp_safe_set_geometry - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_safe_set_geometry + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function get_geometry(v){ - /*<>*/ return pp_get_geometry - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_get_geometry + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function update_geometry(v){ - /*<>*/ return pp_update_geometry - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_update_geometry + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_max_boxes(v){ - /*<>*/ return pp_set_max_boxes - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_max_boxes + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_boxes(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[15]; - /*<>*/ } + /*<>*/ } function over_max_boxes(v){ - /*<>*/ return pp_over_max_boxes - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_over_max_boxes + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_ellipsis_text(v){ - /*<>*/ return pp_set_ellipsis_text - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_ellipsis_text + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_ellipsis_text(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[16]; - /*<>*/ } + /*<>*/ } function set_formatter_out_channel(v){ - /*<>*/ return pp_set_formatter_out_channel - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_formatter_out_channel + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_out_functions(v){ - /*<>*/ return pp_set_formatter_out_functions - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_formatter_out_functions + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_out_functions(v){ - /*<>*/ return pp_get_formatter_out_functions - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_get_formatter_out_functions + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_output_functions(v, w){ - /*<>*/ return pp_set_formatter_output_functi - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_formatter_output_functi + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function get_formatter_output_functions(v){ - /*<>*/ return pp_get_formatter_output_functi - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_get_formatter_output_functi + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_stag_functions(v){ - /*<>*/ return pp_set_formatter_stag_function - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_formatter_stag_function + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_stag_functions(v){ - /*<>*/ return pp_get_formatter_stag_function - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_get_formatter_stag_function + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_print_tags(v){ - /*<>*/ return pp_set_print_tags - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_print_tags + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_print_tags(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[22]; - /*<>*/ } + /*<>*/ } function set_mark_tags(v){ - /*<>*/ return pp_set_mark_tags - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_mark_tags + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_mark_tags(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key); + /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key); return state[23]; - /*<>*/ } + /*<>*/ } function set_tags(v){ - /*<>*/ return pp_set_tags - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return pp_set_tags + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function pp_print_iter(opt, iter, pp_v, ppf, v){ - /*<>*/ var + /*<>*/ var pp_sep = opt ? opt[1] : pp_print_cut, - /*<>*/ is_first = [0, 1]; + /*<>*/ is_first = [0, 1]; function pp_v$0(v){ - /*<>*/ if(is_first[1]) + /*<>*/ if(is_first[1]) is_first[1] = 0; else - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (pp_sep, ppf, 0); - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (pp_v, ppf, v); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 (iter, pp_v$0, v); } function pp_print_list(opt, pp_v, ppf, v){ var pp_sep = opt ? opt[1] : pp_print_cut; - /*<>*/ return pp_print_iter + /*<>*/ return pp_print_iter ([0, pp_sep], Stdlib_List[18], pp_v, ppf, v); } function pp_print_array(opt, pp_v, ppf, v){ var pp_sep = opt ? opt[1] : pp_print_cut; - /*<>*/ return pp_print_iter + /*<>*/ return pp_print_iter ([0, pp_sep], Stdlib_Array[12], pp_v, ppf, v); } function pp_print_seq(opt, pp_v, ppf, seq){ var pp_sep = opt ? opt[1] : pp_print_cut; - /*<>*/ return pp_print_iter + /*<>*/ return pp_print_iter ([0, pp_sep], Stdlib_Seq[4], pp_v, ppf, seq); } - function pp_print_text(ppf, s){ - /*<>*/ var + function pp_print_text(state, s){ + /*<>*/ var len = caml_ml_string_length(s), - /*<>*/ left = [0, 0], - /*<>*/ right = [0, 0]; + /*<>*/ left = [0, 0], + /*<>*/ right = [0, 0]; function flush(param){ - /*<>*/ pp_print_string - (ppf, - /*<>*/ caml_call3 - (Stdlib_String[16], s, left[1], right[1] - left[1] | 0)); + /*<>*/ var + len = right[1] - left[1] | 0, + pos = left[1]; + /*<>*/ pp_print_substring_as(pos, len, state, len, s); right[1]++; left[1] = right[1]; return 0; - /*<>*/ } + /*<>*/ } for(;;){ if(right[1] === len){ var _O_ = left[1] !== len ? 1 : 0; return _O_ ? flush(0) : _O_; } - /*<>*/ /*<>*/ var - match = /*<>*/ runtime.caml_string_get(s, right[1]); + /*<>*/ /*<>*/ var + match = /*<>*/ runtime.caml_string_get(s, right[1]); if(10 === match){ - /*<>*/ flush(0); - /*<>*/ pp_force_newline(ppf, 0); + /*<>*/ flush(0); + /*<>*/ pp_force_newline(state, 0); } else if(32 === match){ - /*<>*/ flush(0); - /*<>*/ pp_print_space(ppf, 0); + /*<>*/ flush(0); + /*<>*/ pp_print_space(state, 0); } else right[1]++; } - /*<>*/ } + /*<>*/ } function pp_print_option(opt, pp_v, ppf, param){ var none = @@ -28496,82 +27755,82 @@ ? opt[1] : function (_N_, param){ - /*<>*/ return 0; - /*<>*/ }; + /*<>*/ return 0; + /*<>*/ }; if(! param) - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (none, ppf, 0); var v = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (pp_v, ppf, v); } function pp_print_result(ok, error, ppf, param){ /*<>*/ if(0 === param[0]){ var v = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (ok, ppf, v); } var e = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (error, ppf, e); } function pp_print_either(left, right, ppf, param){ /*<>*/ if(0 === param[0]){ var l = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (left, ppf, l); } var r = param[1]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (right, ppf, r); } function compute_tag(output, tag_acc){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1(Stdlib_Buffer[1], 16), - /*<>*/ ppf = formatter_of_buffer(buf); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ buf = + /*<>*/ caml_call1(Stdlib_Buffer[1], 16), + /*<>*/ ppf = formatter_of_buffer(buf); + /*<>*/ /*<>*/ caml_call2 (output, ppf, tag_acc); - /*<>*/ pp_print_flush(ppf, 0); - /*<>*/ /*<>*/ var - len = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ return 2 <= len - ? /*<>*/ caml_call3 + /*<>*/ pp_print_flush(ppf, 0); + /*<>*/ /*<>*/ var + len = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ return 2 <= len + ? /*<>*/ caml_call3 (Stdlib_Buffer[4], buf, 1, len - 2 | 0) - : /*<>*/ caml_call1(Stdlib_Buffer[2], buf); - /*<>*/ } + : /*<>*/ caml_call1(Stdlib_Buffer[2], buf); + /*<>*/ } function output_formatting_lit(ppf, fmting_lit){ - /*<>*/ if(typeof fmting_lit === "number") + /*<>*/ if(typeof fmting_lit === "number") switch(fmting_lit){ case 0: - /*<>*/ return pp_close_box(ppf, 0); + /*<>*/ return pp_close_box(ppf, 0); case 1: - /*<>*/ return pp_close_stag(ppf, 0); + /*<>*/ return pp_close_stag(ppf, 0); case 2: - /*<>*/ return pp_print_flush(ppf, 0); + /*<>*/ return pp_print_flush(ppf, 0); case 3: - /*<>*/ return pp_force_newline(ppf, 0); + /*<>*/ return pp_force_newline(ppf, 0); case 4: - /*<>*/ return pp_print_newline(ppf, 0); + /*<>*/ return pp_print_newline(ppf, 0); case 5: - /*<>*/ return pp_print_char(ppf, 64); - default: /*<>*/ return pp_print_char(ppf, 37); + /*<>*/ return pp_print_char(ppf, 64); + default: /*<>*/ return pp_print_char(ppf, 37); } switch(fmting_lit[0]){ case 0: var offset = fmting_lit[3], width = fmting_lit[2]; - /*<>*/ return pp_print_break(ppf, width, offset); + /*<>*/ return pp_print_break(ppf, width, offset); case 1: - /*<>*/ return 0; + /*<>*/ return 0; default: var c = fmting_lit[1]; - /*<>*/ pp_print_char(ppf, 64); - /*<>*/ return pp_print_char(ppf, c); + /*<>*/ pp_print_char(ppf, 64); + /*<>*/ return pp_print_char(ppf, c); } - /*<>*/ } + /*<>*/ } function output_acc(ppf, acc){ - /*<>*/ if(typeof acc === "number") - /*<>*/ return 0; + /*<>*/ if(typeof acc === "number") + /*<>*/ return 0; a: { b: @@ -28581,26 +27840,26 @@ switch(acc[0]){ case 0: var f = acc[2], p = acc[1]; - /*<>*/ output_acc(ppf, p); - /*<>*/ return output_formatting_lit(ppf, f); + /*<>*/ output_acc(ppf, p); + /*<>*/ return output_formatting_lit(ppf, f); case 1: var match = acc[2], p$0 = acc[1]; if(0 === match[0]){ var acc$0 = match[1]; - /*<>*/ output_acc(ppf, p$0); - /*<>*/ return pp_open_stag + /*<>*/ output_acc(ppf, p$0); + /*<>*/ return pp_open_stag (ppf, [0, String_tag, compute_tag(output_acc, acc$0)]); } var acc$1 = match[1]; - /*<>*/ output_acc(ppf, p$0); - /*<>*/ var - /*<>*/ _E_ = compute_tag(output_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 + /*<>*/ output_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _E_ = compute_tag(output_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 (CamlinternalFormat[20], _E_), bty = match$0[2], indent = match$0[1]; - /*<>*/ return pp_open_box_gen(ppf, indent, bty); + /*<>*/ return pp_open_box_gen(ppf, indent, bty); case 2: var _F_ = acc[1]; if(typeof _F_ !== "number" && 0 === _F_[0]){ @@ -28647,38 +27906,38 @@ break c; case 6: var f$0 = acc[2], p$5 = acc[1]; - /*<>*/ output_acc(ppf, p$5); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ output_acc(ppf, p$5); + /*<>*/ return /*<>*/ caml_call1 (f$0, ppf); case 7: var p$6 = acc[1]; - /*<>*/ output_acc(ppf, p$6); - /*<>*/ return pp_print_flush(ppf, 0); + /*<>*/ output_acc(ppf, p$6); + /*<>*/ return pp_print_flush(ppf, 0); default: var msg = acc[2], p$7 = acc[1]; - /*<>*/ output_acc(ppf, p$7); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ output_acc(ppf, p$7); + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], msg); } - /*<>*/ output_acc(ppf, p$4); - /*<>*/ return pp_print_as_size + /*<>*/ output_acc(ppf, p$4); + /*<>*/ return pp_print_as_size (ppf, size$0, - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_String[1], 1, c$0)); } - /*<>*/ output_acc(ppf, p$3); - /*<>*/ return pp_print_char(ppf, c); + /*<>*/ output_acc(ppf, p$3); + /*<>*/ return pp_print_char(ppf, c); } - /*<>*/ output_acc(ppf, p$2); - /*<>*/ return pp_print_as_size(ppf, size, s$0); + /*<>*/ output_acc(ppf, p$2); + /*<>*/ return pp_print_as_size(ppf, size, s$0); } - /*<>*/ output_acc(ppf, p$1); - /*<>*/ return pp_print_string(ppf, s); - /*<>*/ } + /*<>*/ output_acc(ppf, p$1); + /*<>*/ return pp_print_string(ppf, s); + /*<>*/ } function strput_acc(ppf, acc){ - /*<>*/ if(typeof acc === "number") - /*<>*/ return 0; + /*<>*/ if(typeof acc === "number") + /*<>*/ return 0; a: { b: @@ -28688,26 +27947,26 @@ switch(acc[0]){ case 0: var f = acc[2], p = acc[1]; - /*<>*/ strput_acc(ppf, p); - /*<>*/ return output_formatting_lit(ppf, f); + /*<>*/ strput_acc(ppf, p); + /*<>*/ return output_formatting_lit(ppf, f); case 1: var match = acc[2], p$0 = acc[1]; if(0 === match[0]){ var acc$0 = match[1]; - /*<>*/ strput_acc(ppf, p$0); - /*<>*/ return pp_open_stag + /*<>*/ strput_acc(ppf, p$0); + /*<>*/ return pp_open_stag (ppf, [0, String_tag, compute_tag(strput_acc, acc$0)]); } var acc$1 = match[1]; - /*<>*/ strput_acc(ppf, p$0); - /*<>*/ var - /*<>*/ _v_ = compute_tag(strput_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 + /*<>*/ strput_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _v_ = compute_tag(strput_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 (CamlinternalFormat[20], _v_), bty = match$0[2], indent = match$0[1]; - /*<>*/ return pp_open_box_gen(ppf, indent, bty); + /*<>*/ return pp_open_box_gen(ppf, indent, bty); case 2: var _w_ = acc[1]; if(typeof _w_ !== "number" && 0 === _w_[0]){ @@ -28758,60 +28017,60 @@ var match$1 = p$5[2]; if(typeof match$1 !== "number" && 1 === match$1[0]){ var f$1 = acc[2], size$1 = match$1[2], p$6 = p$5[1]; - /*<>*/ strput_acc(ppf, p$6); - /*<>*/ return pp_print_as_size - (ppf, size$1, /*<>*/ caml_call1(f$1, 0)); + /*<>*/ strput_acc(ppf, p$6); + /*<>*/ return pp_print_as_size + (ppf, size$1, /*<>*/ caml_call1(f$1, 0)); } } var f$0 = acc[2]; - /*<>*/ strput_acc(ppf, p$5); - /*<>*/ return pp_print_string - (ppf, /*<>*/ caml_call1(f$0, 0)); + /*<>*/ strput_acc(ppf, p$5); + /*<>*/ return pp_print_string + (ppf, /*<>*/ caml_call1(f$0, 0)); case 7: var p$7 = acc[1]; - /*<>*/ strput_acc(ppf, p$7); - /*<>*/ return pp_print_flush(ppf, 0); + /*<>*/ strput_acc(ppf, p$7); + /*<>*/ return pp_print_flush(ppf, 0); default: var msg = acc[2], p$8 = acc[1]; - /*<>*/ strput_acc(ppf, p$8); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ strput_acc(ppf, p$8); + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], msg); } - /*<>*/ strput_acc(ppf, p$4); - /*<>*/ return pp_print_as_size + /*<>*/ strput_acc(ppf, p$4); + /*<>*/ return pp_print_as_size (ppf, size$0, - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_String[1], 1, c$0)); } - /*<>*/ strput_acc(ppf, p$3); - /*<>*/ return pp_print_char(ppf, c); + /*<>*/ strput_acc(ppf, p$3); + /*<>*/ return pp_print_char(ppf, c); } - /*<>*/ strput_acc(ppf, p$2); - /*<>*/ return pp_print_as_size(ppf, size, s$0); + /*<>*/ strput_acc(ppf, p$2); + /*<>*/ return pp_print_as_size(ppf, size, s$0); } - /*<>*/ strput_acc(ppf, p$1); - /*<>*/ return pp_print_string(ppf, s); - /*<>*/ } + /*<>*/ strput_acc(ppf, p$1); + /*<>*/ return pp_print_string(ppf, s); + /*<>*/ } function kfprintf(k, ppf, param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], function(acc){ - /*<>*/ output_acc(ppf, acc); + /*<>*/ output_acc(ppf, acc); return caml_call1(k, ppf); - /*<>*/ }, + /*<>*/ }, 0, fmt); } function ikfprintf(k, ppf, param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[8], k, ppf, fmt); } function ifprintf(ppf, param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[8], function(_u_){ /*<>*/ return 0;}, 0, @@ -28819,109 +28078,109 @@ } function fprintf(ppf){ function _r_(_t_){ /*<>*/ return 0;} - /*<>*/ return function(_s_){ + /*<>*/ return function(_s_){ /*<>*/ return kfprintf(_r_, ppf, _s_);}; - /*<>*/ } + /*<>*/ } function printf(param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], function(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ return output_acc + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), acc); - /*<>*/ }, + /*<>*/ }, 0, fmt); } function eprintf(param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], function(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], err_formatter_key), + /*<>*/ return output_acc + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], err_formatter_key), acc); - /*<>*/ }, + /*<>*/ }, 0, fmt); } function kdprintf(k, param){ var fmt = param[1]; - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], function(acc){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (k, function(ppf){ - /*<>*/ return output_acc(ppf, acc); - /*<>*/ }); - /*<>*/ }, + /*<>*/ return output_acc(ppf, acc); + /*<>*/ }); + /*<>*/ }, 0, fmt); } function dprintf(fmt){ - /*<>*/ return kdprintf + /*<>*/ return kdprintf (function(i){ - /*<>*/ return i; - /*<>*/ }, + /*<>*/ return i; + /*<>*/ }, fmt); - /*<>*/ } + /*<>*/ } function ksprintf(k, param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ b = pp_make_buffer(0), - /*<>*/ ppf = formatter_of_buffer(b); + /*<>*/ b = pp_make_buffer(0), + /*<>*/ ppf = formatter_of_buffer(b); function k$0(acc){ - /*<>*/ strput_acc(ppf, acc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ strput_acc(ppf, acc); + /*<>*/ return /*<>*/ caml_call1 (k, flush_buffer_formatter(b, ppf)); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], k$0, 0, fmt); } function sprintf(fmt){ - /*<>*/ return ksprintf(id, fmt); - /*<>*/ } + /*<>*/ return ksprintf(id, fmt); + /*<>*/ } function kasprintf(k, param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ b = pp_make_buffer(0), - /*<>*/ ppf = formatter_of_buffer(b); + /*<>*/ b = pp_make_buffer(0), + /*<>*/ ppf = formatter_of_buffer(b); function k$0(acc){ - /*<>*/ output_acc(ppf, acc); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ output_acc(ppf, acc); + /*<>*/ return /*<>*/ caml_call1 (k, flush_buffer_formatter(b, ppf)); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 (CamlinternalFormat[7], k$0, 0, fmt); } function asprintf(fmt){ - /*<>*/ return kasprintf(id, fmt); - /*<>*/ } + /*<>*/ return kasprintf(id, fmt); + /*<>*/ } function flush_standard_formatters(param){ - /*<>*/ pp_print_flush - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], std_formatter_key), + /*<>*/ pp_print_flush + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], std_formatter_key), 0); - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 - (Stdlib_Domain[10][2], err_formatter_key), + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 + (Stdlib_Domain[11][2], err_formatter_key), 0); - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 + /*<>*/ } + /*<>*/ /*<>*/ caml_call1 (Stdlib[100], flush_standard_formatters); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Domain[5], function(param){ - /*<>*/ flush_standard_formatters(0); - /*<>*/ var - /*<>*/ fs = + /*<>*/ flush_standard_formatters(0); + /*<>*/ var + /*<>*/ fs = pp_get_formatter_out_functions(std_formatter, 0), _h_ = Stdlib[39]; - /*<>*/ pp_set_formatter_out_functions + /*<>*/ pp_set_formatter_out_functions (std_formatter, [0, function(_o_, _p_, _q_){ @@ -28933,11 +28192,11 @@ fs[3], fs[4], fs[5]]); - /*<>*/ var - /*<>*/ fs$0 = + /*<>*/ var + /*<>*/ fs$0 = pp_get_formatter_out_functions(err_formatter, 0), _i_ = Stdlib[40]; - /*<>*/ return pp_set_formatter_out_functions + /*<>*/ return pp_set_formatter_out_functions (err_formatter, [0, function(_k_, _l_, _m_){ @@ -28950,7 +28209,7 @@ fs$0[3], fs$0[4], fs$0[5]]); - /*<>*/ }); + /*<>*/ }); var Stdlib_Format = [0, @@ -28968,10 +28227,14 @@ open_hovbox, pp_print_string, print_string, + pp_print_substring, + print_substring, pp_print_bytes, print_bytes, pp_print_as, print_as, + pp_print_substring_as, + print_substring_as, pp_print_int, print_int, pp_print_float, @@ -31336,10 +30599,10 @@ var runtime = globalThis.jsoo_runtime, cst_camlinternalOO_ml = "camlinternalOO.ml", + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, caml_div = runtime.caml_div, caml_get_public_method = runtime.caml_get_public_method, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_obj_block = runtime.caml_obj_block, caml_set_oo_id = runtime.caml_set_oo_id, @@ -31426,7 +30689,7 @@ /*<>*/ var len = pub_labels.length - 1, /*<>*/ methods = - /*<>*/ caml_make_vect + /*<>*/ caml_array_make ((len * 2 | 0) + 2 | 0, dummy_met); /*<>*/ caml_check_bound(methods, 0)[1] = len; var @@ -31475,7 +30738,7 @@ if(_ab_){ /*<>*/ /*<>*/ var new_buck = - /*<>*/ caml_make_vect(new_size, dummy_met); + /*<>*/ caml_array_make(new_size, dummy_met); /*<>*/ /*<>*/ caml_call5 (Stdlib_Array[9], array[2], 0, new_buck, 0, old_size); array[2] = new_buck; @@ -31542,7 +30805,7 @@ /*<>*/ /*<>*/ var _X_ = /*<>*/ caml_call2 - (Stdlib_List[49], label, table[6]); + (Stdlib_List[53], label, table[6]); /*<>*/ return _X_; } catch(_Y_){ @@ -31719,7 +30982,8 @@ /*<>*/ nmeths = meths$0.length - 1, nvals = vals.length - 1, /*<>*/ res = - /*<>*/ caml_make_vect(nmeths + nvals | 0, 0), + /*<>*/ caml_array_make + (nmeths + nvals | 0, 0), /*<>*/ _D_ = nmeths - 1 | 0, /*<>*/ _C_ = 0; if(_D_ >= 0){ @@ -31813,7 +31077,7 @@ 3 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _x_) | 0); /*<>*/ } function inherits(cla, vals, virt_meths, concr_meths, param, top){ - var env = param[4], super$0 = param[2]; + var env = param[3], super$0 = param[2]; /*<>*/ narrow (cla, vals, virt_meths, concr_meths); var @@ -31856,9 +31120,8 @@ /*<>*/ return [0, /*<>*/ caml_call1(env_init, 0), class_init, - env_init, 0]; - /*<>*/ } + /*<>*/ } function make_class_store(pub_meths, class_init, init_table){ /*<>*/ var /*<>*/ table = create_table(pub_meths), @@ -31874,8 +31137,8 @@ /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Stdlib[15], loc], 1); /*<>*/ } - /*<>*/ return [0, undef, undef, undef, 0]; - /*<>*/ } + /*<>*/ return [0, undef, undef, 0]; + /*<>*/ } function create_object(table){ /*<>*/ /*<>*/ var obj = @@ -32345,254 +31608,1597 @@ /*<>*/ new_cache(table); let m$6 = m$5, n$19 = n$18; var - clo$0 = - function(obj){ - /*<>*/ /*<>*/ var - _i_ = - /*<>*/ caml_call1 - (obj[1][1 + n$19], obj); - /*<>*/ return /*<>*/ caml_call1 - (caml_get_public_method(_i_, m$6, 0), _i_); - /*<>*/ }; + clo$0 = + function(obj){ + /*<>*/ /*<>*/ var + _i_ = + /*<>*/ caml_call1 + (obj[1][1 + n$19], obj); + /*<>*/ return /*<>*/ caml_call1 + (caml_get_public_method(_i_, m$6, 0), _i_); + /*<>*/ }; + } + else + var clo$0 = clo; + /*<>*/ set_method(table, label, clo$0); + i[1]++; + } + /*<>*/ } + function stats(param){ + /*<>*/ return [0, + table_count[1], + method_count[1], + inst_var_count[1]]; + /*<>*/ } + var + CamlinternalOO = + [0, + public_method_label, + new_method, + new_variable, + new_methods_variables, + get_variable, + get_variables, + get_method_label, + get_method_labels, + get_method, + set_method, + set_methods, + narrow, + widen, + add_initializer, + dummy_table, + create_table, + init_class, + inherits, + make_class, + make_class_store, + dummy_class, + copy, + create_object, + create_object_opt, + run_initializers, + run_initializers_opt, + create_object_and_run_initiali, + lookup_tables, + params, + stats]; + runtime.caml_register_global(17, CamlinternalOO, "CamlinternalOO"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Oo +//# unitInfo: Requires: CamlinternalOO +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + global_data = runtime.caml_get_global_data(), + CamlinternalOO = global_data.CamlinternalOO, + copy = CamlinternalOO[22], + new_method = CamlinternalOO[1], + public_method_label = CamlinternalOO[1], + Stdlib_Oo = [0, copy, new_method, public_method_label]; + runtime.caml_register_global(1, Stdlib_Oo, "Stdlib__Oo"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: CamlinternalMod +//# unitInfo: Requires: CamlinternalLazy, CamlinternalOO, Stdlib, Stdlib__Obj +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_camlinternalMod_ml = "camlinternalMod.ml", + caml_check_bound = runtime.caml_check_bound, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_tag = runtime.caml_obj_tag; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + CamlinternalLazy = global_data.CamlinternalLazy, + CamlinternalOO = global_data.CamlinternalOO, + Assert_failure = global_data.Assert_failure, + cst_CamlinternalMod_init_mod_n = "CamlinternalMod.init_mod: not a module", + _a_ = [0, cst_camlinternalMod_ml, 72, 5], + _b_ = [0, cst_camlinternalMod_ml, 81, 2], + cst_CamlinternalMod_update_mod = + "CamlinternalMod.update_mod: not a module"; + function init_mod_block(loc, comps$0){ + /*<>*/ var + length = comps$0.length - 1, + /*<>*/ modu = + /*<>*/ runtime.caml_obj_block(0, length), + /*<>*/ _h_ = length - 1 | 0, + /*<>*/ _g_ = 0; + if(_h_ >= 0){ + var i = _g_; + for(;;){ + /*<>*/ /*<>*/ var + shape = caml_check_bound(comps$0, i)[1 + i]; + if(typeof shape === "number") + switch(shape){ + case 0: + let i$1 = i; + var + fn = + function(x){ + /*<>*/ /*<>*/ var + fn = modu[1 + i$1]; + if(fn$0 === fn) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[15], loc], 1); + /*<>*/ return /*<>*/ caml_call1 + (fn, x); + /*<>*/ }; + let fn$0 = fn; + var init = fn; + break; + case 1: + var l = []; + let l$0 = l, i$0 = i; + runtime.caml_update_dummy + (l, + [246, + function(param){ + /*<>*/ /*<>*/ var + l = modu[1 + i$0]; + if(l$0 === l) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[15], loc], 1); + var _j_ = caml_obj_tag(l); + if(250 === _j_) return l[1]; + if(246 !== _j_ && 244 !== _j_) + /*<>*/ return l; + /*<>*/ return /*<>*/ caml_call1 + (CamlinternalLazy[2], l); + }]); + var init = l; + break; + default: + var + init = + /*<>*/ caml_call1 + (CamlinternalOO[21], loc); + } + else if(0 === shape[0]) + var comps = shape[1], init = init_mod_block(loc, comps); + else + var v = shape[1], init = v; + /*<>*/ modu[1 + i] = init; + /*<>*/ /*<>*/ var + _i_ = i + 1 | 0; + if(_h_ === i) break; + i = _i_; + } + } + /*<>*/ return modu; + /*<>*/ } + function init_mod(loc, shape){ + /*<>*/ if + (typeof shape !== "number" && 0 === shape[0]){ + var comps = shape[1]; + /*<>*/ return init_mod_block(loc, comps); + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[2], cst_CamlinternalMod_init_mod_n); + /*<>*/ } + function update_mod_block(comps$0, modu, n){ + /*<>*/ if + (0 === /*<>*/ caml_obj_tag(n) + && comps$0.length - 1 <= n.length - 1){ + /*<>*/ var + _e_ = comps$0.length - 2 | 0, + /*<>*/ _d_ = 0; + if(_e_ >= 0){ + var i = _d_; + for(;;){ + /*<>*/ var + /*<>*/ n$0 = n[1 + i], + /*<>*/ shape = + caml_check_bound(comps$0, i)[1 + i]; + a: + if(typeof shape === "number"){ + if(2 === shape){ + if + (0 === /*<>*/ caml_obj_tag(n$0) + && 3 === n$0.length - 1){ + /*<>*/ var + /*<>*/ cl = modu[1 + i], + j = 0; + for(;;){ + /*<>*/ cl[1 + j] = n$0[1 + j]; + /*<>*/ /*<>*/ var + _c_ = j + 1 | 0; + if(2 === j) break; + j = _c_; + } + break a; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); + } + /*<>*/ modu[1 + i] = n$0; + } + else if(0 === shape[0]){ + var comps = shape[1]; + /*<>*/ update_mod_block + (comps, modu[1 + i], n$0); + } + /*<>*/ /*<>*/ var + _f_ = i + 1 | 0; + if(_e_ === i) break; + i = _f_; + } + } + return 0; + } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _b_], 1); + /*<>*/ } + function update_mod(shape, o, n){ + /*<>*/ if + (typeof shape !== "number" && 0 === shape[0]){ + var comps = shape[1]; + /*<>*/ return update_mod_block(comps, o, n); + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[2], cst_CamlinternalMod_update_mod); + /*<>*/ } + var CamlinternalMod = [0, init_mod, update_mod]; + runtime.caml_register_global(8, CamlinternalMod, "CamlinternalMod"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Dynarray +//# unitInfo: Requires: CamlinternalOO, Stdlib, Stdlib__Array, Stdlib__Obj, Stdlib__Printf, Stdlib__Seq, Stdlib__Sys +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_requested = " requested", + cst = "..", + cst_index = ": index ", + cst_Dynarray = "Dynarray.", + cst_append$1 = "append", + cst_blit$1 = "blit", + cst_compare$1 = "compare", + cst_dynarray_ml = "dynarray.ml", + cst_ensure_capacity$0 = "ensure_capacity", + cst_equal$1 = "equal", + caml_array_make = runtime.caml_array_make, + caml_check_bound = runtime.caml_check_bound, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_tag = runtime.caml_obj_tag, + caml_wrap_exception = runtime.caml_wrap_exception; + /*<>*/ function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + /*<>*/ function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + /*<>*/ function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + /*<>*/ function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + /*<>*/ function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + f$1 = cst_ensure_capacity$0, + f$0 = "get_last", + f = "get", + invalid_state_description = + "Invalid dynarray (unsynchronized concurrent length change)", + Stdlib_Array = global_data.Stdlib__Array, + Stdlib = global_data.Stdlib, + Stdlib_Printf = global_data.Stdlib__Printf, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_Sys = global_data.Stdlib__Sys, + Assert_failure = global_data.Assert_failure, + Stdlib_Obj = global_data.Stdlib__Obj, + CamlinternalOO = global_data.CamlinternalOO, + _a_ = [0, 0]; + function copy(a, dummy){ + /*<>*/ /*<>*/ var + _aH_ = Stdlib_Obj[17]; + if( /*<>*/ caml_obj_tag(a) !== _aH_) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Array[7], a); + /*<>*/ var + n = a.length - 1, + /*<>*/ arr = + /*<>*/ caml_array_make(n, dummy), + /*<>*/ _aJ_ = n - 1 | 0, + /*<>*/ _aI_ = 0; + if(_aJ_ >= 0){ + var i = _aI_; + for(;;){ + /*<>*/ /*<>*/ var + v = a[1 + i]; + /*<>*/ arr[1 + i] = v; + /*<>*/ /*<>*/ var + _aK_ = i + 1 | 0; + if(_aJ_ === i) break; + i = _aK_; + } + } + /*<>*/ return arr; + /*<>*/ } + function prefix(arr, n){ + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Array[6], arr, 0, n); + /*<>*/ } + function extend(arr, length, dummy, new_capacity){ + /*<>*/ /*<>*/ var + new_arr = + /*<>*/ caml_array_make(new_capacity, dummy); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], arr, 0, new_arr, 0, length); + /*<>*/ return new_arr; + /*<>*/ } + /*<>*/ var + /*<>*/ r = [0, 0], + cst_to_seq_rev = "to_seq_rev", + cst_to_seq = "to_seq", + cst_to_list = "to_list", + cst_to_array = "to_array", + cst_compare = cst_compare$1, + cst_compare$0 = cst_compare$1, + cst_equal = cst_equal$1, + cst_equal$0 = cst_equal$1, + cst_find_mapi = "find_mapi", + cst_find_map = "find_map", + cst_find_index = "find_index", + cst_find_opt = "find_opt", + cst_memq = "memq", + cst_mem = "mem", + cst_filter_map = "filter_map", + cst_filter = "filter", + cst_for_all = "for_all", + cst_exists = "exists", + cst_fold_right = "fold_right", + cst_fold_left = "fold_left", + cst_mapi = "mapi", + cst_map = "map", + cst_iteri = "iteri", + cst_iter = "iter", + cst_append$0 = cst_append$1, + cst_append = cst_append$1, + _r_ = + [0, + [11, "Dynarray.blit: invalid blit length (", [4, 0, 0, 0, [12, 41, 0]]], + "Dynarray.blit: invalid blit length (%d)"], + _s_ = + [0, + [11, + "Dynarray.blit: invalid source region (", + [4, + 0, + 0, + 0, + [11, + cst, + [4, + 0, + 0, + 0, + [11, ") in source dynarray of length ", [4, 0, 0, 0, 0]]]]]], + "Dynarray.blit: invalid source region (%d..%d) in source dynarray of length %d"], + _t_ = + [0, + [11, + "Dynarray.blit: invalid target region (", + [4, + 0, + 0, + 0, + [11, + cst, + [4, + 0, + 0, + 0, + [11, ") in target dynarray of length ", [4, 0, 0, 0, 0]]]]]], + "Dynarray.blit: invalid target region (%d..%d) in target dynarray of length %d"], + cst_blit = cst_blit$1, + cst_blit$0 = cst_blit$1, + cst_set_capacity = "set_capacity", + cst_ensure_capacity = cst_ensure_capacity$0, + _q_ = [0, cst_dynarray_ml, 606, 4], + _p_ = [0, cst_dynarray_ml, 611, 4], + _o_ = [0, cst_dynarray_ml, 612, 4], + cst_truncate = "truncate", + cst_set = "set", + cst_init = "init", + cst_make = "make", + _n_ = + [0, + [11, cst_Dynarray, [2, 0, [11, ": empty array", 0]]], + "Dynarray.%s: empty array"], + _m_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + ": a length change from ", + [4, + 0, + 0, + 0, + [11, " to ", [4, 0, 0, 0, [11, " occurred during iteration", 0]]]]]]], + "Dynarray.%s: a length change from %d to %d occurred during iteration"], + _l_ = + [0, + [2, + 0, + [11, ": length ", [4, 0, 0, 0, [11, " > capacity ", [4, 0, 0, 0, 0]]]]], + "%s: length %d > capacity %d"], + _k_ = + [0, + [2, + 0, + [11, + ": missing element at position ", + [4, 0, 0, 0, [11, " < length ", [4, 0, 0, 0, 0]]]]], + "%s: missing element at position %d < length %d"], + _j_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + ": cannot grow to requested length ", + [4, + 0, + 0, + 0, + [11, " (max_array_length is ", [4, 0, 0, 0, [12, 41, 0]]]]]]], + "Dynarray.%s: cannot grow to requested length %d (max_array_length is %d)"], + _i_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative capacity ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative capacity %d requested"], + _h_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative length ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative length %d requested"], + _f_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + cst_index, + [4, 0, 0, 0, [11, " out of bounds (empty dynarray)", 0]]]]], + "Dynarray.%s: index %d out of bounds (empty dynarray)"], + _g_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, + cst_index, + [4, 0, 0, 0, [11, " out of bounds (0..", [4, 0, 0, 0, [12, 41, 0]]]]]]], + "Dynarray.%s: index %d out of bounds (0..%d)"], + _d_ = [0, cst_dynarray_ml, 289, 13], + _e_ = [0, cst_dynarray_ml, 299, 8], + cst_x = "x"; + if(! _a_[1]){ + var + _b_ = caml_call1(CamlinternalOO[16], 0), + _c_ = caml_call2(CamlinternalOO[3], _b_, cst_x); + caml_call1(CamlinternalOO[17], _b_); + _a_[1] = + function(_aF_){ + var _aG_ = caml_call2(CamlinternalOO[24], 0, _b_); + _aG_[1 + _c_] = _aF_[2]; + return _aG_; + }; + } + var dummy = caml_call1(_a_[1], [0, 0, r]); + r[1] = [0, dummy]; + function index_out_of_bounds(f, i, length){ + /*<>*/ return 0 === length + ? /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _f_, f, i) + : /*<>*/ caml_call5 + (Stdlib_Printf[10], Stdlib[1], _g_, f, i, length - 1 | 0); + /*<>*/ } + function negative_length_requested(f, n){ + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _h_, f, n); + /*<>*/ } + function negative_capacity_requested(f, n){ + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Printf[10], Stdlib[1], _i_, f, n); + /*<>*/ } + function missing_element(i, length){ + /*<>*/ return /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _k_, + invalid_state_description, + i, + length); + /*<>*/ } + function check_same_length(f, param, expected){ + /*<>*/ var + /*<>*/ length_a = param[1], + _aE_ = expected !== length_a ? 1 : 0; + return _aE_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], Stdlib[1], _m_, f, expected, length_a) + : _aE_; + } + function check_valid_length(length, arr){ + /*<>*/ var + capacity = arr.length - 1, + _aD_ = capacity < length ? 1 : 0; + return _aD_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _l_, + invalid_state_description, + length, + capacity) + : _aD_; + /*<>*/ } + function unsafe_get(arr, dummy, i, length){ + /*<>*/ /*<>*/ var v = arr[1 + i]; + /*<>*/ return v === dummy + ? missing_element(i, length) + : v; + /*<>*/ } + function create(param){ + /*<>*/ return [0, 0, [0], dummy]; + /*<>*/ } + function make(n, x){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_make, n); + /*<>*/ /*<>*/ var + _aC_ = Stdlib_Obj[16]; + if( /*<>*/ caml_obj_tag(x) !== _aC_) + var arr$0 = /*<>*/ caml_array_make(n, x); + else{ + /*<>*/ /*<>*/ var + arr = /*<>*/ caml_array_make(n, dummy); + /*<>*/ /*<>*/ caml_call4 + (Stdlib_Array[8], arr, 0, n, x); + var arr$0 = arr; + } + /*<>*/ return [0, n, arr$0, dummy]; + /*<>*/ } + function init(n, f){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_init, n); + /*<>*/ var + /*<>*/ arr = + /*<>*/ caml_array_make(n, dummy), + /*<>*/ _aA_ = n - 1 | 0, + /*<>*/ _az_ = 0; + if(_aA_ >= 0){ + var i = _az_; + for(;;){ + /*<>*/ /*<>*/ var + v = /*<>*/ caml_call1(f, i); + /*<>*/ arr[1 + i] = v; + /*<>*/ /*<>*/ var + _aB_ = i + 1 | 0; + if(_aA_ === i) break; + i = _aB_; + } + } + /*<>*/ return [0, n, arr, dummy]; + /*<>*/ } + function get(a, i){ + /*<>*/ var + /*<>*/ v = caml_check_bound(a[2], i)[1 + i], + /*<>*/ dummy = a[3]; + /*<>*/ if(v !== dummy) + /*<>*/ return v; + var length = a[1]; + return i < length + ? missing_element(i, length) + : index_out_of_bounds(f, i, length); + } + function set(param, i, x){ + /*<>*/ var + /*<>*/ length = param[1], + arr = param[2]; + return length <= i + ? index_out_of_bounds(cst_set, i, length) + : (caml_check_bound(arr, i)[1 + i] = x, 0); + } + function length(param){ /*<>*/ return param[1];} + function is_empty(param){ /*<>*/ return 0 === param[1] ? 1 : 0;} + function copy$0(param){ + var length = param[1], arr = param[2], dummy = param[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ /*<>*/ var + arr$0 = prefix(arr, length); + /*<>*/ return [0, length, arr$0, dummy]; + } + function get_last(param){ + /*<>*/ var + /*<>*/ length = param[1], + arr = param[2], + dummy = param[3]; + /*<>*/ check_valid_length(length, arr); + if(0 === length) + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[10], Stdlib[1], _n_, f$0); + /*<>*/ return unsafe_get + (arr, dummy, length - 1 | 0, length); + } + function find_last(param){ + /*<>*/ var + /*<>*/ length = param[1], + arr = param[2], + dummy = param[3]; + /*<>*/ check_valid_length(length, arr); + return 0 === length + ? 0 + : [0, unsafe_get(arr, dummy, length - 1 | 0, length)]; + } + function pop_last(a){ + /*<>*/ var + /*<>*/ length = a[1], + arr = a[2], + dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + if(0 === length) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + /*<>*/ var + /*<>*/ last = length - 1 | 0, + /*<>*/ v = unsafe_get(arr, dummy, last, length); + /*<>*/ arr[1 + last] = dummy; + a[1] = last; + /*<>*/ return v; + } + function pop_last_opt(a){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + x = pop_last(a); + } + catch(_ay_){ + var _ax_ = caml_wrap_exception(_ay_); + if(_ax_ === Stdlib[8]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_ax_, 0); + } + /*<>*/ return [0, x]; + /*<>*/ } + function remove_last(a){ + /*<>*/ var + /*<>*/ last = a[1] - 1 | 0, + _av_ = 0 <= last ? 1 : 0; + if(_av_){ + a[1] = last; + var dummy = a[3]; + /*<>*/ caml_check_bound(a[2], last)[1 + last] = dummy; + var _aw_ = 0; + } + else + var _aw_ = _av_; + /*<>*/ return _aw_; + } + function truncate(a, n){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_truncate, n); + var length = a[1], arr = a[2], dummy = a[3]; + return length <= n + ? 0 + : (a + [1] + = n, + /*<>*/ caml_call4 + (Stdlib_Array[8], arr, n, length - n | 0, dummy)); + } + function clear(a){ + /*<>*/ return truncate(a, 0); + /*<>*/ } + function capacity(param){ /*<>*/ return param[2].length - 1;} + function ensure_capacity(a, capacity_request){ + /*<>*/ var + /*<>*/ arr = a[2], + /*<>*/ cur_capacity = arr.length - 1; + /*<>*/ if(0 > capacity_request) + /*<>*/ return negative_capacity_requested + (cst_ensure_capacity, capacity_request); + if(capacity_request <= cur_capacity) /*<>*/ return 0; + if(Stdlib_Sys[13] < capacity_request) + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _j_, + f$1, + capacity_request, + Stdlib_Sys[13]); + /*<>*/ var + n = + 512 < cur_capacity + ? cur_capacity + (cur_capacity / 2 | 0) | 0 + : cur_capacity * 2 | 0, + _as_ = Stdlib_Sys[13], + /*<>*/ _at_ = + /*<>*/ caml_call2(Stdlib[17], 8, n), + /*<>*/ _au_ = + /*<>*/ caml_call2(Stdlib[16], _at_, _as_), + /*<>*/ new_capacity = + /*<>*/ caml_call2 + (Stdlib[17], _au_, capacity_request); + /*<>*/ if(0 >= new_capacity) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _q_], 1); + /*<>*/ /*<>*/ var + new_arr = extend(arr, a[1], a[3], new_capacity); + a[2] = new_arr; + if(0 > capacity_request) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _p_], 1); + if(capacity_request <= new_arr.length - 1) return 0; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _o_], 1); + } + function ensure_extra_capacity(a, extra_capacity_request){ + /*<>*/ return ensure_capacity + (a, a[1] + extra_capacity_request | 0); + /*<>*/ } + function fit_capacity(a){ + /*<>*/ return a[2].length - 1 === a[1] + ? 0 + : (a[2] = prefix(a[2], a[1]), 0); + } + function set_capacity(a, n){ + /*<>*/ if(n < 0) + /*<>*/ negative_capacity_requested + (cst_set_capacity, n); + /*<>*/ var + arr = a[2], + /*<>*/ cur_capacity = arr.length - 1; + if(n < cur_capacity){ + a[1] = /*<>*/ caml_call2(Stdlib[16], a[1], n); + a[2] = prefix(arr, n); + return 0; + } + var + _aq_ = cur_capacity < n ? 1 : 0, + _ar_ = _aq_ ? (a[2] = extend(arr, a[1], a[3], n), 0) : _aq_; + return _ar_; + } + function reset(param){ /*<>*/ param[1] = 0; param[2] = [0]; return 0;} + function add_last_if_room(a, v){ + /*<>*/ var + /*<>*/ length = a[1], + arr = a[2]; + return arr.length - 1 <= length + ? 0 + : (a[1] = length + 1 | 0, arr[1 + length] = v, 1); + } + function add_last(a, x){ + /*<>*/ if(add_last_if_room(a, x)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, 1); + /*<>*/ /*<>*/ var + _ap_ = 1 - add_last_if_room(a, x); + if(! _ap_) /*<>*/ return _ap_; + } + /*<>*/ } + function append_list(a, li){ + /*<>*/ var li$0 = li; + /*<>*/ for(;;){ + if(! li$0) /*<>*/ return 0; + var xs = li$0[2], x = li$0[1]; + /*<>*/ add_last(a, x); + li$0 = xs; + } + /*<>*/ } + function append_iter(a, iter, b){ + /*<>*/ return /*<>*/ caml_call2 + (iter, + function(x){ + /*<>*/ return add_last(a, x); + /*<>*/ }, + b); + /*<>*/ } + function append_seq(a, seq){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], + function(x){ + /*<>*/ return add_last(a, x); + /*<>*/ }, + seq); + /*<>*/ } + function blit_assume_room + (src, src_pos, src_length, dst, dst_pos, dst_length, blit_length){ + /*<>*/ var + /*<>*/ src_arr = src[2], + /*<>*/ dst_arr = dst[2]; + /*<>*/ check_same_length(cst_blit, src, src_length); + /*<>*/ check_same_length(cst_blit$0, dst, dst_length); + if(dst_length < (dst_pos + blit_length | 0)) + dst[1] = dst_pos + blit_length | 0; + var dst_dummy = dst[3], src_dummy = src[3]; + if(src_dummy === dst_dummy) + /*<>*/ return /*<>*/ caml_call5 + (Stdlib_Array[9], + src_arr, + src_pos, + dst_arr, + dst_pos, + blit_length); + var _af_ = blit_length < 0 ? 1 : 0; + if(_af_) + var _ag_ = _af_; + else{ + var _ak_ = src_pos < 0 ? 1 : 0; + if(_ak_) + var _ag_ = _ak_; + else{ + var _al_ = (src_pos + blit_length | 0) < 0 ? 1 : 0; + if(_al_) + var _ag_ = _al_; + else{ + var _am_ = src_arr.length - 1 < (src_pos + blit_length | 0) ? 1 : 0; + if(_am_) + var _ag_ = _am_; + else{ + var _an_ = dst_pos < 0 ? 1 : 0; + if(_an_) + var _ag_ = _an_; + else + var + _ao_ = (dst_pos + blit_length | 0) < 0 ? 1 : 0, + _ag_ = + _ao_ || (dst_arr.length - 1 < (dst_pos + blit_length | 0) ? 1 : 0); + } } - else - var clo$0 = clo; - /*<>*/ set_method(table, label, clo$0); - i[1]++; + } } - /*<>*/ } - function stats(param){ - /*<>*/ return [0, - table_count[1], - method_count[1], - inst_var_count[1]]; - /*<>*/ } - var - CamlinternalOO = - [0, - public_method_label, - new_method, - new_variable, - new_methods_variables, - get_variable, - get_variables, - get_method_label, - get_method_labels, - get_method, - set_method, - set_methods, - narrow, - widen, - add_initializer, - dummy_table, - create_table, - init_class, - inherits, - make_class, - make_class_store, - dummy_class, - copy, - create_object, - create_object_opt, - run_initializers, - run_initializers_opt, - create_object_and_run_initiali, - lookup_tables, - params, - stats]; - runtime.caml_register_global(17, CamlinternalOO, "CamlinternalOO"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: Stdlib__Oo -//# unitInfo: Requires: CamlinternalOO -(function - (globalThis){ - "use strict"; - var - runtime = globalThis.jsoo_runtime, - global_data = runtime.caml_get_global_data(), - CamlinternalOO = global_data.CamlinternalOO, - copy = CamlinternalOO[22], - new_method = CamlinternalOO[1], - public_method_label = CamlinternalOO[1], - Stdlib_Oo = [0, copy, new_method, public_method_label]; - runtime.caml_register_global(1, Stdlib_Oo, "Stdlib__Oo"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: CamlinternalMod -//# unitInfo: Requires: CamlinternalLazy, CamlinternalOO, Stdlib, Stdlib__Obj -(function - (globalThis){ - "use strict"; - var - runtime = globalThis.jsoo_runtime, - cst_camlinternalMod_ml = "camlinternalMod.ml", - caml_check_bound = runtime.caml_check_bound, - caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_obj_tag = runtime.caml_obj_tag; - /*<>*/ function caml_call1(f, a0){ - return (f.l >= 0 ? f.l : f.l = f.length) == 1 - ? f(a0) - : runtime.caml_call_gen(f, [a0]); + if(_ag_) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _d_], 1); + if(src_arr === dst_arr) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _e_], 1); + /*<>*/ var + _ai_ = blit_length - 1 | 0, + /*<>*/ _ah_ = 0; + if(_ai_ >= 0){ + var i = _ah_; + for(;;){ + /*<>*/ dst_arr[1 + (dst_pos + i | 0)] = src_arr[1 + (src_pos + i | 0)]; + /*<>*/ /*<>*/ var + _aj_ = i + 1 | 0; + if(_ai_ === i) break; + i = _aj_; + } + } + return 0; } - var - global_data = runtime.caml_get_global_data(), - Stdlib = global_data.Stdlib, - CamlinternalLazy = global_data.CamlinternalLazy, - CamlinternalOO = global_data.CamlinternalOO, - Assert_failure = global_data.Assert_failure, - cst_CamlinternalMod_init_mod_n = "CamlinternalMod.init_mod: not a module", - _a_ = [0, cst_camlinternalMod_ml, 72, 5], - _b_ = [0, cst_camlinternalMod_ml, 81, 2], - cst_CamlinternalMod_update_mod = - "CamlinternalMod.update_mod: not a module"; - function init_mod_block(loc, comps$0){ - /*<>*/ var - length = comps$0.length - 1, - /*<>*/ modu = - /*<>*/ runtime.caml_obj_block(0, length), - /*<>*/ _h_ = length - 1 | 0, - /*<>*/ _g_ = 0; - if(_h_ >= 0){ - var i = _g_; + function blit(src, src_pos, dst, dst_pos, len){ + /*<>*/ var + /*<>*/ src_length = src[1], + /*<>*/ dst_length = dst[1]; + if(len < 0) + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[10], Stdlib[1], _r_, len); + var + _ab_ = src_pos < 0 ? 1 : 0, + _ac_ = _ab_ || (src_length < (src_pos + len | 0) ? 1 : 0); + if(_ac_) + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _s_, + src_pos, + src_pos + len | 0, + src_length); + var + _ad_ = dst_pos < 0 ? 1 : 0, + _ae_ = _ad_ || (dst_length < dst_pos ? 1 : 0); + if(_ae_) + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _t_, + dst_pos, + dst_pos + len | 0, + dst_length); + /*<>*/ ensure_capacity(dst, dst_pos + len | 0); + /*<>*/ return blit_assume_room + (src, src_pos, src_length, dst, dst_pos, dst_length, len); + /*<>*/ } + function append_array_if_room(a, src){ + /*<>*/ var + /*<>*/ length_a = a[1], + arr = a[2], + /*<>*/ length_b = src.length - 1; + if(arr.length - 1 < (length_a + length_b | 0)) + /*<>*/ return 0; + a[1] = length_a + length_b | 0; + /*<>*/ var + /*<>*/ _X_ = Stdlib_Obj[17], + src_pos = 0; + if( /*<>*/ caml_obj_tag(src) !== _X_) + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], src, src_pos, arr, length_a, length_b); + else{ + /*<>*/ var + _Z_ = length_b - 1 | 0, + /*<>*/ _Y_ = 0; + if(_Z_ >= 0){ + var i = _Y_; + for(;;){ + /*<>*/ var + ___ = i | 0, + /*<>*/ v = caml_check_bound(src, ___)[1 + ___], + _$_ = length_a + i | 0; + /*<>*/ caml_check_bound(arr, _$_)[1 + _$_] = v; + /*<>*/ /*<>*/ var + _aa_ = i + 1 | 0; + if(_Z_ === i) break; + i = _aa_; + } + } + } + /*<>*/ return 1; + } + function append_array(a, b){ + /*<>*/ if(append_array_if_room(a, b)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, b.length - 1); + /*<>*/ /*<>*/ var + _W_ = 1 - append_array_if_room(a, b); + if(! _W_) /*<>*/ return _W_; + } + /*<>*/ } + function append_if_room(a, b, length_b){ + /*<>*/ var + /*<>*/ length_a = a[1], + arr_a = a[2]; + return arr_a.length - 1 < (length_a + length_b | 0) + ? 0 + : (blit_assume_room + (b, 0, length_b, a, length_a, length_a, length_b), + check_same_length(cst_append, b, length_b), + 1); + } + function append(a, b){ + /*<>*/ /*<>*/ var + length_b = b[1]; + /*<>*/ if(append_if_room(a, b, length_b)) + /*<>*/ return 0; + /*<>*/ for(;;){ + /*<>*/ ensure_extra_capacity(a, length_b); + /*<>*/ check_same_length(cst_append$0, b, length_b); + /*<>*/ /*<>*/ var + _V_ = 1 - append_if_room(a, b, length_b); + if(! _V_) /*<>*/ return _V_; + } + /*<>*/ } + function iter(f, k, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + _T_ = length - 1 | 0, + /*<>*/ _S_ = 0; + if(_T_ >= 0){ + var i = _S_; for(;;){ - /*<>*/ /*<>*/ var - shape = caml_check_bound(comps$0, i)[1 + i]; - if(typeof shape === "number") - switch(shape){ - case 0: - let i$1 = i; - var - fn = - function(x){ - /*<>*/ /*<>*/ var - fn = modu[1 + i$1]; - if(fn$0 === fn) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[15], loc], 1); - /*<>*/ return /*<>*/ caml_call1 - (fn, x); - /*<>*/ }; - let fn$0 = fn; - var init = fn; - break; - case 1: - var l = []; - let l$0 = l, i$0 = i; - runtime.caml_update_dummy - (l, - [246, - function(param){ - /*<>*/ /*<>*/ var - l = modu[1 + i$0]; - if(l$0 === l) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[15], loc], 1); - var _j_ = caml_obj_tag(l); - if(250 === _j_) return l[1]; - if(246 !== _j_ && 244 !== _j_) - /*<>*/ return l; - /*<>*/ return /*<>*/ caml_call1 - (CamlinternalLazy[2], l); - }]); - var init = l; - break; - default: - var - init = - /*<>*/ caml_call1 - (CamlinternalOO[21], loc); - } - else if(0 === shape[0]) - var comps = shape[1], init = init_mod_block(loc, comps); - else - var v = shape[1], init = v; - /*<>*/ modu[1 + i] = init; - /*<>*/ /*<>*/ var - _i_ = i + 1 | 0; - if(_h_ === i) break; - i = _i_; + /*<>*/ /*<>*/ caml_call1 + (k, unsafe_get(arr, dummy, i, length)); + /*<>*/ /*<>*/ var + _U_ = i + 1 | 0; + if(_T_ === i) break; + i = _U_; + } + } + /*<>*/ return check_same_length(f, a, length); + /*<>*/ } + function iter$0(k, a){ + /*<>*/ return iter(cst_iter, k, a); + /*<>*/ } + function iteri(k, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + _Q_ = length - 1 | 0, + /*<>*/ _P_ = 0; + if(_Q_ >= 0){ + var i = _P_; + for(;;){ + /*<>*/ /*<>*/ caml_call2 + (k, i, unsafe_get(arr, dummy, i, length)); + /*<>*/ /*<>*/ var + _R_ = i + 1 | 0; + if(_Q_ === i) break; + i = _R_; + } + } + /*<>*/ return check_same_length(cst_iteri, a, length); + /*<>*/ } + function map(f, a){ + /*<>*/ var length = a[1], arr_in = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr_in); + /*<>*/ var + /*<>*/ arr_out = + /*<>*/ caml_array_make(length, dummy), + /*<>*/ _N_ = length - 1 | 0, + /*<>*/ _M_ = 0; + if(_N_ >= 0){ + var i = _M_; + for(;;){ + /*<>*/ /*<>*/ var + v = + /*<>*/ caml_call1 + (f, unsafe_get(arr_in, dummy, i, length)); + /*<>*/ arr_out[1 + i] = v; + /*<>*/ /*<>*/ var + _O_ = i + 1 | 0; + if(_N_ === i) break; + i = _O_; + } + } + /*<>*/ /*<>*/ var + res = [0, length, arr_out, dummy]; + /*<>*/ check_same_length(cst_map, a, length); + /*<>*/ return res; + /*<>*/ } + function mapi(f, a){ + /*<>*/ var length = a[1], arr_in = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr_in); + /*<>*/ var + /*<>*/ arr_out = + /*<>*/ caml_array_make(length, dummy), + /*<>*/ _K_ = length - 1 | 0, + /*<>*/ _J_ = 0; + if(_K_ >= 0){ + var i = _J_; + for(;;){ + /*<>*/ /*<>*/ var + v = + /*<>*/ caml_call2 + (f, i, unsafe_get(arr_in, dummy, i, length)); + /*<>*/ arr_out[1 + i] = v; + /*<>*/ /*<>*/ var + _L_ = i + 1 | 0; + if(_K_ === i) break; + i = _L_; + } + } + /*<>*/ /*<>*/ var + res = [0, length, arr_out, dummy]; + /*<>*/ check_same_length(cst_mapi, a, length); + /*<>*/ return res; + /*<>*/ } + function fold_left(f, acc, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ r = [0, acc], + /*<>*/ _H_ = length - 1 | 0, + /*<>*/ _G_ = 0; + if(_H_ >= 0){ + var i = _G_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, dummy, i, length); + r[1] = /*<>*/ caml_call2(f, r[1], v); + /*<>*/ /*<>*/ var + _I_ = i + 1 | 0; + if(_H_ === i) break; + i = _I_; + } + } + /*<>*/ check_same_length(cst_fold_left, a, length); + return r[1]; + /*<>*/ } + function fold_right(f, a, acc){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ r = [0, acc], + /*<>*/ _E_ = length - 1 | 0; + if(_E_ >= 0){ + var i = _E_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, dummy, i, length); + r[1] = /*<>*/ caml_call2(f, v, r[1]); + /*<>*/ /*<>*/ var + _F_ = i - 1 | 0; + if(0 === i) break; + i = _F_; + } + } + /*<>*/ check_same_length(cst_fold_right, a, length); + return r[1]; + /*<>*/ } + function exists(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + _D_ = + /*<>*/ caml_call1 + (p, unsafe_get(arr, dummy, i, length)); + /*<>*/ if(! _D_){ + var i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = _D_; } + /*<>*/ check_same_length(cst_exists, a, length); + /*<>*/ return res; } - /*<>*/ return modu; - /*<>*/ } - function init_mod(loc, shape){ - /*<>*/ if - (typeof shape !== "number" && 0 === shape[0]){ - var comps = shape[1]; - /*<>*/ return init_mod_block(loc, comps); + /*<>*/ } + function for_all(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 1; + else{ + /*<>*/ /*<>*/ var + _C_ = + /*<>*/ caml_call1 + (p, unsafe_get(arr, dummy, i, length)); + /*<>*/ if(_C_){ + var i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = _C_; + } + /*<>*/ check_same_length(cst_for_all, a, length); + /*<>*/ return res; } - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[2], cst_CamlinternalMod_init_mod_n); - /*<>*/ } - function update_mod_block(comps$0, modu, n){ - /*<>*/ if - (0 === /*<>*/ caml_obj_tag(n) - && comps$0.length - 1 <= n.length - 1){ - /*<>*/ var - _e_ = comps$0.length - 2 | 0, - /*<>*/ _d_ = 0; - if(_e_ >= 0){ - var i = _d_; - for(;;){ - /*<>*/ var - /*<>*/ n$0 = n[1 + i], - /*<>*/ shape = - caml_check_bound(comps$0, i)[1 + i]; - a: - if(typeof shape === "number"){ - if(2 === shape){ - if - (0 === /*<>*/ caml_obj_tag(n$0) - && 4 === n$0.length - 1){ - /*<>*/ var - /*<>*/ cl = modu[1 + i], - j = 0; - for(;;){ - /*<>*/ cl[1 + j] = n$0[1 + j]; - /*<>*/ /*<>*/ var - _c_ = j + 1 | 0; - if(3 === j) break; - j = _c_; - } - break a; - } - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - } - /*<>*/ modu[1 + i] = n$0; - } - else if(0 === shape[0]){ - var comps = shape[1]; - /*<>*/ update_mod_block - (comps, modu[1 + i], n$0); - } - /*<>*/ /*<>*/ var - _f_ = i + 1 | 0; - if(_e_ === i) break; - i = _f_; + /*<>*/ } + function filter(f, a){ + /*<>*/ /*<>*/ var b = create(0); + /*<>*/ iter + (cst_filter, + function(x){ + /*<>*/ /*<>*/ var + _B_ = /*<>*/ caml_call1(f, x); + /*<>*/ return _B_ ? add_last(b, x) : _B_; + /*<>*/ }, + a); + /*<>*/ return b; + /*<>*/ } + function filter_map(f, a){ + /*<>*/ /*<>*/ var b = create(0); + /*<>*/ iter + (cst_filter_map, + function(x){ + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(f, x); + if(! match) /*<>*/ return 0; + var y = match[1]; + /*<>*/ return add_last(b, y); + /*<>*/ }, + a); + /*<>*/ return b; + /*<>*/ } + function mem(x, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ if + (0 + !== + /*<>*/ runtime.caml_compare + (unsafe_get(arr, dummy, i, length), x)){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; } + var res = 1; } - return 0; + /*<>*/ check_same_length(cst_mem, a, length); + /*<>*/ return res; } - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _b_], 1); - /*<>*/ } - function update_mod(shape, o, n){ - /*<>*/ if - (typeof shape !== "number" && 0 === shape[0]){ - var comps = shape[1]; - /*<>*/ return update_mod_block(comps, o, n); + /*<>*/ } + function memq(x, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + if(unsafe_get(arr, dummy, i, length) !== x){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = 1; + } + /*<>*/ check_same_length(cst_memq, a, length); + /*<>*/ return res; } - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[2], cst_CamlinternalMod_update_mod); - /*<>*/ } - var CamlinternalMod = [0, init_mod, update_mod]; - runtime.caml_register_global(8, CamlinternalMod, "CamlinternalMod"); + /*<>*/ } + function find_opt(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + x = unsafe_get(arr, dummy, i, length); + /*<>*/ if + (! /*<>*/ caml_call1(p, x)){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = [0, x]; + } + /*<>*/ check_same_length(cst_find_opt, a, length); + /*<>*/ return res; + } + /*<>*/ } + function find_index(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + x = unsafe_get(arr, dummy, i, length); + /*<>*/ if + (! /*<>*/ caml_call1(p, x)){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = [0, i]; + } + /*<>*/ check_same_length(cst_find_index, a, length); + /*<>*/ return res; + } + /*<>*/ } + function find_map(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_call1 + (p, unsafe_get(arr, dummy, i, length)); + if(! r){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = r; + } + /*<>*/ check_same_length(cst_find_map, a, length); + /*<>*/ return res; + } + /*<>*/ } + function find_mapi(p, a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var res = 0; + else{ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_call2 + (p, i, unsafe_get(arr, dummy, i, length)); + if(! r){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var res = r; + } + /*<>*/ check_same_length(cst_find_mapi, a, length); + /*<>*/ return res; + } + /*<>*/ } + function equal(eq, a1, a2){ + /*<>*/ var + length = a1[1], + arr1 = a1[2], + dum1 = a1[3], + /*<>*/ len2 = a2[1], + arr2 = a2[2], + dum2 = a2[3]; + if(length !== len2) /*<>*/ return 0; + /*<>*/ check_valid_length(length, arr1); + /*<>*/ check_valid_length(length, arr2); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var r = 1; + else{ + /*<>*/ var + /*<>*/ _z_ = unsafe_get(arr2, dum2, i, length), + /*<>*/ _A_ = + /*<>*/ caml_call2 + (eq, unsafe_get(arr1, dum1, i, length), _z_); + /*<>*/ if(_A_){ + var i$0 = i + 1 | 0; + i = i$0; + continue; + } + var r = _A_; + } + /*<>*/ check_same_length(cst_equal, a1, length); + /*<>*/ check_same_length(cst_equal$0, a2, length); + /*<>*/ return r; + } + /*<>*/ } + function compare(cmp, a1, a2){ + /*<>*/ var + length = a1[1], + arr1 = a1[2], + dum1 = a1[3], + /*<>*/ len2 = a2[1], + arr2 = a2[2], + dum2 = a2[3]; + if(length !== len2) return length - len2 | 0; + /*<>*/ check_valid_length(length, arr1); + /*<>*/ check_valid_length(length, arr2); + var i = 0; + /*<>*/ for(;;){ + if(i === length) + var r = 0; + else{ + /*<>*/ var + /*<>*/ _y_ = unsafe_get(arr2, dum2, i, length), + /*<>*/ c = + /*<>*/ caml_call2 + (cmp, unsafe_get(arr1, dum1, i, length), _y_); + /*<>*/ if(0 === c){ + /*<>*/ /*<>*/ var + i$0 = i + 1 | 0; + i = i$0; + continue; + } + var r = c; + } + /*<>*/ check_same_length(cst_compare, a1, length); + /*<>*/ check_same_length(cst_compare$0, a2, length); + /*<>*/ return r; + } + /*<>*/ } + function of_array(a){ + /*<>*/ var + length = a.length - 1, + /*<>*/ arr = copy(a, dummy); + /*<>*/ return [0, length, arr, dummy]; + /*<>*/ } + function to_array(a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_call2 + (Stdlib_Array[1], + length, + function(i){ + /*<>*/ return unsafe_get(arr, dummy, i, length); + /*<>*/ }); + /*<>*/ check_same_length(cst_to_array, a, length); + /*<>*/ return res; + /*<>*/ } + function of_list(li){ + /*<>*/ var + /*<>*/ a = + /*<>*/ caml_call1(Stdlib_Array[11], li), + /*<>*/ length = a.length - 1, + /*<>*/ _x_ = Stdlib_Obj[17], + arr = + /*<>*/ caml_obj_tag(a) !== _x_ + ? a + : copy(a, dummy); + /*<>*/ return [0, length, arr, dummy]; + /*<>*/ } + function to_list(a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + /*<>*/ l = [0, 0], + /*<>*/ _u_ = length - 1 | 0; + if(_u_ >= 0){ + var i = _u_; + for(;;){ + var _v_ = l[1]; + l[1] = [0, unsafe_get(arr, dummy, i, length), _v_]; + /*<>*/ /*<>*/ var + _w_ = i - 1 | 0; + if(0 === i) break; + i = _w_; + } + } + /*<>*/ check_same_length(cst_to_list, a, length); + return l[1]; + /*<>*/ } + function of_seq(seq){ + /*<>*/ /*<>*/ var + init = create(0); + /*<>*/ append_seq(init, seq); + /*<>*/ return init; + /*<>*/ } + function to_seq(a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq, a, length); + if(length <= i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, dummy, i, length); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(a[1] <= i) + /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_rev(a){ + /*<>*/ var length = a[1], arr = a[2], dummy = a[3]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq_rev, a, length); + if(0 > i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, dummy, i, length); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(length - 1 | 0); + /*<>*/ } + function to_seq_rev_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(0 > i) + /*<>*/ return 0; + if(a[1] <= i) /*<>*/ return aux(a[1] - 1 | 0)(0); + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(a[1] - 1 | 0); + /*<>*/ } + var + Stdlib_Dynarray = + [0, + create, + make, + init, + get, + set, + length, + is_empty, + get_last, + find_last, + copy$0, + add_last, + append_array, + append_list, + append, + append_seq, + append_iter, + blit, + pop_last_opt, + pop_last, + remove_last, + truncate, + clear, + iter$0, + iteri, + map, + mapi, + fold_left, + fold_right, + filter, + filter_map, + exists, + for_all, + mem, + memq, + find_opt, + find_index, + find_map, + find_mapi, + equal, + compare, + of_array, + to_array, + of_list, + to_list, + of_seq, + to_seq, + to_seq_reentrant, + to_seq_rev, + to_seq_rev_reentrant, + capacity, + ensure_capacity, + ensure_extra_capacity, + fit_capacity, + set_capacity, + reset]; + runtime.caml_register_global(64, Stdlib_Dynarray, "Stdlib__Dynarray"); return; /*<>*/ } (globalThis)); @@ -32604,8 +33210,8 @@ "use strict"; var runtime = globalThis.jsoo_runtime, + caml_array_make = runtime.caml_array_make, caml_check_bound = runtime.caml_check_bound, - caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ @@ -32679,7 +33285,7 @@ var seed = 0; /*<>*/ return [0, 0, - /*<>*/ caml_make_vect(x, 0), + /*<>*/ caml_array_make(x, 0), seed, x]; } @@ -32708,7 +33314,7 @@ : (h [1] = 0, - h[2] = /*<>*/ caml_make_vect(h[4], 0), + h[2] = /*<>*/ caml_array_make(h[4], 0), 0); /*<>*/ } function copy(h){ @@ -32762,7 +33368,7 @@ _ad_ = _ac_ ? (osize >>> 1 | 0) <= h[1] ? 1 : 0 : _ac_; if(_ad_){ /*<>*/ /*<>*/ var - ndata = /*<>*/ caml_make_vect(nsize, 0); + ndata = /*<>*/ caml_array_make(nsize, 0); h[2] = ndata; /*<>*/ var insert_bucket = @@ -33001,7 +33607,7 @@ 0, h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0); + /*<>*/ caml_array_make(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Array[12], function(b){ @@ -33043,7 +33649,7 @@ 0, h[2]), /*<>*/ histo = - /*<>*/ caml_make_vect(mbl + 1 | 0, 0); + /*<>*/ caml_array_make(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 (Stdlib_Array[12], function(b){ @@ -34462,63 +35068,73 @@ (Stdlib_Buffer[2], b); /*<>*/ } function quote_cmd_filename(f){ - /*<>*/ if + /*<>*/ /*<>*/ var + f$0 = + /*<>*/ caml_call2(Stdlib_String[15], f, 47) + ? /*<>*/ caml_call2 + (Stdlib_String[18], + function(c){ + /*<>*/ return 47 === c ? 92 : c; + /*<>*/ }, + f) + : f; + /*<>*/ if (! - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_String[23], function(param){ - /*<>*/ if(34 !== param && 37 !== param) - /*<>*/ return 0; - /*<>*/ return 1; - /*<>*/ }, - f)) - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_String[15], f, 32) - ? /*<>*/ caml_call2 - (Stdlib_String[7], cst$7, [0, cst$6, [0, f, _c_]]) - : f; - /*<>*/ /*<>*/ var + /*<>*/ if(34 !== param && 37 !== param) + /*<>*/ return 0; + /*<>*/ return 1; + /*<>*/ }, + f$0)) + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_String[15], f$0, 32) + ? /*<>*/ caml_call2 + (Stdlib_String[7], cst$7, [0, cst$6, [0, f$0, _c_]]) + : f$0; + /*<>*/ /*<>*/ var _J_ = - /*<>*/ caml_call2 - (Stdlib[28], cst_Filename_quote_command_bad, f); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ caml_call2 + (Stdlib[28], cst_Filename_quote_command_bad, f$0); + /*<>*/ return /*<>*/ caml_call1 (Stdlib[2], _J_); - /*<>*/ } + /*<>*/ } function quote_command$0(cmd, stdin, stdout, stderr, args){ - /*<>*/ if(stderr){ + /*<>*/ if(stderr){ var f = stderr[1]; - /*<>*/ if - ( /*<>*/ caml_equal(stderr, stdout)) + /*<>*/ if + ( /*<>*/ caml_equal(stderr, stdout)) var _w_ = cst_2_1$0; else - /*<>*/ var - /*<>*/ _H_ = quote_cmd_filename(f), - _w_ = /*<>*/ caml_call2(Stdlib[28], cst_2$0, _H_); + /*<>*/ var + /*<>*/ _H_ = quote_cmd_filename(f), + _w_ = /*<>*/ caml_call2(Stdlib[28], cst_2$0, _H_); var _x_ = _w_; } else var _x_ = cst$16; var _y_ = [0, _x_, _d_]; if(stdout) - /*<>*/ var + /*<>*/ var f$0 = stdout[1], - /*<>*/ _z_ = quote_cmd_filename(f$0), - _A_ = /*<>*/ caml_call2(Stdlib[28], cst$8, _z_); + /*<>*/ _z_ = quote_cmd_filename(f$0), + _A_ = /*<>*/ caml_call2(Stdlib[28], cst$8, _z_); else var _A_ = cst$15; var _B_ = [0, _A_, _y_]; if(stdin) - /*<>*/ var + /*<>*/ var f$1 = stdin[1], - /*<>*/ _C_ = quote_cmd_filename(f$1), - _D_ = /*<>*/ caml_call2(Stdlib[28], cst$9, _C_); + /*<>*/ _C_ = quote_cmd_filename(f$1), + _D_ = /*<>*/ caml_call2(Stdlib[28], cst$9, _C_); else var _D_ = cst$14; - /*<>*/ var - /*<>*/ _E_ = - /*<>*/ caml_call2(Stdlib_List[20], quote$0, args), - /*<>*/ s = - /*<>*/ caml_call2(Stdlib_String[7], cst$10, _E_), + /*<>*/ var + /*<>*/ _E_ = + /*<>*/ caml_call2(Stdlib_List[20], quote$0, args), + /*<>*/ s = + /*<>*/ caml_call2(Stdlib_String[7], cst$10, _E_), /*<>*/ b = /*<>*/ caml_call1 (Stdlib_Buffer[1], caml_ml_string_length(s) + 20 | 0); @@ -34552,24 +35168,24 @@ (Stdlib_Buffer[12], b, c); /*<>*/ }, s); - /*<>*/ var + /*<>*/ var _F_ = [0, cst$11, [0, /*<>*/ caml_call1(Stdlib_Buffer[2], b), [0, _D_, _B_]]], - /*<>*/ _G_ = + /*<>*/ _G_ = [0, cst$12, [0, quote_cmd_filename(cmd), _F_]]; - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_String[7], cst$13, _G_); - /*<>*/ } + /*<>*/ } function drive_and_path(s){ - /*<>*/ var - _s_ = 2 <= /*<>*/ caml_ml_string_length(s) ? 1 : 0; + /*<>*/ var + _s_ = 2 <= /*<>*/ caml_ml_string_length(s) ? 1 : 0; if(_s_){ - /*<>*/ /*<>*/ var - param = /*<>*/ caml_string_get(s, 0); + /*<>*/ /*<>*/ var + param = /*<>*/ caml_string_get(s, 0); a: { b: @@ -34583,39 +35199,39 @@ } var _t_ = 0; } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _u_ = _t_ - ? 58 === /*<>*/ caml_string_get(s, 1) ? 1 : 0 + ? 58 === /*<>*/ caml_string_get(s, 1) ? 1 : 0 : _t_; } else var _u_ = _s_; - /*<>*/ if(! _u_) - /*<>*/ return [0, cst$17, s]; - /*<>*/ /*<>*/ var + /*<>*/ if(! _u_) + /*<>*/ return [0, cst$17, s]; + /*<>*/ /*<>*/ var _v_ = - /*<>*/ caml_call3 + /*<>*/ caml_call3 (Stdlib_String[16], s, 2, caml_ml_string_length(s) - 2 | 0); - /*<>*/ return [0, - /*<>*/ caml_call3(Stdlib_String[16], s, 0, 2), + /*<>*/ return [0, + /*<>*/ caml_call3(Stdlib_String[16], s, 0, 2), _v_]; - /*<>*/ } + /*<>*/ } function dirname$0(s){ - /*<>*/ var - /*<>*/ match = drive_and_path(s), + /*<>*/ var + /*<>*/ match = drive_and_path(s), path = match[2], drive = match[1], - /*<>*/ dir = + /*<>*/ dir = generic_dirname(is_dir_sep$0, current_dir_name$0, path); - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib[28], drive, dir); - /*<>*/ } + /*<>*/ } function basename$0(s){ - /*<>*/ var path = drive_and_path(s)[2]; - /*<>*/ return generic_basename + /*<>*/ var path = drive_and_path(s)[2]; + /*<>*/ return generic_basename (is_dir_sep$0, current_dir_name$0, path); - /*<>*/ } + /*<>*/ } /*<>*/ /*<>*/ var Win32 = [0, @@ -34633,14 +35249,14 @@ quote_command$0, basename$0, dirname$0]; - /*<>*/ function basename$1(_r_){ + /*<>*/ function basename$1(_r_){ /*<>*/ return generic_basename(is_dir_sep$0, current_dir_name$1, _r_); } - /*<>*/ function dirname$1(_q_){ + /*<>*/ function dirname$1(_q_){ /*<>*/ return generic_dirname(is_dir_sep$0, current_dir_name$1, _q_); } - /*<>*/ var - /*<>*/ Cygwin = + /*<>*/ var + /*<>*/ Cygwin = [0, null$2, current_dir_name$1, @@ -34673,151 +35289,151 @@ basename$2 = Sysdeps[13], dirname$2 = Sysdeps[14]; function concat(dirname, filename){ - /*<>*/ var l = caml_ml_string_length(dirname); - /*<>*/ if + /*<>*/ var l = caml_ml_string_length(dirname); + /*<>*/ if (0 !== l && ! is_dir_sep$1(dirname, l - 1 | 0)){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _p_ = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib[28], dir_sep$2, filename); - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib[28], dirname, _p_); } - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib[28], dirname, filename); - /*<>*/ } + /*<>*/ } function chop_suffix(name, suff){ - /*<>*/ return check_suffix$1(name, suff) + /*<>*/ return check_suffix$1(name, suff) ? caml_call3 (Stdlib_String[16], name, 0, caml_ml_string_length(name) - caml_ml_string_length(suff) | 0) - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Filename_chop_suffix); - /*<>*/ } + /*<>*/ } function extension_len(name){ - /*<>*/ var + /*<>*/ var i$3 = caml_ml_string_length(name) - 1 | 0, i0 = i$3; - /*<>*/ for(;;){ - /*<>*/ if(0 <= i0 && ! is_dir_sep$1(name, i0)){ - /*<>*/ if - (46 === /*<>*/ caml_string_get(name, i0)) + /*<>*/ for(;;){ + /*<>*/ if(0 <= i0 && ! is_dir_sep$1(name, i0)){ + /*<>*/ if + (46 === /*<>*/ caml_string_get(name, i0)) break; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var i$2 = i0 - 1 | 0; i0 = i$2; continue; } - /*<>*/ return 0; + /*<>*/ return 0; } - /*<>*/ var - /*<>*/ i$1 = i0 - 1 | 0, + /*<>*/ var + /*<>*/ i$1 = i0 - 1 | 0, i = i$1; - /*<>*/ for(;;){ - /*<>*/ if(0 <= i && ! is_dir_sep$1(name, i)){ - /*<>*/ if - (46 !== /*<>*/ caml_string_get(name, i)) + /*<>*/ for(;;){ + /*<>*/ if(0 <= i && ! is_dir_sep$1(name, i)){ + /*<>*/ if + (46 !== /*<>*/ caml_string_get(name, i)) return caml_ml_string_length(name) - i0 | 0; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var i$0 = i - 1 | 0; i = i$0; continue; } - /*<>*/ return 0; + /*<>*/ return 0; } - /*<>*/ } + /*<>*/ } function extension(name){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var l = extension_len(name); - /*<>*/ return 0 === l + /*<>*/ return 0 === l ? cst$18 - : /*<>*/ caml_call3 + : /*<>*/ caml_call3 (Stdlib_String[16], name, caml_ml_string_length(name) - l | 0, l); - /*<>*/ } + /*<>*/ } function chop_extension(name){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var l = extension_len(name); - /*<>*/ return 0 === l - ? /*<>*/ caml_call1 + /*<>*/ return 0 === l + ? /*<>*/ caml_call1 (Stdlib[1], cst_Filename_chop_extension) : caml_call3 (Stdlib_String[16], name, 0, caml_ml_string_length(name) - l | 0); - /*<>*/ } + /*<>*/ } function remove_extension(name){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var l = extension_len(name); - /*<>*/ return 0 === l + /*<>*/ return 0 === l ? name : caml_call3 (Stdlib_String[16], name, 0, caml_ml_string_length(name) - l | 0); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var prng_key = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]); + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], 0, Stdlib_Random[19][2]); function temp_file_name(temp_dir, prefix, suffix){ - /*<>*/ var - /*<>*/ random_state = - /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - /*<>*/ rnd = - /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ random_state = + /*<>*/ caml_call1(Stdlib_Domain[11][2], prng_key), + /*<>*/ rnd = + /*<>*/ caml_call1 (Stdlib_Random[19][4], random_state) & 16777215; - /*<>*/ return concat + /*<>*/ return concat (temp_dir, - /*<>*/ caml_call4 + /*<>*/ caml_call4 (Stdlib_Printf[4], _f_, prefix, rnd, suffix)); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var current_temp_dir_name = - /*<>*/ caml_call2 - (Stdlib_Domain[10][1], + /*<>*/ caml_call2 + (Stdlib_Domain[11][1], [0, function(_o_){ /*<>*/ return _o_;}], function(param){ - /*<>*/ return temp_dir_name$1; - /*<>*/ }); + /*<>*/ return temp_dir_name$1; + /*<>*/ }); function set_temp_dir_name(s){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Domain[10][3], current_temp_dir_name, s); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Domain[11][3], current_temp_dir_name, s); + /*<>*/ } function get_temp_dir_name(param){ - /*<>*/ return caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - /*<>*/ } + /*<>*/ return caml_call1 + (Stdlib_Domain[11][2], current_temp_dir_name); + /*<>*/ } function temp_file(opt, prefix, suffix){ var temp_dir = opt ? opt[1] - : /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name), + : /*<>*/ caml_call1 + (Stdlib_Domain[11][2], current_temp_dir_name), counter = 0; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); - /*<>*/ try{ - /*<>*/ /*<>*/ runtime.caml_sys_close - ( /*<>*/ runtime.caml_sys_open(name, _g_, 384)); - /*<>*/ return name; + /*<>*/ try{ + /*<>*/ /*<>*/ runtime.caml_sys_close + ( /*<>*/ runtime.caml_sys_open(name, _g_, 384)); + /*<>*/ return name; } catch(e$0){ var e = caml_wrap_exception(e$0); if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); if(20 <= counter) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var counter$0 = counter + 1 | 0; counter = counter$0; } @@ -34830,28 +35446,28 @@ temp_dir = opt ? opt[1] - : /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name), + : /*<>*/ caml_call1 + (Stdlib_Domain[11][2], current_temp_dir_name), counter = 0; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); - /*<>*/ try{ - /*<>*/ /*<>*/ var + /*<>*/ try{ + /*<>*/ /*<>*/ var _n_ = [0, name, - /*<>*/ caml_call3 + /*<>*/ caml_call3 (Stdlib[62], [0, 1, [0, 3, [0, 5, mode]]], perms, name)]; - /*<>*/ return _n_; + /*<>*/ return _n_; } catch(e$0){ var e = caml_wrap_exception(e$0); if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); if(20 <= counter) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var counter$0 = counter + 1 | 0; counter = counter$0; } @@ -34862,25 +35478,25 @@ temp_dir = _k_ ? _k_[1] - : /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name), + : /*<>*/ caml_call1 + (Stdlib_Domain[11][2], current_temp_dir_name), perms = opt ? opt[1] : 448, counter = 0; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); - /*<>*/ try{ - /*<>*/ /*<>*/ runtime.caml_sys_mkdir + /*<>*/ try{ + /*<>*/ /*<>*/ runtime.caml_sys_mkdir (name, perms); - /*<>*/ return name; + /*<>*/ return name; } catch(e$0){ var e = caml_wrap_exception(e$0); if(e[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(e, 0); if(20 <= counter) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var counter$0 = counter + 1 | 0; counter = counter$0; } @@ -35205,25 +35821,29 @@ filter = Stdlib_List[44], find_all = Stdlib_List[45], filteri = Stdlib_List[46], - partition = Stdlib_List[47], - partition_map = Stdlib_List[48], - assoc = Stdlib_List[49], - assoc_opt = Stdlib_List[50], - assq = Stdlib_List[51], - assq_opt = Stdlib_List[52], - mem_assoc = Stdlib_List[53], - mem_assq = Stdlib_List[54], - remove_assoc = Stdlib_List[55], - remove_assq = Stdlib_List[56], - split = Stdlib_List[57], - combine = Stdlib_List[58], - sort = Stdlib_List[59], - stable_sort = Stdlib_List[60], - fast_sort = Stdlib_List[61], - sort_uniq = Stdlib_List[62], - merge = Stdlib_List[63], - to_seq = Stdlib_List[64], - of_seq = Stdlib_List[65], + take = Stdlib_List[47], + drop = Stdlib_List[48], + take_while = Stdlib_List[49], + drop_while = Stdlib_List[50], + partition = Stdlib_List[51], + partition_map = Stdlib_List[52], + assoc = Stdlib_List[53], + assoc_opt = Stdlib_List[54], + assq = Stdlib_List[55], + assq_opt = Stdlib_List[56], + mem_assoc = Stdlib_List[57], + mem_assq = Stdlib_List[58], + remove_assoc = Stdlib_List[59], + remove_assq = Stdlib_List[60], + split = Stdlib_List[61], + combine = Stdlib_List[62], + sort = Stdlib_List[63], + stable_sort = Stdlib_List[64], + fast_sort = Stdlib_List[65], + sort_uniq = Stdlib_List[66], + merge = Stdlib_List[67], + to_seq = Stdlib_List[68], + of_seq = Stdlib_List[69], Stdlib_ListLabels = [0, length, @@ -35272,6 +35892,10 @@ filter, find_all, filteri, + take, + drop, + take_while, + drop_while, partition, partition_map, assoc, @@ -35721,77 +36345,75 @@ "Effect.Continuation_already_resumed", Continuation_already_resumed); /*<>*/ function continue$0(k, v){ - /*<>*/ /*<>*/ var - _h_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ /*<>*/ var + _h_ = /*<>*/ caml_continuation_use_noexc(k); function _g_(x){ - /*<>*/ return x; - /*<>*/ } - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return x; + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue(k, e){ - /*<>*/ /*<>*/ var - _f_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ /*<>*/ var + _f_ = /*<>*/ caml_continuation_use_noexc(k); function _e_(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ } - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue_with_backtrace(k, e, bt){ - /*<>*/ /*<>*/ var - _d_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ /*<>*/ var + _d_ = /*<>*/ caml_continuation_use_noexc(k); function _c_(e){ - /*<>*/ caml_restore_raw_backtrace(e, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ caml_restore_raw_backtrace(e, bt); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ } - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function match_with(comp, arg, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[3], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[3], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - k[2] = last_fiber; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return /*<>*/ caml_call1(f, k); + /*<>*/ } + /*<>*/ /*<>*/ var s = - /*<>*/ caml_alloc_stack(handler[1], handler[2], effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ caml_alloc_stack(handler[1], handler[2], effc); + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function try_with(comp, arg, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[1], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[1], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - k[2] = last_fiber; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return /*<>*/ caml_call1(f, k); + /*<>*/ } + /*<>*/ /*<>*/ var s = - /*<>*/ caml_alloc_stack + /*<>*/ caml_alloc_stack (function(x){ - /*<>*/ return x; - /*<>*/ }, + /*<>*/ return x; + /*<>*/ }, function(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ }, + /*<>*/ }, effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } /*<>*/ var /*<>*/ Deep = [0, @@ -35804,28 +36426,27 @@ cst_E = "E", cst_impossible = "impossible"; function fiber(f){ - /*<>*/ var - /*<>*/ Initial_setup = + /*<>*/ var + /*<>*/ Initial_setup = [248, cst_Initial_setup, caml_fresh_oo_id(0)], - /*<>*/ E = [248, cst_E, caml_fresh_oo_id(0)]; + /*<>*/ E = [248, cst_E, caml_fresh_oo_id(0)]; function f$0(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, /*<>*/ jsoo_effect_not_supported()); - /*<>*/ } - /*<>*/ function error(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 + (f, /*<>*/ jsoo_effect_not_supported()); + /*<>*/ } + /*<>*/ function error(param){ + /*<>*/ return /*<>*/ caml_call1 (Stdlib[2], cst_impossible); - /*<>*/ } + /*<>*/ } function effc(eff, k, last_fiber){ - /*<>*/ if(eff !== Initial_setup) - /*<>*/ return error(0); - k[2] = last_fiber; - /*<>*/ throw [0, E, k]; - /*<>*/ } - /*<>*/ /*<>*/ var - s = /*<>*/ caml_alloc_stack(error, error, effc); - /*<>*/ try{ - /*<>*/ /*<>*/ jsoo_effect_not_supported + /*<>*/ if(eff === Initial_setup) + /*<>*/ throw [0, E, k]; + /*<>*/ return error(0); + /*<>*/ } + /*<>*/ /*<>*/ var + s = /*<>*/ caml_alloc_stack(error, error, effc); + /*<>*/ try{ + /*<>*/ /*<>*/ jsoo_effect_not_supported (); var _b_ = 0; } @@ -35833,59 +36454,58 @@ var exn = caml_wrap_exception(exn$0); if(exn[1] !== E) throw caml_maybe_attach_backtrace(exn, 0); var k = exn[2]; - /*<>*/ return k; + /*<>*/ return k; } - /*<>*/ return error(0); - /*<>*/ } + /*<>*/ return error(0); + /*<>*/ } function continue_gen(k, resume_fun, v, handler){ function effc(eff, k, last_fiber){ - /*<>*/ /*<>*/ var - match = /*<>*/ caml_call1(handler[3], eff); + /*<>*/ /*<>*/ var + match = /*<>*/ caml_call1(handler[3], eff); if(! match) - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); var f = match[1]; - k[2] = last_fiber; - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var stack = - /*<>*/ runtime.caml_continuation_use_and_update_handler_noexc + /*<>*/ runtime.caml_continuation_use_and_update_handler_noexc (k, handler[1], handler[2], effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function continue_with(k, v, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(x){ - /*<>*/ return x; - /*<>*/ }, + /*<>*/ return x; + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } function discontinue_with(k, v, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ }, + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } function discontinue_with_backtrace$0(k, v, bt, handler){ - /*<>*/ return continue_gen + /*<>*/ return continue_gen (k, function(e){ - /*<>*/ caml_restore_raw_backtrace(e, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ caml_restore_raw_backtrace(e, bt); + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 0); - /*<>*/ }, + /*<>*/ }, v, handler); - /*<>*/ } + /*<>*/ } var Stdlib_Effect = [0, diff --git a/ppx/ppx_deriving_json/tests/gen.mlt b/ppx/ppx_deriving_json/tests/gen.mlt index 3994e69fa3..4c324e596d 100644 --- a/ppx/ppx_deriving_json/tests/gen.mlt +++ b/ppx/ppx_deriving_json/tests/gen.mlt @@ -170,7 +170,6 @@ type variant1 = [%%expect {| - type variant1 = | A | B @@ -219,7 +218,6 @@ type variant2 = [%%expect {| - type variant2 = | D of string | E of variant1 [@@deriving json] @@ -436,7 +434,6 @@ type inline_record = [%%expect {| - type inline_record = | I of { name: string ; @@ -580,7 +577,6 @@ val json : type t = A | B [@@deriving json] [%%expect {| - type t = | A | B [@@deriving json] diff --git a/ppx/ppx_js/tests/ppx.mlt b/ppx/ppx_js/tests/ppx.mlt index e1c1510135..02d7850ebf 100644 --- a/ppx/ppx_js/tests/ppx.mlt +++ b/ppx/ppx_js/tests/ppx.mlt @@ -102,7 +102,7 @@ fun (obj : int) -> obj##m [%%expect {| Line _, characters 19-22: -Error: This expression has type int but an expression was expected of type +Error: The value obj has type int but an expression was expected of type < .. > Js_of_ocaml.Js.t |}] @@ -122,7 +122,7 @@ fun (obj : < m : float Js.prop > Js.t) -> obj##m [%%expect {| Line _, characters 42-48: -Error: This expression has type +Error: The method call x#m has type float Js_of_ocaml.Js.prop = < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop but an expression was expected of type 'res Js_of_ocaml.Js.meth @@ -144,7 +144,7 @@ fun (obj : < m : int -> int Js.meth > Js.t) -> obj##m + 1 [%%expect {| Line _, characters 47-53: -Error: This expression has type int -> int Js_of_ocaml.Js.meth +Error: The method call x#m has type int -> int Js_of_ocaml.Js.meth but an expression was expected of type 'res Js_of_ocaml.Js.meth |}] @@ -154,7 +154,7 @@ fun (obj : < m : int Js.meth > Js.t) -> obj##m 1 [%%expect {| Line _, characters 40-46: -Error: This expression has type int Js_of_ocaml.Js.meth +Error: The method call x#m has type int Js_of_ocaml.Js.meth but an expression was expected of type int -> 'res Js_of_ocaml.Js.meth |}] @@ -189,7 +189,7 @@ fun (obj : int) -> obj##.p [%%expect {| Line _, characters 19-22: -Error: This expression has type int but an expression was expected of type +Error: The value obj has type int but an expression was expected of type < .. > Js_of_ocaml.Js.t |}] @@ -209,7 +209,7 @@ fun (obj : < p : float Js.writeonly_prop > Js.t) -> obj##.p + 1 [%%expect {| Line _, characters 58-59: -Error: This expression has type +Error: The method call x#p has type float Js_of_ocaml.Js.writeonly_prop = < set : float -> unit > Js_of_ocaml.Js.gen_prop but an expression was expected of type @@ -235,7 +235,7 @@ fun (obj : int) -> obj##.p := 2 [%%expect {| Line _, characters 19-22: -Error: This expression has type int but an expression was expected of type +Error: The value obj has type int but an expression was expected of type < .. > Js_of_ocaml.Js.t |}] @@ -255,7 +255,7 @@ fun (obj : < p : float Js.readonly_prop > Js.t) -> obj##.p := 1 [%%expect {| Line _, characters 51-58: -Error: This expression has type +Error: The method call x#p has type float Js_of_ocaml.Js.readonly_prop = < get : float > Js_of_ocaml.Js.gen_prop but an expression was expected of type @@ -269,7 +269,7 @@ fun (obj : < p : float Js.prop > Js.t) -> obj##.p := 1 [%%expect {| Line _, characters 42-49: -Error: This expression has type +Error: The method call x#p has type float Js_of_ocaml.Js.prop = < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop but an expression was expected of type