diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0f5098855..66cdb4d1e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,10 +99,7 @@ jobs: dune-cache: true opam-depext: false - - run: opam pin add ppxlib git+https://github.com/hhugo/ppxlib.git#jsoo-ocaml-52 --no-action - if: ${{ matrix.ocaml-compiler == 'ocaml-variants.5.3.0+trunk' }} - - - run: opam pin add ocaml-compiler-libs git+https://github.com/art-w/ocaml-compiler-libs.git#ocaml-5.2-trunk --no-action + - run: opam pin add ppxlib git+https://github.com/hhugo/ppxlib.git#trunk-support-53 --no-action if: ${{ matrix.ocaml-compiler == 'ocaml-variants.5.3.0+trunk' }} - run: opam pin add ./ --no-action diff --git a/CHANGES.md b/CHANGES.md index 8dd3d5660b..cefde49774 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ * Runtime: abort instead of exit when calling unimplemented js primitives in bytecode/native. It should help if one tries to understand the source of the call with gdb (see #677) +* Compiler: initial support for OCaml 5.3 ## Bug fixes diff --git a/compiler/lib/magic_number.ml b/compiler/lib/magic_number.ml index d78ac3ca37..34718527f5 100644 --- a/compiler/lib/magic_number.ml +++ b/compiler/lib/magic_number.ml @@ -77,11 +77,12 @@ let v = | 5 :: 00 :: _ -> 32 | 5 :: 01 :: _ -> 33 | 5 :: 02 :: _ -> 34 + | 5 :: 03 :: _ -> 35 | _ -> - if Ocaml_version.compare current [ 4; 8 ] < 0 + if Ocaml_version.compare current [ 4; 08 ] < 0 then failwith "OCaml version unsupported. Upgrade to OCaml 4.08 or newer." else ( - assert (Ocaml_version.compare current [ 5; 3 ] >= 0); + assert (Ocaml_version.compare current [ 5; 04 ] >= 0); failwith "OCaml version unsupported. Upgrade js_of_ocaml.") let current_exe = "Caml1999X", v diff --git a/compiler/lib/parse_bytecode.ml b/compiler/lib/parse_bytecode.ml index 07933245a5..20de7e8713 100644 --- a/compiler/lib/parse_bytecode.ml +++ b/compiler/lib/parse_bytecode.ml @@ -2412,7 +2412,6 @@ and compile infos pc state instrs = | true -> State.pop 2 state | false -> State.pop 3 state in - compile infos (pc + 1) diff --git a/compiler/tests-check-prim/main.output5 b/compiler/tests-check-prim/main.output5 index ebff659038..0eb366941a 100644 --- a/compiler/tests-check-prim/main.output5 +++ b/compiler/tests-check-prim/main.output5 @@ -4,21 +4,11 @@ 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 caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_int64_add_native -caml_int64_and_native -caml_int64_div_native -caml_int64_mod_native -caml_int64_mul_native -caml_int64_neg_native -caml_int64_or_native -caml_int64_sub_native -caml_int64_xor_native caml_int_as_pointer caml_reset_afl_instrumentation caml_signbit @@ -44,7 +34,6 @@ caml_bigstring_memcmp caml_hash_mix_bigstring From +domain.js: -caml_atomic_make_contended caml_ml_domain_set_name From +effect.js: @@ -63,7 +52,6 @@ caml_eventlog_resume caml_gc_huge_fallback_count caml_get_major_bucket caml_get_major_credit -caml_memprof_discard caml_memprof_set From +graphics.js: @@ -119,10 +107,6 @@ From +ints.js: caml_div caml_mod -From +io.js: -caml_ml_input_bigarray -caml_ml_output_bigarray - From +jslib.js: caml_is_js caml_trampoline @@ -155,12 +139,10 @@ caml_obj_set_tag caml_obj_truncate From +runtime_events.js: -caml_ml_runtime_events_pause -caml_ml_runtime_events_resume -caml_ml_runtime_events_start caml_runtime_events_create_cursor caml_runtime_events_free_cursor caml_runtime_events_read_poll +caml_runtime_events_user_resolve From +stdlib.js: caml_build_symbols @@ -188,7 +170,6 @@ caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked From +toplevel.js: -caml_dynlink_get_bytecode_sections caml_static_alloc caml_static_free caml_terminfo_backup diff --git a/compiler/tests-check-prim/unix-unix.output5 b/compiler/tests-check-prim/unix-unix.output5 index 9324cb2628..6ba27a9417 100644 --- a/compiler/tests-check-prim/unix-unix.output5 +++ b/compiler/tests-check-prim/unix-unix.output5 @@ -4,21 +4,11 @@ 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 caml_dynlink_lookup_symbol caml_dynlink_open_lib -caml_int64_add_native -caml_int64_and_native -caml_int64_div_native -caml_int64_mod_native -caml_int64_mul_native -caml_int64_neg_native -caml_int64_or_native -caml_int64_sub_native -caml_int64_xor_native caml_int_as_pointer caml_reset_afl_instrumentation caml_signbit @@ -92,6 +82,7 @@ caml_unix_outchannel_of_filedescr caml_unix_pipe caml_unix_putenv caml_unix_read +caml_unix_read_bigarray caml_unix_realpath caml_unix_recv caml_unix_recvfrom @@ -131,6 +122,7 @@ caml_unix_utimes caml_unix_wait caml_unix_waitpid caml_unix_write +caml_unix_write_bigarray debugger is_digit_normalized @@ -153,7 +145,6 @@ caml_bigstring_memcmp caml_hash_mix_bigstring From +domain.js: -caml_atomic_make_contended caml_ml_domain_set_name From +effect.js: @@ -172,7 +163,6 @@ caml_eventlog_resume caml_gc_huge_fallback_count caml_get_major_bucket caml_get_major_credit -caml_memprof_discard caml_memprof_set From +graphics.js: @@ -228,10 +218,6 @@ From +ints.js: caml_div caml_mod -From +io.js: -caml_ml_input_bigarray -caml_ml_output_bigarray - From +jslib.js: caml_is_js caml_trampoline @@ -264,12 +250,10 @@ caml_obj_set_tag caml_obj_truncate From +runtime_events.js: -caml_ml_runtime_events_pause -caml_ml_runtime_events_resume -caml_ml_runtime_events_start caml_runtime_events_create_cursor caml_runtime_events_free_cursor caml_runtime_events_read_poll +caml_runtime_events_user_resolve From +stdlib.js: caml_build_symbols @@ -297,7 +281,6 @@ caml_spacetime_only_works_for_native_code caml_sys_const_naked_pointers_checked From +toplevel.js: -caml_dynlink_get_bytecode_sections caml_static_alloc caml_static_free caml_terminfo_backup diff --git a/compiler/tests-full/dune b/compiler/tests-full/dune index 7bff07f310..5c4c041a25 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.1.1")) + (>= %{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.1.1")) + (>= %{ocaml_version} "5.2.0")) (action (with-stdout-to %{targets} @@ -23,6 +23,6 @@ (rule (alias runtest) (enabled_if - (= %{ocaml_version} "5.1.1")) + (>= %{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 38fe68e355..27e5a4d8ac 100644 --- a/compiler/tests-full/stdlib.cma.expected.js +++ b/compiler/tests-full/stdlib.cma.expected.js @@ -808,12 +808,12 @@ var str = param[2]; /*<>*/ return str; } - function symbol$0(param, _h_){ + function symbol$0(_h_, param){ var - str2 = _h_[2], - fmt2 = _h_[1], - str1 = param[2], - fmt1 = param[1], + str2 = param[2], + fmt2 = param[1], + str1 = _h_[2], + fmt1 = _h_[1], s2 = "%," + str2; /*<>*/ return [0, /*<>*/ caml_call2 @@ -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.1.1", - ocaml_release = [0, 5, 1, 1, 0], + ocaml_version = "5.3.0+dev0-2023-12-22", + ocaml_release = [0, 5, 3, 0, [0, [0, 0, "dev0-2023-12-22"]]], Stdlib = global_data.Stdlib, /*<>*/ executable_name = /*<>*/ runtime.caml_sys_executable_name(0), @@ -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, @@ -1216,7 +1216,6 @@ var runtime = globalThis.jsoo_runtime, cst_Obj_extension_constructor$1 = "Obj.extension_constructor", - 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 @@ -1226,7 +1225,6 @@ var global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, - Assert_failure = global_data.Assert_failure, Stdlib_Sys = global_data.Stdlib__Sys; function is_block(a){ /*<>*/ return 1 - (typeof a === "number" ? 1 : 0); @@ -1234,49 +1232,37 @@ var double_field = runtime.caml_array_get, set_double_field = runtime.caml_array_set, - _a_ = [0, "obj.ml", 94, 4], cst_Obj_extension_constructor = cst_Obj_extension_constructor$1, cst_Obj_extension_constructor$0 = cst_Obj_extension_constructor$1; - function info(obj){ - /*<>*/ if( /*<>*/ caml_obj_tag(obj) !== 247) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - /*<>*/ var - /*<>*/ info = - /*<>*/ runtime.caml_obj_raw_field(obj, 1), - arity = 64 === Stdlib_Sys[9] ? info >> 56 : info >> 24, - /*<>*/ start_env = info << 8 >>> 9 | 0; - /*<>*/ return [0, arity, start_env]; - /*<>*/ } function of_val(x){ - /*<>*/ a: + /*<>*/ a: { if (is_block(x) - && /*<>*/ caml_obj_tag(x) !== 248 && 1 <= x.length - 1){var slot = x[1]; break a;} + && /*<>*/ caml_obj_tag(x) !== 248 && 1 <= x.length - 1){var slot = x[1]; break a;} var slot = x; } a: { - if(is_block(slot) && /*<>*/ caml_obj_tag(slot) === 248){var name = slot[1]; break a;} + if(is_block(slot) && /*<>*/ caml_obj_tag(slot) === 248){var name = slot[1]; break a;} var name = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib[1], cst_Obj_extension_constructor$0); } - return /*<>*/ caml_obj_tag(name) === 252 + return /*<>*/ caml_obj_tag(name) === 252 ? slot - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Obj_extension_constructor); - /*<>*/ } + /*<>*/ } function name(slot){ - /*<>*/ return slot[1]; - /*<>*/ } + /*<>*/ return slot[1]; + /*<>*/ } function id(slot){ - /*<>*/ return slot[2]; - /*<>*/ } - /*<>*/ var - /*<>*/ Extension_constructor = [0, of_val, name, id], + /*<>*/ return slot[2]; + /*<>*/ } + /*<>*/ var + /*<>*/ Extension_constructor = [0, of_val, name, id], max_ephe_length = Stdlib_Sys[13] - 2 | 0, cst_Obj_Ephemeron_create = "Obj.Ephemeron.create", cst_Obj_Ephemeron_get_key = "Obj.Ephemeron.get_key", @@ -1286,73 +1272,73 @@ cst_Obj_Ephemeron_check_key = "Obj.Ephemeron.check_key", cst_Obj_Ephemeron_blit_key = "Obj.Ephemeron.blit_key"; function create(l){ - /*<>*/ var - _g_ = 0 <= l ? 1 : 0, - _h_ = _g_ ? l <= max_ephe_length ? 1 : 0 : _g_; - if(1 - _h_) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ var + _f_ = 0 <= l ? 1 : 0, + _g_ = _f_ ? l <= max_ephe_length ? 1 : 0 : _f_; + if(1 - _g_) + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Obj_Ephemeron_create); - /*<>*/ return /*<>*/ runtime.caml_ephe_create + /*<>*/ return /*<>*/ runtime.caml_ephe_create (l); - /*<>*/ } + /*<>*/ } function length(x){ - /*<>*/ return x.length - 3 | 0; - /*<>*/ } + /*<>*/ return x.length - 3 | 0; + /*<>*/ } function raise_if_invalid_offset(e, o, msg){ - /*<>*/ var - _d_ = 0 <= o ? 1 : 0, - _e_ = _d_ ? o < length(e) ? 1 : 0 : _d_, - _f_ = 1 - _e_; - return _f_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _f_; - /*<>*/ } + /*<>*/ var + _c_ = 0 <= o ? 1 : 0, + _d_ = _c_ ? o < length(e) ? 1 : 0 : _c_, + _e_ = 1 - _d_; + return _e_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _e_; + /*<>*/ } function get_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_get_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_get_key + /*<>*/ return /*<>*/ runtime.caml_ephe_get_key (e, o); - /*<>*/ } + /*<>*/ } function get_key_copy(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_get_key_copy); - /*<>*/ return /*<>*/ runtime.caml_ephe_get_key_copy + /*<>*/ return /*<>*/ runtime.caml_ephe_get_key_copy (e, o); - /*<>*/ } + /*<>*/ } function set_key(e, o, x){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_set_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_set_key + /*<>*/ return /*<>*/ runtime.caml_ephe_set_key (e, o, x); - /*<>*/ } + /*<>*/ } function unset_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_unset_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_unset_key + /*<>*/ return /*<>*/ runtime.caml_ephe_unset_key (e, o); - /*<>*/ } + /*<>*/ } function check_key(e, o){ - /*<>*/ raise_if_invalid_offset + /*<>*/ raise_if_invalid_offset (e, o, cst_Obj_Ephemeron_check_key); - /*<>*/ return /*<>*/ runtime.caml_ephe_check_key + /*<>*/ return /*<>*/ runtime.caml_ephe_check_key (e, o); - /*<>*/ } + /*<>*/ } function blit_key(e1, o1, e2, o2, l){ - /*<>*/ if + /*<>*/ if (0 <= l && 0 <= o1 && (length(e1) - l | 0) >= o1 && 0 <= o2 && (length(e2) - l | 0) >= o2){ var - _b_ = 0 !== l ? 1 : 0, - _c_ = - _b_ - ? /*<>*/ runtime.caml_ephe_blit_key + _a_ = 0 !== l ? 1 : 0, + _b_ = + _a_ + ? /*<>*/ runtime.caml_ephe_blit_key (e1, o1, e2, o2, l) - : _b_; - /*<>*/ return _c_; + : _a_; + /*<>*/ return _b_; } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Obj_Ephemeron_blit_key); - /*<>*/ } + /*<>*/ } var Stdlib_Obj = [0, @@ -1377,7 +1363,6 @@ 1000, 1001, 1002, - [0, info], Extension_constructor, [0, create, @@ -1395,7 +1380,7 @@ runtime.caml_ephe_check_data, runtime.caml_ephe_blit_data, max_ephe_length]]; - runtime.caml_register_global(13, Stdlib_Obj, "Stdlib__Obj"); + runtime.caml_register_global(11, Stdlib_Obj, "Stdlib__Obj"); return; /*<>*/ } (globalThis)); @@ -1423,9 +1408,9 @@ /*<>*/ } function uid(A){ /*<>*/ /*<>*/ var - _b_ = /*<>*/ caml_call1(Stdlib_Obj[23][1], A[1]); + _b_ = /*<>*/ caml_call1(Stdlib_Obj[22][1], A[1]); /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[23][3], _b_); + (Stdlib_Obj[22][3], _b_); /*<>*/ } function provably_equal(A, B){ /*<>*/ return A[1] === B[1] ? _a_ : 0; @@ -1446,21 +1431,22 @@ caml_atomic_exchange = runtime.caml_atomic_exchange, caml_atomic_fetch_add = runtime.caml_atomic_fetch_add; function set(r, x){ - /*<>*/ caml_atomic_exchange(r, x); + /*<>*/ caml_atomic_exchange(r, x); return 0; - /*<>*/ } + /*<>*/ } function incr(r){ - /*<>*/ caml_atomic_fetch_add(r, 1); + /*<>*/ caml_atomic_fetch_add(r, 1); return 0; - /*<>*/ } + /*<>*/ } function decr(r){ - /*<>*/ caml_atomic_fetch_add(r, -1); + /*<>*/ caml_atomic_fetch_add(r, -1); return 0; - /*<>*/ } + /*<>*/ } var Stdlib_Atomic = [0, function(_a_){ /*<>*/ return [0, _a_];}, + runtime.caml_atomic_make_contended, runtime.caml_atomic_load, set, caml_atomic_exchange, @@ -1702,7 +1688,7 @@ var next = match[2], x = match[1]; /*<>*/ return [0, x, - function(_av_){ /*<>*/ return append(next, seq2, _av_);}]; + function(_au_){ /*<>*/ return append(next, seq2, _au_);}]; /*<>*/ } function map(f, seq, param){ /*<>*/ /*<>*/ var @@ -1711,7 +1697,7 @@ var next = match[2], x = match[1]; /*<>*/ return [0, /*<>*/ caml_call1(f, x), - function(_au_){ /*<>*/ return map(f, next, _au_);}]; + function(_at_){ /*<>*/ return map(f, next, _at_);}]; /*<>*/ } function filter_map(f, seq, param){ /*<>*/ var seq$0 = seq; @@ -1727,7 +1713,7 @@ var y = match$0[1]; /*<>*/ return [0, y, - function(_at_){ /*<>*/ return filter_map(f, next, _at_);}]; + function(_as_){ /*<>*/ return filter_map(f, next, _as_);}]; } seq$0 = next; } @@ -1742,7 +1728,7 @@ /*<>*/ if( /*<>*/ caml_call1(f, x)) /*<>*/ return [0, x, - function(_as_){ /*<>*/ return filter(f, next, _as_);}]; + function(_ar_){ /*<>*/ return filter(f, next, _ar_);}]; seq$0 = next; } /*<>*/ } @@ -1752,7 +1738,7 @@ if(! match) /*<>*/ return 0; var next = match[2], x = match[1]; /*<>*/ return append - (x, function(_ar_){ /*<>*/ return concat(next, _ar_);}, 0); + (x, function(_aq_){ /*<>*/ return concat(next, _aq_);}, 0); /*<>*/ } function flat_map(f, seq, param){ /*<>*/ /*<>*/ var @@ -1761,7 +1747,7 @@ var next = match[2], x = match[1]; /*<>*/ return append ( /*<>*/ caml_call1(f, x), - function(_aq_){ /*<>*/ return flat_map(f, next, _aq_);}, + function(_ap_){ /*<>*/ return flat_map(f, next, _ap_);}, 0); /*<>*/ } function fold_left(f, acc, seq){ @@ -1797,7 +1783,7 @@ var match$0 = match[1], u$0 = match$0[2], x = match$0[1]; /*<>*/ return [0, x, - function(_ap_){ /*<>*/ return unfold(f, u$0, _ap_);}]; + function(_ao_){ /*<>*/ return unfold(f, u$0, _ao_);}]; /*<>*/ } function is_empty(xs){ /*<>*/ return /*<>*/ caml_call1(xs, 0) ? 0 : 1; @@ -1861,8 +1847,8 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _ao_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(! _ao_) /*<>*/ return _ao_; + /*<>*/ _an_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(! _an_) /*<>*/ return _an_; xs$0 = xs$1; } /*<>*/ } @@ -1875,8 +1861,8 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _an_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(_an_) /*<>*/ return _an_; + /*<>*/ _am_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(_am_) /*<>*/ return _am_; xs$0 = xs$1; } /*<>*/ } @@ -1992,8 +1978,8 @@ /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _am_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(! _am_) /*<>*/ return _am_; + /*<>*/ _al_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(! _al_) /*<>*/ return _al_; xs$0 = xs$1; ys$0 = ys$1; } @@ -2013,8 +1999,8 @@ /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _al_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(_al_) /*<>*/ return _al_; + /*<>*/ _ak_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(_ak_) /*<>*/ return _ak_; xs$0 = xs$1; ys$0 = ys$1; } @@ -2033,9 +2019,9 @@ y = match$0[1], xs$1 = match[2], x = match[1], - /*<>*/ _ak_ = + /*<>*/ _aj_ = /*<>*/ caml_call2(eq, x, y); - /*<>*/ if(! _ak_) /*<>*/ return _ak_; + /*<>*/ if(! _aj_) /*<>*/ return _aj_; xs$0 = xs$1; ys$0 = ys$1; continue; @@ -2066,33 +2052,33 @@ /*<>*/ } function init_aux(f, i, j, param){ /*<>*/ if(i >= j) /*<>*/ return 0; - var _ai_ = i + 1 | 0; + var _ah_ = i + 1 | 0; /*<>*/ return [0, /*<>*/ caml_call1(f, i), - function(_aj_){ /*<>*/ return init_aux(f, _ai_, j, _aj_);}]; + function(_ai_){ /*<>*/ return init_aux(f, _ah_, j, _ai_);}]; /*<>*/ } function init(n, f){ /*<>*/ if(0 > n) /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Seq_init); - var _ag_ = 0; - /*<>*/ return function(_ah_){ - /*<>*/ return init_aux(f, _ag_, n, _ah_);}; + var _af_ = 0; + /*<>*/ return function(_ag_){ + /*<>*/ return init_aux(f, _af_, n, _ag_);}; /*<>*/ } function repeat(x, param){ /*<>*/ return [0, x, - function(_af_){ /*<>*/ return repeat(x, _af_);}]; + function(_ae_){ /*<>*/ return repeat(x, _ae_);}]; /*<>*/ } function forever(f, param){ /*<>*/ return [0, /*<>*/ caml_call1(f, 0), - function(_ae_){ /*<>*/ return forever(f, _ae_);}]; + function(_ad_){ /*<>*/ return forever(f, _ad_);}]; /*<>*/ } function cycle_nonempty(xs, param){ /*<>*/ return append (xs, - function(_ad_){ /*<>*/ return cycle_nonempty(xs, _ad_);}, + function(_ac_){ /*<>*/ return cycle_nonempty(xs, _ac_);}, 0); /*<>*/ } function cycle(xs, param){ @@ -2100,40 +2086,40 @@ match = /*<>*/ caml_call1(xs, 0); if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ function _aa_(_ac_){ - /*<>*/ return cycle_nonempty(xs, _ac_); + /*<>*/ function _$_(_ab_){ + /*<>*/ return cycle_nonempty(xs, _ab_); } /*<>*/ return [0, x, - function(_ab_){ /*<>*/ return append(xs$0, _aa_, _ab_);}]; + function(_aa_){ /*<>*/ return append(xs$0, _$_, _aa_);}]; /*<>*/ } function iterate1(f, x, param){ /*<>*/ /*<>*/ var y = /*<>*/ caml_call1(f, x); /*<>*/ return [0, y, - function(_$_){ /*<>*/ return iterate1(f, y, _$_);}]; + function(___){ /*<>*/ return iterate1(f, y, ___);}]; /*<>*/ } function iterate(f, x){ - /*<>*/ function next(___){ - /*<>*/ return iterate1(f, x, ___); + /*<>*/ function next(_Z_){ + /*<>*/ return iterate1(f, x, _Z_); } - /*<>*/ return function(_Z_){ + /*<>*/ return function(_Y_){ /*<>*/ return [0, x, next];}; /*<>*/ } function mapi_aux(f, i, xs, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(xs, 0); if(! match) /*<>*/ return 0; - var xs$0 = match[2], x = match[1], /*<>*/ _X_ = i + 1 | 0; + var xs$0 = match[2], x = match[1], /*<>*/ _W_ = i + 1 | 0; /*<>*/ return [0, /*<>*/ caml_call2(f, i, x), - function(_Y_){ /*<>*/ return mapi_aux(f, _X_, xs$0, _Y_);}]; + function(_X_){ /*<>*/ return mapi_aux(f, _W_, xs$0, _X_);}]; /*<>*/ } function mapi(f, xs){ - /*<>*/ var _V_ = 0; - /*<>*/ return function(_W_){ - /*<>*/ return mapi_aux(f, _V_, xs, _W_);}; + /*<>*/ var _U_ = 0; + /*<>*/ return function(_V_){ + /*<>*/ return mapi_aux(f, _U_, xs, _V_);}; /*<>*/ } function tail_scan(f, s, xs, param){ /*<>*/ /*<>*/ var @@ -2145,13 +2131,13 @@ /*<>*/ s$0 = /*<>*/ caml_call2(f, s, x); /*<>*/ return [0, s$0, - function(_U_){ /*<>*/ return tail_scan(f, s$0, xs$0, _U_);}]; + function(_T_){ /*<>*/ return tail_scan(f, s$0, xs$0, _T_);}]; /*<>*/ } function scan(f, s, xs){ - /*<>*/ function next(_T_){ - /*<>*/ return tail_scan(f, s, xs, _T_); + /*<>*/ function next(_S_){ + /*<>*/ return tail_scan(f, s, xs, _S_); } - /*<>*/ return function(_S_){ + /*<>*/ return function(_R_){ /*<>*/ return [0, s, next];}; /*<>*/ } function take_aux(n, xs){ @@ -2204,7 +2190,7 @@ /*<>*/ return /*<>*/ caml_call1(p, x) ? [0, x, - function(_R_){ /*<>*/ return take_while(p, xs$0, _R_);}] + function(_Q_){ /*<>*/ return take_while(p, xs$0, _Q_);}] : 0; /*<>*/ } function drop_while(p, xs, param){ @@ -2226,17 +2212,17 @@ var xs$0 = match[2], x = match[1], - /*<>*/ _K_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function _L_(_Q_){ - /*<>*/ return drop_while(_K_, xs$0, _Q_); + /*<>*/ _J_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function _K_(_P_){ + /*<>*/ return drop_while(_J_, xs$0, _P_); } - /*<>*/ var _M_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function next(_P_){ - /*<>*/ return take_while(_M_, xs$0, _P_); + /*<>*/ var _L_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function next(_O_){ + /*<>*/ return take_while(_L_, xs$0, _O_); } /*<>*/ return [0, - function(_O_){ /*<>*/ return [0, x, next];}, - function(_N_){ /*<>*/ return group(eq, _L_, _N_);}]; + function(_N_){ /*<>*/ return [0, x, next];}, + function(_M_){ /*<>*/ return group(eq, _K_, _M_);}]; /*<>*/ } /*<>*/ var /*<>*/ Forced_twice = @@ -2257,12 +2243,12 @@ /*<>*/ } /*<>*/ /*<>*/ var s = /*<>*/ caml_call1(to_lazy, s$0); - /*<>*/ return function(_J_){ - var _I_ = runtime.caml_obj_tag(s); + /*<>*/ return function(param){ + /*<>*/ var _I_ = runtime.caml_obj_tag(s); if(250 === _I_) return s[1]; - if(246 !== _I_ && 244 !== _I_) /*<>*/ return s; - /*<>*/ return /*<>*/ caml_call1 - (CamlinternalLazy[2], s);}; + if(246 !== _I_ && 244 !== _I_) /*<>*/ return s; + /*<>*/ return /*<>*/ caml_call1 + (CamlinternalLazy[2], s); /*<>*/ }; /*<>*/ } function once(xs){ function f(param){ @@ -2276,7 +2262,7 @@ action = /*<>*/ caml_call1(Stdlib_Atomic[1], f); /*<>*/ return function(param){ /*<>*/ /*<>*/ var - f = /*<>*/ caml_call2(Stdlib_Atomic[4], action, failure); + f = /*<>*/ caml_call2(Stdlib_Atomic[5], action, failure); /*<>*/ return /*<>*/ caml_call1(f, 0); /*<>*/ }; /*<>*/ } function zip(xs, ys, param){ @@ -3308,6 +3294,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){ @@ -4062,117 +4050,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]; } } } @@ -4181,56 +4255,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; @@ -4240,23 +4314,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]; } } } @@ -4265,56 +4339,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; @@ -4324,29 +4398,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]; } } } @@ -4355,32 +4429,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 @@ -4393,15 +4467,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 @@ -4413,34 +4487,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; @@ -4448,13 +4522,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; @@ -4464,25 +4538,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]; } } } @@ -4491,34 +4565,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 @@ -4529,17 +4603,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 @@ -4549,34 +4623,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; @@ -4584,13 +4658,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; @@ -4600,116 +4674,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; @@ -4720,9 +4794,9 @@ } else dst[1 + offset] = 0; - /*<>*/ return [0, x1, block]; + /*<>*/ return [0, x1, block]; } - /*<>*/ } + /*<>*/ } var Stdlib_List = [0, @@ -4772,6 +4846,10 @@ find_all, find_all, filteri, + take, + drop, + take_while, + drop_while, partition, partition_map, assoc, @@ -4791,7 +4869,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)); @@ -7042,10 +7120,10 @@ (function(globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, cst = "()"; - function equal(param, _b_){ + function equal(_b_, param){ /*<>*/ return 1; /*<>*/ } - function compare(param, _a_){ + function compare(_a_, param){ /*<>*/ return 0; /*<>*/ } function to_string(param){ @@ -7170,6 +7248,8 @@ Stdlib = global_data.Stdlib, /*<>*/ Floatarray = [0], cst_Array_init = "Array.init", + cst_Array_make_matrix = "Array.make_matrix", + cst_Array_init_matrix = "Array.init_matrix", cst_Array_sub = "Array.sub", cst_Array_fill = "Array.fill", cst_Array_blit = "Array.blit", @@ -7185,599 +7265,643 @@ if(0 > l) /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_init); - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, 0)), - /*<>*/ _aw_ = l - 1 | 0, - /*<>*/ _av_ = 1; - if(_aw_ >= 1){ - var i = _av_; + /*<>*/ var + /*<>*/ res = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, 0)), + /*<>*/ _aE_ = l - 1 | 0, + /*<>*/ _aD_ = 1; + if(_aE_ >= 1){ + var i = _aD_; for(;;){ - /*<>*/ res[1 + i] = - /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _ax_ = i + 1 | 0; - if(_aw_ === i) break; - i = _ax_; + /*<>*/ res[1 + i] = + /*<>*/ caml_call1(f, i); + /*<>*/ /*<>*/ var _aF_ = i + 1 | 0; + if(_aE_ === i) break; + i = _aF_; } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function make_matrix(sx, sy, init){ - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect(sx, [0]), - /*<>*/ _at_ = sx - 1 | 0, - /*<>*/ _as_ = 0; - if(_at_ >= 0){ - var x = _as_; - for(;;){ - res[1 + x] = /*<>*/ caml_make_vect(sy, init); - /*<>*/ /*<>*/ var _au_ = x + 1 | 0; - if(_at_ === x) break; - x = _au_; + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Array_make_matrix); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_make_vect(sx, [0]); + if(0 < sy){ + /*<>*/ var + _aB_ = sx - 1 | 0, + /*<>*/ _aA_ = 0; + if(_aB_ >= 0){ + var x = _aA_; + for(;;){ + res[1 + x] = /*<>*/ caml_make_vect(sy, init); + /*<>*/ /*<>*/ var _aC_ = x + 1 | 0; + if(_aB_ === x) break; + x = _aC_; + } + } + } + /*<>*/ return res; + /*<>*/ } + function init_matrix(sx, sy, f){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Array_init_matrix); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_make_vect(sx, [0]); + if(0 < sy){ + /*<>*/ var + _av_ = sx - 1 | 0, + /*<>*/ _au_ = 0; + if(_av_ >= 0){ + var x = _au_; + for(;;){ + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_make_vect + (sy, /*<>*/ caml_call2(f, x, 0)), + /*<>*/ _ax_ = sy - 1 | 0, + /*<>*/ _aw_ = 1; + if(_ax_ >= 1){ + var y = _aw_; + for(;;){ + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var _az_ = y + 1 | 0; + if(_ax_ === y) break; + y = _az_; + } + } + res[1 + x] = row; + /*<>*/ /*<>*/ var _ay_ = x + 1 | 0; + if(_av_ === x) break; + x = _ay_; + } } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function copy(a){ - /*<>*/ var l = a.length - 1; - /*<>*/ return 0 === l + /*<>*/ var l = a.length - 1; + /*<>*/ return 0 === l ? [0] - : /*<>*/ caml_array_sub(a, 0, l); - /*<>*/ } + : /*<>*/ caml_array_sub(a, 0, l); + /*<>*/ } function append(a1, a2){ - /*<>*/ var l1 = a1.length - 1; - /*<>*/ return 0 === l1 + /*<>*/ var l1 = a1.length - 1; + /*<>*/ return 0 === l1 ? copy(a2) : 0 === a2.length - 1 - ? /*<>*/ caml_array_sub(a1, 0, l1) - : /*<>*/ runtime.caml_array_append(a1, a2); - /*<>*/ } + ? /*<>*/ caml_array_sub(a1, 0, l1) + : /*<>*/ runtime.caml_array_append(a1, a2); + /*<>*/ } function sub(a, ofs, len){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_array_sub + /*<>*/ return /*<>*/ caml_array_sub (a, ofs, len); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_sub); - /*<>*/ } + /*<>*/ } function fill(a, ofs, len, v){ - /*<>*/ if + /*<>*/ if (0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) - /*<>*/ return /*<>*/ runtime.caml_array_fill + /*<>*/ return /*<>*/ runtime.caml_array_fill (a, ofs, len, v); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_fill); - /*<>*/ } + /*<>*/ } function blit(a1, ofs1, a2, ofs2, len){ - /*<>*/ if + /*<>*/ if (0 <= len && 0 <= ofs1 && (a1.length - 1 - len | 0) >= ofs1 && 0 <= ofs2 && (a2.length - 1 - len | 0) >= ofs2) - /*<>*/ return /*<>*/ runtime.caml_array_blit + /*<>*/ return /*<>*/ runtime.caml_array_blit (a1, ofs1, a2, ofs2, len); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_blit); - /*<>*/ } + /*<>*/ } function iter(f, a){ - /*<>*/ var - _aq_ = a.length - 2 | 0, - /*<>*/ _ap_ = 0; - if(_aq_ >= 0){ - var i = _ap_; + /*<>*/ var + _as_ = a.length - 2 | 0, + /*<>*/ _ar_ = 0; + if(_as_ >= 0){ + var i = _ar_; for(;;){ - /*<>*/ /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ar_ = i + 1 | 0; - if(_aq_ === i) break; - i = _ar_; + /*<>*/ /*<>*/ caml_call1 + (f, a[1 + i]); + /*<>*/ /*<>*/ var _at_ = i + 1 | 0; + if(_as_ === i) break; + i = _at_; } } 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_Array_iter2_arrays_must_ha); - /*<>*/ var - _an_ = a.length - 2 | 0, - /*<>*/ _am_ = 0; - if(_an_ >= 0){ - var i = _am_; + /*<>*/ var + _ap_ = a.length - 2 | 0, + /*<>*/ _ao_ = 0; + if(_ap_ >= 0){ + var i = _ao_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ao_ = i + 1 | 0; - if(_an_ === i) break; - i = _ao_; + /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; + if(_ap_ === i) break; + i = _aq_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _ak_ = l - 1 | 0, - /*<>*/ _aj_ = 1; - if(_ak_ >= 1){ - var i = _aj_; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _am_ = l - 1 | 0, + /*<>*/ _al_ = 1; + if(_am_ >= 1){ + var i = _al_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _al_ = i + 1 | 0; - if(_ak_ === i) break; - i = _al_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _an_ = i + 1 | 0; + if(_am_ === i) break; + i = _an_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_inplace(f, a){ - /*<>*/ var - _ah_ = a.length - 2 | 0, - /*<>*/ _ag_ = 0; - if(_ah_ >= 0){ - var i = _ag_; + /*<>*/ var + _aj_ = a.length - 2 | 0, + /*<>*/ _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ai_ = i + 1 | 0; - if(_ah_ === i) break; - i = _ai_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; + if(_aj_ === i) break; + i = _ak_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi_inplace(f, a){ - /*<>*/ var - _ae_ = a.length - 2 | 0, - /*<>*/ _ad_ = 0; - if(_ae_ >= 0){ - var i = _ad_; + /*<>*/ var + _ag_ = a.length - 2 | 0, + /*<>*/ _af_ = 0; + if(_ag_ >= 0){ + var i = _af_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _af_ = i + 1 | 0; - if(_ae_ === i) break; - i = _af_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; + if(_ag_ === i) break; + i = _ah_; } } 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_Array_map2_arrays_must_hav); - if(0 === la) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (la, /*<>*/ caml_call2(f, a[1], b[1])), - /*<>*/ _ab_ = la - 1 | 0, - /*<>*/ _aa_ = 1; - if(_ab_ >= 1){ - var i = _aa_; + if(0 === la) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (la, /*<>*/ caml_call2(f, a[1], b[1])), + /*<>*/ _ad_ = la - 1 | 0, + /*<>*/ _ac_ = 1; + if(_ad_ >= 1){ + var i = _ac_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ac_ = i + 1 | 0; - if(_ab_ === i) break; - i = _ac_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; + if(_ad_ === i) break; + i = _ae_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - ___ = a.length - 2 | 0, - /*<>*/ _Z_ = 0; - if(___ >= 0){ - var i = _Z_; + /*<>*/ var + _aa_ = a.length - 2 | 0, + /*<>*/ _$_ = 0; + if(_aa_ >= 0){ + var i = _$_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _$_ = i + 1 | 0; - if(___ === i) break; - i = _$_; + /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; + if(_aa_ === i) break; + i = _ab_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var l = a.length - 1; - /*<>*/ if(0 === l) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call2(f, 0, a[1])), - /*<>*/ _X_ = l - 1 | 0, - /*<>*/ _W_ = 1; - if(_X_ >= 1){ - var i = _W_; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call2(f, 0, a[1])), + /*<>*/ _Z_ = l - 1 | 0, + /*<>*/ _Y_ = 1; + if(_Z_ >= 1){ + var i = _Y_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _Y_ = i + 1 | 0; - if(_X_ === i) break; - i = _Y_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var ___ = i + 1 | 0; + if(_Z_ === i) break; + i = ___; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function to_list(a){ - /*<>*/ var i$1 = a.length - 2 | 0, i = i$1, res = 0; - /*<>*/ for(;;){ - if(0 > i) /*<>*/ return res; - /*<>*/ var - /*<>*/ res$0 = [0, a[1 + i], res], - /*<>*/ i$0 = i - 1 | 0; + /*<>*/ var i$1 = a.length - 2 | 0, i = i$1, res = 0; + /*<>*/ for(;;){ + if(0 > i) /*<>*/ return res; + /*<>*/ var + /*<>*/ res$0 = [0, a[1 + i], res], + /*<>*/ i$0 = i - 1 | 0; i = i$0; res = res$0; } - /*<>*/ } + /*<>*/ } function list_length(accu, param){ var accu$0 = accu, param$0 = param; for(;;){ - if(! param$0) /*<>*/ return accu$0; - /*<>*/ var + if(! param$0) /*<>*/ return accu$0; + /*<>*/ var t = param$0[2], - /*<>*/ accu$1 = accu$0 + 1 | 0; + /*<>*/ accu$1 = accu$0 + 1 | 0; accu$0 = accu$1; param$0 = t; } } function of_list(l){ - /*<>*/ if(! l) /*<>*/ return [0]; - /*<>*/ var + /*<>*/ if(! l) /*<>*/ return [0]; + /*<>*/ var tl = l[2], hd = l[1], - /*<>*/ a = - /*<>*/ caml_make_vect(list_length(0, l), hd), + /*<>*/ a = + /*<>*/ caml_make_vect(list_length(0, l), hd), 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; } - /*<>*/ } + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], - _U_ = a.length - 2 | 0, - /*<>*/ _T_ = 0; - if(_U_ >= 0){ - var i = _T_; + /*<>*/ var + /*<>*/ r = [0, x], + _W_ = a.length - 2 | 0, + /*<>*/ _V_ = 0; + if(_W_ >= 0){ + var i = _V_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _V_ = i + 1 | 0; - if(_U_ === i) break; - i = _V_; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _X_ = i + 1 | 0; + if(_W_ === i) break; + i = _X_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_left_map(f, acc, input_array){ - /*<>*/ var len = input_array.length - 1; - /*<>*/ if(0 === len) - /*<>*/ return [0, acc, [0]]; - /*<>*/ var - /*<>*/ match = - /*<>*/ caml_call2(f, acc, input_array[1]), + /*<>*/ var len = input_array.length - 1; + /*<>*/ if(0 === len) + /*<>*/ return [0, acc, [0]]; + /*<>*/ var + /*<>*/ match = + /*<>*/ caml_call2(f, acc, input_array[1]), elt = match[2], acc$0 = match[1], - /*<>*/ output_array = - /*<>*/ caml_make_vect(len, elt), - /*<>*/ acc$1 = [0, acc$0], - /*<>*/ _R_ = len - 1 | 0, - /*<>*/ _Q_ = 1; - if(_R_ >= 1){ - var i = _Q_; + /*<>*/ output_array = + /*<>*/ caml_make_vect(len, elt), + /*<>*/ acc$1 = [0, acc$0], + /*<>*/ _T_ = len - 1 | 0, + /*<>*/ _S_ = 1; + if(_T_ >= 1){ + var i = _S_; for(;;){ - /*<>*/ var - /*<>*/ match$0 = - /*<>*/ caml_call2(f, acc$1[1], input_array[1 + i]), + /*<>*/ var + /*<>*/ match$0 = + /*<>*/ caml_call2(f, acc$1[1], input_array[1 + i]), elt$0 = match$0[2], acc$2 = match$0[1]; acc$1[1] = acc$2; - /*<>*/ output_array[1 + i] = elt$0; - /*<>*/ /*<>*/ var _S_ = i + 1 | 0; - if(_R_ === i) break; - i = _S_; + /*<>*/ output_array[1 + i] = elt$0; + /*<>*/ /*<>*/ var _U_ = i + 1 | 0; + if(_T_ === i) break; + i = _U_; } } - /*<>*/ return [0, acc$1[1], output_array]; - /*<>*/ } + /*<>*/ return [0, acc$1[1], output_array]; + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _O_ = a.length - 2 | 0; - if(_O_ >= 0){ - var i = _O_; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _Q_ = a.length - 2 | 0; + if(_Q_ >= 0){ + var i = _Q_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _P_ = i - 1 | 0; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _R_ = i - 1 | 0; if(0 === i) break; - i = _P_; + i = _R_; } } 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 for_all2(p, l1, l2){ - /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; + /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; if(n1 !== n2) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_for_all2); var i = 0; - /*<>*/ for(;;){ - if(i === n1) /*<>*/ return 1; - /*<>*/ if - (! /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) - /*<>*/ return 0; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ for(;;){ + if(i === n1) /*<>*/ return 1; + /*<>*/ if + (! /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) + /*<>*/ return 0; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function exists2(p, l1, l2){ - /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; + /*<>*/ var n1 = l1.length - 1, n2 = l2.length - 1; if(n1 !== n2) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_exists2); var i = 0; - /*<>*/ for(;;){ - if(i === n1) /*<>*/ return 0; - /*<>*/ if - ( /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) - /*<>*/ return 1; - /*<>*/ /*<>*/ var i$0 = i + 1 | 0; + /*<>*/ for(;;){ + if(i === n1) /*<>*/ return 0; + /*<>*/ if + ( /*<>*/ caml_call2(p, l1[1 + i], l2[1 + i])) + /*<>*/ return 1; + /*<>*/ /*<>*/ 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 === /*<>*/ runtime.caml_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 === /*<>*/ runtime.caml_compare(a[1 + i], x)) + /*<>*/ return 1; + /*<>*/ /*<>*/ var i$0 = i + 1 | 0; i = i$0; } - /*<>*/ } + /*<>*/ } function memq(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; } - /*<>*/ } + /*<>*/ } function split(x){ - /*<>*/ if - ( /*<>*/ runtime.caml_equal(x, [0])) - /*<>*/ return [0, [0], [0]]; - /*<>*/ var + /*<>*/ if + ( /*<>*/ runtime.caml_equal(x, [0])) + /*<>*/ return [0, [0], [0]]; + /*<>*/ var match = x[1], b0 = match[2], a0 = match[1], - /*<>*/ n = x.length - 1, - /*<>*/ a = - /*<>*/ caml_make_vect(n, a0), - /*<>*/ b = - /*<>*/ caml_make_vect(n, b0), - /*<>*/ _M_ = n - 1 | 0, - /*<>*/ _L_ = 1; - if(_M_ >= 1){ - var i = _L_; + /*<>*/ n = x.length - 1, + /*<>*/ a = + /*<>*/ caml_make_vect(n, a0), + /*<>*/ b = + /*<>*/ caml_make_vect(n, b0), + /*<>*/ _O_ = n - 1 | 0, + /*<>*/ _N_ = 1; + if(_O_ >= 1){ + var i = _N_; for(;;){ var match$0 = x[1 + i], bi = match$0[2], ai = match$0[1]; - /*<>*/ a[1 + i] = ai; - /*<>*/ b[1 + i] = bi; - /*<>*/ /*<>*/ var _N_ = i + 1 | 0; - if(_M_ === i) break; - i = _N_; + /*<>*/ a[1 + i] = ai; + /*<>*/ b[1 + i] = bi; + /*<>*/ /*<>*/ var _P_ = i + 1 | 0; + if(_O_ === i) break; + i = _P_; } } - /*<>*/ return [0, a, b]; - /*<>*/ } + /*<>*/ return [0, a, b]; + /*<>*/ } function combine(a, b){ - /*<>*/ var + /*<>*/ var na = a.length - 1, - /*<>*/ nb = b.length - 1; + /*<>*/ nb = b.length - 1; if(na !== nb) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Array_combine); - if(0 === na) /*<>*/ return [0]; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_make_vect(na, [0, a[1], b[1]]), - /*<>*/ _J_ = na - 1 | 0, - /*<>*/ _I_ = 1; - if(_J_ >= 1){ - var i = _I_; + 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_; for(;;){ x[1 + i] = [0, a[1 + i], b[1 + i]]; - /*<>*/ /*<>*/ var _K_ = i + 1 | 0; - if(_J_ === i) break; - i = _K_; + /*<>*/ /*<>*/ var _M_ = i + 1 | 0; + if(_L_ === i) break; + i = _M_; } } - /*<>*/ return x; - /*<>*/ } - /*<>*/ var - /*<>*/ Bottom = + /*<>*/ return x; + /*<>*/ } + /*<>*/ var + /*<>*/ Bottom = [248, "Stdlib.Array.Bottom", runtime.caml_fresh_oo_id(0)], - _a_ = [0, "array.ml", 348, 4]; + _a_ = [0, "array.ml", 369, 4]; 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 - /*<>*/ _B_ = i31 + 1 | 0, - /*<>*/ _C_ = caml_check_bound(a, _B_)[1 + _B_]; + /*<>*/ var + /*<>*/ _D_ = i31 + 1 | 0, + /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _C_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _E_) < 0) x[1] = i31 + 1 | 0; - /*<>*/ var - /*<>*/ _D_ = i31 + 2 | 0, - /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_], - _F_ = x[1]; + /*<>*/ var + /*<>*/ _F_ = i31 + 2 | 0, + /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_], + _H_ = x[1]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, _F_)[1 + _F_], _E_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, _H_)[1 + _H_], _G_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ - /*<>*/ var - _G_ = i31 + 1 | 0, - /*<>*/ _H_ = caml_check_bound(a, _G_)[1 + _G_]; - /*<>*/ if + /*<>*/ var + _I_ = i31 + 1 | 0, + /*<>*/ _J_ = caml_check_bound(a, _I_)[1 + _I_]; + /*<>*/ if (0 > - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _H_)) - /*<>*/ return i31 + 1 | 0; + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _J_)) + /*<>*/ 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, _v_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_v_ >= 0){ - var i$6 = _v_; + /*<>*/ } + var l = a.length - 1, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_x_ >= 0){ + var i$6 = _x_; 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 - _s_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _s_; + /*<>*/ /*<>*/ var + _u_ = caml_check_bound(a, j)[1 + j]; + /*<>*/ caml_check_bound(a, i)[1 + i] = _u_; 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 _A_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _C_ = i$6 - 1 | 0; if(0 === i$6) break; - i$6 = _A_; + i$6 = _C_; } } - /*<>*/ /*<>*/ var _w_ = l - 1 | 0; - if(_w_ >= 2){ - var i$4 = _w_; + /*<>*/ /*<>*/ var _y_ = l - 1 | 0; + if(_y_ >= 2){ + var i$4 = _y_; 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), - /*<>*/ _t_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _t_; + /*<>*/ 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_; i$1 = j$0; } } @@ -7790,206 +7914,225 @@ 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, _a_], 1); - /*<>*/ if + /*<>*/ if (0 <= - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, caml_check_bound(a, father)[1 + father], e$0)) break; - /*<>*/ /*<>*/ var - _u_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _u_; + /*<>*/ /*<>*/ var + _w_ = caml_check_bound(a, father)[1 + father]; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _w_; 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 _z_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _B_ = i$4 - 1 | 0; if(2 === i$4) break; - i$4 = _z_; + i$4 = _B_; } } } - var _x_ = 1 < l ? 1 : 0; - if(_x_){ - /*<>*/ /*<>*/ var + var _z_ = 1 < l ? 1 : 0; + if(_z_){ + /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; - /*<>*/ a[2] = caml_check_bound(a, 0)[1]; - /*<>*/ a[1] = e; - var _y_ = 0; + /*<>*/ a[2] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1] = e; + var _A_ = 0; } else - var _y_ = _x_; - /*<>*/ return _y_; - /*<>*/ } + var _A_ = _z_; + /*<>*/ return _A_; + /*<>*/ } 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 i2$0 = i2 + 1 | 0; + /*<>*/ 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 i1$0 = i1 + 1 | 0; + /*<>*/ 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 - _k_ = len - 1 | 0, - /*<>*/ _j_ = 0; - if(_k_ >= 0){ - var i = _j_; + /*<>*/ var + _m_ = len - 1 | 0, + /*<>*/ _l_ = 0; + if(_m_ >= 0){ + var i = _l_; for(;;){ - /*<>*/ var - _l_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _l_)[1 + _l_], - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ var + _n_ = srcofs + i | 0, + /*<>*/ e = caml_check_bound(a, _n_)[1 + _n_], + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ if(dstofs > j[1]) break; - var _m_ = j[1]; - /*<>*/ if + var _o_ = j[1]; + /*<>*/ if (0 >= - /*<>*/ caml_call2 - (cmp, caml_check_bound(dst, _m_)[1 + _m_], e)) + /*<>*/ caml_call2 + (cmp, caml_check_bound(dst, _o_)[1 + _o_], e)) break; - /*<>*/ var - _n_ = j[1], - /*<>*/ _o_ = caml_check_bound(dst, _n_)[1 + _n_], - _p_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _p_)[1 + _p_] = _o_; + /*<>*/ 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_; j[1]--; } - var _q_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _q_)[1 + _q_] = e; - /*<>*/ /*<>*/ var _r_ = i + 1 | 0; - if(_k_ === i) break; - i = _r_; + 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_; } } 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_make_vect(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); - /*<>*/ } + /*<>*/ t = + /*<>*/ caml_make_vect(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_; + 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; + if(1 === i) break; + i = _k_; + } + } + 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, + /*<>*/ 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_){ + /*<>*/ } + /*<>*/ 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; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _d_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_e_){ /*<>*/ return aux(_d_, _e_);}]; - /*<>*/ } - /*<>*/ var _b_ = 0; - /*<>*/ return function(_c_){ + /*<>*/ } + /*<>*/ var _b_ = 0; + /*<>*/ return function(_c_){ /*<>*/ return aux(_b_, _c_);}; - /*<>*/ } + /*<>*/ } 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_make_vect(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, init, make_matrix, + init_matrix, append, runtime.caml_array_concat, sub, @@ -8024,11 +8167,12 @@ sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, Floatarray]; - runtime.caml_register_global(14, Stdlib_Array, "Stdlib__Array"); + runtime.caml_register_global(16, Stdlib_Array, "Stdlib__Array"); return; /*<>*/ } (globalThis)); @@ -8048,6 +8192,7 @@ caml_floatarray_blit = runtime.caml_floatarray_blit, caml_floatarray_create = runtime.caml_floatarray_create, 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, @@ -8095,8 +8240,10 @@ 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, 228, 14], + _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, @@ -8107,8 +8254,8 @@ "Float.Array.map2: arrays must have the same length"; function is_integer(x){ /*<>*/ var - _am_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; - return _am_ ? is_finite(x) : _am_; + _ax_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; + return _ax_ ? is_finite(x) : _ax_; /*<>*/ } function succ(x){ /*<>*/ return /*<>*/ caml_nextafter_float @@ -8209,32 +8356,32 @@ (10, 100, 0, x); /*<>*/ } function unsafe_fill(a, ofs, len, v){ - /*<>*/ var _ak_ = (ofs + len | 0) - 1 | 0; - if(_ak_ >= ofs){ + /*<>*/ var _av_ = (ofs + len | 0) - 1 | 0; + if(_av_ >= ofs){ var i = ofs; for(;;){ /*<>*/ a[1 + i] = v; - /*<>*/ /*<>*/ var _al_ = i + 1 | 0; - if(_ak_ === i) break; - i = _al_; + /*<>*/ /*<>*/ var _aw_ = i + 1 | 0; + if(_av_ === i) break; + i = _aw_; } } return 0; /*<>*/ } function check(a, ofs, len, msg){ - /*<>*/ var _ag_ = ofs < 0 ? 1 : 0; - if(_ag_) - var _ah_ = _ag_; + /*<>*/ var _ar_ = ofs < 0 ? 1 : 0; + if(_ar_) + var _as_ = _ar_; else{ - var _ai_ = len < 0 ? 1 : 0; - if(_ai_) - var _ah_ = _ai_; + var _at_ = len < 0 ? 1 : 0; + if(_at_) + var _as_ = _at_; else var - _aj_ = (ofs + len | 0) < 0 ? 1 : 0, - _ah_ = _aj_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); + _au_ = (ofs + len | 0) < 0 ? 1 : 0, + _as_ = _au_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); } - return _ah_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _ah_; + return _as_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _as_; /*<>*/ } function make(n, v){ /*<>*/ /*<>*/ var @@ -8249,34 +8396,98 @@ /*<>*/ var /*<>*/ res = /*<>*/ caml_floatarray_create(l), - /*<>*/ _ae_ = l - 1 | 0, - /*<>*/ _ad_ = 0; - if(_ae_ >= 0){ - var i = _ad_; + /*<>*/ _ap_ = l - 1 | 0, + /*<>*/ _ao_ = 0; + if(_ap_ >= 0){ + var i = _ao_; for(;;){ /*<>*/ res[1 + i] = /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _af_ = i + 1 | 0; - if(_ae_ === i) break; - i = _af_; + /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; + if(_ap_ === i) break; + i = _aq_; } } /*<>*/ return res; /*<>*/ } + function make_matrix(sx, sy, v){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Float_Array_make_matrix); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_make_vect + (sx, /*<>*/ caml_floatarray_create(0)); + if(0 < sy){ + /*<>*/ var + _am_ = sx - 1 | 0, + /*<>*/ _al_ = 0; + if(_am_ >= 0){ + var x = _al_; + for(;;){ + /*<>*/ res[1 + x] = make(sy, v); + /*<>*/ /*<>*/ var _an_ = x + 1 | 0; + if(_am_ === x) break; + x = _an_; + } + } + } + /*<>*/ return res; + /*<>*/ } + function init_matrix(sx, sy, f){ + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Float_Array_init_matrix); + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_make_vect + (sx, /*<>*/ caml_floatarray_create(0)); + if(0 < sy){ + /*<>*/ var + _ag_ = sx - 1 | 0, + /*<>*/ _af_ = 0; + if(_ag_ >= 0){ + var x = _af_; + for(;;){ + /*<>*/ 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 + _ak_ = y + 1 | 0; + if(_ai_ === y) break; + y = _ak_; + } + } + /*<>*/ res[1 + x] = row; + /*<>*/ /*<>*/ var _aj_ = x + 1 | 0; + if(_ag_ === x) break; + x = _aj_; + } + } + } + /*<>*/ return res; + /*<>*/ } function append(a1, a2){ - /*<>*/ var + /*<>*/ var l1 = a1.length - 1, - /*<>*/ l2 = a2.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l1 + l2 | 0); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ l2 = a2.length - 1, + /*<>*/ result = + /*<>*/ caml_floatarray_create(l1 + l2 | 0); + /*<>*/ /*<>*/ caml_floatarray_blit (a1, 0, result, 0, l1); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ /*<>*/ caml_floatarray_blit (a2, 0, result, l1, l2); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } function concat(l){ - /*<>*/ var acc = 0, param = l; + /*<>*/ var acc = 0, param = l; for(;;){ if(! param) break; var @@ -8286,435 +8497,435 @@ 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 + /*<>*/ check(a, ofs, len, cst_Float_Array_sub); + /*<>*/ /*<>*/ var + result = /*<>*/ caml_floatarray_create(len); + /*<>*/ /*<>*/ caml_floatarray_blit (a, ofs, result, 0, len); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } function copy(a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ result = - /*<>*/ caml_floatarray_create(l); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ result = + /*<>*/ caml_floatarray_create(l); + /*<>*/ /*<>*/ caml_floatarray_blit (a, 0, result, 0, l); - /*<>*/ return result; - /*<>*/ } + /*<>*/ return result; + /*<>*/ } 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 unsafe_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(_ac_){ /*<>*/ return a[1 + _ac_];}); - /*<>*/ } + 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 - _aa_ = a.length - 2 | 0, - /*<>*/ _$_ = 0; - if(_aa_ >= 0){ - var i = _$_; + /*<>*/ var + _ac_ = a.length - 2 | 0, + /*<>*/ _ab_ = 0; + if(_ac_ >= 0){ + var i = _ab_; for(;;){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (f, a[1 + i]); - /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; - if(_aa_ === i) break; - i = _ab_; + /*<>*/ /*<>*/ 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 - _Z_ = a.length - 2 | 0, - /*<>*/ _Y_ = 0; - if(_Z_ >= 0){ - var i = _Y_; + /*<>*/ var + _$_ = a.length - 2 | 0, + /*<>*/ ___ = 0; + if(_$_ >= 0){ + var i = ___; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var ___ = i + 1 | 0; - if(_Z_ === i) break; - i = ___; + /*<>*/ /*<>*/ var _aa_ = i + 1 | 0; + if(_$_ === i) break; + i = _aa_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _W_ = l - 1 | 0, - /*<>*/ _V_ = 0; - if(_W_ >= 0){ - var i = _V_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _Y_ = l - 1 | 0, + /*<>*/ _X_ = 0; + if(_Y_ >= 0){ + var i = _X_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _X_ = i + 1 | 0; - if(_W_ === i) break; - i = _X_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _Z_ = i + 1 | 0; + if(_Y_ === i) break; + i = _Z_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_inplace(f, a){ - /*<>*/ var - _T_ = a.length - 2 | 0, - /*<>*/ _S_ = 0; - if(_T_ >= 0){ - var i = _S_; + /*<>*/ var + _V_ = a.length - 2 | 0, + /*<>*/ _U_ = 0; + if(_V_ >= 0){ + var i = _U_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _U_ = i + 1 | 0; - if(_T_ === i) break; - i = _U_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _W_ = i + 1 | 0; + if(_V_ === i) break; + i = _W_; } } 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), - /*<>*/ _Q_ = la - 1 | 0, - /*<>*/ _P_ = 0; - if(_Q_ >= 0){ - var i = _P_; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_floatarray_create(la), + /*<>*/ _S_ = la - 1 | 0, + /*<>*/ _R_ = 0; + if(_S_ >= 0){ + var i = _R_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _R_ = i + 1 | 0; - if(_Q_ === i) break; - i = _R_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _T_ = i + 1 | 0; + if(_S_ === i) break; + i = _T_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - _N_ = a.length - 2 | 0, - /*<>*/ _M_ = 0; - if(_N_ >= 0){ - var i = _M_; + /*<>*/ var + _P_ = a.length - 2 | 0, + /*<>*/ _O_ = 0; + if(_P_ >= 0){ + var i = _O_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _O_ = i + 1 | 0; - if(_N_ === i) break; - i = _O_; + /*<>*/ /*<>*/ var _Q_ = i + 1 | 0; + if(_P_ === i) break; + i = _Q_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _K_ = l - 1 | 0, - /*<>*/ _J_ = 0; - if(_K_ >= 0){ - var i = _J_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _M_ = l - 1 | 0, + /*<>*/ _L_ = 0; + if(_M_ >= 0){ + var i = _L_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _L_ = i + 1 | 0; - if(_K_ === i) break; - i = _L_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _N_ = i + 1 | 0; + if(_M_ === i) break; + i = _N_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function mapi_inplace(f, a){ - /*<>*/ var - _H_ = a.length - 2 | 0, - /*<>*/ _G_ = 0; - if(_H_ >= 0){ - var i = _G_; + /*<>*/ var + _J_ = a.length - 2 | 0, + /*<>*/ _I_ = 0; + if(_J_ >= 0){ + var i = _I_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _I_ = i + 1 | 0; - if(_H_ === i) break; - i = _I_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _K_ = i + 1 | 0; + if(_J_ === i) break; + i = _K_; } } return 0; - /*<>*/ } + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], - _E_ = a.length - 2 | 0, - /*<>*/ _D_ = 0; - if(_E_ >= 0){ - var i = _D_; + /*<>*/ var + /*<>*/ r = [0, x], + _G_ = a.length - 2 | 0, + /*<>*/ _F_ = 0; + if(_G_ >= 0){ + var i = _F_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _F_ = i + 1 | 0; - if(_E_ === i) break; - i = _F_; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _H_ = i + 1 | 0; + if(_G_ === i) break; + i = _H_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _B_ = a.length - 2 | 0; - if(_B_ >= 0){ - var i = _B_; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _D_ = a.length - 2 | 0; + if(_D_ >= 0){ + var i = _D_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _C_ = i - 1 | 0; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _E_ = i - 1 | 0; if(0 === i) break; - i = _C_; + i = _E_; } } 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, 458, 6]; + _b_ = [0, cst_float_ml, 484, 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){ if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, - /*<>*/ caml_array_get(a, i31), - /*<>*/ caml_array_get(a, i31 + 1 | 0)) + /*<>*/ caml_array_get(a, i31), + /*<>*/ caml_array_get(a, i31 + 1 | 0)) < 0) x[1] = i31 + 1 | 0; if - ( /*<>*/ caml_call2 + ( /*<>*/ caml_call2 (cmp, - /*<>*/ caml_array_get(a, x[1]), - /*<>*/ caml_array_get(a, i31 + 2 | 0)) + /*<>*/ caml_array_get(a, x[1]), + /*<>*/ caml_array_get(a, i31 + 2 | 0)) < 0) x[1] = i31 + 2 | 0; return x[1]; } - /*<>*/ if + /*<>*/ if ((i31 + 1 | 0) < l && 0 > - /*<>*/ caml_call2 + /*<>*/ caml_call2 (cmp, - /*<>*/ caml_array_get(a, i31), - /*<>*/ caml_array_get(a, i31 + 1 | 0))) - /*<>*/ return i31 + 1 | 0; - if(i31 < l) /*<>*/ return i31; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ caml_array_get(a, i31), + /*<>*/ caml_array_get(a, i31 + 1 | 0))) + /*<>*/ return i31 + 1 | 0; + if(i31 < l) /*<>*/ return i31; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Bottom, i], 1); - /*<>*/ } - var l = a.length - 1, _v_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_v_ >= 0){ - var i$6 = _v_; + /*<>*/ } + var l = a.length - 1, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_x_ >= 0){ + var i$6 = _x_; for(;;){ - /*<>*/ /*<>*/ var - e$1 = /*<>*/ caml_array_get(a, i$6); - /*<>*/ try{ + /*<>*/ /*<>*/ var + e$1 = /*<>*/ caml_array_get(a, i$6); + /*<>*/ try{ var i = i$6; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var j = maxson(l, i); - /*<>*/ if + /*<>*/ if (0 >= - /*<>*/ caml_call2 - (cmp, /*<>*/ caml_array_get(a, j), e$1)) + /*<>*/ caml_call2 + (cmp, /*<>*/ caml_array_get(a, j), e$1)) break; - /*<>*/ /*<>*/ caml_array_set - (a, i, /*<>*/ caml_array_get(a, j)); + /*<>*/ /*<>*/ caml_array_set + (a, i, /*<>*/ caml_array_get(a, j)); i = j; } - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (a, 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_array_set + /*<>*/ /*<>*/ caml_array_set (a, i$0, e$1); } - /*<>*/ /*<>*/ var _A_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _C_ = i$6 - 1 | 0; if(0 === i$6) break; - i$6 = _A_; + i$6 = _C_; } } - /*<>*/ /*<>*/ var _w_ = l - 1 | 0; - if(_w_ >= 2){ - var i$4 = _w_; + /*<>*/ /*<>*/ var _y_ = l - 1 | 0; + if(_y_ >= 2){ + var i$4 = _y_; for(;;){ - /*<>*/ /*<>*/ var - e$0 = /*<>*/ caml_array_get(a, i$4); - /*<>*/ /*<>*/ caml_array_set - (a, i$4, /*<>*/ caml_array_get(a, 0)); + /*<>*/ /*<>*/ var + e$0 = /*<>*/ caml_array_get(a, i$4); + /*<>*/ /*<>*/ caml_array_set + (a, i$4, /*<>*/ caml_array_get(a, 0)); var i$5 = 0; - /*<>*/ try{ + /*<>*/ try{ var i$1 = i$5; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var j$0 = maxson(i$4, i$1); - /*<>*/ /*<>*/ caml_array_set - (a, i$1, /*<>*/ caml_array_get(a, j$0)); + /*<>*/ /*<>*/ caml_array_set + (a, i$1, /*<>*/ caml_array_get(a, j$0)); i$1 = j$0; } } @@ -8727,243 +8938,262 @@ 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 - (cmp, /*<>*/ caml_array_get(a, father), e$0)) + /*<>*/ caml_call2 + (cmp, /*<>*/ caml_array_get(a, father), e$0)) break; - /*<>*/ /*<>*/ caml_array_set - (a, i$3, /*<>*/ caml_array_get(a, father)); + /*<>*/ /*<>*/ caml_array_set + (a, i$3, /*<>*/ caml_array_get(a, father)); if(0 >= father) break b; i$3 = father; } - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (a, i$3, e$0); break a; } - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (a, 0, e$0); } - /*<>*/ /*<>*/ var _z_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _B_ = i$4 - 1 | 0; if(2 === i$4) break; - i$4 = _z_; + i$4 = _B_; } } } - var _x_ = 1 < l ? 1 : 0; - if(_x_){ - /*<>*/ /*<>*/ var - e = /*<>*/ caml_array_get(a, 1); - /*<>*/ /*<>*/ caml_array_set - (a, 1, /*<>*/ caml_array_get(a, 0)); - var _y_ = /*<>*/ caml_array_set(a, 0, e); + var _z_ = 1 < l ? 1 : 0; + if(_z_){ + /*<>*/ /*<>*/ var + e = /*<>*/ caml_array_get(a, 1); + /*<>*/ /*<>*/ caml_array_set + (a, 1, /*<>*/ caml_array_get(a, 0)); + var _A_ = /*<>*/ caml_array_set(a, 0, e); } else - var _y_ = _x_; - /*<>*/ return _y_; - /*<>*/ } + var _A_ = _z_; + /*<>*/ return _A_; + /*<>*/ } 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 = - /*<>*/ caml_array_get(src2, src2ofs), - /*<>*/ s1$1 = - /*<>*/ caml_array_get(a, src1ofs), + /*<>*/ s2$1 = + /*<>*/ caml_array_get(src2, src2ofs), + /*<>*/ s1$1 = + /*<>*/ caml_array_get(a, src1ofs), i1 = src1ofs, s1 = s1$1, i2 = src2ofs, s2 = s2$1, d = dstofs; - /*<>*/ for(;;) - /*<>*/ if - (0 < /*<>*/ caml_call2(cmp, s1, s2)){ - /*<>*/ /*<>*/ caml_array_set + /*<>*/ for(;;) + /*<>*/ if + (0 < /*<>*/ caml_call2(cmp, s1, s2)){ + /*<>*/ /*<>*/ caml_array_set (dst, d, s2); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ 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_array_get(src2, i2$0); + /*<>*/ var + /*<>*/ d$0 = d + 1 | 0, + /*<>*/ s2$0 = + /*<>*/ caml_array_get(src2, i2$0); i2 = i2$0; s2 = s2$0; d = d$0; } else{ - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (dst, d, s1); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ 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_array_get(a, i1$0); + /*<>*/ var + /*<>*/ d$1 = d + 1 | 0, + /*<>*/ s1$0 = + /*<>*/ caml_array_get(a, i1$0); i1 = i1$0; s1 = s1$0; d = d$1; } - /*<>*/ } + /*<>*/ } function isortto(srcofs, dst, dstofs, len){ - /*<>*/ var - _t_ = len - 1 | 0, - /*<>*/ _s_ = 0; - if(_t_ >= 0){ - var i = _s_; + /*<>*/ var + _v_ = len - 1 | 0, + /*<>*/ _u_ = 0; + if(_v_ >= 0){ + var i = _u_; for(;;){ - /*<>*/ var - /*<>*/ e = - /*<>*/ caml_array_get(a, srcofs + i | 0), - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ var + /*<>*/ e = + /*<>*/ caml_array_get(a, srcofs + i | 0), + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ if(dstofs > j[1]) break; - /*<>*/ if + /*<>*/ if (0 >= - /*<>*/ caml_call2 - (cmp, /*<>*/ caml_array_get(dst, j[1]), e)) + /*<>*/ caml_call2 + (cmp, /*<>*/ caml_array_get(dst, j[1]), e)) break; - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (dst, j[1] + 1 | 0, - /*<>*/ caml_array_get(dst, j[1])); + /*<>*/ caml_array_get(dst, j[1])); j[1]--; } - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (dst, j[1] + 1 | 0, e); - /*<>*/ /*<>*/ var _u_ = i + 1 | 0; - if(_t_ === i) break; - i = _u_; + /*<>*/ /*<>*/ var _w_ = i + 1 | 0; + if(_v_ === i) break; + i = _w_; } } 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 _s_ = a.length - 2 | 0; + if(_s_ >= 1){ + var i = _s_; + for(;;){ + /*<>*/ var + /*<>*/ j = + /*<>*/ caml_call1(rand, i + 1 | 0), + /*<>*/ v = a[1 + i]; + /*<>*/ a[1 + i] = + /*<>*/ caml_array_get(a, j); + /*<>*/ a[1 + j] = v; + var _t_ = i - 1 | 0; + if(1 === i) break; + i = _t_; + } + } + return 0; + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _q_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _q_ = i + 1 | 0; + /*<>*/ return [0, x, function(_r_){ /*<>*/ return aux(_q_, _r_);}]; - /*<>*/ } - /*<>*/ var _o_ = 0; - /*<>*/ return function(_p_){ + /*<>*/ } + /*<>*/ var _o_ = 0; + /*<>*/ return function(_p_){ /*<>*/ return aux(_o_, _p_);}; - /*<>*/ } + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _m_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _m_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_n_){ /*<>*/ return aux(_m_, _n_);}]; - /*<>*/ } - /*<>*/ var _k_ = 0; - /*<>*/ return function(_l_){ + /*<>*/ } + /*<>*/ var _k_ = 0; + /*<>*/ return function(_l_){ /*<>*/ return aux(_k_, _l_);}; - /*<>*/ } + /*<>*/ } 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 = - /*<>*/ runtime.caml_make_vect - (l, /*<>*/ caml_call1(f, a[1])), - /*<>*/ _i_ = l - 1 | 0, - /*<>*/ _h_ = 1; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _i_ = l - 1 | 0, + /*<>*/ _h_ = 1; if(_i_ >= 1){ var i = _h_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _j_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _j_ = i + 1 | 0; if(_i_ === i) break; i = _j_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_from_array(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _f_ = l - 1 | 0, - /*<>*/ _e_ = 0; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _f_ = l - 1 | 0, + /*<>*/ _e_ = 0; if(_f_ >= 0){ var i = _e_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _g_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _g_ = i + 1 | 0; if(_f_ === i) break; i = _g_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } var Stdlib_Float = [0, @@ -9004,6 +9234,8 @@ make, caml_floatarray_create, init, + make_matrix, + init_matrix, append, concat, sub, @@ -9033,6 +9265,7 @@ sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, @@ -9045,6 +9278,8 @@ make, caml_floatarray_create, init, + make_matrix, + init_matrix, append, concat, sub, @@ -9074,12 +9309,13 @@ sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, map_to_array, map_from_array]]; - runtime.caml_register_global(23, Stdlib_Float, "Stdlib__Float"); + runtime.caml_register_global(25, Stdlib_Float, "Stdlib__Float"); return; /*<>*/ } (globalThis)); @@ -9094,6 +9330,8 @@ caml_greaterequal = runtime.caml_greaterequal, caml_hash = runtime.caml_hash, caml_int_compare = runtime.caml_int_compare, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_mul = runtime.caml_mul, caml_wrap_exception = runtime.caml_wrap_exception, @@ -9130,8 +9368,8 @@ unsigned_to_int = function(n){ /*<>*/ if - (0 >= /*<>*/ caml_int_compare(0, n) - && 0 >= /*<>*/ caml_int_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, 0) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, n]; /*<>*/ return 0; /*<>*/ }; @@ -9150,67 +9388,64 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _d_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; - /*<>*/ return _d_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _d_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; + /*<>*/ return _d_; } catch(_e_){ var _c_ = caml_wrap_exception(_e_); - if(_c_[1] === Stdlib[7]) /*<>*/ return 0; + if(_c_[1] === Stdlib[7]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_c_, 0); } - /*<>*/ } - var compare = caml_int_compare; - function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int_compare(x, y) - ? 1 - : 0; - /*<>*/ } + /*<>*/ } + var compare = caml_int_compare, equal = runtime.caml_equal; function unsigned_compare(n, m){ - /*<>*/ var - /*<>*/ y = m + 2147483648 | 0, - /*<>*/ x = n + 2147483648 | 0; - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ var + /*<>*/ y = m + 2147483648 | 0, + /*<>*/ x = n + 2147483648 | 0; + /*<>*/ return /*<>*/ caml_int_compare (x, y); - /*<>*/ } + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan + (n + 2147483648 | 0, m + 2147483648 | 0); + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function max(x, y){ - /*<>*/ return /*<>*/ caml_greaterequal + /*<>*/ return /*<>*/ caml_greaterequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, 0)) - /*<>*/ return 0 <= unsigned_compare(n, d) ? one : zero; - /*<>*/ var - /*<>*/ q = - /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, - /*<>*/ r = - n - /*<>*/ caml_mul(q, d) | 0; - /*<>*/ return 0 <= unsigned_compare(r, d) ? q + 1 | 0 : q; - /*<>*/ } + /*<>*/ if( /*<>*/ caml_lessthan(d, 0)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; + /*<>*/ var + /*<>*/ q = + /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, + /*<>*/ r = + n - /*<>*/ caml_mul(q, d) | 0; + /*<>*/ return unsigned_lt(r, d) ? q : q + 1 | 0; + /*<>*/ } function unsigned_rem(n, d){ - /*<>*/ return n - - /*<>*/ caml_mul(unsigned_div(n, d), d) + /*<>*/ return n + - /*<>*/ caml_mul(unsigned_div(n, d), d) | 0; - /*<>*/ } + /*<>*/ } function seeded_hash(seed, x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, seed, x); - /*<>*/ } + /*<>*/ } function hash(x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, 0, x); - /*<>*/ } + /*<>*/ } var Stdlib_Int32 = [0, @@ -9235,7 +9470,7 @@ max, seeded_hash, hash]; - runtime.caml_register_global(14, Stdlib_Int32, "Stdlib__Int32"); + runtime.caml_register_global(15, Stdlib_Int32, "Stdlib__Int32"); return; /*<>*/ } (globalThis)); @@ -9253,6 +9488,8 @@ caml_int64_compare = runtime.caml_int64_compare, caml_int64_mul = runtime.caml_int64_mul, caml_int64_sub = runtime.caml_int64_sub, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_wrap_exception = runtime.caml_wrap_exception, global_data = runtime.caml_get_global_data(), @@ -9284,13 +9521,14 @@ /*<>*/ return /*<>*/ runtime.caml_int64_xor (n, _d_); /*<>*/ } - /*<>*/ /*<>*/ var - max_int$0 = - /*<>*/ runtime.caml_int64_of_int32(Stdlib[19]); - function unsigned_to_int(n){ + /*<>*/ var + /*<>*/ max_int$0 = + /*<>*/ runtime.caml_int64_of_int32(Stdlib[19]), + _e_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0); + /*<>*/ function unsigned_to_int(n){ /*<>*/ if - (0 >= /*<>*/ caml_int64_compare(zero, n) - && 0 >= /*<>*/ caml_int64_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, _e_) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, runtime.caml_int64_to_int32(n)]; /*<>*/ return 0; /*<>*/ } @@ -9299,38 +9537,38 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _f_ = [0, /*<>*/ runtime.caml_int64_of_string(s)]; - /*<>*/ return _f_; - } - catch(_g_){ - var _e_ = caml_wrap_exception(_g_); - if(_e_[1] === Stdlib[7]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_e_, 0); + /*<>*/ try{ + /*<>*/ /*<>*/ var + _g_ = [0, /*<>*/ runtime.caml_int64_of_string(s)]; + /*<>*/ return _g_; } - /*<>*/ } + catch(_h_){ + var _f_ = caml_wrap_exception(_h_); + if(_f_[1] === Stdlib[7]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_f_, 0); + } + /*<>*/ } function compare(x, y){ - /*<>*/ return /*<>*/ caml_int64_compare + /*<>*/ return /*<>*/ caml_int64_compare (x, y); - /*<>*/ } - function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int64_compare(x, y) - ? 1 - : 0; - /*<>*/ } + /*<>*/ } + var equal = runtime.caml_equal; function unsigned_compare(n, m){ - /*<>*/ var - /*<>*/ y = - /*<>*/ caml_int64_sub(m, min_int), - /*<>*/ x = - /*<>*/ caml_int64_sub(n, min_int); - /*<>*/ return /*<>*/ caml_int64_compare + /*<>*/ var + /*<>*/ y = + /*<>*/ caml_int64_sub(m, min_int), + /*<>*/ x = + /*<>*/ caml_int64_sub(n, min_int); + /*<>*/ return /*<>*/ caml_int64_compare (x, y); - /*<>*/ } + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan + ( /*<>*/ caml_int64_sub(n, min_int), + /*<>*/ caml_int64_sub(m, min_int)); + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; @@ -9342,9 +9580,8 @@ : y; /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, zero)) - /*<>*/ return 0 <= unsigned_compare(n, d) ? one : zero; + /*<>*/ if( /*<>*/ caml_lessthan(d, zero)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; /*<>*/ var /*<>*/ q = /*<>*/ runtime.caml_int64_shift_left @@ -9356,10 +9593,10 @@ /*<>*/ r = /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(q, d)); - /*<>*/ return 0 <= unsigned_compare(r, d) - ? /*<>*/ caml_int64_add(q, _a_) - : q; - /*<>*/ } + /*<>*/ return unsigned_lt(r, d) + ? q + : /*<>*/ caml_int64_add(q, _a_); + /*<>*/ } function unsigned_rem(n, d){ /*<>*/ return /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(unsigned_div(n, d), d)); @@ -9396,7 +9633,7 @@ max, seeded_hash, hash]; - runtime.caml_register_global(11, Stdlib_Int64, "Stdlib__Int64"); + runtime.caml_register_global(12, Stdlib_Int64, "Stdlib__Int64"); return; /*<>*/ } (globalThis)); @@ -9411,6 +9648,8 @@ caml_greaterequal = runtime.caml_greaterequal, caml_hash = runtime.caml_hash, caml_int_compare = runtime.caml_int_compare, + caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_mul = runtime.caml_mul, caml_wrap_exception = runtime.caml_wrap_exception, @@ -9439,10 +9678,10 @@ /*<>*/ return n ^ -1; /*<>*/ } var max_int$0 = Stdlib[19]; - function unsigned_to_int(n){ + /*<>*/ function unsigned_to_int(n){ /*<>*/ if - (0 >= /*<>*/ caml_int_compare(0, n) - && 0 >= /*<>*/ caml_int_compare(n, max_int$0)) + ( /*<>*/ caml_greaterequal(n, 0) + && /*<>*/ caml_lessequal(n, max_int$0)) /*<>*/ return [0, n]; /*<>*/ return 0; /*<>*/ } @@ -9451,71 +9690,71 @@ ("%d", n); /*<>*/ } function of_string_opt(s){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - _b_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; - /*<>*/ return _b_; + /*<>*/ try{ + /*<>*/ /*<>*/ var + _b_ = [0, /*<>*/ runtime.caml_int_of_string(s)]; + /*<>*/ return _b_; } catch(_c_){ var _a_ = caml_wrap_exception(_c_); - if(_a_[1] === Stdlib[7]) /*<>*/ return 0; + if(_a_[1] === Stdlib[7]) /*<>*/ return 0; throw caml_maybe_attach_backtrace(_a_, 0); } - /*<>*/ } + /*<>*/ } var compare = caml_int_compare; function equal(x, y){ - /*<>*/ return 0 - === /*<>*/ caml_int_compare(x, y) + /*<>*/ return 0 + === /*<>*/ caml_int_compare(x, y) ? 1 : 0; - /*<>*/ } + /*<>*/ } function unsigned_compare(n, m){ - /*<>*/ var - /*<>*/ y = m - min_int | 0, - /*<>*/ x = n - min_int | 0; - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ var + /*<>*/ y = m - min_int | 0, + /*<>*/ x = n - min_int | 0; + /*<>*/ return /*<>*/ caml_int_compare (x, y); - /*<>*/ } + /*<>*/ } + function unsigned_lt(n, m){ + /*<>*/ return /*<>*/ caml_lessthan + (n - min_int | 0, m - min_int | 0); + /*<>*/ } function min(x, y){ - /*<>*/ return /*<>*/ runtime.caml_lessequal + /*<>*/ return /*<>*/ caml_lessequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function max(x, y){ - /*<>*/ return /*<>*/ caml_greaterequal + /*<>*/ return /*<>*/ caml_greaterequal (x, y) ? x : y; - /*<>*/ } + /*<>*/ } function unsigned_div(n, d){ - /*<>*/ if - ( /*<>*/ runtime.caml_lessthan(d, 0)) - /*<>*/ return 0 <= unsigned_compare(n, d) - ? one - : zero; - /*<>*/ var - /*<>*/ q = - /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, - /*<>*/ r = - n - /*<>*/ caml_mul(q, d) | 0; - /*<>*/ return 0 <= unsigned_compare(r, d) - ? q + 1 | 0 - : q; - /*<>*/ } + /*<>*/ if + ( /*<>*/ caml_lessthan(d, 0)) + /*<>*/ return unsigned_lt(n, d) ? zero : one; + /*<>*/ var + /*<>*/ q = + /*<>*/ runtime.caml_div(n >>> 1 | 0, d) << 1, + /*<>*/ r = + n - /*<>*/ caml_mul(q, d) | 0; + /*<>*/ return unsigned_lt(r, d) ? q : q + 1 | 0; + /*<>*/ } function unsigned_rem(n, d){ - /*<>*/ return n - - /*<>*/ caml_mul(unsigned_div(n, d), d) + /*<>*/ return n + - /*<>*/ caml_mul(unsigned_div(n, d), d) | 0; - /*<>*/ } + /*<>*/ } function seeded_hash(seed, x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, seed, x); - /*<>*/ } + /*<>*/ } function hash(x){ - /*<>*/ return /*<>*/ caml_hash + /*<>*/ return /*<>*/ caml_hash (10, 100, 0, x); - /*<>*/ } + /*<>*/ } var Stdlib_Nativeint = [0, @@ -9541,7 +9780,7 @@ max, seeded_hash, hash]; - runtime.caml_register_global(12, Stdlib_Nativeint, "Stdlib__Nativeint"); + runtime.caml_register_global(13, Stdlib_Nativeint, "Stdlib__Nativeint"); return; /*<>*/ } (globalThis)); @@ -9619,11 +9858,8 @@ /*<>*/ return result; /*<>*/ } function from_function(opt, read_fun){ - /*<>*/ if(opt) - var sth = opt[1], with_positions = sth; - else - var with_positions = 1; /*<>*/ var + with_positions = opt ? opt[1] : 1, /*<>*/ _f_ = with_positions ? zero_pos : dummy_pos, _g_ = with_positions ? zero_pos : dummy_pos, /*<>*/ aux_buffer = @@ -9704,7 +9940,7 @@ [0], _g_, _f_]; - /*<>*/ } + } function from_channel(with_positions, ic){ /*<>*/ return from_function (with_positions, @@ -9714,11 +9950,8 @@ /*<>*/ }); /*<>*/ } function from_string(opt, s){ - /*<>*/ if(opt) - var sth = opt[1], with_positions = sth; - else - var with_positions = 1; /*<>*/ var + with_positions = opt ? opt[1] : 1, /*<>*/ _d_ = with_positions ? zero_pos : dummy_pos, _e_ = with_positions ? zero_pos : dummy_pos; /*<>*/ return [0, @@ -9737,7 +9970,7 @@ [0], _e_, _d_]; - /*<>*/ } + } function set_position(lexbuf, position){ /*<>*/ lexbuf[12] = [0, lexbuf[12][1], position[2], position[3], position[4]]; @@ -9910,23 +10143,23 @@ /*<>*/ new_end = /*<>*/ caml_make_vect(newsize, Stdlib_Lexing[1]); /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[1], 0, new_s, 0, oldsize); + (Stdlib_Array[9], env[1], 0, new_s, 0, oldsize); env[1] = new_s; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[2], 0, new_v, 0, oldsize); + (Stdlib_Array[9], env[2], 0, new_v, 0, oldsize); env[2] = new_v; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[3], 0, new_start, 0, oldsize); + (Stdlib_Array[9], env[3], 0, new_start, 0, oldsize); env[3] = new_start; /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], env[4], 0, new_end, 0, oldsize); + (Stdlib_Array[9], env[4], 0, new_end, 0, oldsize); env[4] = new_end; env[5] = newsize; return; /*<>*/ } function clear_parser(param){ /*<>*/ /*<>*/ caml_call4 - (Stdlib_Array[7], env[2], 0, env[5], 0); + (Stdlib_Array[8], env[2], 0, env[5], 0); env[8] = 0; return 0; /*<>*/ } @@ -10913,7 +11146,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) @@ -12227,7 +12460,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 @@ -12484,7 +12717,8 @@ caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_bytes_length = runtime.caml_ml_bytes_length, caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_get = runtime.caml_string_get; + caml_string_get = runtime.caml_string_get, + 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) @@ -12670,14 +12904,14 @@ } /*<>*/ } function add_substring(b, s, offset, len){ - /*<>*/ var _q_ = offset < 0 ? 1 : 0; - if(_q_) - var _r_ = _q_; + /*<>*/ var _s_ = offset < 0 ? 1 : 0; + if(_s_) + var _t_ = _s_; else var - _s_ = len < 0 ? 1 : 0, - _r_ = _s_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); - if(_r_) + _u_ = len < 0 ? 1 : 0, + _t_ = _u_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); + if(_t_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_substring_add_s); /*<>*/ var @@ -12732,9 +12966,9 @@ /*<>*/ } function add_channel(b, ic, to_read$1){ /*<>*/ var - _o_ = to_read$1 < 0 ? 1 : 0, - _p_ = _o_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); - if(_p_) + _q_ = to_read$1 < 0 ? 1 : 0, + _r_ = _q_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); + if(_r_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_channel); if(b[1][2] < (b[2] + to_read$1 | 0)) @@ -12774,284 +13008,285 @@ (Stdlib[68], oc, b[1][1], 0, b[2]); /*<>*/ } function add_substitute(b, f, s){ - /*<>*/ var + /*<>*/ var lim$1 = caml_ml_string_length(s), previous = 32, i$4 = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(i$4 >= lim$1){ - var _n_ = 92 === previous ? 1 : 0; - return _n_ ? add_char(b, previous) : _n_; + var _o_ = 92 === previous ? 1 : 0; + return _o_ ? add_char(b, previous) : _o_; } - /*<>*/ /*<>*/ var - previous$0 = /*<>*/ caml_string_get(s, i$4); + /*<>*/ /*<>*/ var + previous$0 = /*<>*/ caml_string_get(s, i$4); if(36 === previous$0) if(92 === previous){ - /*<>*/ add_char(b, previous$0); - /*<>*/ /*<>*/ var + /*<>*/ add_char(b, previous$0); + /*<>*/ /*<>*/ var i$5 = i$4 + 1 | 0; previous = 32; i$4 = i$5; } else{ - /*<>*/ /*<>*/ var - start$0 = i$4 + 1 | 0; - if(lim$1 <= start$0) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - /*<>*/ /*<>*/ var - opening = /*<>*/ caml_string_get(s, start$0); - a: - { - if(40 !== opening && 123 !== opening){ - /*<>*/ var - /*<>*/ start = start$0 + 1 | 0, - lim$0 = caml_ml_string_length(s); - b: - { - c: + /*<>*/ /*<>*/ var + start = i$4 + 1 | 0; + /*<>*/ try{ + if(lim$1 <= start) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + /*<>*/ /*<>*/ var + opening = /*<>*/ caml_string_get(s, start); + a: + { + if(40 !== opening && 123 !== opening){ + var lim$0 = caml_ml_string_length(s); + b: { - d: + c: { - var i$2 = start; - /*<>*/ for(;;){ - if(lim$0 <= i$2) break c; - /*<>*/ /*<>*/ var - match = /*<>*/ caml_string_get(s, i$2); - if(91 <= match){ - if(97 <= match){ - if(123 <= match) break d; + d: + { + var i$2 = start; + /*<>*/ for(;;){ + if(lim$0 <= i$2) break c; + /*<>*/ /*<>*/ var + match = /*<>*/ caml_string_get(s, i$2); + if(91 <= match){ + if(97 <= match){ + if(123 <= match) break d; + } + else if(95 !== match) break d; } - else if(95 !== match) break d; + else + if(58 <= match){ + if(65 > match) break; + } + else if(48 > match) break d; + var i$3 = i$2 + 1 | 0; + i$2 = i$3; } - else - if(58 <= match){ - if(65 > match) break; - } - else if(48 > match) break d; - var i$3 = i$2 + 1 | 0; - i$2 = i$3; } + var stop$0 = i$2; + break b; } - var stop$0 = i$2; - break b; + var stop$0 = lim$0; + } + if(stop$0 === start) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + var + val = + [0, + /*<>*/ caml_call3 + (Stdlib_String[16], s, start, stop$0 - start | 0), + stop$0]; + break a; + } + /*<>*/ var + /*<>*/ new_start = start + 1 | 0, + k$2 = 0; + if(40 === opening) + var closing = 41; + else{ + if(123 !== opening) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); + var closing = 125; + } + var lim = caml_ml_string_length(s), k = k$2, stop = new_start; + /*<>*/ for(;;){ + if(lim <= stop) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[8], 1); + if( /*<>*/ caml_string_get(s, stop) === opening){var i = stop + 1 | 0, k$0 = k + 1 | 0; k = k$0; stop = i;} + else if + ( /*<>*/ caml_string_get(s, stop) === closing){ + if(0 === k) break; + var i$0 = stop + 1 | 0, k$1 = k - 1 | 0; + k = k$1; + stop = i$0; } - var stop$0 = lim$0; + else{var i$1 = stop + 1 | 0; stop = i$1;} } var - match$0 = + val = [0, - /*<>*/ caml_call3 - (Stdlib_String[16], s, start$0, stop$0 - start$0 | 0), - stop$0]; - break a; - } - /*<>*/ var - /*<>*/ new_start = start$0 + 1 | 0, - k$2 = 0; - if(40 === opening) - var closing = 41; - else{ - if(123 !== opening) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Assert_failure, _a_], 1); - var closing = 125; + /*<>*/ caml_call3 + (Stdlib_String[16], s, new_start, (stop - start | 0) - 1 | 0), + stop + 1 | 0]; } - var lim = caml_ml_string_length(s), k = k$2, stop = new_start; - /*<>*/ for(;;){ - if(lim <= stop) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (Stdlib[8], 1); - if( /*<>*/ caml_string_get(s, stop) === opening){var i = stop + 1 | 0, k$0 = k + 1 | 0; k = k$0; stop = i;} - else if - ( /*<>*/ caml_string_get(s, stop) === closing){ - if(0 === k) break; - var i$0 = stop + 1 | 0, k$1 = k - 1 | 0; - k = k$1; - stop = i$0; - } - else{var i$1 = stop + 1 | 0; stop = i$1;} - } - var - match$0 = - [0, - /*<>*/ caml_call3 - (Stdlib_String[16], s, new_start, (stop - start$0 | 0) - 1 | 0), - stop + 1 | 0]; } - var next_i = match$0[2], ident = match$0[1]; - /*<>*/ add_string - (b, /*<>*/ caml_call1(f, ident)); + catch(_p_){ + var _n_ = caml_wrap_exception(_p_); + if(_n_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_n_, 0); + /*<>*/ add_char(b, 36); + previous = 32; + i$4 = start; + continue; + } + var next_i = val[2], ident = val[1]; + /*<>*/ add_string + (b, /*<>*/ caml_call1(f, ident)); previous = 32; i$4 = next_i; } - else if(92 === previous){ - /*<>*/ add_char(b, 92); - /*<>*/ add_char(b, previous$0); - /*<>*/ /*<>*/ var i$6 = i$4 + 1 | 0; - previous = 32; - i$4 = i$6; - } - else if(92 === previous$0){ - /*<>*/ /*<>*/ var i$7 = i$4 + 1 | 0; - previous = previous$0; - i$4 = i$7; - } else{ - /*<>*/ add_char(b, previous$0); - /*<>*/ /*<>*/ var i$8 = i$4 + 1 | 0; + if(92 === previous) /*<>*/ add_char(b, previous); + if(92 !== previous$0) /*<>*/ add_char(b, previous$0); + /*<>*/ /*<>*/ var + i$6 = i$4 + 1 | 0; previous = previous$0; - i$4 = i$8; + i$4 = i$6; } } - /*<>*/ } + /*<>*/ } function truncate(b, len){ - /*<>*/ if(0 <= len && b[2] >= len){b[2] = len; return 0;} - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 <= len && b[2] >= len){b[2] = len; return 0;} + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_truncate); - /*<>*/ } + /*<>*/ } function to_seq(b){ function aux(i, param){ - /*<>*/ if(b[2] <= i) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_bytes_get(b[1][1], i), - /*<>*/ _l_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _l_ = i + 1 | 0; + /*<>*/ return [0, x, function(_m_){ /*<>*/ return aux(_l_, _m_);}]; - /*<>*/ } - /*<>*/ var _j_ = 0; - /*<>*/ return function(_k_){ + /*<>*/ } + /*<>*/ var _j_ = 0; + /*<>*/ return function(_k_){ /*<>*/ return aux(_j_, _k_);}; - /*<>*/ } + /*<>*/ } function to_seqi(b){ function aux(i, param){ - /*<>*/ if(b[2] <= i) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_bytes_get(b[1][1], i), - /*<>*/ _h_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _h_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_i_){ /*<>*/ return aux(_h_, _i_);}]; - /*<>*/ } - /*<>*/ var _f_ = 0; - /*<>*/ return function(_g_){ + /*<>*/ } + /*<>*/ var _f_ = 0; + /*<>*/ return function(_g_){ /*<>*/ return aux(_f_, _g_);}; - /*<>*/ } + /*<>*/ } function add_seq(b, seq){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Seq[4], function(_e_){ /*<>*/ return add_char(b, _e_);}, seq); - /*<>*/ } + /*<>*/ } function of_seq(i){ - /*<>*/ /*<>*/ var b = create(32); - /*<>*/ add_seq(b, i); - /*<>*/ return b; - /*<>*/ } + /*<>*/ /*<>*/ var b = create(32); + /*<>*/ add_seq(b, i); + /*<>*/ return b; + /*<>*/ } function add_int8(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 1 | 0; + /*<>*/ new_position = position + 1 | 0; if(length < new_position){ - /*<>*/ resize(b, 1); - /*<>*/ /*<>*/ caml_bytes_set + /*<>*/ resize(b, 1); + /*<>*/ /*<>*/ caml_bytes_set (b[1][1], b[2], x); } else caml_bytes_unsafe_set(buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int16_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 2 | 0; + /*<>*/ new_position = position + 2 | 0; if(length < new_position){ - /*<>*/ resize(b, 2); - /*<>*/ /*<>*/ caml_bytes_set16 + /*<>*/ resize(b, 2); + /*<>*/ /*<>*/ caml_bytes_set16 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set16 + /*<>*/ /*<>*/ caml_bytes_set16 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int32_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 4 | 0; + /*<>*/ new_position = position + 4 | 0; if(length < new_position){ - /*<>*/ resize(b, 4); - /*<>*/ /*<>*/ caml_bytes_set32 + /*<>*/ resize(b, 4); + /*<>*/ /*<>*/ caml_bytes_set32 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set32 + /*<>*/ /*<>*/ caml_bytes_set32 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int64_ne(b, x){ - /*<>*/ var + /*<>*/ var position = b[2], - /*<>*/ match = b[1], + /*<>*/ match = b[1], length = match[2], buffer = match[1], - /*<>*/ new_position = position + 8 | 0; + /*<>*/ new_position = position + 8 | 0; if(length < new_position){ - /*<>*/ resize(b, 8); - /*<>*/ /*<>*/ caml_bytes_set64 + /*<>*/ resize(b, 8); + /*<>*/ /*<>*/ caml_bytes_set64 (b[1][1], b[2], x); } else - /*<>*/ /*<>*/ caml_bytes_set64 + /*<>*/ /*<>*/ caml_bytes_set64 (buffer, position, x); b[2] = new_position; return 0; - /*<>*/ } + /*<>*/ } function add_int16_le(b, x){ - /*<>*/ var _d_ = Stdlib_Sys[11] ? caml_bswap16(x) : x; + /*<>*/ var _d_ = Stdlib_Sys[11] ? caml_bswap16(x) : x; return add_int16_ne(b, _d_); - /*<>*/ } + /*<>*/ } function add_int16_be(b, x){ - /*<>*/ var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x); - /*<>*/ return add_int16_ne(b, x$0); - /*<>*/ } + /*<>*/ var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x); + /*<>*/ return add_int16_ne(b, x$0); + /*<>*/ } function add_int32_le(b, x){ - /*<>*/ var - _c_ = Stdlib_Sys[11] ? /*<>*/ caml_int32_bswap(x) : x; - /*<>*/ return add_int32_ne(b, _c_); - /*<>*/ } + /*<>*/ var + _c_ = Stdlib_Sys[11] ? /*<>*/ caml_int32_bswap(x) : x; + /*<>*/ return add_int32_ne(b, _c_); + /*<>*/ } function add_int32_be(b, x){ - /*<>*/ var - x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int32_bswap(x); - /*<>*/ return add_int32_ne(b, x$0); - /*<>*/ } + /*<>*/ var + x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int32_bswap(x); + /*<>*/ return add_int32_ne(b, x$0); + /*<>*/ } function add_int64_le(b, x){ - /*<>*/ var - _b_ = Stdlib_Sys[11] ? /*<>*/ caml_int64_bswap(x) : x; - /*<>*/ return add_int64_ne(b, _b_); - /*<>*/ } + /*<>*/ var + _b_ = Stdlib_Sys[11] ? /*<>*/ caml_int64_bswap(x) : x; + /*<>*/ return add_int64_ne(b, _b_); + /*<>*/ } function add_int64_be(b, x){ - /*<>*/ var - x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int64_bswap(x); - /*<>*/ return add_int64_ne(b, x$0); - /*<>*/ } + /*<>*/ var + x$0 = Stdlib_Sys[11] ? x : /*<>*/ caml_int64_bswap(x); + /*<>*/ return add_int64_ne(b, x$0); + /*<>*/ } var Stdlib_Buffer = [0, @@ -13286,7 +13521,7 @@ var runtime = globalThis.jsoo_runtime, caml_check_bound = runtime.caml_check_bound, - caml_domain_dls_set = runtime.caml_domain_dls_set, + 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, @@ -13314,265 +13549,247 @@ var undef = undefined, global_data = runtime.caml_get_global_data(), - Stdlib_Mutex = global_data.Stdlib__Mutex, Stdlib_Condition = global_data.Stdlib__Condition, - Stdlib = global_data.Stdlib, + Stdlib_Mutex = global_data.Stdlib__Mutex, Stdlib_Atomic = global_data.Stdlib__Atomic, + Stdlib = global_data.Stdlib, + Stdlib_Array = global_data.Stdlib__Array, Stdlib_List = global_data.Stdlib__List, - Stdlib_Array = global_data.Stdlib__Array; + Assert_failure = global_data.Assert_failure; function cpu_relax(param){ - /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax + /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax (0); - /*<>*/ } - /*<>*/ /*<>*/ var - unique_value = [0, 0]; + /*<>*/ } + /*<>*/ /*<>*/ var none = [0, 0]; function create_dls(param){ - /*<>*/ /*<>*/ var - st = /*<>*/ caml_make_vect(8, unique_value); - /*<>*/ /*<>*/ caml_domain_dls_set(st); - /*<>*/ return; - /*<>*/ } - /*<>*/ create_dls(0); - /*<>*/ var - /*<>*/ key_counter = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0), - /*<>*/ parent_keys = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0); + /*<>*/ /*<>*/ var + st = /*<>*/ caml_make_vect(8, none); + /*<>*/ /*<>*/ runtime.caml_domain_dls_set + (st); + /*<>*/ return; + /*<>*/ } + /*<>*/ create_dls(0); + /*<>*/ var + /*<>*/ key_counter = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + /*<>*/ parent_keys = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + _a_ = [0, "domain.ml", 184, 13]; function new_key(split_from_parent, init_orphan){ - /*<>*/ var - /*<>*/ idx = - /*<>*/ caml_call2(Stdlib_Atomic[6], key_counter, 1), - /*<>*/ k = [0, idx, init_orphan]; - /*<>*/ if(split_from_parent){ - /*<>*/ var + /*<>*/ var + /*<>*/ idx = + /*<>*/ caml_call2(Stdlib_Atomic[7], key_counter, 1), + /*<>*/ k = [0, idx, init_orphan]; + /*<>*/ if(split_from_parent){ + /*<>*/ var split = split_from_parent[1], - /*<>*/ ki = [0, k, split]; - /*<>*/ for(;;){ - /*<>*/ /*<>*/ var - l = /*<>*/ caml_call1(Stdlib_Atomic[2], parent_keys); + /*<>*/ ki = [0, k, split]; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + l = /*<>*/ caml_call1(Stdlib_Atomic[3], parent_keys); if (! (1 - - /*<>*/ caml_call3 - (Stdlib_Atomic[5], parent_keys, l, [0, ki, l]))) + /*<>*/ caml_call3 + (Stdlib_Atomic[6], parent_keys, l, [0, ki, l]))) break; } } - /*<>*/ return k; - /*<>*/ } + /*<>*/ return k; + /*<>*/ } function maybe_grow(idx){ - /*<>*/ var - st = runtime.caml_domain_dls_get(0), - /*<>*/ sz = st.length - 1; - if(idx < sz) /*<>*/ return st; - var new_sz = sz; - /*<>*/ for(;;){ - if(idx < new_sz){ - /*<>*/ /*<>*/ var - new_st = /*<>*/ caml_make_vect(new_sz, unique_value); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], st, 0, new_st, 0, sz); - /*<>*/ /*<>*/ caml_domain_dls_set - (new_st); - /*<>*/ return new_st; - } - var s = 2 * new_sz | 0; - new_sz = s; - } - /*<>*/ } + /*<>*/ for(;;){ + /*<>*/ var + st = caml_domain_dls_get(0), + /*<>*/ sz = st.length - 1; + if(idx < sz) /*<>*/ return st; + var new_sz = sz; + /*<>*/ for(;;){ + if(idx < new_sz) break; + var s = 2 * new_sz | 0; + new_sz = s; + } + /*<>*/ /*<>*/ var + new_st = /*<>*/ caml_make_vect(new_sz, none); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], st, 0, new_st, 0, sz); + /*<>*/ if + ( /*<>*/ runtime.caml_domain_dls_compare_and_set + (st, new_st)) + /*<>*/ return new_st; + } + /*<>*/ } function set(param, x){ - /*<>*/ var + /*<>*/ var idx = param[1], - /*<>*/ st = maybe_grow(idx); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = x; - /*<>*/ return 0; + /*<>*/ st = maybe_grow(idx); + /*<>*/ caml_check_bound(st, idx)[1 + idx] = x; + /*<>*/ return 0; } function get(param){ - /*<>*/ var + /*<>*/ var init = param[2], idx = param[1], - /*<>*/ st = maybe_grow(idx), - /*<>*/ v = caml_check_bound(st, idx)[1 + idx]; - if(v !== unique_value) /*<>*/ return v; - /*<>*/ /*<>*/ var - v$0 = /*<>*/ caml_call1(init, 0); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = v$0; - /*<>*/ return v$0; + /*<>*/ st = maybe_grow(idx), + /*<>*/ oldval = caml_check_bound(st, idx)[1 + idx]; + /*<>*/ if(oldval !== none) + /*<>*/ return oldval; + /*<>*/ var + /*<>*/ new_obj = + /*<>*/ caml_call1(init, 0), + /*<>*/ st$0 = + /*<>*/ caml_domain_dls_get(0), + /*<>*/ curval = caml_check_bound(st$0, idx)[1 + idx], + _e_ = curval === oldval ? (st$0[1 + idx] = new_obj, 1) : 0; + /*<>*/ if(_e_) /*<>*/ return new_obj; + /*<>*/ /*<>*/ var + updated_obj = caml_check_bound(st$0, idx)[1 + idx]; + /*<>*/ if(updated_obj !== none) + /*<>*/ return updated_obj; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _a_], 1); } function get_id(param){ var domain = param[1]; - /*<>*/ return domain; + /*<>*/ return domain; } function self(param){ - /*<>*/ return /*<>*/ caml_ml_domain_id + /*<>*/ return /*<>*/ caml_ml_domain_id (0); - /*<>*/ } + /*<>*/ } function is_main_domain(param){ - /*<>*/ return 0 - === /*<>*/ caml_ml_domain_id(0) + /*<>*/ return 0 + === /*<>*/ caml_ml_domain_id(0) ? 1 : 0; - /*<>*/ } - /*<>*/ var - /*<>*/ first_domain_spawned = - /*<>*/ caml_call1(Stdlib_Atomic[1], 0), - /*<>*/ first_spawn_function = + /*<>*/ } + /*<>*/ var + /*<>*/ first_domain_spawned = + /*<>*/ caml_call1(Stdlib_Atomic[1], 0), + /*<>*/ first_spawn_function = [0, function(param){ - /*<>*/ return; - /*<>*/ }], + /*<>*/ return; + /*<>*/ }], cst_first_domain_already_spawn = "first domain already spawned"; function before_first_spawn(f){ - /*<>*/ if - ( /*<>*/ caml_call1 - (Stdlib_Atomic[2], first_domain_spawned)) - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ if + ( /*<>*/ caml_call1 + (Stdlib_Atomic[3], first_domain_spawned)) + /*<>*/ 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, _c_){ - /*<>*/ return 0; - /*<>*/ }); + function(param){ + /*<>*/ 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; - var - cst_internal_error_Am_I_alread = "internal error: Am I already finished?"; function spawn(f){ - /*<>*/ if + /*<>*/ if (1 - - /*<>*/ caml_call1 - (Stdlib_Atomic[2], first_domain_spawned)){ - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Atomic[3], first_domain_spawned, 1); - /*<>*/ /*<>*/ caml_call1 + /*<>*/ caml_call1 + (Stdlib_Atomic[3], first_domain_spawned)){ + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Atomic[4], first_domain_spawned, 1); + /*<>*/ /*<>*/ caml_call1 (first_spawn_function[1], 0); first_spawn_function[1] = function(param){ - /*<>*/ return 0; - /*<>*/ }; - } - /*<>*/ var - /*<>*/ _a_ = - /*<>*/ caml_call1(Stdlib_Atomic[2], parent_keys), - /*<>*/ pk = - /*<>*/ caml_call2 + /*<>*/ return 0; + /*<>*/ }; + } + /*<>*/ var + /*<>*/ _b_ = + /*<>*/ caml_call1(Stdlib_Atomic[3], parent_keys), + /*<>*/ pk = + /*<>*/ caml_call2 (Stdlib_List[20], function(param){ - /*<>*/ var - split = param[2], - k = param[1], - idx = k[1]; - /*<>*/ return [0, - idx, - /*<>*/ caml_call1(split, get(k))]; - /*<>*/ }, - _a_), - /*<>*/ term_mutex = - /*<>*/ caml_call1(Stdlib_Mutex[1], 0), - /*<>*/ term_condition = - /*<>*/ caml_call1(Stdlib_Condition[1], 0), - /*<>*/ term_state = [0, 0]; + /*<>*/ var split = param[2], k = param[1]; + /*<>*/ return [0, + k, + /*<>*/ caml_call1(split, get(k))]; + /*<>*/ }, + _b_), + /*<>*/ _c_ = + /*<>*/ caml_call1(Stdlib_Condition[1], 0), + /*<>*/ term_sync = + [0, 0, /*<>*/ caml_call1(Stdlib_Mutex[1], 0), _c_]; function body(param){ - /*<>*/ a: - { - /*<>*/ try{ - /*<>*/ create_dls(0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_List[18], - function(param){ - /*<>*/ var - v = param[2], - idx = param[1], - /*<>*/ st = maybe_grow(idx); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = v; - /*<>*/ return 0; - /*<>*/ }, - pk); - /*<>*/ /*<>*/ var - res = /*<>*/ caml_call1(f, 0); - } - catch(ex$0){ - var ex = caml_wrap_exception(ex$0), result = [1, ex]; - break a; - } - var result = [0, res]; - } - /*<>*/ try{ - /*<>*/ do_at_exit(0); - var result$0 = result; - } - catch(ex){ - /*<>*/ var - ex$0 = caml_wrap_exception(ex), - /*<>*/ _b_ = 0 === result[0] ? [1, ex$0] : result, - result$0 = _b_; - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[2], term_mutex); - return term_state[1] - ? /*<>*/ caml_call1 - (Stdlib[2], cst_internal_error_Am_I_alread) - : (term_state - [1] - = [0, result$0], - /*<>*/ caml_call1 - (Stdlib_Condition[4], term_condition)); - /*<>*/ } - /*<>*/ return [0, - /*<>*/ runtime.caml_domain_spawn - (body, term_mutex), - term_mutex, - term_condition, - term_state]; - /*<>*/ } - function join(param){ - var - term_state = param[4], - term_condition = param[3], - term_mutex = param[2]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[2], term_mutex); - /*<>*/ for(;;){ - var match = term_state[1]; - if(match){ - var res = match[1]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Mutex[4], term_mutex); - if(0 === res[0]){var x = res[1]; /*<>*/ return x;} - var ex = res[1]; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (ex, 1); + /*<>*/ try{ + /*<>*/ create_dls(0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_List[18], + function(param){ + /*<>*/ var v = param[2], k = param[1]; + /*<>*/ return set(k, v); + /*<>*/ }, + pk); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_call1(f, 0); } - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Condition[2], term_condition, term_mutex); - } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + /*<>*/ try{ /*<>*/ do_at_exit(0);} + catch(_d_){} + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (exn, 0); + } + /*<>*/ do_at_exit(0); + /*<>*/ return res; + /*<>*/ } + /*<>*/ /*<>*/ var + domain = + /*<>*/ runtime.caml_domain_spawn(body, term_sync); + /*<>*/ return [0, domain, term_sync]; + /*<>*/ } + function join(param){ + var term_sync = param[2]; + /*<>*/ function loop(param){ + /*<>*/ for(;;){ + var match = term_sync[1]; + if(match){var res = match[1]; /*<>*/ return res;} + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Condition[2], term_sync[3], term_sync[2]); + } + /*<>*/ } + /*<>*/ /*<>*/ var + match = + /*<>*/ caml_call2 + (Stdlib_Mutex[5], term_sync[2], loop); + if(0 === match[0]){var x = match[1]; /*<>*/ return x;} + var ex = match[1]; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (ex, 1); } var recommended_domain_count = runtime.caml_recommended_domain_count, @@ -13588,7 +13805,7 @@ is_main_domain, recommended_domain_count, [0, new_key, get, set]]; - runtime.caml_register_global(8, Stdlib_Domain, "Stdlib__Domain"); + runtime.caml_register_global(9, Stdlib_Domain, "Stdlib__Domain"); return; /*<>*/ } (globalThis)); @@ -13937,10 +14154,7 @@ } /*<>*/ } function char_of_fconv(opt, fconv){ - /*<>*/ if(opt) - var sth = opt[1], cF = sth; - else - var cF = 70; + var cF = opt ? opt[1] : 70; switch(fconv[2]){ case 0: /*<>*/ return 102; @@ -13960,7 +14174,7 @@ /*<>*/ return 72; default: /*<>*/ return 70; } - /*<>*/ } + } function bprint_padty(buf, padty){ /*<>*/ switch(padty){ case 0: @@ -17683,7 +17897,7 @@ fmt); /*<>*/ }; case 10: var rest$9 = fmtty[1]; - /*<>*/ return function(param, _cc_){ + /*<>*/ return function(_cc_, param){ /*<>*/ return make_from_fmtty (k, acc, rest$9, fmt); /*<>*/ }; case 11: @@ -20476,7 +20690,907 @@ /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Arg +//# unitInfo: Provides: Stdlib__Dynarray +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__List, Stdlib__Printf, Stdlib__Seq, 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", + 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){ + 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$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, + Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, + Assert_failure = global_data.Assert_failure, + Stdlib_Printf = global_data.Stdlib__Printf, + _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)"], + _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)"], + _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_ = + [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_ = + [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); + } + /*<>*/ 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_; + } + } + /*<>*/ 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 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; + } + /*<>*/ } + 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); + /*<>*/ ensure_capacity + (a, /*<>*/ caml_call1(Stdlib_List[1], li)); + /*<>*/ /*<>*/ 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){ @@ -21018,16 +22132,16 @@ /*<>*/ var /*<>*/ before = /*<>*/ caml_call3 - (Stdlib_Array[5], argv[1], 0, current[1] + 1 | 0), + (Stdlib_Array[6], argv[1], 0, current[1] + 1 | 0), /*<>*/ after = /*<>*/ caml_call3 - (Stdlib_Array[5], + (Stdlib_Array[6], argv[1], current[1] + 1 | 0, (argv[1].length - 1 - current[1] | 0) - 1 | 0); argv[1] = /*<>*/ caml_call1 - (Stdlib_Array[4], [0, before, [0, newarg, [0, after, 0]]]); + (Stdlib_Array[5], [0, before, [0, newarg, [0, after, 0]]]); return 0; } /*<>*/ }; @@ -21062,21 +22176,15 @@ (1, current, argv, speclist, anonfun, errmsg); /*<>*/ } function parse_argv_dynamic(opt, argv, speclist, anonfun, errmsg){ - /*<>*/ if(opt) - var sth = opt[1], current$0 = sth; - else - var current$0 = current; + var current$0 = opt ? opt[1] : current; /*<>*/ return parse_and_expand_argv_dynamic_ (0, current$0, [0, argv], speclist, anonfun, errmsg); - /*<>*/ } + } function parse_argv(opt, argv, speclist, anonfun, errmsg){ - /*<>*/ if(opt) - var sth = opt[1], current$0 = sth; - else - var current$0 = current; + var current$0 = opt ? opt[1] : current; /*<>*/ return parse_argv_dynamic ([0, current$0], argv, [0, speclist], anonfun, errmsg); - /*<>*/ } + } function parse(l, f, msg){ /*<>*/ try{ /*<>*/ /*<>*/ var @@ -21204,11 +22312,8 @@ s); /*<>*/ } function align(opt, speclist){ - /*<>*/ if(opt) - var sth = opt[1], limit = sth; - else - var limit = Stdlib[19]; /*<>*/ var + limit = opt ? opt[1] : Stdlib[19], /*<>*/ completed = add_help(speclist), /*<>*/ len = /*<>*/ caml_call3 @@ -21272,7 +22377,7 @@ /*<>*/ caml_call2(Stdlib[28], prefix, _J_)]; }, completed); - /*<>*/ } + } function read_aux(trim, sep, file){ /*<>*/ var /*<>*/ ic = @@ -21326,7 +22431,7 @@ /*<>*/ /*<>*/ var _F_ = /*<>*/ caml_call1(Stdlib_List[10], words[1]); /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[10], _F_); + (Stdlib_Array[11], _F_); } /*<>*/ } var _r_ = 10, _s_ = 1; @@ -21344,7 +22449,7 @@ /*<>*/ /*<>*/ var oc = /*<>*/ caml_call1(Stdlib[61], file); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], + (Stdlib_Array[12], function(s){ /*<>*/ return caml_call4 (Stdlib_Printf[1], oc, _v_, s, sep); @@ -21484,8 +22589,9 @@ cst_Re_raised_at = "Re-raised at", cst_Raised_by_primitive_operat = "Raised by primitive operation at", cst_Called_from = "Called from", + _h_ = [0, [12, 32, [4, 0, 0, 0, 0]], " %d"], cst_inlined = " (inlined)", - _h_ = + _i_ = [0, [2, 0, @@ -21499,17 +22605,16 @@ 0, [12, 34, - [2, - 0, - [11, ", line ", [4, 0, 0, 0, [11, cst_characters, partial]]]]]]]]]], - '%s %s in file "%s"%s, line %d, characters %d-%d'], - _i_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], - _j_ = [0, [2, 0, [12, 10, 0]], cst_s], - _k_ = + [2, 0, [11, ", line", [2, 0, [11, cst_characters, partial]]]]]]]]]], + '%s %s in file "%s"%s, line%s, characters %d-%d'], + _j_ = [0, [11, "s ", [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]]], "s %d-%d"], + _k_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], + _l_ = [0, [2, 0, [12, 10, 0]], cst_s], + _m_ = [0, [11, cst_Program_not_linked_with_g_$0, 0], cst_Program_not_linked_with_g_$0], - _l_ = [0, [2, 0, [12, 10, 0]], cst_s], + _n_ = [0, [2, 0, [12, 10, 0]], cst_s], cst_Program_not_linked_with_g_ = cst_Program_not_linked_with_g_$0; function field(x, i){ /*<>*/ /*<>*/ var f = x[1 + i]; @@ -21518,13 +22623,13 @@ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _b_, f); /*<>*/ /*<>*/ var - _ag_ = Stdlib_Obj[15]; - if( /*<>*/ caml_obj_tag(f) === _ag_) + _ah_ = Stdlib_Obj[15]; + if( /*<>*/ caml_obj_tag(f) === _ah_) /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _a_, f); /*<>*/ /*<>*/ var - _ah_ = Stdlib_Obj[16]; - return /*<>*/ caml_obj_tag(f) === _ah_ + _ai_ = Stdlib_Obj[16]; + return /*<>*/ caml_obj_tag(f) === _ai_ ? /*<>*/ caml_call1(Stdlib[35], f) : cst; /*<>*/ } @@ -21532,14 +22637,14 @@ /*<>*/ if(x.length - 1 <= i) /*<>*/ return cst$0; /*<>*/ var - /*<>*/ _ae_ = other_fields(x, i + 1 | 0), - /*<>*/ _af_ = field(x, i); + /*<>*/ _af_ = other_fields(x, i + 1 | 0), + /*<>*/ _ag_ = field(x, i); /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Printf[4], _c_, _af_, _ae_); + (Stdlib_Printf[4], _c_, _ag_, _af_); /*<>*/ } function use_printers(x){ /*<>*/ var - param = /*<>*/ caml_call1(Stdlib_Atomic[2], printers); + param = /*<>*/ caml_call1(Stdlib_Atomic[3], printers); /*<>*/ for(;;){ if(! param) /*<>*/ return 0; var tl = param[2], hd = param[1]; @@ -21549,7 +22654,7 @@ /*<>*/ /*<>*/ var val = /*<>*/ caml_call1(hd, x); } - catch(_ad_){break a;} + catch(_ae_){break a;} if(val){var s = val[1]; /*<>*/ return [0, s];} } param = tl; @@ -21563,24 +22668,24 @@ match = t.length - 1; if(2 < match >>> 0) /*<>*/ var - /*<>*/ _$_ = other_fields(t, 2), - /*<>*/ _aa_ = field(t, 1), - _ac_ = + /*<>*/ _aa_ = other_fields(t, 2), + /*<>*/ _ab_ = field(t, 1), + _ad_ = /*<>*/ caml_call3 - (Stdlib_Printf[4], _d_, _aa_, _$_); + (Stdlib_Printf[4], _d_, _ab_, _aa_); else switch(match){ case 0: - var _ac_ = cst$1; break; + var _ad_ = cst$1; break; case 1: - var _ac_ = cst$2; break; + var _ad_ = cst$2; break; default: /*<>*/ var - /*<>*/ _ab_ = field(t, 1), - _ac_ = - /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ab_); + /*<>*/ _ac_ = field(t, 1), + _ad_ = + /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ac_); } - var match$0 = [0, constructor, [0, _ac_]]; + var match$0 = [0, constructor, [0, _ad_]]; } else var match$0 = [0, t[1], 0]; @@ -21647,15 +22752,15 @@ function print(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - ___ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return ___; + _$_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _$_; } catch(x$0){ /*<>*/ var x = caml_wrap_exception(x$0), - /*<>*/ _Z_ = to_string(x); + /*<>*/ ___ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _f_, _Z_); + (Stdlib_Printf[3], _f_, ___); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[40]); /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace @@ -21665,17 +22770,17 @@ function catch$0(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _Y_ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return _Y_; + _Z_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _Z_; } catch(x$0){ var x = caml_wrap_exception(x$0); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[39]); /*<>*/ /*<>*/ var - _X_ = to_string(x); + _Y_ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _g_, _X_); + (Stdlib_Printf[3], _g_, _Y_); /*<>*/ return /*<>*/ caml_call1 (Stdlib[99], 2); } @@ -21684,168 +22789,174 @@ /*<>*/ return bt; /*<>*/ } function convert_raw_backtrace(bt){ - /*<>*/ return [0, - /*<>*/ runtime.caml_convert_raw_backtrace(bt)]; - /*<>*/ } + /*<>*/ return [0, + /*<>*/ runtime.caml_convert_raw_backtrace(bt)]; + /*<>*/ } function format_backtrace_slot(pos, slot){ function info(is_raise){ - /*<>*/ return is_raise + /*<>*/ return is_raise ? 0 === pos ? cst_Raised_at : cst_Re_raised_at : 0 === pos ? cst_Raised_by_primitive_operat : cst_Called_from; - /*<>*/ } - /*<>*/ if(0 === slot[0]){ - /*<>*/ var - _P_ = slot[5], - _Q_ = slot[4], - _R_ = slot[3], - _S_ = slot[6] ? cst_inlined : cst$3, - _T_ = slot[2], - _U_ = slot[7], - /*<>*/ _V_ = info(slot[1]); - /*<>*/ return [0, - /*<>*/ caml_call8 - (Stdlib_Printf[4], _h_, _V_, _U_, _T_, _S_, _R_, _Q_, _P_)]; - } - if(slot[1]) /*<>*/ return 0; - /*<>*/ /*<>*/ var _W_ = info(0); - /*<>*/ return [0, - /*<>*/ caml_call2(Stdlib_Printf[4], _i_, _W_)]; - /*<>*/ } + /*<>*/ } + /*<>*/ if(0 === slot[0]){ + /*<>*/ var + lines = + slot[3] === slot[6] + ? /*<>*/ caml_call2 + (Stdlib_Printf[4], _h_, slot[3]) + : /*<>*/ caml_call3 + (Stdlib_Printf[4], _j_, slot[3], slot[6]), + _R_ = slot[7], + _S_ = slot[4], + _T_ = slot[8] ? cst_inlined : cst$3, + _U_ = slot[2], + _V_ = slot[9], + /*<>*/ _W_ = info(slot[1]); + /*<>*/ return [0, + /*<>*/ caml_call8 + (Stdlib_Printf[4], _i_, _W_, _V_, _U_, _T_, lines, _S_, _R_)]; + } + if(slot[1]) /*<>*/ return 0; + /*<>*/ /*<>*/ var _X_ = info(0); + /*<>*/ return [0, + /*<>*/ caml_call2(Stdlib_Printf[4], _k_, _X_)]; + /*<>*/ } function print_raw_backtrace(outchan, raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var backtrace = convert_raw_backtrace(raw_backtrace); if(! backtrace) - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Printf[1], outchan, _k_); - var a = backtrace[1], _N_ = a.length - 2 | 0, _M_ = 0; - if(_N_ >= 0){ - var i = _M_; + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Printf[1], outchan, _m_); + var a = backtrace[1], _P_ = a.length - 2 | 0, _O_ = 0; + if(_P_ >= 0){ + var i = _O_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); if(match){ var str = match[1]; - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[1], outchan, _j_, str); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[1], outchan, _l_, str); } - /*<>*/ /*<>*/ var - _O_ = i + 1 | 0; - if(_N_ === i) break; - i = _O_; + /*<>*/ /*<>*/ var + _Q_ = i + 1 | 0; + if(_P_ === i) break; + i = _Q_; } } return 0; - /*<>*/ } + /*<>*/ } function print_backtrace(outchan){ - /*<>*/ return print_raw_backtrace + /*<>*/ return print_raw_backtrace (outchan, - /*<>*/ caml_get_exception_raw_backtra(0)); - /*<>*/ } + /*<>*/ caml_get_exception_raw_backtra(0)); + /*<>*/ } function raw_backtrace_to_string(raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var backtrace = convert_raw_backtrace(raw_backtrace); if(! backtrace) - /*<>*/ return cst_Program_not_linked_with_g_; - /*<>*/ var + /*<>*/ return cst_Program_not_linked_with_g_; + /*<>*/ var a = backtrace[1], - /*<>*/ b = - /*<>*/ caml_call1(Stdlib_Buffer[1], 1024), - _K_ = a.length - 2 | 0, - /*<>*/ _J_ = 0; - if(_K_ >= 0){ - var i = _J_; + /*<>*/ b = + /*<>*/ caml_call1(Stdlib_Buffer[1], 1024), + _M_ = a.length - 2 | 0, + /*<>*/ _L_ = 0; + if(_M_ >= 0){ + var i = _L_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); if(match){ var str = match[1]; - /*<>*/ /*<>*/ caml_call3 - (Stdlib_Printf[5], b, _l_, str); + /*<>*/ /*<>*/ caml_call3 + (Stdlib_Printf[5], b, _n_, str); } - /*<>*/ /*<>*/ var - _L_ = i + 1 | 0; - if(_K_ === i) break; - i = _L_; + /*<>*/ /*<>*/ var + _N_ = i + 1 | 0; + if(_M_ === i) break; + i = _N_; } } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[2], b); - /*<>*/ } + /*<>*/ } function backtrace_slot_is_raise(param){ - /*<>*/ return 0 === param[0] ? param[1] : param[1]; - /*<>*/ } + /*<>*/ return 0 === param[0] ? param[1] : param[1]; + /*<>*/ } function backtrace_slot_is_inline(param){ - /*<>*/ return 0 === param[0] ? param[6] : 0; - /*<>*/ } + /*<>*/ return 0 === param[0] ? param[8] : 0; + /*<>*/ } function backtrace_slot_location(param){ - /*<>*/ return 0 === param[0] - ? [0, [0, param[2], param[3], param[4], param[5]]] + /*<>*/ return 0 === param[0] + ? [0, + [0, param[2], param[3], param[4], param[5], param[6], param[7]]] : 0; - /*<>*/ } + /*<>*/ } function backtrace_slot_defname(param){ - /*<>*/ if(0 === param[0] && param[7] !== cst$4) - /*<>*/ return [0, param[7]]; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ if(0 === param[0] && param[9] !== cst$4) + /*<>*/ return [0, param[9]]; + /*<>*/ return 0; + /*<>*/ } function backtrace_slots(raw_backtrace){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var match = convert_raw_backtrace(raw_backtrace); - if(! match) /*<>*/ return 0; + if(! match) /*<>*/ return 0; var backtrace = match[1], i$1 = backtrace.length - 2 | 0, i = i$1; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(-1 === i) - var _I_ = 0; + var _K_ = 0; else{ - var _H_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; - /*<>*/ if(! _H_){ + var _J_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; + /*<>*/ if(! _J_){ var i$0 = i - 1 | 0; i = i$0; continue; } - var _I_ = _H_; + var _K_ = _J_; } - /*<>*/ return _I_ ? [0, backtrace] : 0; + /*<>*/ return _K_ ? [0, backtrace] : 0; } - /*<>*/ } + /*<>*/ } function backtrace_slots_of_raw_entry(entry){ - /*<>*/ return backtrace_slots([0, entry]); - /*<>*/ } + /*<>*/ return backtrace_slots([0, entry]); + /*<>*/ } function raw_backtrace_length(bt){ - /*<>*/ return bt.length - 1; - /*<>*/ } + /*<>*/ return bt.length - 1; + /*<>*/ } function get_backtrace(param){ - /*<>*/ return raw_backtrace_to_string - ( /*<>*/ caml_get_exception_raw_backtra(0)); - /*<>*/ } + /*<>*/ return raw_backtrace_to_string + ( /*<>*/ caml_get_exception_raw_backtra(0)); + /*<>*/ } function register_printer(fn){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ old_printers = - /*<>*/ caml_call1(Stdlib_Atomic[2], printers), - /*<>*/ new_printers = [0, fn, old_printers], - /*<>*/ success = - /*<>*/ caml_call3 - (Stdlib_Atomic[5], printers, old_printers, new_printers), - /*<>*/ _G_ = 1 - success; - if(! _G_) /*<>*/ return _G_; - } - /*<>*/ } + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ old_printers = + /*<>*/ caml_call1(Stdlib_Atomic[3], printers), + /*<>*/ new_printers = [0, fn, old_printers], + /*<>*/ success = + /*<>*/ caml_call3 + (Stdlib_Atomic[6], printers, old_printers, new_printers), + /*<>*/ _I_ = 1 - success; + if(! _I_) /*<>*/ return _I_; + } + /*<>*/ } function exn_slot(x){ - /*<>*/ return 0 - === /*<>*/ caml_obj_tag(x) + /*<>*/ return 0 + === /*<>*/ caml_obj_tag(x) ? x[1] : x; - /*<>*/ } + /*<>*/ } function exn_slot_id(x){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var slot = exn_slot(x); - /*<>*/ return slot[2]; - /*<>*/ } + /*<>*/ return slot[2]; + /*<>*/ } function exn_slot_name(x){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var slot = exn_slot(x); - /*<>*/ return slot[1]; - /*<>*/ } + /*<>*/ return slot[1]; + /*<>*/ } var errors = [0, @@ -21855,103 +22966,103 @@ "(Cannot print locations:\n bytecode executable program file has wrong magic number)", "(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"].slice (), - _m_ = + _o_ = [0, [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], cst_Fatal_error_exception_s]; function default_uncaught_exception_han(exn, raw_backtrace){ - /*<>*/ /*<>*/ var - _D_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _m_, _D_); - /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - status = /*<>*/ runtime.caml_ml_debug_info_status(0); + /*<>*/ /*<>*/ var + _F_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _o_, _F_); + /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); + /*<>*/ /*<>*/ var + status = /*<>*/ runtime.caml_ml_debug_info_status(0); if(status < 0){ - /*<>*/ var - /*<>*/ _E_ = - /*<>*/ caml_call1(Stdlib[18], status), - /*<>*/ _F_ = caml_check_bound(errors, _E_)[1 + _E_]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib[53], _F_); - } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ _G_ = + /*<>*/ caml_call1(Stdlib[18], status), + /*<>*/ _H_ = caml_check_bound(errors, _G_)[1 + _G_]; + /*<>*/ /*<>*/ caml_call1 + (Stdlib[53], _H_); + } + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], Stdlib[40]); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var uncaught_exception_handler = [0, default_uncaught_exception_han]; function set_uncaught_exception_handler(fn){ - /*<>*/ uncaught_exception_handler[1] = fn; + /*<>*/ uncaught_exception_handler[1] = fn; return 0; - /*<>*/ } + /*<>*/ } var empty_backtrace = [0], cst_Fatal_error_out_of_memory_ = "Fatal error: out of memory in uncaught exception handler", - _n_ = + _p_ = [0, [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], cst_Fatal_error_exception_s], - _o_ = + _q_ = [0, [11, "Fatal error in uncaught exception handler: exception ", [2, 0, [12, 10, 0]]], "Fatal error in uncaught exception handler: exception %s\n"]; function handle_uncaught_exception(exn$0, debugger_in_use){ - /*<>*/ try{ - /*<>*/ try{ + /*<>*/ try{ + /*<>*/ try{ var raw_backtrace = debugger_in_use ? empty_backtrace - : /*<>*/ caml_get_exception_raw_backtra(0); - /*<>*/ try{ - /*<>*/ /*<>*/ caml_call1 + : /*<>*/ caml_get_exception_raw_backtra(0); + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call1 (Stdlib[103], 0); } - catch(_C_){} - /*<>*/ try{ - /*<>*/ var - /*<>*/ _y_ = - /*<>*/ caml_call2 + catch(_E_){} + /*<>*/ try{ + /*<>*/ var + /*<>*/ _A_ = + /*<>*/ caml_call2 (uncaught_exception_handler[1], exn$0, raw_backtrace), - _x_ = _y_; + _z_ = _A_; } catch(exn$1){ - /*<>*/ var + /*<>*/ var exn = caml_wrap_exception(exn$1), - /*<>*/ raw_backtrace$0 = - /*<>*/ caml_get_exception_raw_backtra(0), - /*<>*/ _v_ = to_string(exn$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _n_, _v_); - /*<>*/ print_raw_backtrace + /*<>*/ raw_backtrace$0 = + /*<>*/ caml_get_exception_raw_backtra(0), + /*<>*/ _x_ = to_string(exn$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _p_, _x_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - _w_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _o_, _w_); - /*<>*/ print_raw_backtrace + /*<>*/ /*<>*/ var + _y_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _q_, _y_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace$0); var - _x_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); + _z_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); } - var _z_ = _x_; + var _B_ = _z_; } - catch(_B_){ - var _u_ = caml_wrap_exception(_B_); - if(_u_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_u_, 0); + catch(_D_){ + var _w_ = caml_wrap_exception(_D_); + if(_w_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_w_, 0); var - _z_ = - /*<>*/ caml_call1 + _B_ = + /*<>*/ caml_call1 (Stdlib[53], cst_Fatal_error_out_of_memory_); } - /*<>*/ return _z_; + /*<>*/ return _B_; } - catch(_A_){ /*<>*/ return 0;} - /*<>*/ } - /*<>*/ /*<>*/ runtime.caml_register_named_value + catch(_C_){ /*<>*/ return 0;} + /*<>*/ } + /*<>*/ /*<>*/ runtime.caml_register_named_value ("Printexc.handle_uncaught_exception", handle_uncaught_exception); var Stdlib_Printexc = @@ -21967,7 +23078,7 @@ register_printer, use_printers, raw_backtrace_entries, - function(_t_){ /*<>*/ return caml_get_exception_raw_backtra(_t_);}, + function(_v_){ /*<>*/ return caml_get_exception_raw_backtra(_v_);}, print_raw_backtrace, raw_backtrace_to_string, default_uncaught_exception_han, @@ -21981,19 +23092,19 @@ backtrace_slot_defname, format_backtrace_slot], raw_backtrace_length, - function(_s_, _r_){ - /*<>*/ return runtime.caml_raw_backtrace_slot(_s_, _r_); + function(_u_, _t_){ + /*<>*/ return runtime.caml_raw_backtrace_slot(_u_, _t_); }, - function(_q_){ - /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_q_); + function(_s_){ + /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_s_); }, - function(_p_){ - /*<>*/ return runtime.caml_raw_backtrace_next_slot(_p_); + function(_r_){ + /*<>*/ return runtime.caml_raw_backtrace_next_slot(_r_); }, exn_slot_id, exn_slot_name, string_of_extension_constructo]; - runtime.caml_register_global(42, Stdlib_Printexc, "Stdlib__Printexc"); + runtime.caml_register_global(43, Stdlib_Printexc, "Stdlib__Printexc"); return; /*<>*/ } (globalThis)); @@ -22026,71 +23137,76 @@ function const$0(c, param){ /*<>*/ return c; /*<>*/ } + function compose(f, g, x){ + /*<>*/ return /*<>*/ caml_call1 + (f, /*<>*/ caml_call1(g, x)); + /*<>*/ } function flip(f, x, y){ - /*<>*/ return /*<>*/ caml_call2(f, y, x); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2(f, y, x); + /*<>*/ } function negate(p, v){ - /*<>*/ return 1 - /*<>*/ caml_call1(p, v); - /*<>*/ } - /*<>*/ var - /*<>*/ Finally_raised = + /*<>*/ return 1 - /*<>*/ caml_call1(p, v); + /*<>*/ } + /*<>*/ var + /*<>*/ Finally_raised = [248, "Stdlib.Fun.Finally_raised", runtime.caml_fresh_oo_id(0)], cst_Fun_Finally_raised = "Fun.Finally_raised: "; - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib_Printexc[9], function(param){ - /*<>*/ if(param[1] !== Finally_raised) - /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(param[1] !== Finally_raised) + /*<>*/ return 0; + /*<>*/ var exn = param[2], - /*<>*/ _a_ = - /*<>*/ caml_call1(Stdlib_Printexc[1], exn); - /*<>*/ return [0, - /*<>*/ caml_call2 + /*<>*/ _a_ = + /*<>*/ caml_call1(Stdlib_Printexc[1], exn); + /*<>*/ return [0, + /*<>*/ caml_call2 (Stdlib[28], cst_Fun_Finally_raised, _a_)]; - /*<>*/ }); + /*<>*/ }); function protect(finally$0, work){ function finally_no_exn(param){ - /*<>*/ try{ - /*<>*/ /*<>*/ caml_call1(finally$0, 0); - /*<>*/ return; + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call1(finally$0, 0); + /*<>*/ return; } catch(e$0){ - /*<>*/ var + /*<>*/ var e = caml_wrap_exception(e$0), - /*<>*/ bt = - /*<>*/ caml_call1(Stdlib_Printexc[12], 0), - /*<>*/ exn = [0, Finally_raised, e]; + /*<>*/ bt = + /*<>*/ caml_call1(Stdlib_Printexc[12], 0), + /*<>*/ exn = [0, Finally_raised, e]; caml_restore_raw_backtrace(exn, bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (exn, 0); } - /*<>*/ } - /*<>*/ try{ - /*<>*/ /*<>*/ var - result = /*<>*/ caml_call1(work, 0); + /*<>*/ } + /*<>*/ try{ + /*<>*/ /*<>*/ var + result = /*<>*/ caml_call1(work, 0); } catch(work_exn$0){ - /*<>*/ var + /*<>*/ var work_exn = caml_wrap_exception(work_exn$0), - /*<>*/ work_bt = - /*<>*/ caml_call1(Stdlib_Printexc[12], 0); - /*<>*/ finally_no_exn(0); + /*<>*/ work_bt = + /*<>*/ caml_call1(Stdlib_Printexc[12], 0); + /*<>*/ finally_no_exn(0); caml_restore_raw_backtrace(work_exn, work_bt); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (work_exn, 0); } - /*<>*/ finally_no_exn(0); - /*<>*/ return result; - /*<>*/ } - var Stdlib_Fun = [0, const$0, flip, negate, protect, Finally_raised]; + /*<>*/ finally_no_exn(0); + /*<>*/ return result; + /*<>*/ } + var + Stdlib_Fun = [0, const$0, compose, flip, negate, protect, Finally_raised]; runtime.caml_register_global(4, Stdlib_Fun, "Stdlib__Fun"); return; /*<>*/ } (globalThis)); //# unitInfo: Provides: Stdlib__Gc -//# unitInfo: Requires: Stdlib, Stdlib__Atomic, Stdlib__Fun, Stdlib__Printf, Stdlib__Sys +//# unitInfo: Requires: Stdlib, Stdlib__Atomic, Stdlib__Domain, Stdlib__Fun, Stdlib__Printf, Stdlib__Sys (function (globalThis){ "use strict"; @@ -22124,6 +23240,7 @@ global_data.Stdlib__Fun; var Stdlib = global_data.Stdlib, + Stdlib_Domain = global_data.Stdlib__Domain, Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Printf = global_data.Stdlib__Printf, _a_ = @@ -22258,30 +23375,33 @@ mi = match[1]; /*<>*/ return (mi + ma - pro) * (Stdlib_Sys[9] / 8 | 0); /*<>*/ } - function create_alarm(f){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Atomic[1], 1); - /*<>*/ } function delete_alarm(a){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Atomic[3], a, 0); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Atomic[4], a, 0); + /*<>*/ } + function create_alarm(f){ + /*<>*/ /*<>*/ var + _y_ = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], + function(param){ + /*<>*/ return delete_alarm(_y_); + /*<>*/ }); + return _y_; + /*<>*/ } + /*<>*/ /*<>*/ 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 start(sampling_rate, opt, tracker){ - /*<>*/ if(opt) - var sth = opt[1], callstack_size = sth; - else - var callstack_size = Stdlib[19]; - /*<>*/ return /*<>*/ runtime.caml_memprof_start + var callstack_size = opt ? opt[1] : Stdlib[19]; + /*<>*/ return /*<>*/ runtime.caml_memprof_start (sampling_rate, callstack_size, tracker); - /*<>*/ } + } var Stdlib_Gc = [0, @@ -22296,26 +23416,28 @@ delete_alarm, eventlog_pause, eventlog_resume, - [0, null_tracker, start, runtime.caml_memprof_stop]]; - runtime.caml_register_global(26, Stdlib_Gc, "Stdlib__Gc"); + [0, + null_tracker, + start, + runtime.caml_memprof_stop, + runtime.caml_memprof_discard]]; + runtime.caml_register_global(27, Stdlib_Gc, "Stdlib__Gc"); return; /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Digest -//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Char, Stdlib__String +//# unitInfo: Provides: Stdlib__In_channel +//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Fun, Stdlib__Sys (function (globalThis){ "use strict"; var runtime = globalThis.jsoo_runtime, - cst_Digest_from_hex$1 = "Digest.from_hex", - caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_ba_dim_1 = runtime.caml_ba_dim_1, caml_create_bytes = runtime.caml_create_bytes, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_md5_string = runtime.caml_md5_string, - caml_ml_string_length = runtime.caml_ml_string_length, - caml_string_get = runtime.caml_string_get, + caml_ml_bytes_length = runtime.caml_ml_bytes_length, + caml_ml_input_bigarray = runtime.caml_ml_input_bigarray, caml_wrap_exception = runtime.caml_wrap_exception; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -22327,169 +23449,359 @@ ? f(a0, a1) : runtime.caml_call_gen(f, [a0, a1]); } - var - global_data = runtime.caml_get_global_data(), - Stdlib = global_data.Stdlib, - Stdlib_Char = global_data.Stdlib__Char, + /*<>*/ 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(), + Stdlib = global_data.Stdlib, Stdlib_Bytes = global_data.Stdlib__Bytes, - Stdlib_String = global_data.Stdlib__String, - compare = Stdlib_String[10], - equal = Stdlib_String[9], - cst_Digest_substring = "Digest.substring", - cst_Digest_to_hex = "Digest.to_hex", - cst_Digest_from_hex = cst_Digest_from_hex$1, - cst_Digest_from_hex$0 = cst_Digest_from_hex$1; - function string(str){ - /*<>*/ return /*<>*/ caml_md5_string - (str, 0, caml_ml_string_length(str)); - /*<>*/ } - function bytes(b){ - /*<>*/ return string - ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); - /*<>*/ } - function substring(str, ofs, len){ - /*<>*/ if - (0 <= ofs && 0 <= len && (caml_ml_string_length(str) - len | 0) >= ofs) - /*<>*/ return /*<>*/ caml_md5_string - (str, ofs, len); - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Digest_substring); - /*<>*/ } - function subbytes(b, ofs, len){ - /*<>*/ return substring - ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), - ofs, - len); - /*<>*/ } - function file(filename){ - /*<>*/ /*<>*/ var - ic = /*<>*/ caml_call1(Stdlib[80], filename); - /*<>*/ try{ - /*<>*/ /*<>*/ var - d = /*<>*/ runtime.caml_md5_chan(ic, -1); + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Fun = global_data.Stdlib__Fun, + stdin = Stdlib[38], + open_bin = Stdlib[80], + open_text = Stdlib[79], + open_gen = Stdlib[81]; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + ic = /*<>*/ caml_call1(openfun, s); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[94], ic); + /*<>*/ }, + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, ic); + /*<>*/ }); + /*<>*/ } + function with_open_bin(s, f){ + /*<>*/ return with_open(Stdlib[80], s, f); + /*<>*/ } + function with_open_text(s, f){ + /*<>*/ return with_open(Stdlib[79], s, f); + /*<>*/ } + function with_open_gen(flags, perm, s, f){ + /*<>*/ return with_open + ( /*<>*/ caml_call2(Stdlib[81], flags, perm), + s, + f); + /*<>*/ } + var + seek = Stdlib[96][4], + pos = Stdlib[96][5], + length = Stdlib[96][6], + close = Stdlib[93], + close_noerr = Stdlib[94]; + function input_char(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + c = /*<>*/ caml_call1(Stdlib[82], ic); } - catch(e$0){ - var e = caml_wrap_exception(e$0); - /*<>*/ /*<>*/ caml_call1 - (Stdlib[93], ic); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - (e, 0); + catch(_x_){ + var _w_ = caml_wrap_exception(_x_); + if(_w_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_w_, 0); } - /*<>*/ /*<>*/ caml_call1 - (Stdlib[93], ic); - /*<>*/ return d; - /*<>*/ } - function output(chan, digest){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[66], chan, digest); - /*<>*/ } - function input(chan){ - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[86], chan, 16); - /*<>*/ } - function char_hex(n){ - /*<>*/ var _e_ = 10 <= n ? 87 : 48; - return n + _e_ | 0; - /*<>*/ } - function to_hex(d){ - /*<>*/ if(16 !== caml_ml_string_length(d)) - /*<>*/ /*<>*/ caml_call1 - (Stdlib[1], cst_Digest_to_hex); - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_create_bytes(32), - i = 0; - for(;;){ - /*<>*/ /*<>*/ var - x = /*<>*/ caml_string_get(d, i); - caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0)); - caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15)); - /*<>*/ /*<>*/ var _d_ = i + 1 | 0; - if(15 === i) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], result); - i = _d_; - } - /*<>*/ } - function from_hex(s){ - /*<>*/ if(32 !== caml_ml_string_length(s)) - /*<>*/ /*<>*/ caml_call1 - (Stdlib[1], cst_Digest_from_hex); - /*<>*/ function digit(c){ - /*<>*/ if(65 <= c){ - if(97 <= c){ - if(103 > c) return (c - 97 | 0) + 10 | 0; + /*<>*/ return [0, c]; + /*<>*/ } + function input_byte(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + n = /*<>*/ caml_call1(Stdlib[87], ic); + } + catch(_v_){ + var _u_ = caml_wrap_exception(_v_); + if(_u_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_u_, 0); + } + /*<>*/ return [0, n]; + /*<>*/ } + function input_line(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_t_){ + var _s_ = caml_wrap_exception(_t_); + if(_s_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_s_, 0); + } + /*<>*/ return [0, s]; + /*<>*/ } + var + input = Stdlib[84], + cst_input_bigarray = "input_bigarray", + _a_ = [0, 0], + _b_ = [0, 0], + cst_really_input_bigarray = "really_input_bigarray", + cst_In_channel_input_all_chann = + "In_channel.input_all: channel content is larger than maximum string length"; + function input_bigarray(ic, buf, ofs, len){ + /*<>*/ if + (0 <= ofs + && + 0 <= len + && ( /*<>*/ caml_ba_dim_1(buf) - len | 0) >= ofs) + /*<>*/ return /*<>*/ caml_ml_input_bigarray + (ic, buf, ofs, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_input_bigarray); + /*<>*/ } + function really_input(ic, buf, pos, len){ + /*<>*/ try{ + /*<>*/ /*<>*/ caml_call4 + (Stdlib[85], ic, buf, pos, len); + /*<>*/ return _a_; + } + catch(_r_){ + var _q_ = caml_wrap_exception(_r_); + if(_q_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_q_, 0); + } + /*<>*/ } + function really_input_bigarray(ic, buf, ofs$1, len$1){ + /*<>*/ if + (0 <= ofs$1 + && + 0 <= len$1 + && + ( /*<>*/ caml_ba_dim_1(buf) - len$1 | 0) >= ofs$1){ + var ofs = ofs$1, len = len$1; + /*<>*/ for(;;){ + if(0 >= len) /*<>*/ return _b_; + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_ml_input_bigarray + (ic, buf, ofs, len); + /*<>*/ if(0 === r) + /*<>*/ return 0; + var len$0 = len - r | 0, ofs$0 = ofs + r | 0; + ofs = ofs$0; + len = len$0; + } + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_really_input_bigarray); + /*<>*/ } + function really_input_string(ic, len){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + s = /*<>*/ caml_call2(Stdlib[86], ic, len); + } + catch(_p_){ + var _o_ = caml_wrap_exception(_p_); + if(_o_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_o_, 0); + } + /*<>*/ return [0, s]; + /*<>*/ } + function read_upto(ic, buf, ofs, len){ + /*<>*/ var ofs$0 = ofs, len$0 = len; + /*<>*/ for(;;){ + if(0 !== len$0){ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_call4 + (Stdlib[84], ic, buf, ofs$0, len$0); + /*<>*/ if(0 !== r){ + var len$1 = len$0 - r | 0, ofs$1 = ofs$0 + r | 0; + ofs$0 = ofs$1; + len$0 = len$1; + continue; } - else if(71 > c) return (c - 65 | 0) + 10 | 0; } - else if(9 >= c - 48 >>> 0) return c - 48 | 0; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], cst_Digest_from_hex$0], 1); - /*<>*/ } - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_create_bytes(16), - i = 0; + /*<>*/ return ofs$0 - ofs | 0; + } + /*<>*/ } + function ensure(buf, ofs, n){ + /*<>*/ var len = caml_ml_bytes_length(buf); + if((ofs + n | 0) <= len) /*<>*/ return buf; + /*<>*/ /*<>*/ var + new_len = [0, len]; for(;;){ - /*<>*/ var - i$0 = 2 * i | 0, - /*<>*/ _a_ = - digit( /*<>*/ caml_string_get(s, i$0 + 1 | 0)), - _b_ = - (digit( /*<>*/ caml_string_get(s, i$0)) << 4) + _a_ - | 0; - /*<>*/ /*<>*/ runtime.caml_bytes_set - (result, i, /*<>*/ caml_call1(Stdlib_Char[1], _b_)); - /*<>*/ /*<>*/ var _c_ = i + 1 | 0; - if(15 === i) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], result); - i = _c_; - } - /*<>*/ } + if(new_len[1] >= (ofs + n | 0)) break; + new_len[1] = (2 * new_len[1] | 0) + 1 | 0; + } + /*<>*/ var + new_len$0 = new_len[1], + new_len$1 = + new_len$0 <= Stdlib_Sys[12] + ? new_len$0 + : ofs + < Stdlib_Sys[12] + ? Stdlib_Sys[12] + : /*<>*/ caml_call1 + (Stdlib[2], cst_In_channel_input_all_chann), + /*<>*/ new_buf = + /*<>*/ caml_create_bytes(new_len$1); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Bytes[11], buf, 0, new_buf, 0, ofs); + /*<>*/ return new_buf; + /*<>*/ } + function input_all(ic){ + /*<>*/ /*<>*/ var + chunk_size = 65536; + /*<>*/ try{ + /*<>*/ var + /*<>*/ _k_ = + /*<>*/ caml_call1(Stdlib[91], ic), + /*<>*/ _l_ = + /*<>*/ caml_call1(Stdlib[92], ic) - _k_ | 0, + initial_size = _l_; + } + catch(_n_){ + var _i_ = caml_wrap_exception(_n_); + if(_i_[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(_i_, 0); + var initial_size = -1; + } + /*<>*/ var + /*<>*/ initial_size$0 = + 0 <= initial_size ? initial_size : chunk_size, + initial_size$1 = + initial_size$0 <= Stdlib_Sys[12] ? initial_size$0 : Stdlib_Sys[12], + /*<>*/ buf = + /*<>*/ caml_create_bytes(initial_size$1), + /*<>*/ nread = + read_upto(ic, buf, 0, initial_size$1); + if(nread < initial_size$1) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Bytes[8], buf, 0, nread); + /*<>*/ try{ + /*<>*/ /*<>*/ var + c = /*<>*/ caml_call1(Stdlib[82], ic); + } + catch(_m_){ + var _j_ = caml_wrap_exception(_m_); + if(_j_ === Stdlib[12]) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], buf); + throw caml_maybe_attach_backtrace(_j_, 0); + } + /*<>*/ /*<>*/ var + buf$2 = ensure(buf, nread, 65537); + /*<>*/ /*<>*/ runtime.caml_bytes_set + (buf$2, nread, c); + /*<>*/ var + /*<>*/ ofs$1 = nread + 1 | 0, + buf$0 = buf$2, + ofs = ofs$1; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ buf$1 = ensure(buf$0, ofs, chunk_size), + rem = caml_ml_bytes_length(buf$1) - ofs | 0, + /*<>*/ r = read_upto(ic, buf$1, ofs, rem); + if(r < rem) + /*<>*/ return /*<>*/ caml_call3 + (Stdlib_Bytes[8], buf$1, 0, ofs + r | 0); + var ofs$0 = ofs + rem | 0; + buf$0 = buf$1; + ofs = ofs$0; + } + /*<>*/ } + function input_lines(ic){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_h_){ + var _e_ = caml_wrap_exception(_h_); + if(_e_ === Stdlib[12]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_e_, 0); + } + /*<>*/ var + /*<>*/ block = [0, line, 24029], + dst = block, + offset = 1; + /*<>*/ for(;;){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line$0 = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_g_){ + var _f_ = caml_wrap_exception(_g_); + if(_f_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_f_, 0); + dst[1 + offset] = 0; + /*<>*/ return block; + } + /*<>*/ /*<>*/ var + dst$0 = [0, line$0, 24029]; + dst[1 + offset] = dst$0; + dst = dst$0; + offset = 1; + } + /*<>*/ } + function fold_lines(f, accu, ic){ + /*<>*/ var accu$0 = accu; + /*<>*/ for(;;){ + /*<>*/ try{ + /*<>*/ /*<>*/ var + line = /*<>*/ caml_call1(Stdlib[83], ic); + } + catch(_d_){ + var _c_ = caml_wrap_exception(_d_); + if(_c_ === Stdlib[12]) /*<>*/ return accu$0; + throw caml_maybe_attach_backtrace(_c_, 0); + } + /*<>*/ /*<>*/ var + accu$1 = /*<>*/ caml_call2(f, accu$0, line); + accu$0 = accu$1; + } + /*<>*/ } var - Stdlib_Digest = + set_binary_mode = Stdlib[95], + Stdlib_In_channel = [0, - compare, - equal, - string, - bytes, - substring, - subbytes, - file, - output, + stdin, + open_bin, + open_text, + open_gen, + with_open_bin, + with_open_text, + with_open_gen, + close, + close_noerr, + input_char, + input_byte, + input_line, + really_input_string, + input_all, + input_lines, input, - to_hex, - from_hex]; - runtime.caml_register_global(8, Stdlib_Digest, "Stdlib__Digest"); + input_bigarray, + really_input, + really_input_bigarray, + fold_lines, + seek, + pos, + length, + set_binary_mode, + runtime.caml_ml_is_binary_mode, + runtime.caml_sys_isatty]; + runtime.caml_register_global(9, Stdlib_In_channel, "Stdlib__In_channel"); return; /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Bigarray -//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Sys +//# unitInfo: Provides: Stdlib__Out_channel +//# unitInfo: Requires: Stdlib, Stdlib__Fun (function (globalThis){ "use strict"; - var - runtime = globalThis.jsoo_runtime, - cst_Bigarray_Array3_of_array_n$1 = - "Bigarray.Array3.of_array: non-cubic data", - 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, - caml_ba_dim_2 = runtime.caml_ba_dim_2, - caml_ba_kind = runtime.caml_ba_kind, - caml_ba_num_dims = runtime.caml_ba_num_dims, - caml_ba_reshape = runtime.caml_ba_reshape, - caml_ba_set_1 = runtime.caml_ba_set_1, - caml_ba_set_2 = runtime.caml_ba_set_2, - caml_ba_set_3 = runtime.caml_ba_set_3, - 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; + var runtime = globalThis.jsoo_runtime; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 ? f(a0) @@ -22499,14 +23811,481 @@ 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]); } var - undef = undefined, + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Fun = global_data.Stdlib__Fun, + stdout = Stdlib[39], + stderr = Stdlib[40], + open_bin = Stdlib[61], + open_text = Stdlib[60], + open_gen = Stdlib[62]; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + oc = /*<>*/ caml_call1(openfun, s); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[77], oc); + /*<>*/ }, + function(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, oc); + /*<>*/ }); + /*<>*/ } + function with_open_bin(s, f){ + /*<>*/ return with_open(Stdlib[61], s, f); + /*<>*/ } + function with_open_text(s, f){ + /*<>*/ return with_open(Stdlib[60], s, f); + /*<>*/ } + function with_open_gen(flags, perm, s, f){ + /*<>*/ return with_open + ( /*<>*/ caml_call2(Stdlib[62], flags, perm), + s, + f); + /*<>*/ } + var + seek = Stdlib[96][1], + pos = Stdlib[96][2], + length = Stdlib[96][3], + close = Stdlib[76], + close_noerr = Stdlib[77], + flush = Stdlib[63], + flush_all = Stdlib[64], + output_char = Stdlib[65], + output_byte = Stdlib[70], + output_string = Stdlib[66], + output_bytes = Stdlib[67], + output = Stdlib[68], + output_substring = Stdlib[69], + cst_output_bigarray = "output_bigarray"; + function output_bigarray(oc, buf, ofs, len){ + /*<>*/ if + (0 <= ofs + && + 0 <= len + && + ( /*<>*/ runtime.caml_ba_dim_1(buf) - len | 0) + >= ofs) + /*<>*/ return /*<>*/ runtime.caml_ml_output_bigarray + (oc, buf, ofs, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_output_bigarray); + /*<>*/ } + var + set_binary_mode = Stdlib[78], + Stdlib_Out_channel = + [0, + stdout, + stderr, + open_bin, + open_text, + open_gen, + with_open_bin, + with_open_text, + with_open_gen, + close, + close_noerr, + output_char, + output_byte, + output_string, + output_bytes, + output, + output_substring, + output_bigarray, + flush, + flush_all, + seek, + pos, + length, + set_binary_mode, + runtime.caml_ml_is_binary_mode, + runtime.caml_ml_set_buffered, + runtime.caml_ml_is_buffered, + runtime.caml_sys_isatty]; + runtime.caml_register_global(3, Stdlib_Out_channel, "Stdlib__Out_channel"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Digest +//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Char, Stdlib__In_channel, Stdlib__Int, Stdlib__String +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst = "", + cst_Digest_of_hex$1 = "Digest.of_hex", + cst_Digest_substring$1 = "Digest.substring", + cst_Digest_to_hex$1 = "Digest.to_hex", + caml_blake2_final = runtime.caml_blake2_final, + caml_blake2_string = runtime.caml_blake2_string, + caml_blake2_update = runtime.caml_blake2_update, + caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_md5_chan = runtime.caml_md5_chan, + caml_md5_string = runtime.caml_md5_string, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get; + /*<>*/ 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_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]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_In_channel = global_data.Stdlib__In_channel, + Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib_String = global_data.Stdlib__String, + Stdlib_Char = global_data.Stdlib__Char, + cst_Digest_of_hex = cst_Digest_of_hex$1, + cst_Digest_BLAKE2_wrong_hash_s = "Digest.BLAKE2: wrong hash size", + cst_Digest_substring = cst_Digest_substring$1, + cst_Digest_to_hex = cst_Digest_to_hex$1, + cst_Digest_of_hex$0 = cst_Digest_of_hex$1; + function hex_of_string(d){ + /*<>*/ function char_hex(n){ + /*<>*/ var + _l_ = 10 <= n ? (97 + n | 0) - 10 | 0 : 48 + n | 0; + return caml_call1(Stdlib_Char[1], _l_); + /*<>*/ } + /*<>*/ var + /*<>*/ len = + /*<>*/ caml_ml_string_length(d), + /*<>*/ result = + /*<>*/ caml_create_bytes(len * 2 | 0), + /*<>*/ _j_ = len - 1 | 0, + /*<>*/ _i_ = 0; + if(_j_ >= 0){ + var i = _i_; + for(;;){ + /*<>*/ /*<>*/ var + x = /*<>*/ caml_string_get(d, i); + caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0)); + caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15)); + /*<>*/ /*<>*/ var _k_ = i + 1 | 0; + if(_j_ === i) break; + i = _k_; + } + } + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Bytes[44], result); + /*<>*/ } + function string_of_hex(s){ + /*<>*/ function digit(c){ + /*<>*/ if(65 <= c){ + if(97 <= c){ + if(103 > c) return (c - 97 | 0) + 10 | 0; + } + else if(71 > c) return (c - 65 | 0) + 10 | 0; + } + else if(9 >= c - 48 >>> 0) return c - 48 | 0; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_of_hex); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_String[2], + caml_ml_string_length(s) / 2 | 0, + function(i){ + /*<>*/ var + i$0 = 2 * i | 0, + /*<>*/ _g_ = + digit + ( /*<>*/ caml_string_get(s, i$0 + 1 | 0)), + _h_ = + (digit( /*<>*/ caml_string_get(s, i$0)) + << 4) + + _g_ + | 0; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Char[1], _h_); + /*<>*/ }); + /*<>*/ } + function BLAKE2(X){ + var _a_ = X[1] < 1 ? 1 : 0, _b_ = _a_ || (64 < X[1] ? 1 : 0); + if(_b_) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_BLAKE2_wrong_hash_s); + var + hash_length = X[1], + compare = Stdlib_String[10], + equal = Stdlib_String[9]; + function string(str){ + /*<>*/ return /*<>*/ caml_blake2_string + (hash_length, cst, str, 0, caml_ml_string_length(str)); + /*<>*/ } + function bytes(b){ + /*<>*/ return string + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); + /*<>*/ } + function substring(str, ofs, len){ + /*<>*/ var _d_ = ofs < 0 ? 1 : 0; + if(_d_) + var _e_ = _d_; + else + var + _f_ = len < 0 ? 1 : 0, + _e_ = _f_ || ((caml_ml_string_length(str) - len | 0) < ofs ? 1 : 0); + if(_e_) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_substring); + /*<>*/ return /*<>*/ caml_blake2_string + (hash_length, cst, str, ofs, len); + /*<>*/ } + function subbytes(b, ofs, len){ + /*<>*/ return substring + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), + ofs, + len); + /*<>*/ } + function channel(ic, toread){ + /*<>*/ var + /*<>*/ buf_size = 4096, + /*<>*/ buf = + /*<>*/ caml_create_bytes(4096), + /*<>*/ ctx = + /*<>*/ runtime.caml_blake2_create(hash_length, cst); + /*<>*/ if(0 <= toread){ + var toread$0 = toread; + /*<>*/ for(;;){ + if(0 === toread$0) + /*<>*/ return /*<>*/ caml_blake2_final + (ctx, hash_length); + /*<>*/ var + /*<>*/ _c_ = + /*<>*/ caml_call2 + (Stdlib_Int[10], buf_size, toread$0), + /*<>*/ n = + /*<>*/ caml_call4 + (Stdlib_In_channel[16], ic, buf, 0, _c_); + /*<>*/ if(0 === n) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[12], 1); + /*<>*/ /*<>*/ caml_blake2_update + (ctx, + /*<>*/ caml_call1(Stdlib_Bytes[44], buf), + 0, + n); + var toread$1 = toread$0 - n | 0; + toread$0 = toread$1; + } + } + else + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + n$0 = + /*<>*/ caml_call4 + (Stdlib_In_channel[16], ic, buf, 0, buf_size); + /*<>*/ if(0 === n$0) + /*<>*/ return /*<>*/ caml_blake2_final + (ctx, hash_length); + /*<>*/ /*<>*/ caml_blake2_update + (ctx, + /*<>*/ caml_call1(Stdlib_Bytes[44], buf), + 0, + n$0); + } + /*<>*/ } + function file(filename){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], + filename, + function(ic){ + /*<>*/ return channel(ic, -1); + /*<>*/ }); + /*<>*/ } + function output(chan, digest){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[66], chan, digest); + /*<>*/ } + function input(chan){ + /*<>*/ return caml_call2 + (Stdlib[86], chan, hash_length); + /*<>*/ } + function to_hex(d){ + /*<>*/ if(caml_ml_string_length(d) !== hash_length) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_to_hex); + /*<>*/ return hex_of_string(d); + /*<>*/ } + function of_hex(s){ + /*<>*/ if + (caml_ml_string_length(s) !== (hash_length * 2 | 0)) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_of_hex$0); + /*<>*/ return string_of_hex(s); + /*<>*/ } + /*<>*/ return [0, + hash_length, + compare, + equal, + string, + bytes, + substring, + subbytes, + channel, + file, + output, + input, + to_hex, + of_hex]; + } + var + BLAKE128 = BLAKE2([0, 16]), + BLAKE256 = BLAKE2([0, 32]), + BLAKE512 = BLAKE2([0, 64]), + compare = Stdlib_String[10], + equal = Stdlib_String[9], + cst_Digest_substring$0 = cst_Digest_substring$1, + cst_Digest_to_hex$0 = cst_Digest_to_hex$1, + cst_Digest_from_hex = "Digest.from_hex"; + function string(str){ + /*<>*/ return /*<>*/ caml_md5_string + (str, 0, caml_ml_string_length(str)); + /*<>*/ } + function bytes(b){ + /*<>*/ return string + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b)); + /*<>*/ } + function substring(str, ofs, len){ + /*<>*/ if + (0 <= ofs && 0 <= len && (caml_ml_string_length(str) - len | 0) >= ofs) + /*<>*/ return /*<>*/ caml_md5_string + (str, ofs, len); + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_substring$0); + /*<>*/ } + function subbytes(b, ofs, len){ + /*<>*/ return substring + ( /*<>*/ caml_call1(Stdlib_Bytes[44], b), + ofs, + len); + /*<>*/ } + function file(filename){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], + filename, + function(ic){ + /*<>*/ return /*<>*/ caml_md5_chan + (ic, -1); + /*<>*/ }); + /*<>*/ } + function output(chan, digest){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[66], chan, digest); + /*<>*/ } + function input(chan){ + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[86], chan, 16); + /*<>*/ } + function to_hex(d){ + /*<>*/ if(16 !== caml_ml_string_length(d)) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_to_hex$0); + /*<>*/ return hex_of_string(d); + /*<>*/ } + function of_hex(s){ + /*<>*/ if(32 !== caml_ml_string_length(s)) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_from_hex); + /*<>*/ return string_of_hex(s); + /*<>*/ } + var + Stdlib_Digest = + [0, + compare, + equal, + string, + bytes, + substring, + subbytes, + caml_md5_chan, + file, + output, + input, + to_hex, + of_hex, + of_hex, + BLAKE128, + BLAKE256, + BLAKE512, + [0, + 16, + compare, + equal, + string, + bytes, + substring, + subbytes, + caml_md5_chan, + file, + output, + input, + to_hex, + of_hex]]; + runtime.caml_register_global(17, Stdlib_Digest, "Stdlib__Digest"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Bigarray +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Sys +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_Bigarray_Array3_of_array_n$1 = + "Bigarray.Array3.of_array: non-cubic data", + 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, + caml_ba_dim_2 = runtime.caml_ba_dim_2, + caml_ba_kind = runtime.caml_ba_kind, + caml_ba_num_dims = runtime.caml_ba_num_dims, + caml_ba_reshape = runtime.caml_ba_reshape, + caml_ba_set_1 = runtime.caml_ba_set_1, + caml_ba_set_2 = runtime.caml_ba_set_2, + caml_ba_set_3 = runtime.caml_ba_set_3, + 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 + ? 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]); + } + var + undef = undefined, global_data = runtime.caml_get_global_data(), Stdlib = global_data.Stdlib, Stdlib_Array = global_data.Stdlib__Array, @@ -22514,30 +24293,32 @@ function kind_size_in_bytes(param){ /*<>*/ switch(param){ case 0: - /*<>*/ return 4; + /*<>*/ return 4; case 1: - /*<>*/ return 8; + /*<>*/ return 8; case 2: - /*<>*/ return 1; + /*<>*/ return 1; case 3: - /*<>*/ return 1; + /*<>*/ return 1; case 4: - /*<>*/ return 2; + /*<>*/ return 2; case 5: - /*<>*/ return 2; + /*<>*/ return 2; case 6: - /*<>*/ return 4; + /*<>*/ return 4; case 7: - /*<>*/ return 8; + /*<>*/ return 8; case 8: return Stdlib_Sys[9] / 8 | 0; case 9: return Stdlib_Sys[9] / 8 | 0; case 10: - /*<>*/ return 8; + /*<>*/ return 8; case 11: - /*<>*/ return 16; - default: /*<>*/ return 1; + /*<>*/ return 16; + case 12: + /*<>*/ return 1; + default: /*<>*/ return 2; } } var @@ -22550,546 +24331,547 @@ cst_Bigarray_array2_of_genarra = "Bigarray.array2_of_genarray", cst_Bigarray_array3_of_genarra = "Bigarray.array3_of_genarray"; function cloop(arr, idx, f, col, max){ - /*<>*/ if(col === idx.length - 1){ - /*<>*/ /*<>*/ caml_ba_set_generic - (arr, idx, /*<>*/ caml_call1(f, idx)); - /*<>*/ return; + /*<>*/ if(col === idx.length - 1){ + /*<>*/ /*<>*/ caml_ba_set_generic + (arr, idx, /*<>*/ caml_call1(f, idx)); + /*<>*/ return; } - /*<>*/ var - /*<>*/ _am_ = + /*<>*/ var + /*<>*/ _am_ = caml_check_bound(max, col)[1 + col] - 1 | 0, - /*<>*/ _al_ = 0; + /*<>*/ _al_ = 0; if(_am_ >= 0){ var j = _al_; for(;;){ - /*<>*/ caml_check_bound(idx, col)[1 + col] = j; - /*<>*/ cloop(arr, idx, f, col + 1 | 0, max); - /*<>*/ /*<>*/ var + /*<>*/ caml_check_bound(idx, col)[1 + col] = j; + /*<>*/ cloop(arr, idx, f, col + 1 | 0, max); + /*<>*/ /*<>*/ var _an_ = j + 1 | 0; if(_am_ === j) break; j = _an_; } } return; - /*<>*/ } + /*<>*/ } function floop(arr, idx, f, col, max){ - /*<>*/ if(0 > col){ - /*<>*/ /*<>*/ caml_ba_set_generic - (arr, idx, /*<>*/ caml_call1(f, idx)); - /*<>*/ return; - } - /*<>*/ var - /*<>*/ _aj_ = caml_check_bound(max, col)[1 + col], - /*<>*/ _ai_ = 1; + /*<>*/ if(0 > col){ + /*<>*/ /*<>*/ caml_ba_set_generic + (arr, idx, /*<>*/ caml_call1(f, idx)); + /*<>*/ return; + } + /*<>*/ var + /*<>*/ _aj_ = caml_check_bound(max, col)[1 + col], + /*<>*/ _ai_ = 1; if(_aj_ >= 1){ var j = _ai_; for(;;){ - /*<>*/ caml_check_bound(idx, col)[1 + col] = j; - /*<>*/ floop(arr, idx, f, col - 1 | 0, max); - /*<>*/ /*<>*/ var + /*<>*/ caml_check_bound(idx, col)[1 + col] = j; + /*<>*/ floop(arr, idx, f, col - 1 | 0, max); + /*<>*/ /*<>*/ var _ak_ = j + 1 | 0; if(_aj_ === j) break; j = _ak_; } } return; - /*<>*/ } + /*<>*/ } function init(kind, layout, dims, f){ - /*<>*/ var - /*<>*/ arr = - /*<>*/ caml_ba_create(kind, layout, dims), - /*<>*/ dlen = dims.length - 1; - /*<>*/ return layout + /*<>*/ var + /*<>*/ arr = + /*<>*/ caml_ba_create(kind, layout, dims), + /*<>*/ dlen = dims.length - 1; + /*<>*/ return layout ? (floop (arr, - /*<>*/ caml_make_vect(dlen, 1), + /*<>*/ caml_make_vect(dlen, 1), f, dlen - 1 | 0, dims), arr) : (cloop (arr, - /*<>*/ caml_make_vect(dlen, 0), + /*<>*/ caml_make_vect(dlen, 0), f, 0, dims), arr); - /*<>*/ } + /*<>*/ } function dims(a){ - /*<>*/ var - /*<>*/ n = - /*<>*/ caml_ba_num_dims(a), - /*<>*/ d = - /*<>*/ caml_make_vect(n, 0), - /*<>*/ _af_ = n - 1 | 0, - /*<>*/ _ae_ = 0; + /*<>*/ var + /*<>*/ n = + /*<>*/ caml_ba_num_dims(a), + /*<>*/ d = + /*<>*/ caml_make_vect(n, 0), + /*<>*/ _af_ = n - 1 | 0, + /*<>*/ _ae_ = 0; if(_af_ >= 0){ var i = _ae_; for(;;){ - /*<>*/ /*<>*/ var - _ag_ = /*<>*/ runtime.caml_ba_dim(a, i); - /*<>*/ caml_check_bound(d, i)[1 + i] = _ag_; - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var + _ag_ = /*<>*/ runtime.caml_ba_dim(a, i); + /*<>*/ caml_check_bound(d, i)[1 + i] = _ag_; + /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; if(_af_ === i) break; i = _ah_; } } - /*<>*/ return d; - /*<>*/ } + /*<>*/ return d; + /*<>*/ } function size_in_bytes(arr){ - /*<>*/ var - /*<>*/ _ac_ = dims(arr), - /*<>*/ _ad_ = - /*<>*/ caml_call3 - (Stdlib_Array[17], caml_mul, 1, _ac_); - /*<>*/ return /*<>*/ caml_mul - (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), + /*<>*/ var + /*<>*/ _ac_ = dims(arr), + /*<>*/ _ad_ = + /*<>*/ caml_call3 + (Stdlib_Array[18], caml_mul, 1, _ac_); + /*<>*/ return /*<>*/ caml_mul + (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), _ad_); - /*<>*/ } + /*<>*/ } function create(kind, layout){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0]); - /*<>*/ } + /*<>*/ } function get(arr){ - /*<>*/ return /*<>*/ runtime.caml_ba_get_generic + /*<>*/ return /*<>*/ runtime.caml_ba_get_generic (arr, [0]); - /*<>*/ } + /*<>*/ } function set(arr){ - /*<>*/ /*<>*/ var _aa_ = [0]; - /*<>*/ return function(_ab_){ + /*<>*/ /*<>*/ var _aa_ = [0]; + /*<>*/ return function(_ab_){ /*<>*/ return caml_ba_set_generic(arr, _aa_, _ab_);}; - /*<>*/ } + /*<>*/ } function size_in_bytes$0(arr){ - /*<>*/ return kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)); - /*<>*/ } + /*<>*/ return kind_size_in_bytes + ( /*<>*/ caml_ba_kind(arr)); + /*<>*/ } function of_value(kind, layout, v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var a = create(kind, layout); - /*<>*/ set(a)(v); - /*<>*/ return a; - /*<>*/ } + /*<>*/ set(a)(v); + /*<>*/ return a; + /*<>*/ } function create$0(kind, layout, dim){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim]); - /*<>*/ } + /*<>*/ } function size_in_bytes$1(arr){ - /*<>*/ /*<>*/ var - _$_ = /*<>*/ caml_ba_dim_1(arr); - /*<>*/ return /*<>*/ caml_mul - (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), + /*<>*/ /*<>*/ var + _$_ = /*<>*/ caml_ba_dim_1(arr); + /*<>*/ return /*<>*/ caml_mul + (kind_size_in_bytes( /*<>*/ caml_ba_kind(arr)), _$_); - /*<>*/ } + /*<>*/ } function slice(a, n){ - /*<>*/ return /*<>*/ runtime.caml_ba_layout + /*<>*/ return /*<>*/ runtime.caml_ba_layout (a) - ? /*<>*/ caml_ba_slice(a, [0, n]) - : /*<>*/ caml_ba_slice(a, [0, n]); - /*<>*/ } + ? /*<>*/ caml_ba_slice(a, [0, n]) + : /*<>*/ caml_ba_slice(a, [0, n]); + /*<>*/ } function init$0(kind, layout, dim, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$0(kind, layout, dim); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _Z_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _Z_ = 1; if(dim >= 1){ var i$0 = _Z_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 - (arr, i$0, /*<>*/ caml_call1(f, i$0)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_1 + (arr, i$0, /*<>*/ caml_call1(f, i$0)); + /*<>*/ /*<>*/ var ___ = i$0 + 1 | 0; if(dim === i$0) break; i$0 = ___; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _X_ = dim - 1 | 0, - /*<>*/ _W_ = 0; + /*<>*/ _W_ = 0; if(_X_ >= 0){ var i = _W_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 - (arr, i, /*<>*/ caml_call1(f, i)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_1 + (arr, i, /*<>*/ caml_call1(f, i)); + /*<>*/ /*<>*/ var _Y_ = i + 1 | 0; if(_X_ === i) break; i = _Y_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array(kind, layout, data){ - /*<>*/ var - /*<>*/ ba = create$0(kind, layout, data.length - 1), - /*<>*/ ofs = layout ? 1 : 0, + /*<>*/ var + /*<>*/ ba = create$0(kind, layout, data.length - 1), + /*<>*/ ofs = layout ? 1 : 0, _U_ = data.length - 2 | 0, _T_ = 0; if(_U_ >= 0){ var i = _T_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_1 + /*<>*/ /*<>*/ caml_ba_set_1 (ba, i + ofs | 0, caml_check_bound(data, i)[1 + i]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _V_ = i + 1 | 0; if(_U_ === i) break; i = _V_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function create$1(kind, layout, dim1, dim2){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim1, dim2]); - /*<>*/ } + /*<>*/ } function size_in_bytes$2(arr){ - /*<>*/ var - /*<>*/ _R_ = - /*<>*/ caml_ba_dim_2(arr), - /*<>*/ _S_ = - /*<>*/ caml_ba_dim_1(arr); + /*<>*/ var + /*<>*/ _R_ = + /*<>*/ caml_ba_dim_2(arr), + /*<>*/ _S_ = + /*<>*/ caml_ba_dim_1(arr); return caml_mul - ( /*<>*/ caml_mul + ( /*<>*/ caml_mul (kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)), + ( /*<>*/ caml_ba_kind(arr)), _S_), _R_); - /*<>*/ } + /*<>*/ } function slice_left(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function slice_right(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function init$1(kind, layout, dim1, dim2, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$1(kind, layout, dim1, dim2); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _N_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _N_ = 1; if(dim2 >= 1){ var j$0 = _N_; for(;;){ - /*<>*/ /*<>*/ var _O_ = 1; + /*<>*/ /*<>*/ var _O_ = 1; if(dim1 >= 1){ var i$0 = _O_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 - (arr, i$0, j$0, /*<>*/ caml_call2(f, i$0, j$0)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_2 + (arr, i$0, j$0, /*<>*/ caml_call2(f, i$0, j$0)); + /*<>*/ /*<>*/ var _Q_ = i$0 + 1 | 0; if(dim1 === i$0) break; i$0 = _Q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _P_ = j$0 + 1 | 0; if(dim2 === j$0) break; j$0 = _P_; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _I_ = dim1 - 1 | 0, - /*<>*/ _H_ = 0; + /*<>*/ _H_ = 0; if(_I_ >= 0){ var i = _H_; for(;;){ - /*<>*/ var + /*<>*/ var _K_ = dim2 - 1 | 0, - /*<>*/ _J_ = 0; + /*<>*/ _J_ = 0; if(_K_ >= 0){ var j = _J_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 - (arr, i, j, /*<>*/ caml_call2(f, i, j)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_2 + (arr, i, j, /*<>*/ caml_call2(f, i, j)); + /*<>*/ /*<>*/ var _M_ = j + 1 | 0; if(_K_ === j) break; j = _M_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _L_ = i + 1 | 0; if(_I_ === i) break; i = _L_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array$0(kind, layout, data){ - /*<>*/ var + /*<>*/ var dim1 = data.length - 1, - /*<>*/ dim2 = + /*<>*/ dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1, - /*<>*/ ba = create$1(kind, layout, dim1, dim2), - /*<>*/ ofs = layout ? 1 : 0, - /*<>*/ _C_ = dim1 - 1 | 0, + /*<>*/ ba = create$1(kind, layout, dim1, dim2), + /*<>*/ ofs = layout ? 1 : 0, + /*<>*/ _C_ = dim1 - 1 | 0, _B_ = 0; if(_C_ >= 0){ var i = _B_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var row = caml_check_bound(data, i)[1 + i]; if(row.length - 1 !== dim2) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array2_of_array_n); - /*<>*/ var - /*<>*/ _E_ = dim2 - 1 | 0, - /*<>*/ _D_ = 0; + /*<>*/ var + /*<>*/ _E_ = dim2 - 1 | 0, + /*<>*/ _D_ = 0; if(_E_ >= 0){ var j = _D_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_2 + /*<>*/ /*<>*/ caml_ba_set_2 (ba, i + ofs | 0, j + ofs | 0, caml_check_bound(row, j)[1 + j]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _G_ = j + 1 | 0; if(_E_ === j) break; j = _G_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _F_ = i + 1 | 0; if(_C_ === i) break; i = _F_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function create$2(kind, layout, dim1, dim2, dim3){ - /*<>*/ return /*<>*/ caml_ba_create + /*<>*/ return /*<>*/ caml_ba_create (kind, layout, [0, dim1, dim2, dim3]); - /*<>*/ } + /*<>*/ } function size_in_bytes$3(arr){ - /*<>*/ var - /*<>*/ _y_ = - /*<>*/ runtime.caml_ba_dim_3(arr), - /*<>*/ _z_ = - /*<>*/ caml_ba_dim_2(arr), - /*<>*/ _A_ = - /*<>*/ caml_ba_dim_1(arr); + /*<>*/ var + /*<>*/ _y_ = + /*<>*/ runtime.caml_ba_dim_3(arr), + /*<>*/ _z_ = + /*<>*/ caml_ba_dim_2(arr), + /*<>*/ _A_ = + /*<>*/ caml_ba_dim_1(arr); return caml_mul (caml_mul - ( /*<>*/ caml_mul + ( /*<>*/ caml_mul (kind_size_in_bytes - ( /*<>*/ caml_ba_kind(arr)), + ( /*<>*/ caml_ba_kind(arr)), _A_), _z_), _y_); - /*<>*/ } + /*<>*/ } function slice_left_1(a, n, m){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n, m]); - /*<>*/ } + /*<>*/ } function slice_right_1(a, n, m){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n, m]); - /*<>*/ } + /*<>*/ } function slice_left_2(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function slice_right_2(a, n){ - /*<>*/ return /*<>*/ caml_ba_slice + /*<>*/ return /*<>*/ caml_ba_slice (a, [0, n]); - /*<>*/ } + /*<>*/ } function init$2(kind, layout, dim1, dim2, dim3, f){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var arr = create$2(kind, layout, dim1, dim2, dim3); - /*<>*/ if(layout){ - /*<>*/ /*<>*/ var _s_ = 1; + /*<>*/ if(layout){ + /*<>*/ /*<>*/ var _s_ = 1; if(dim3 >= 1){ var k$0 = _s_; for(;;){ - /*<>*/ /*<>*/ var _t_ = 1; + /*<>*/ /*<>*/ var _t_ = 1; if(dim2 >= 1){ var j$0 = _t_; for(;;){ - /*<>*/ /*<>*/ var _v_ = 1; + /*<>*/ /*<>*/ var _v_ = 1; if(dim1 >= 1){ var i$0 = _v_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 + /*<>*/ /*<>*/ caml_ba_set_3 (arr, i$0, j$0, k$0, - /*<>*/ caml_call3(f, i$0, j$0, k$0)); - /*<>*/ /*<>*/ var + /*<>*/ caml_call3(f, i$0, j$0, k$0)); + /*<>*/ /*<>*/ var _x_ = i$0 + 1 | 0; if(dim1 === i$0) break; i$0 = _x_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _w_ = j$0 + 1 | 0; if(dim2 === j$0) break; j$0 = _w_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _u_ = k$0 + 1 | 0; if(dim3 === k$0) break; k$0 = _u_; } } - /*<>*/ return arr; + /*<>*/ return arr; } - /*<>*/ var + /*<>*/ var _k_ = dim1 - 1 | 0, - /*<>*/ _j_ = 0; + /*<>*/ _j_ = 0; if(_k_ >= 0){ var i = _j_; for(;;){ - /*<>*/ var + /*<>*/ var _m_ = dim2 - 1 | 0, - /*<>*/ _l_ = 0; + /*<>*/ _l_ = 0; if(_m_ >= 0){ var j = _l_; for(;;){ - /*<>*/ var + /*<>*/ var _p_ = dim3 - 1 | 0, - /*<>*/ _o_ = 0; + /*<>*/ _o_ = 0; if(_p_ >= 0){ var k = _o_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 - (arr, i, j, k, /*<>*/ caml_call3(f, i, j, k)); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ caml_ba_set_3 + (arr, i, j, k, /*<>*/ caml_call3(f, i, j, k)); + /*<>*/ /*<>*/ var _r_ = k + 1 | 0; if(_p_ === k) break; k = _r_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _q_ = j + 1 | 0; if(_m_ === j) break; j = _q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _n_ = i + 1 | 0; if(_k_ === i) break; i = _n_; } } - /*<>*/ return arr; - /*<>*/ } + /*<>*/ return arr; + /*<>*/ } function of_array$1(kind, layout, data){ - /*<>*/ var + /*<>*/ var dim1 = data.length - 1, - /*<>*/ dim2 = + /*<>*/ dim2 = 0 === dim1 ? 0 : caml_check_bound(data, 0)[1].length - 1, - /*<>*/ dim3 = + /*<>*/ dim3 = 0 === dim2 ? 0 : caml_check_bound(caml_check_bound(data, 0)[1], 0)[1].length - 1, - /*<>*/ ba = create$2(kind, layout, dim1, dim2, dim3), - /*<>*/ ofs = layout ? 1 : 0, - /*<>*/ _b_ = dim1 - 1 | 0, + /*<>*/ ba = create$2(kind, layout, dim1, dim2, dim3), + /*<>*/ ofs = layout ? 1 : 0, + /*<>*/ _b_ = dim1 - 1 | 0, _a_ = 0; if(_b_ >= 0){ var i = _a_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var row = caml_check_bound(data, i)[1 + i]; if(row.length - 1 !== dim2) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array3_of_array_n); - /*<>*/ var - /*<>*/ _d_ = dim2 - 1 | 0, - /*<>*/ _c_ = 0; + /*<>*/ var + /*<>*/ _d_ = dim2 - 1 | 0, + /*<>*/ _c_ = 0; if(_d_ >= 0){ var j = _c_; for(;;){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var col = caml_check_bound(row, j)[1 + j]; if(col.length - 1 !== dim3) - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_Array3_of_array_n$0); - /*<>*/ var - /*<>*/ _g_ = dim3 - 1 | 0, - /*<>*/ _f_ = 0; + /*<>*/ var + /*<>*/ _g_ = dim3 - 1 | 0, + /*<>*/ _f_ = 0; if(_g_ >= 0){ var k = _f_; for(;;){ - /*<>*/ /*<>*/ caml_ba_set_3 + /*<>*/ /*<>*/ caml_ba_set_3 (ba, i + ofs | 0, j + ofs | 0, k + ofs | 0, caml_check_bound(col, k)[1 + k]); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _i_ = k + 1 | 0; if(_g_ === k) break; k = _i_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _h_ = j + 1 | 0; if(_d_ === j) break; j = _h_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _e_ = i + 1 | 0; if(_b_ === i) break; i = _e_; } } - /*<>*/ return ba; - /*<>*/ } + /*<>*/ return ba; + /*<>*/ } function array0_of_genarray(a){ - /*<>*/ return 0 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 0 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array0_of_genarra); - /*<>*/ } + /*<>*/ } function array1_of_genarray(a){ - /*<>*/ return 1 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 1 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array1_of_genarra); - /*<>*/ } + /*<>*/ } function array2_of_genarray(a){ - /*<>*/ return 2 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 2 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array2_of_genarra); - /*<>*/ } + /*<>*/ } function array3_of_genarray(a){ - /*<>*/ return 3 - === /*<>*/ caml_ba_num_dims(a) + /*<>*/ return 3 + === /*<>*/ caml_ba_num_dims(a) ? a - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Bigarray_array3_of_genarra); - /*<>*/ } + /*<>*/ } function reshape_0(a){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0]); - /*<>*/ } + /*<>*/ } function reshape_1(a, dim1){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1]); - /*<>*/ } + /*<>*/ } function reshape_2(a, dim1, dim2){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1, dim2]); - /*<>*/ } + /*<>*/ } function reshape_3(a, dim1, dim2, dim3){ - /*<>*/ return /*<>*/ caml_ba_reshape + /*<>*/ return /*<>*/ caml_ba_reshape (a, [0, dim1, dim2, dim3]); - /*<>*/ } + /*<>*/ } var Stdlib_Bigarray = [0, + 13, 0, 1, 10, @@ -23166,11 +24948,13 @@ caml_bytes_set = runtime.caml_bytes_set, caml_create_bytes = runtime.caml_create_bytes, caml_greaterthan = runtime.caml_greaterthan, + caml_int64_add = runtime.caml_int64_add, caml_int64_of_int32 = runtime.caml_int64_of_int32, caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned, caml_int64_sub = runtime.caml_int64_sub, caml_int64_to_int32 = runtime.caml_int64_to_int32, caml_lessequal = runtime.caml_lessequal, + caml_lessthan = runtime.caml_lessthan, caml_lxm_next = runtime.caml_lxm_next, caml_mod = runtime.caml_mod, caml_notequal = runtime.caml_notequal, @@ -23199,13 +24983,13 @@ global_data = runtime.caml_get_global_data(), serialization_prefix = "lxm1:", Stdlib_Domain = global_data.Stdlib__Domain, - Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Int32 = global_data.Stdlib__Int32, Stdlib_Int64 = global_data.Stdlib__Int64, + Stdlib = global_data.Stdlib, Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib_Digest = global_data.Stdlib__Digest, Stdlib_String = global_data.Stdlib__String, - Stdlib_Sys = global_data.Stdlib__Sys, Stdlib_Bigarray = global_data.Stdlib__Bigarray, Stdlib_Nativeint = global_data.Stdlib__Nativeint, _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), @@ -23215,7 +24999,7 @@ _e_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0); function create(param){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bigarray[19][1], 7, 0, 4); + (Stdlib_Bigarray[20][1], 7, 0, 4); /*<>*/ } function set(s, i1, i2, i3, i4){ /*<>*/ /*<>*/ caml_ba_set_1 @@ -23237,10 +25021,7 @@ var serialization_prefix_len = 5, cst_Random_State_of_binary_str = - "Random.State.of_binary_string: expected a format compatible with OCaml ", - cst_Random_int = "Random.int", - cst_Random_full_int = "Random.full_int", - cst_Random_int32 = "Random.int32"; + "Random.State.of_binary_string: expected a format compatible with OCaml "; function to_binary_string(s){ /*<>*/ /*<>*/ var buf = /*<>*/ caml_create_bytes(37); @@ -23350,91 +25131,172 @@ /*<>*/ return make ( /*<>*/ caml_sys_random_seed(0)); /*<>*/ } + var + max_int31 = 1073741823, + max_int32 = 2147483647, + cst_Random_int = "Random.int", + cst_Random_full_int = "Random.full_int", + cst_Random_int_in_range = "Random.int_in_range", + cst_Random_int32 = "Random.int32", + cst_Random_int32_in_range = "Random.int32_in_range"; function bits(s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)) + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) & 1073741823; - /*<>*/ } - function intaux(s, n){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = bits(s), + /*<>*/ } + function int_aux(s, n, mask){ + /*<>*/ for(;;){ + var + r = + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) + & mask, v = caml_mod(r, n); - if(((1073741823 - n | 0) + 1 | 0) >= (r - v | 0)) - /*<>*/ return v; + if(((mask - n | 0) + 1 | 0) >= (r - v | 0)) + /*<>*/ return v; } - /*<>*/ } + /*<>*/ } function int$0(s, bound){ - /*<>*/ if(1073741823 >= bound && 0 < bound) - /*<>*/ return intaux(s, bound); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(1073741823 >= bound && 0 < bound) + return int_aux(s, bound, max_int31); + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Random_int); - /*<>*/ } + /*<>*/ } function full_int(s, bound){ - /*<>*/ if(0 >= bound) - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ if(0 >= bound) + /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Random_full_int); - if(1073741823 >= bound) /*<>*/ return intaux(s, bound); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ _n_ = Stdlib[19], + var + _n_ = + bound <= 1073741823 + ? max_int31 + : bound <= 2147483647 ? max_int32 : Stdlib[19]; + return int_aux(s, bound, _n_); + /*<>*/ } + function int_in_range_aux(s, min, max, mask, nbits){ + /*<>*/ var span = (max - min | 0) + 1 | 0; + if(span <= mask && 0 < span) return min + int_aux(s, span, mask) | 0; + /*<>*/ for(;;){ + var + drop = Stdlib_Sys[10] - nbits | 0, r = - /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)) - & _n_, - v = caml_mod(r, bound); - if(((Stdlib[19] - bound | 0) + 1 | 0) >= (r - v | 0)) - /*<>*/ return v; - } - /*<>*/ } + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)) + << drop + >> drop; + if(r >= min && max >= r) /*<>*/ return r; + } + /*<>*/ } + function int_in_range(s, min, max){ + /*<>*/ if(max < min) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int_in_range); + if(-1073741824 <= min && max <= 1073741823) + /*<>*/ return int_in_range_aux + (s, min, max, max_int31, 31); + if(-2147483648 <= min && max <= 2147483647) + /*<>*/ return int_in_range_aux + (s, min, max, max_int32, 32); + /*<>*/ return int_in_range_aux + (s, min, max, Stdlib[19], Stdlib_Sys[10]); + /*<>*/ } function bits32(s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)); - /*<>*/ } + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ } + function int32aux(s, n){ + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ r = bits32(s) >>> 1 | 0, + /*<>*/ v = /*<>*/ caml_mod(r, n); + /*<>*/ if + (! + /*<>*/ caml_greaterthan + (r - v | 0, (Stdlib_Int32[9] - n | 0) + 1 | 0)) + /*<>*/ return v; + } + /*<>*/ } function int32(s, bound){ - /*<>*/ if - ( /*<>*/ caml_lessequal(bound, 0)) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Random_int32); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = bits32(s) >>> 1 | 0, - /*<>*/ v = - /*<>*/ caml_mod(r, bound); - /*<>*/ if + /*<>*/ return /*<>*/ caml_lessequal + (bound, 0) + ? /*<>*/ caml_call1(Stdlib[1], cst_Random_int32) + : int32aux(s, bound); + /*<>*/ } + function int32_in_range(s, min, max){ + /*<>*/ if + ( /*<>*/ caml_greaterthan(min, max)) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int32_in_range); + /*<>*/ /*<>*/ var + span = + /*<>*/ caml_call1(Stdlib_Int32[6], max - min | 0); + /*<>*/ if + (! /*<>*/ caml_lessequal(span, Stdlib_Int32[1])) + /*<>*/ return min + int32aux(s, span) | 0; + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + r = + /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ if (! - /*<>*/ caml_greaterthan - (r - v | 0, (Stdlib_Int32[9] - bound | 0) + 1 | 0)) - /*<>*/ return v; + /*<>*/ caml_lessthan(r, min) + && ! /*<>*/ caml_greaterthan(r, max)) + /*<>*/ return r; } - /*<>*/ } + /*<>*/ } var bits64 = caml_lxm_next, _f_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), _g_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), - cst_Random_int64 = "Random.int64"; + cst_Random_int64 = "Random.int64", + cst_Random_int64_in_range = "Random.int64_in_range"; + function int64aux(s, n){ + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_int64_shift_right_unsigne + ( /*<>*/ caml_lxm_next(s), 1), + /*<>*/ v = + /*<>*/ runtime.caml_int64_mod(r, n); + /*<>*/ if + (! + /*<>*/ caml_greaterthan + ( /*<>*/ caml_int64_sub(r, v), + /*<>*/ caml_int64_add + ( /*<>*/ caml_int64_sub(Stdlib_Int64[9], n), _f_))) + /*<>*/ return v; + } + /*<>*/ } function int64(s, bound){ - /*<>*/ if - ( /*<>*/ caml_lessequal(bound, _g_)) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[1], cst_Random_int64); - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ r = - /*<>*/ caml_int64_shift_right_unsigne - ( /*<>*/ caml_lxm_next(s), 1), - /*<>*/ v = - /*<>*/ runtime.caml_int64_mod(r, bound); - /*<>*/ if + /*<>*/ return /*<>*/ caml_lessequal + (bound, _g_) + ? /*<>*/ caml_call1(Stdlib[1], cst_Random_int64) + : int64aux(s, bound); + /*<>*/ } + function int64_in_range(s, min, max){ + /*<>*/ if + ( /*<>*/ caml_greaterthan(min, max)) + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[1], cst_Random_int64_in_range); + /*<>*/ /*<>*/ var + span = + /*<>*/ caml_call1 + (Stdlib_Int64[6], /*<>*/ caml_int64_sub(max, min)); + /*<>*/ if + (! /*<>*/ caml_lessequal(span, Stdlib_Int64[1])) + /*<>*/ return /*<>*/ caml_int64_add + (min, int64aux(s, span)); + /*<>*/ for(;;){ + /*<>*/ /*<>*/ var + r = /*<>*/ caml_lxm_next(s); + /*<>*/ if (! - /*<>*/ caml_greaterthan - ( /*<>*/ caml_int64_sub(r, v), - /*<>*/ runtime.caml_int64_add - ( /*<>*/ caml_int64_sub(Stdlib_Int64[9], bound), - _f_))) - /*<>*/ return v; - } - /*<>*/ } + /*<>*/ caml_lessthan(r, min) + && ! /*<>*/ caml_greaterthan(r, max)) + /*<>*/ return r; + } + /*<>*/ } var _j_ = runtime.caml_int64_create_lo_mi_hi(14371852, 15349651, 22696), _k_ = runtime.caml_int64_create_lo_mi_hi(12230193, 11438743, 35013), @@ -23446,150 +25308,192 @@ 32 === Stdlib_Nativeint[9] ? function (s){ - /*<>*/ return bits32(s); - /*<>*/ } + /*<>*/ return bits32(s); + /*<>*/ } : function (s){ - /*<>*/ return /*<>*/ caml_int64_to_int32 - ( /*<>*/ caml_lxm_next(s)); - /*<>*/ }, + /*<>*/ return /*<>*/ caml_int64_to_int32 + ( /*<>*/ caml_lxm_next(s)); + /*<>*/ }, nativeint = 32 === Stdlib_Nativeint[9] ? function (s, bound){ - /*<>*/ return int32(s, bound); - /*<>*/ } + /*<>*/ return int32(s, bound); + /*<>*/ } : function (s, bound){ - /*<>*/ return /*<>*/ caml_int64_to_int32 + /*<>*/ return /*<>*/ caml_int64_to_int32 (int64 - (s, /*<>*/ caml_int64_of_int32(bound))); - /*<>*/ }; + (s, /*<>*/ caml_int64_of_int32(bound))); + /*<>*/ }, + nativeint_in_range = + 32 === Stdlib_Nativeint[9] + ? function + (s, min, max){ + /*<>*/ return int32_in_range(s, min, max); + /*<>*/ } + : function + (s, min, max){ + /*<>*/ return /*<>*/ caml_int64_to_int32 + (int64_in_range + (s, + /*<>*/ caml_int64_of_int32(min), + /*<>*/ caml_int64_of_int32(max))); + /*<>*/ }; function float$0(s, bound){ - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ b = /*<>*/ caml_lxm_next(s), - /*<>*/ n = - /*<>*/ caml_int64_shift_right_unsigne(b, 11); - /*<>*/ if - ( /*<>*/ caml_notequal(n, _h_)) - /*<>*/ return /*<>*/ runtime.caml_int64_to_float + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ b = /*<>*/ caml_lxm_next(s), + /*<>*/ n = + /*<>*/ caml_int64_shift_right_unsigne(b, 11); + /*<>*/ if + ( /*<>*/ caml_notequal(n, _h_)) + /*<>*/ return /*<>*/ runtime.caml_int64_to_float (n) * 1.1102230246251565e-16 * bound; } - /*<>*/ } + /*<>*/ } function bool(s){ - /*<>*/ return /*<>*/ runtime.caml_lessthan - ( /*<>*/ caml_lxm_next(s), _i_); - /*<>*/ } + /*<>*/ return /*<>*/ caml_lessthan + ( /*<>*/ caml_lxm_next(s), _i_); + /*<>*/ } function split(s){ - /*<>*/ var - /*<>*/ i1 = /*<>*/ caml_lxm_next(s), - /*<>*/ i2 = /*<>*/ caml_lxm_next(s), - /*<>*/ i3 = /*<>*/ caml_lxm_next(s), - /*<>*/ i4 = /*<>*/ caml_lxm_next(s); - /*<>*/ return mk(i1, i2, i3, i4); - /*<>*/ } + /*<>*/ var + /*<>*/ i1 = /*<>*/ caml_lxm_next(s), + /*<>*/ i2 = /*<>*/ caml_lxm_next(s), + /*<>*/ i3 = /*<>*/ caml_lxm_next(s), + /*<>*/ i4 = /*<>*/ caml_lxm_next(s); + /*<>*/ return mk(i1, i2, i3, i4); + /*<>*/ } function mk_default(param){ - /*<>*/ return mk(_m_, _l_, _k_, _j_); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return mk(_m_, _l_, _k_, _j_); + /*<>*/ } + /*<>*/ /*<>*/ var random_key = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_Domain[10][1], [0, split], mk_default); function bits$0(param){ - /*<>*/ return bits - ( /*<>*/ caml_call1 + /*<>*/ return bits + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function int$1(bound){ - /*<>*/ return int$0 - ( /*<>*/ caml_call1 + /*<>*/ return int$0 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } function full_int$0(bound){ - /*<>*/ return full_int - ( /*<>*/ caml_call1 + /*<>*/ return full_int + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int_in_range$0(min, max){ + /*<>*/ return int_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function int32$0(bound){ - /*<>*/ return int32 - ( /*<>*/ caml_call1 + /*<>*/ return int32 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int32_in_range$0(min, max){ + /*<>*/ return int32_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function nativeint$0(bound){ - /*<>*/ return nativeint - ( /*<>*/ caml_call1 + /*<>*/ return nativeint + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function nativeint_in_range$0(min, max){ + /*<>*/ return nativeint_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function int64$0(bound){ - /*<>*/ return int64 - ( /*<>*/ caml_call1 + /*<>*/ return int64 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), bound); - /*<>*/ } + /*<>*/ } + function int64_in_range$0(min, max){ + /*<>*/ return int64_in_range + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], random_key), + min, + max); + /*<>*/ } function float$1(scale){ - /*<>*/ return float$0 - ( /*<>*/ caml_call1 + /*<>*/ return float$0 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), scale); - /*<>*/ } + /*<>*/ } function bool$0(param){ - /*<>*/ return bool - ( /*<>*/ caml_call1 + /*<>*/ return bool + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function bits32$0(param){ - /*<>*/ return bits32 - ( /*<>*/ caml_call1 + /*<>*/ return bits32 + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function bits64$0(param){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var s = - /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); - /*<>*/ return /*<>*/ caml_lxm_next(s); - /*<>*/ } + /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ return /*<>*/ caml_lxm_next(s); + /*<>*/ } function nativebits$0(param){ - /*<>*/ return nativebits - ( /*<>*/ caml_call1 + /*<>*/ return nativebits + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function full_init(seed){ - /*<>*/ return reinit - ( /*<>*/ caml_call1 + /*<>*/ return reinit + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key), seed); - /*<>*/ } + /*<>*/ } function init(seed){ - /*<>*/ return full_init([0, seed]); - /*<>*/ } + /*<>*/ return full_init([0, seed]); + /*<>*/ } function self_init(param){ - /*<>*/ return full_init - ( /*<>*/ caml_sys_random_seed(0)); - /*<>*/ } + /*<>*/ return full_init + ( /*<>*/ caml_sys_random_seed(0)); + /*<>*/ } function split$0(param){ - /*<>*/ return split - ( /*<>*/ caml_call1 + /*<>*/ return split + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function get_state(param){ - /*<>*/ return copy - ( /*<>*/ caml_call1 + /*<>*/ return copy + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } function set_state(src){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var dst = - /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); + /*<>*/ caml_call1(Stdlib_Domain[10][2], random_key); /*<>*/ return /*<>*/ caml_ba_blit (src, dst); - /*<>*/ } + /*<>*/ } var Stdlib_Random = [0, @@ -23599,9 +25503,13 @@ bits$0, int$1, full_int$0, + int_in_range$0, int32$0, + int32_in_range$0, nativeint$0, + nativeint_in_range$0, int64$0, + int64_in_range$0, float$1, bool$0, bits32$0, @@ -23614,9 +25522,13 @@ bits, int$0, full_int, + int_in_range, int32, + int32_in_range, nativeint, + nativeint_in_range, int64, + int64_in_range, float$0, bool, bits32, @@ -23628,7 +25540,7 @@ get_state, set_state, split$0]; - runtime.caml_register_global(32, Stdlib_Random, "Stdlib__Random"); + runtime.caml_register_global(35, Stdlib_Random, "Stdlib__Random"); return; /*<>*/ } (globalThis)); @@ -23723,15 +25635,15 @@ (Stdlib_Atomic[1], randomized_default); function randomize(param){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Atomic[3], randomized, 1); + (Stdlib_Atomic[4], randomized, 1); /*<>*/ } function is_randomized(param){ - /*<>*/ return caml_call1(Stdlib_Atomic[2], randomized); + /*<>*/ return caml_call1(Stdlib_Atomic[3], randomized); /*<>*/ } /*<>*/ /*<>*/ var prng_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[15][2]); + (Stdlib_Domain[10][1], 0, Stdlib_Random[19][2]); function power_2_above(x, n){ /*<>*/ var x$0 = x; /*<>*/ for(;;){ @@ -23742,19 +25654,17 @@ } /*<>*/ } function create(opt, initial_size){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = - /*<>*/ caml_call1(Stdlib_Atomic[2], randomized); - /*<>*/ /*<>*/ var - s = power_2_above(16, initial_size); + /*<>*/ var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Atomic[3], randomized), + /*<>*/ s = power_2_above(16, initial_size); /*<>*/ if(random) /*<>*/ var /*<>*/ _ak_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - seed = /*<>*/ caml_call1(Stdlib_Random[15][4], _ak_); + seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _ak_); else var seed = 0; /*<>*/ return [0, @@ -23762,7 +25672,7 @@ /*<>*/ caml_make_vect(s, 0), seed, s]; - /*<>*/ } + } function clear(h){ /*<>*/ var _aj_ = 0 < h[1] ? 1 : 0; return _aj_ @@ -23770,7 +25680,7 @@ [1] = 0, /*<>*/ caml_call4 - (Stdlib_Array[7], h[2], 0, h[2].length - 1, 0)) + (Stdlib_Array[8], h[2], 0, h[2].length - 1, 0)) : _aj_; /*<>*/ } function reset(h){ @@ -23813,7 +25723,7 @@ _ah_ = h[3], /*<>*/ _ai_ = /*<>*/ caml_call2 - (Stdlib_Array[13], copy_bucketlist, h[2]); + (Stdlib_Array[14], copy_bucketlist, h[2]); /*<>*/ return [0, h[1], _ai_, _ah_, _ag_]; /*<>*/ } function length(h){ @@ -24053,7 +25963,7 @@ /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[17], + (Stdlib_Array[18], function(m, b){ /*<>*/ /*<>*/ var _L_ = bucket_length(0, b); @@ -24065,7 +25975,7 @@ /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], + (Stdlib_Array[12], function(b){ /*<>*/ /*<>*/ var l = bucket_length(0, b); @@ -24624,19 +26534,17 @@ /*<>*/ return tbl; /*<>*/ } function rebuild(opt, h){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = - /*<>*/ caml_call1(Stdlib_Atomic[2], randomized); - /*<>*/ /*<>*/ var - s = power_2_above(16, h[2].length - 1); + /*<>*/ var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Atomic[3], randomized), + /*<>*/ s = power_2_above(16, h[2].length - 1); /*<>*/ if(random) /*<>*/ var /*<>*/ _g_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - seed = /*<>*/ caml_call1(Stdlib_Random[15][4], _g_); + seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _g_); else var seed = 4 <= h.length - 1 ? h[3] : 0; /*<>*/ var @@ -24646,7 +26554,7 @@ /*<>*/ insert_all_buckets (function(_i_){ /*<>*/ return key_index(h$0, _i_);}, 0, h[2], h$0[2]); /*<>*/ return h$0; - /*<>*/ } + } var Stdlib_Hashtbl = [0, @@ -24740,7 +26648,7 @@ function create(l){ /*<>*/ var _J_ = 0 <= l ? 1 : 0, - _K_ = _J_ ? l <= Stdlib_Obj[24][15] ? 1 : 0 : _J_; + _K_ = _J_ ? l <= Stdlib_Obj[23][15] ? 1 : 0 : _J_; if(1 - _K_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Weak_create); @@ -24856,7 +26764,7 @@ function fold(f, t, init){ /*<>*/ var i = 0; /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[19], + (Stdlib_Array[20], function(b, accu$1){ var i$0 = i, accu = accu$1; /*<>*/ for(;;){ @@ -24881,7 +26789,7 @@ function iter(f, t){ /*<>*/ var i = 0; /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[11], + (Stdlib_Array[12], function(b){ var i$0 = i; /*<>*/ for(;;){ @@ -24915,7 +26823,7 @@ function count(t){ /*<>*/ var _v_ = 0; /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[19], + (Stdlib_Array[20], function(_w_, _x_){ /*<>*/ return count_bucket(_v_, _w_, _x_); }, @@ -24956,7 +26864,7 @@ /*<>*/ caml_make_vect(newsz, 0); /*<>*/ blit(bucket$0, 0, newbucket$0, 0, sz); /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], hashes, 0, newhashes, 0, sz); + (Stdlib_Array[9], hashes, 0, newhashes, 0, sz); /*<>*/ /*<>*/ caml_call3 (setter, newbucket$0, sz, d); /*<>*/ caml_check_bound(newhashes, sz)[1 + sz] = h; @@ -25017,7 +26925,7 @@ /*<>*/ var /*<>*/ _p_ = /*<>*/ caml_call3 - (Stdlib_Array[5], hbucket, 0, prev_len), + (Stdlib_Array[6], hbucket, 0, prev_len), _q_ = t[5]; /*<>*/ caml_check_bound(t[2], _q_)[1 + _q_] = _p_; } @@ -25044,7 +26952,7 @@ /*<>*/ newt = create$0(newlen), i = 0; /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], + (Stdlib_Array[13], function(j, ob){ var oi = i; /*<>*/ for(;;){ @@ -25213,13 +27121,13 @@ /*<>*/ var len = t[1].length - 1, /*<>*/ lens = - /*<>*/ caml_call2(Stdlib_Array[13], length, t[1]); + /*<>*/ caml_call2(Stdlib_Array[14], length, t[1]); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[34], runtime.caml_int_compare, lens); + (Stdlib_Array[35], runtime.caml_int_compare, lens); /*<>*/ var /*<>*/ totlen = /*<>*/ caml_call3 - (Stdlib_Array[17], + (Stdlib_Array[18], function(_g_, _f_){ /*<>*/ return _g_ + _f_ | 0;}, 0, lens), @@ -25317,82 +27225,83 @@ 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], _c_ = [1, "margin <= max_indent"], - _d_ = [0, 0], - _e_ = [1, "max_indent < 2"], + _d_ = [1, "margin >= pp_infinity"], + _e_ = [0, 0], + _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; return; - /*<>*/ } + /*<>*/ } function format_string(state, s){ - /*<>*/ /*<>*/ var - _a9_ = s !== cst$16 ? 1 : 0; - /*<>*/ return _a9_ + /*<>*/ /*<>*/ var + _a$_ = s !== cst$16 ? 1 : 0; + /*<>*/ return _a$_ ? format_pp_text(state, caml_ml_string_length(s), s) - : _a9_; - /*<>*/ } + : _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)]; @@ -25400,68 +27309,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 _a7_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; - if(! _a7_) return _a7_; - /*<>*/ /*<>*/ 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) @@ -25484,240 +27400,240 @@ ? 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 _a8_ = head; + var _a__ = head; } else - var _a8_ = first; - var tab = _a8_; + 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, - _a5_ = 0 <= size ? 1 : 0, - /*<>*/ _a6_ = - _a5_ || (state[9] <= pending_count ? 1 : 0); - if(! _a6_) /*<>*/ return _a6_; - /*<>*/ /*<>*/ 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 _a4_ = queue_elem[2]; - if(typeof _a4_ !== "number") - switch(_a4_[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; } - /*<>*/ 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 _a3_ = state[14] === state[15] ? 1 : 0; - if(! _a3_) return _a3_; + 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 _a1_ = 1 < state[14] ? 1 : 0; - if(_a1_){ + /*<>*/ 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 _a2_ = 0; + var _a4_ = 0; } else - var _a2_ = _a1_; - return _a2_; - /*<>*/ } + 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 _a0_ = state[23]; - if(! _a0_) return _a0_; - /*<>*/ /*<>*/ 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 _aY_ = state[22]; - if(_aY_){ - /*<>*/ /*<>*/ 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 _aZ_ = 0; + var _a1_ = 0; } else - var _aZ_ = _aY_; - /*<>*/ return _aZ_; - /*<>*/ } + 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; @@ -25727,280 +27643,294 @@ 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 + /*<>*/ 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 _aX_ = state[14] < state[15] ? 1 : 0; - return _aX_ ? enqueue_string_as(state, size, s) : _aX_; - /*<>*/ } + /*<>*/ 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); - /*<>*/ } + /*<>*/ /*<>*/ 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 _aW_ = state[14] < state[15] ? 1 : 0; - return _aW_ ? enqueue_advance(state, [0, zero, 3, 0]) : _aW_; - /*<>*/ } + /*<>*/ 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 _aV_ = state[14] < state[15] ? 1 : 0; - return _aV_ ? enqueue_advance(state, [0, zero, 4, 0]) : _aV_; - /*<>*/ } + /*<>*/ 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], - _aU_ = state[14] < state[15] ? 1 : 0; - if(! _aU_) return _aU_; - /*<>*/ var + _aV_ = state[14] < state[15] ? 1 : 0; + if(! _aV_) return _aV_; + /*<>*/ 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; - var _aT_ = state[14] < state[15] ? 1 : 0; - if(! _aT_) return _aT_; - /*<>*/ /*<>*/ var - elem = [0, zero, [4, [0, [0, 0]]], 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ state[14] = state[14] + 1 | 0; + var _aU_ = state[14] < state[15] ? 1 : 0; + if(! _aU_) return _aU_; + /*<>*/ /*<>*/ var + elem = [0, zero, [5, [0, [0, 0]]], 0]; + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_close_tbox(state, param){ - /*<>*/ var _aQ_ = 1 < state[14] ? 1 : 0; - if(_aQ_){ - var _aR_ = state[14] < state[15] ? 1 : 0; - if(_aR_){ - /*<>*/ /*<>*/ var + /*<>*/ var _aR_ = 1 < state[14] ? 1 : 0; + if(_aR_){ + var _aS_ = state[14] < state[15] ? 1 : 0; + if(_aS_){ + /*<>*/ /*<>*/ var elem = [0, zero, 2, 0]; - /*<>*/ enqueue_advance(state, elem); + /*<>*/ enqueue_advance(state, elem); state[14] = state[14] - 1 | 0; - var _aS_ = 0; + var _aT_ = 0; } else - var _aS_ = _aR_; + var _aT_ = _aS_; } else - var _aS_ = _aQ_; - return _aS_; - /*<>*/ } + var _aT_ = _aR_; + return _aT_; + /*<>*/ } function pp_print_tbreak(state, width, offset){ - /*<>*/ var _aP_ = state[14] < state[15] ? 1 : 0; - if(! _aP_) return _aP_; - /*<>*/ var + /*<>*/ var _aQ_ = state[14] < state[15] ? 1 : 0; + if(! _aQ_) return _aQ_; + /*<>*/ 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 _aO_ = state[14] < state[15] ? 1 : 0; - if(! _aO_) return _aO_; - /*<>*/ /*<>*/ var + /*<>*/ var _aP_ = state[14] < state[15] ? 1 : 0; + if(! _aP_) return _aP_; + /*<>*/ /*<>*/ var elem = [0, zero, 0, 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_set_max_boxes(state, n){ - /*<>*/ var - _aM_ = 1 < n ? 1 : 0, - _aN_ = _aM_ ? (state[15] = n, 0) : _aM_; - return _aN_; - /*<>*/ } + /*<>*/ 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 _aL_ = 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$1 = state[6] - n$0 | 0, _aK_ = 1 <= n$1 ? 1 : 0; - if(! _aK_) return _aK_; - /*<>*/ /*<>*/ 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 _aI_ = 1 <= n ? 1 : 0; - if(! _aI_) return _aI_; - /*<>*/ /*<>*/ var n$0 = pp_limit(n); + /*<>*/ var _aJ_ = 1 <= n ? 1 : 0; + if(! _aJ_) return _aJ_; + /*<>*/ /*<>*/ var n$0 = pp_limit(n); state[6] = n$0; if(state[8] <= state[6]) var new_max_indent = state[8]; else - /*<>*/ var - /*<>*/ _aJ_ = - /*<>*/ 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], _aJ_, 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 - ? margin <= max_indent ? _c_ : _d_ - : _e_; + /*<>*/ 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], - /*<>*/ _aH_ = - /*<>*/ caml_call2 + /*<>*/ _aI_ = + /*<>*/ caml_call2 (Stdlib[28], cst_Format_pp_set_geometry, msg); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], _aH_], 1); - /*<>*/ } + /*<>*/ 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; @@ -26011,106 +27941,106 @@ 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), - _f_ = [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 _aG_ = 0 < n$0 ? 1 : 0; - if(! _aG_) return _aG_; + /*<>*/ 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(_aF_){ /*<>*/ return display_newline(state, _aF_);}; - state[20] = function(_aE_){ /*<>*/ return display_blanks(state, _aE_);}; - state[21] = function(_aD_){ /*<>*/ return display_blanks(state, _aD_);}; + 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], - /*<>*/ _aC_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$8); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$9, _aC_); - /*<>*/ } + /*<>*/ _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], - /*<>*/ _aB_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$11); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$12, _aB_); - /*<>*/ } - function default_pp_print_open_tag(_aA_){ /*<>*/ return 0;} - function default_pp_print_close_tag(_az_){ /*<>*/ return 0;} + /*<>*/ _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, _f_, 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, - _av_ = Stdlib[19], - /*<>*/ _aw_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _ax_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _ay_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ return [0, + /*<>*/ 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, scan_stack, - /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + _az_, _ay_, _ax_, - _aw_, pp_margin, 10, 68, @@ -26120,7 +28050,7 @@ 1, 1, 1, - _av_, + _aw_, cst$14, f, g, @@ -26136,760 +28066,765 @@ 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, flush, + function(_av_){ /*<>*/ return 0;}, function(_au_){ /*<>*/ return 0;}, - function(_at_){ /*<>*/ return 0;}, - function(_as_){ /*<>*/ return 0;}); - ppf[19] = function(_ar_){ /*<>*/ return display_newline(ppf, _ar_);}; - ppf[20] = function(_aq_){ /*<>*/ return display_blanks(ppf, _aq_);}; - ppf[21] = function(_ap_){ /*<>*/ return display_blanks(ppf, _ap_);}; - /*<>*/ return ppf; - /*<>*/ } + function(_at_){ /*<>*/ return 0;}); + 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; + /*<>*/ } 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), - function(_ao_){ /*<>*/ return 0;}); - /*<>*/ } + /*<>*/ 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 + /*<>*/ str_formatter = formatter_of_buffer(stdbuf), + /*<>*/ stdbuf_key = + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, pp_make_buffer); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], stdbuf_key, stdbuf); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var str_formatter_key = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, function(param){ - /*<>*/ return formatter_of_buffer - ( /*<>*/ caml_call1 + /*<>*/ return formatter_of_buffer + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], stdbuf_key)); - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], str_formatter_key, str_formatter); - /*<>*/ function buffered_out_string(key, str, ofs, len){ - /*<>*/ /*<>*/ var - _an_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Buffer[18], _an_, str, ofs, len); - /*<>*/ } + /*<>*/ function buffered_out_string(key, str, ofs, len){ + /*<>*/ /*<>*/ var + _ao_ = /*<>*/ caml_call1(Stdlib_Domain[10][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[10][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 + /*<>*/ } + /*<>*/ var + /*<>*/ std_buf_key = + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, function(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ }), - /*<>*/ err_buf_key = - /*<>*/ caml_call2 + /*<>*/ }), + /*<>*/ err_buf_key = + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, function(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ }), - /*<>*/ std_formatter_key = - /*<>*/ caml_call2 + /*<>*/ }), + /*<>*/ std_formatter_key = + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, function(param){ - /*<>*/ var - _ab_ = Stdlib[39], - /*<>*/ ppf = + /*<>*/ var + _ac_ = Stdlib[39], + /*<>*/ ppf = pp_make_formatter - (function(_ak_, _al_, _am_){ + (function(_al_, _am_, _an_){ /*<>*/ return buffered_out_string - (std_buf_key, _ak_, _al_, _am_); + (std_buf_key, _al_, _am_, _an_); }, - function(_aj_){ - /*<>*/ return buffered_out_flush(_ab_, std_buf_key, _aj_); + function(_ak_){ + /*<>*/ return buffered_out_flush(_ac_, std_buf_key, _ak_); }, + function(_aj_){ /*<>*/ return 0;}, function(_ai_){ /*<>*/ return 0;}, - function(_ah_){ /*<>*/ return 0;}, - function(_ag_){ /*<>*/ return 0;}); + function(_ah_){ /*<>*/ return 0;}); ppf[19] = - function(_af_){ /*<>*/ return display_newline(ppf, _af_);}; + function(_ag_){ /*<>*/ return display_newline(ppf, _ag_);}; ppf[20] = - function(_ae_){ /*<>*/ return display_blanks(ppf, _ae_);}; + function(_af_){ /*<>*/ return display_blanks(ppf, _af_);}; ppf[21] = - function(_ad_){ /*<>*/ return display_blanks(ppf, _ad_);}; - /*<>*/ /*<>*/ caml_call1 + function(_ae_){ /*<>*/ return display_blanks(ppf, _ae_);}; + /*<>*/ /*<>*/ caml_call1 (Stdlib_Domain[6], - function(_ac_){ /*<>*/ return pp_print_flush(ppf, _ac_);}); - /*<>*/ return ppf; - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 + function(_ad_){ /*<>*/ return pp_print_flush(ppf, _ad_);}); + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], std_formatter_key, std_formatter); - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var err_formatter_key = - /*<>*/ caml_call2 + /*<>*/ caml_call2 (Stdlib_Domain[10][1], 0, function(param){ - /*<>*/ var - _R_ = Stdlib[40], - /*<>*/ ppf = + /*<>*/ var + _S_ = Stdlib[40], + /*<>*/ ppf = pp_make_formatter - (function(___, _$_, _aa_){ + (function(_$_, _aa_, _ab_){ /*<>*/ return buffered_out_string - (err_buf_key, ___, _$_, _aa_); + (err_buf_key, _$_, _aa_, _ab_); }, - function(_Z_){ - /*<>*/ return buffered_out_flush(_R_, err_buf_key, _Z_); + function(___){ + /*<>*/ return buffered_out_flush(_S_, err_buf_key, ___); }, + function(_Z_){ /*<>*/ return 0;}, function(_Y_){ /*<>*/ return 0;}, - function(_X_){ /*<>*/ return 0;}, - function(_W_){ /*<>*/ return 0;}); - ppf[19] = function(_V_){ /*<>*/ return display_newline(ppf, _V_);}; - ppf[20] = function(_U_){ /*<>*/ return display_blanks(ppf, _U_);}; - ppf[21] = function(_T_){ /*<>*/ return display_blanks(ppf, _T_);}; - /*<>*/ /*<>*/ caml_call1 + function(_X_){ /*<>*/ return 0;}); + 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 (Stdlib_Domain[6], - function(_S_){ /*<>*/ return pp_print_flush(ppf, _S_);}); - /*<>*/ return ppf; - /*<>*/ }); - /*<>*/ /*<>*/ caml_call2 + function(_T_){ /*<>*/ return pp_print_flush(ppf, _T_);}); + /*<>*/ return ppf; + /*<>*/ }); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], err_formatter_key, err_formatter); function get_std_formatter(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); - /*<>*/ } + /*<>*/ } function get_err_formatter(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][2], err_formatter_key); - /*<>*/ } + /*<>*/ } function get_str_formatter(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][2], str_formatter_key); - /*<>*/ } + /*<>*/ } function get_stdbuf(param){ - /*<>*/ return caml_call1 + /*<>*/ return caml_call1 (Stdlib_Domain[10][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 + /*<>*/ 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 + /*<>*/ return flush_buffer_formatter (stdbuf, str_formatter); - /*<>*/ } + /*<>*/ } function make_synchronized_formatter(output, flush){ - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Domain[10][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 - _Q_ = - /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ /*<>*/ var + _R_ = + /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ /*<>*/ caml_call3 (output, - /*<>*/ caml_call1(Stdlib_Buffer[2], buf), + /*<>*/ caml_call1(Stdlib_Buffer[2], buf), 0, - _Q_); - /*<>*/ /*<>*/ caml_call1 + _R_); + /*<>*/ /*<>*/ 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(_P_){ - /*<>*/ return add_symbolic_output_item(sob, 0); + /*<>*/ function g(_Q_){ + /*<>*/ return add_symbolic_output_item(sob, 0); } - /*<>*/ function h(_O_){ - /*<>*/ 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 + /*<>*/ return pp_open_hbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_vbox(v){ - /*<>*/ return pp_open_vbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_vbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hvbox(v){ - /*<>*/ return pp_open_hvbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_hvbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_hovbox(v){ - /*<>*/ return pp_open_hovbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_hovbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_box(v){ - /*<>*/ return pp_open_box - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_box + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_box(v){ - /*<>*/ return pp_close_box - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_box + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_stag(v){ - /*<>*/ return pp_open_stag - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_stag + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_stag(v){ - /*<>*/ return pp_close_stag - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_stag + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_as(isize, w){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); - /*<>*/ return pp_print_as_size(state, isize, w); - /*<>*/ } + /*<>*/ return pp_print_as_size(state, isize, w); + /*<>*/ } function print_string(v){ - /*<>*/ return pp_print_string - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_string + ( /*<>*/ caml_call1 + (Stdlib_Domain[10][2], std_formatter_key), + v); + /*<>*/ } + function print_substring(pos, len, v){ + /*<>*/ /*<>*/ var + state = + /*<>*/ caml_call1 + (Stdlib_Domain[10][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[10][2], std_formatter_key), + as_len, v); - /*<>*/ } + /*<>*/ } function print_bytes(v){ - /*<>*/ return pp_print_bytes - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_bytes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_int(v){ - /*<>*/ return pp_print_int - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_int + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_float(v){ - /*<>*/ return pp_print_float - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_float + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_char(v){ - /*<>*/ return pp_print_char - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_char + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_bool(v){ - /*<>*/ return pp_print_bool - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_bool + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_break(v, w){ - /*<>*/ return pp_print_break - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_break + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function print_cut(v){ - /*<>*/ return pp_print_cut - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_cut + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_space(v){ - /*<>*/ return pp_print_space - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_space + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function force_newline(v){ - /*<>*/ return pp_force_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_force_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_flush(v){ - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_newline(v){ - /*<>*/ return pp_print_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_if_newline(v){ - /*<>*/ return pp_print_if_newline - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_if_newline + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function open_tbox(v){ - /*<>*/ return pp_open_tbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_open_tbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function close_tbox(v){ - /*<>*/ return pp_close_tbox - ( /*<>*/ caml_call1 + /*<>*/ return pp_close_tbox + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tbreak(v, w){ - /*<>*/ return pp_print_tbreak - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_tbreak + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function set_tab(v){ - /*<>*/ return pp_set_tab - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_tab + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function print_tab(v){ - /*<>*/ return pp_print_tab - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_tab + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_margin(v){ - /*<>*/ return pp_set_margin - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_margin + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_margin(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[6]; - /*<>*/ } + /*<>*/ } function set_max_indent(v){ - /*<>*/ return pp_set_max_indent - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_max_indent + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_indent(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[8]; - /*<>*/ } + /*<>*/ } function set_geometry(max_indent, margin){ - /*<>*/ return pp_set_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function safe_set_geometry(max_indent, margin){ - /*<>*/ return pp_safe_set_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_safe_set_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), max_indent, margin); - /*<>*/ } + /*<>*/ } function get_geometry(v){ - /*<>*/ return pp_get_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function update_geometry(v){ - /*<>*/ return pp_update_geometry - ( /*<>*/ caml_call1 + /*<>*/ return pp_update_geometry + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_max_boxes(v){ - /*<>*/ return pp_set_max_boxes - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_max_boxes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_max_boxes(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[15]; - /*<>*/ } + /*<>*/ } function over_max_boxes(v){ - /*<>*/ return pp_over_max_boxes - ( /*<>*/ caml_call1 + /*<>*/ return pp_over_max_boxes + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_ellipsis_text(v){ - /*<>*/ return pp_set_ellipsis_text - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_ellipsis_text + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_ellipsis_text(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[16]; - /*<>*/ } + /*<>*/ } function set_formatter_out_channel(v){ - /*<>*/ return pp_set_formatter_out_channel - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_out_channel + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_out_functions(v){ - /*<>*/ return pp_set_formatter_out_functions - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_out_functions + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_out_functions(v){ - /*<>*/ return pp_get_formatter_out_functions - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_out_functions + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_output_functions(v, w){ - /*<>*/ return pp_set_formatter_output_functi - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_output_functi + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, w); - /*<>*/ } + /*<>*/ } function get_formatter_output_functions(v){ - /*<>*/ return pp_get_formatter_output_functi - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_output_functi + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_formatter_stag_functions(v){ - /*<>*/ return pp_set_formatter_stag_function - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_formatter_stag_function + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_formatter_stag_functions(v){ - /*<>*/ return pp_get_formatter_stag_function - ( /*<>*/ caml_call1 + /*<>*/ return pp_get_formatter_stag_function + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function set_print_tags(v){ - /*<>*/ return pp_set_print_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_print_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_print_tags(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[22]; - /*<>*/ } + /*<>*/ } function set_mark_tags(v){ - /*<>*/ return pp_set_mark_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_mark_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function get_mark_tags(v){ - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var state = - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key); return state[23]; - /*<>*/ } + /*<>*/ } function set_tags(v){ - /*<>*/ return pp_set_tags - ( /*<>*/ caml_call1 + /*<>*/ return pp_set_tags + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v); - /*<>*/ } + /*<>*/ } function pp_print_iter(opt, iter, pp_v, ppf, v){ - /*<>*/ if(opt) - var sth = opt[1], pp_sep = sth; - else - var pp_sep = pp_print_cut; - /*<>*/ /*<>*/ var - is_first = [0, 1]; + /*<>*/ var + pp_sep = opt ? opt[1] : pp_print_cut, + /*<>*/ 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){ - /*<>*/ if(opt) - var sth = opt[1], pp_sep = sth; - else - var pp_sep = pp_print_cut; - /*<>*/ return pp_print_iter + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ return pp_print_iter ([0, pp_sep], Stdlib_List[18], pp_v, ppf, v); - /*<>*/ } + } function pp_print_array(opt, pp_v, ppf, v){ - /*<>*/ if(opt) - var sth = opt[1], pp_sep = sth; - else - var pp_sep = pp_print_cut; - /*<>*/ return pp_print_iter - ([0, pp_sep], Stdlib_Array[11], pp_v, ppf, v); - /*<>*/ } + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ return pp_print_iter + ([0, pp_sep], Stdlib_Array[12], pp_v, ppf, v); + } function pp_print_seq(opt, pp_v, ppf, seq){ - /*<>*/ if(opt) - var sth = opt[1], pp_sep = sth; - else - var pp_sep = pp_print_cut; - /*<>*/ return pp_print_iter + var pp_sep = opt ? opt[1] : pp_print_cut; + /*<>*/ 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 _N_ = left[1] !== len ? 1 : 0; - return _N_ ? flush(0) : _N_; + 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){ - /*<>*/ if(opt) - var sth = opt[1], none = sth; - else - var - none = - function(param, _M_){ - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ if(! param) - /*<>*/ return /*<>*/ caml_call2 + var + none = + opt + ? opt[1] + : function + (_N_, param){ + /*<>*/ return 0; + /*<>*/ }; + if(! param) + /*<>*/ 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: @@ -26899,104 +28834,104 @@ 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 - /*<>*/ _D_ = compute_tag(output_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 - (CamlinternalFormat[20], _D_), + /*<>*/ 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 _E_ = acc[1]; - if(typeof _E_ !== "number" && 0 === _E_[0]){ - var _F_ = _E_[2]; - if(typeof _F_ !== "number" && 1 === _F_[0]){ - var s$0 = acc[2], size = _F_[2], p$2 = _E_[1]; + var _F_ = acc[1]; + if(typeof _F_ !== "number" && 0 === _F_[0]){ + var _G_ = _F_[2]; + if(typeof _G_ !== "number" && 1 === _G_[0]){ + var s$0 = acc[2], size = _G_[2], p$2 = _F_[1]; break b; } } - var s = acc[2], p$1 = _E_; + var s = acc[2], p$1 = _F_; break a; case 3: - var _G_ = acc[1]; - if(typeof _G_ !== "number" && 0 === _G_[0]){ - var _H_ = _G_[2]; - if(typeof _H_ !== "number" && 1 === _H_[0]){ - var c$0 = acc[2], size$0 = _H_[2], p$4 = _G_[1]; + var _H_ = acc[1]; + if(typeof _H_ !== "number" && 0 === _H_[0]){ + var _I_ = _H_[2]; + if(typeof _I_ !== "number" && 1 === _I_[0]){ + var c$0 = acc[2], size$0 = _I_[2], p$4 = _H_[1]; break; } } - var c = acc[2], p$3 = _G_; + var c = acc[2], p$3 = _H_; break c; case 4: - var _I_ = acc[1]; - if(typeof _I_ !== "number" && 0 === _I_[0]){ - var _J_ = _I_[2]; - if(typeof _J_ !== "number" && 1 === _J_[0]){ - var s$0 = acc[2], size = _J_[2], p$2 = _I_[1]; + var _J_ = acc[1]; + if(typeof _J_ !== "number" && 0 === _J_[0]){ + var _K_ = _J_[2]; + if(typeof _K_ !== "number" && 1 === _K_[0]){ + var s$0 = acc[2], size = _K_[2], p$2 = _J_[1]; break b; } } - var s = acc[2], p$1 = _I_; + var s = acc[2], p$1 = _J_; break a; case 5: - var _K_ = acc[1]; - if(typeof _K_ !== "number" && 0 === _K_[0]){ - var _L_ = _K_[2]; - if(typeof _L_ !== "number" && 1 === _L_[0]){ - var c$0 = acc[2], size$0 = _L_[2], p$4 = _K_[1]; + var _L_ = acc[1]; + if(typeof _L_ !== "number" && 0 === _L_[0]){ + var _M_ = _L_[2]; + if(typeof _M_ !== "number" && 1 === _M_[0]){ + var c$0 = acc[2], size$0 = _M_[2], p$4 = _L_[1]; break; } } - var c = acc[2], p$3 = _K_; + var c = acc[2], p$3 = _L_; 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: @@ -27006,69 +28941,69 @@ 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 - /*<>*/ _u_ = compute_tag(strput_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 - (CamlinternalFormat[20], _u_), + /*<>*/ 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 _v_ = acc[1]; - if(typeof _v_ !== "number" && 0 === _v_[0]){ - var _w_ = _v_[2]; - if(typeof _w_ !== "number" && 1 === _w_[0]){ - var s$0 = acc[2], size = _w_[2], p$2 = _v_[1]; + var _w_ = acc[1]; + if(typeof _w_ !== "number" && 0 === _w_[0]){ + var _x_ = _w_[2]; + if(typeof _x_ !== "number" && 1 === _x_[0]){ + var s$0 = acc[2], size = _x_[2], p$2 = _w_[1]; break b; } } - var s = acc[2], p$1 = _v_; + var s = acc[2], p$1 = _w_; break a; case 3: - var _x_ = acc[1]; - if(typeof _x_ !== "number" && 0 === _x_[0]){ - var _y_ = _x_[2]; - if(typeof _y_ !== "number" && 1 === _y_[0]){ - var c$0 = acc[2], size$0 = _y_[2], p$4 = _x_[1]; + var _y_ = acc[1]; + if(typeof _y_ !== "number" && 0 === _y_[0]){ + var _z_ = _y_[2]; + if(typeof _z_ !== "number" && 1 === _z_[0]){ + var c$0 = acc[2], size$0 = _z_[2], p$4 = _y_[1]; break; } } - var c = acc[2], p$3 = _x_; + var c = acc[2], p$3 = _y_; break c; case 4: - var _z_ = acc[1]; - if(typeof _z_ !== "number" && 0 === _z_[0]){ - var _A_ = _z_[2]; - if(typeof _A_ !== "number" && 1 === _A_[0]){ - var s$0 = acc[2], size = _A_[2], p$2 = _z_[1]; + var _A_ = acc[1]; + if(typeof _A_ !== "number" && 0 === _A_[0]){ + var _B_ = _A_[2]; + if(typeof _B_ !== "number" && 1 === _B_[0]){ + var s$0 = acc[2], size = _B_[2], p$2 = _A_[1]; break b; } } - var s = acc[2], p$1 = _z_; + var s = acc[2], p$1 = _A_; break a; case 5: - var _B_ = acc[1]; - if(typeof _B_ !== "number" && 0 === _B_[0]){ - var _C_ = _B_[2]; - if(typeof _C_ !== "number" && 1 === _C_[0]){ - var c$0 = acc[2], size$0 = _C_[2], p$4 = _B_[1]; + var _C_ = acc[1]; + if(typeof _C_ !== "number" && 0 === _C_[0]){ + var _D_ = _C_[2]; + if(typeof _D_ !== "number" && 1 === _D_[0]){ + var c$0 = acc[2], size$0 = _D_[2], p$4 = _C_[1]; break; } } - var c = acc[2], p$3 = _B_; + var c = acc[2], p$3 = _C_; break c; case 6: var p$5 = acc[1]; @@ -27076,199 +29011,199 @@ 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(_t_){ /*<>*/ return 0;}, + function(_u_){ /*<>*/ return 0;}, 0, fmt); } function fprintf(ppf){ - function _q_(_s_){ /*<>*/ return 0;} - /*<>*/ return function(_r_){ - /*<>*/ return kfprintf(_q_, ppf, _r_);}; - /*<>*/ } + function _r_(_t_){ /*<>*/ return 0;} + /*<>*/ 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 + /*<>*/ return output_acc + ( /*<>*/ caml_call1 (Stdlib_Domain[10][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 + /*<>*/ return output_acc + ( /*<>*/ caml_call1 (Stdlib_Domain[10][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 + /*<>*/ pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), 0); - /*<>*/ return pp_print_flush - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_flush + ( /*<>*/ caml_call1 (Stdlib_Domain[10][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), - _g_ = Stdlib[39]; - /*<>*/ pp_set_formatter_out_functions + _h_ = Stdlib[39]; + /*<>*/ pp_set_formatter_out_functions (std_formatter, [0, - function(_n_, _o_, _p_){ - /*<>*/ return buffered_out_string(std_buf_key, _n_, _o_, _p_); + function(_o_, _p_, _q_){ + /*<>*/ return buffered_out_string(std_buf_key, _o_, _p_, _q_); }, - function(_m_){ - /*<>*/ return buffered_out_flush(_g_, std_buf_key, _m_); + function(_n_){ + /*<>*/ return buffered_out_flush(_h_, std_buf_key, _n_); }, fs[3], fs[4], fs[5]]); - /*<>*/ var - /*<>*/ fs$0 = + /*<>*/ var + /*<>*/ fs$0 = pp_get_formatter_out_functions(err_formatter, 0), - _h_ = Stdlib[40]; - /*<>*/ return pp_set_formatter_out_functions + _i_ = Stdlib[40]; + /*<>*/ return pp_set_formatter_out_functions (err_formatter, [0, - function(_j_, _k_, _l_){ + function(_k_, _l_, _m_){ /*<>*/ return buffered_out_string - (err_buf_key, _j_, _k_, _l_); + (err_buf_key, _k_, _l_, _m_); }, - function(_i_){ - /*<>*/ return buffered_out_flush(_h_, err_buf_key, _i_); + function(_j_){ + /*<>*/ return buffered_out_flush(_i_, err_buf_key, _j_); }, fs$0[3], fs$0[4], fs$0[5]]); - /*<>*/ }); + /*<>*/ }); var Stdlib_Format = [0, @@ -27286,10 +29221,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, @@ -27298,6 +29237,7 @@ print_char, pp_print_bool, print_bool, + pp_print_nothing, pp_print_space, print_space, pp_print_cut, @@ -27313,6 +29253,7 @@ print_flush, pp_print_newline, print_newline, + pp_infinity, pp_set_margin, set_margin, pp_get_margin, @@ -27420,7 +29361,7 @@ ikfprintf, ksprintf, kasprintf]; - runtime.caml_register_global(37, Stdlib_Format, "Stdlib__Format"); + runtime.caml_register_global(38, Stdlib_Format, "Stdlib__Format"); return; /*<>*/ } (globalThis)); @@ -29174,7 +31115,7 @@ rest$13 = fmt$0[2], pad$8 = fmt$0[1], /*<>*/ scan$8 = - function(param, _O_, ib){ + function(_O_, param, ib){ /*<>*/ var /*<>*/ c = checked_peek_char(ib), /*<>*/ m = @@ -29507,7 +31448,7 @@ function kscanf_opt(ib, fmt){ /*<>*/ return kscanf_gen (ib, - function(param, _y_){ + function(_y_, param){ /*<>*/ return 0; /*<>*/ }, function(x){ @@ -29793,7 +31734,7 @@ new_buck = /*<>*/ caml_make_vect(new_size, dummy_met); /*<>*/ /*<>*/ caml_call5 - (Stdlib_Array[8], array[2], 0, new_buck, 0, old_size); + (Stdlib_Array[9], array[2], 0, new_buck, 0, old_size); array[2] = new_buck; var _ac_ = 0; } @@ -29839,7 +31780,7 @@ /*<>*/ } function get_method_labels(table, names){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], + (Stdlib_Array[14], function(_Z_){ /*<>*/ return get_method_label(table, _Z_);}, names); /*<>*/ } @@ -29858,7 +31799,7 @@ /*<>*/ /*<>*/ var _X_ = /*<>*/ caml_call2 - (Stdlib_List[49], label, table[6]); + (Stdlib_List[53], label, table[6]); /*<>*/ return _X_; } catch(_Y_){ @@ -29874,7 +31815,7 @@ /*<>*/ return 0 === arr ? 0 : /*<>*/ caml_call1 - (Stdlib_Array[9], arr); + (Stdlib_Array[10], arr); /*<>*/ } function narrow(table, vars, virt_meths, concr_meths){ /*<>*/ var @@ -30086,7 +32027,7 @@ /*<>*/ } function get_variables(table, names){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], + (Stdlib_Array[14], function(_y_){ /*<>*/ return get_variable(table, _y_);}, names); /*<>*/ } @@ -30100,10 +32041,10 @@ /*<>*/ var /*<>*/ tags = /*<>*/ caml_call2 - (Stdlib_Array[13], public_method_label, public_methods), + (Stdlib_Array[14], public_method_label, public_methods), /*<>*/ table = new_table(tags); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], + (Stdlib_Array[13], function(i, met){ /*<>*/ var lab = (i * 2 | 0) + 2 | 0; table[3] = @@ -30143,7 +32084,7 @@ _t_ = [0, /*<>*/ caml_call2 - (Stdlib_Array[13], + (Stdlib_Array[14], function(nm){ /*<>*/ return get_method (cla, get_method_label(cla, nm)); @@ -30156,12 +32097,12 @@ [0, init], [0, /*<>*/ caml_call2 - (Stdlib_Array[13], + (Stdlib_Array[14], function(_w_){ /*<>*/ return get_variable(cla, _w_);}, _u_), _t_]]; /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[4], _v_); + (Stdlib_Array[5], _v_); } function make_class(pub_meths, class_init){ /*<>*/ var @@ -30959,13 +32900,13 @@ /*<>*/ /*<>*/ var prng = [246, - function(_at_){ /*<>*/ return caml_call1(Stdlib_Random[15][2], 0);}]; + function(_at_){ /*<>*/ return caml_call1(Stdlib_Random[19][2], 0);}]; function create(opt, initial_size){ - /*<>*/ if(opt) - var sth = opt[1], random = sth; - else - var - random = /*<>*/ caml_call1(Stdlib_Hashtbl[17], 0); + var + random = + opt + ? opt[1] + : /*<>*/ caml_call1(Stdlib_Hashtbl[17], 0); a: b: { @@ -30989,7 +32930,7 @@ } var seed = - /*<>*/ caml_call1(Stdlib_Random[15][4], _as_); + /*<>*/ caml_call1(Stdlib_Random[19][4], _as_); } else var seed = 0; @@ -30998,7 +32939,7 @@ /*<>*/ caml_make_vect(x, 0), seed, x]; - /*<>*/ } + } function clear(h){ /*<>*/ h[1] = 0; /*<>*/ var @@ -31032,7 +32973,7 @@ _al_ = h[4], _am_ = h[3], /*<>*/ _an_ = - /*<>*/ caml_call1(Stdlib_Array[6], h[2]); + /*<>*/ caml_call1(Stdlib_Array[7], h[2]); /*<>*/ return [0, h[1], _an_, _am_, _al_]; /*<>*/ } function key_index(h, hkey){ @@ -31308,7 +33249,7 @@ /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[17], + (Stdlib_Array[18], function(m, b){ /*<>*/ /*<>*/ var _T_ = bucket_length(0, b); @@ -31320,7 +33261,7 @@ /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], + (Stdlib_Array[12], function(b){ /*<>*/ /*<>*/ var l = bucket_length(0, b); @@ -31350,7 +33291,7 @@ /*<>*/ size = [0, 0], /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[17], + (Stdlib_Array[18], function(m, b){ /*<>*/ /*<>*/ var _S_ = bucket_length_alive(0, b); @@ -31362,7 +33303,7 @@ /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], + (Stdlib_Array[12], function(b){ /*<>*/ /*<>*/ var l = bucket_length_alive(0, b); @@ -31424,29 +33365,29 @@ } function create(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 1); + (Stdlib_Obj[23][1], 1); /*<>*/ } function get_key(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call2(Stdlib_Obj[24][3], t, 0); + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 0); /*<>*/ return x; /*<>*/ } function set_key(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 0, k); + (Stdlib_Obj[23][5], t, 0, k); /*<>*/ } function check_key(t){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][7], t, 0); + (Stdlib_Obj[23][7], t, 0); /*<>*/ } function get_data(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call1(Stdlib_Obj[24][9], t); + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); /*<>*/ return x; /*<>*/ } function set_data(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make(key, data){ /*<>*/ /*<>*/ var @@ -31483,7 +33424,7 @@ /*<>*/ } function set_key_data(c, k, d){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ set_key(c, k); /*<>*/ return set_data(c, d); /*<>*/ } @@ -31605,34 +33546,34 @@ /*<>*/ } function create$0(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 2); + (Stdlib_Obj[23][1], 2); /*<>*/ } function get_key1(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call2(Stdlib_Obj[24][3], t, 0); + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 0); /*<>*/ return x; /*<>*/ } function set_key1(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 0, k); + (Stdlib_Obj[23][5], t, 0, k); /*<>*/ } function get_key2(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call2(Stdlib_Obj[24][3], t, 1); + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, 1); /*<>*/ return x; /*<>*/ } function set_key2(t, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, 1, k); + (Stdlib_Obj[23][5], t, 1, k); /*<>*/ } function get_data$0(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call1(Stdlib_Obj[24][9], t); + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); /*<>*/ return x; /*<>*/ } function set_data$0(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make$1(key1, key2, data){ /*<>*/ /*<>*/ var @@ -31695,17 +33636,17 @@ function set_key_data(c, param, d){ var k2 = param[2], k1 = param[1]; /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ set_key1(c, k1); /*<>*/ set_key2(c, k2); /*<>*/ return set_data$0(c, d); } function check_key(c){ /*<>*/ /*<>*/ var - _N_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, 0); + _N_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, 0); /*<>*/ return _N_ ? /*<>*/ caml_call2 - (Stdlib_Obj[24][7], c, 1) + (Stdlib_Obj[23][7], c, 1) : _N_; /*<>*/ } /*<>*/ return MakeSeeded @@ -31833,29 +33774,29 @@ /*<>*/ } function create$1(n){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], n); + (Stdlib_Obj[23][1], n); /*<>*/ } function length$1(k){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][2], k); + (Stdlib_Obj[23][2], k); /*<>*/ } function get_key$0(t, n){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call2(Stdlib_Obj[24][3], t, n); + x = /*<>*/ caml_call2(Stdlib_Obj[23][3], t, n); /*<>*/ return x; /*<>*/ } function set_key$0(t, n, k){ /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Obj[24][5], t, n, k); + (Stdlib_Obj[23][5], t, n, k); /*<>*/ } function get_data$1(t){ /*<>*/ /*<>*/ var - x = /*<>*/ caml_call1(Stdlib_Obj[24][9], t); + x = /*<>*/ caml_call1(Stdlib_Obj[23][9], t); /*<>*/ return x; /*<>*/ } function set_data$1(t, d){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][11], t, d); + (Stdlib_Obj[23][11], t, d); /*<>*/ } function make$3(keys, data){ /*<>*/ var @@ -31986,7 +33927,7 @@ /*<>*/ } function set_key_data(c, k, d){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ var _q_ = k.length - 2 | 0, /*<>*/ _p_ = 0; @@ -32013,7 +33954,7 @@ var _o_ = _n_; else{ /*<>*/ /*<>*/ var - _m_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, i); + _m_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, i); /*<>*/ if(_m_){ var i$0 = i - 1 | 0; i = i$0; @@ -33083,14 +35024,14 @@ /*<>*/ /*<>*/ var prng_key = /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, Stdlib_Random[15][2]); + (Stdlib_Domain[10][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 - (Stdlib_Random[15][4], random_state) + (Stdlib_Random[19][4], random_state) & 16777215; /*<>*/ return concat (temp_dir, @@ -33114,14 +35055,13 @@ (Stdlib_Domain[10][2], current_temp_dir_name); /*<>*/ } function temp_file(opt, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], temp_dir = sth; - else - var - temp_dir = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - var counter = 0; + var + temp_dir = + opt + ? opt[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + counter = 0; /*<>*/ for(;;){ /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); @@ -33141,24 +35081,17 @@ counter = counter$0; } } - /*<>*/ } - function open_temp_file(opt, _m_, _l_, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], mode = sth; - else - var mode = _h_; - /*<>*/ if(_m_) - var sth$0 = _m_[1], perms = sth$0; - else - var perms = 384; - /*<>*/ if(_l_) - var sth$1 = _l_[1], temp_dir = sth$1; - else - var - temp_dir = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - var counter = 0; + } + function open_temp_file(_m_, _l_, opt, prefix, suffix){ + var + mode = _m_ ? _m_[1] : _h_, + perms = _l_ ? _l_[1] : 384, + temp_dir = + opt + ? opt[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + counter = 0; /*<>*/ for(;;){ /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); @@ -33182,20 +35115,16 @@ counter = counter$0; } } - /*<>*/ } - function temp_dir(opt, _k_, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], temp_dir = sth; - else - var - temp_dir = - /*<>*/ caml_call1 - (Stdlib_Domain[10][2], current_temp_dir_name); - /*<>*/ if(_k_) - var sth$0 = _k_[1], perms = sth$0; - else - var perms = 448; - var counter = 0; + } + function temp_dir(_k_, opt, prefix, suffix){ + var + temp_dir = + _k_ + ? _k_[1] + : /*<>*/ caml_call1 + (Stdlib_Domain[10][2], current_temp_dir_name), + perms = opt ? opt[1] : 448, + counter = 0; /*<>*/ for(;;){ /*<>*/ /*<>*/ var name = temp_file_name(temp_dir, prefix, suffix); @@ -33215,7 +35144,7 @@ counter = counter$0; } } - /*<>*/ } + } var Stdlib_Filename = [0, @@ -33391,48 +35320,51 @@ Stdlib_Array = global_data.Stdlib__Array, init = Stdlib_Array[1], make_matrix = Stdlib_Array[2], - append = Stdlib_Array[3], - concat = Stdlib_Array[4], - sub = Stdlib_Array[5], - copy = Stdlib_Array[6], - fill = Stdlib_Array[7], - blit = Stdlib_Array[8], - to_list = Stdlib_Array[9], - of_list = Stdlib_Array[10], - iter = Stdlib_Array[11], - iteri = Stdlib_Array[12], - map = Stdlib_Array[13], - map_inplace = Stdlib_Array[14], - mapi = Stdlib_Array[15], - mapi_inplace = Stdlib_Array[16], - fold_left = Stdlib_Array[17], - fold_left_map = Stdlib_Array[18], - fold_right = Stdlib_Array[19], - iter2 = Stdlib_Array[20], - map2 = Stdlib_Array[21], - for_all = Stdlib_Array[22], - exists = Stdlib_Array[23], - for_all2 = Stdlib_Array[24], - exists2 = Stdlib_Array[25], - mem = Stdlib_Array[26], - memq = Stdlib_Array[27], - find_opt = Stdlib_Array[28], - find_index = Stdlib_Array[29], - find_map = Stdlib_Array[30], - find_mapi = Stdlib_Array[31], - split = Stdlib_Array[32], - combine = Stdlib_Array[33], - sort = Stdlib_Array[34], - stable_sort = Stdlib_Array[35], - fast_sort = Stdlib_Array[36], - to_seq = Stdlib_Array[37], - to_seqi = Stdlib_Array[38], - of_seq = Stdlib_Array[39], - Floatarray = Stdlib_Array[40], + init_matrix = Stdlib_Array[3], + append = Stdlib_Array[4], + concat = Stdlib_Array[5], + sub = Stdlib_Array[6], + copy = Stdlib_Array[7], + fill = Stdlib_Array[8], + blit = Stdlib_Array[9], + to_list = Stdlib_Array[10], + of_list = Stdlib_Array[11], + iter = Stdlib_Array[12], + iteri = Stdlib_Array[13], + map = Stdlib_Array[14], + map_inplace = Stdlib_Array[15], + mapi = Stdlib_Array[16], + mapi_inplace = Stdlib_Array[17], + fold_left = Stdlib_Array[18], + fold_left_map = Stdlib_Array[19], + fold_right = Stdlib_Array[20], + iter2 = Stdlib_Array[21], + map2 = Stdlib_Array[22], + for_all = Stdlib_Array[23], + exists = Stdlib_Array[24], + for_all2 = Stdlib_Array[25], + exists2 = Stdlib_Array[26], + mem = Stdlib_Array[27], + memq = Stdlib_Array[28], + find_opt = Stdlib_Array[29], + find_index = Stdlib_Array[30], + find_map = Stdlib_Array[31], + find_mapi = Stdlib_Array[32], + split = Stdlib_Array[33], + combine = Stdlib_Array[34], + sort = Stdlib_Array[35], + stable_sort = Stdlib_Array[36], + fast_sort = Stdlib_Array[37], + shuffle = Stdlib_Array[38], + to_seq = Stdlib_Array[39], + to_seqi = Stdlib_Array[40], + of_seq = Stdlib_Array[41], + Floatarray = Stdlib_Array[42], Stdlib_ArrayLabels = [0, init, make_matrix, + init_matrix, append, concat, sub, @@ -33467,6 +35399,7 @@ sort, stable_sort, fast_sort, + shuffle, to_seq, to_seqi, of_seq, @@ -33531,25 +35464,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, @@ -33598,6 +35535,10 @@ filter, find_all, filteri, + take, + drop, + take_while, + drop_while, partition, partition_map, assoc, @@ -33983,431 +35924,6 @@ /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__In_channel -//# unitInfo: Requires: Stdlib, Stdlib__Bytes, Stdlib__Fun, Stdlib__Sys -(function - (globalThis){ - "use strict"; - var - runtime = globalThis.jsoo_runtime, - caml_create_bytes = runtime.caml_create_bytes, - caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_ml_bytes_length = runtime.caml_ml_bytes_length, - 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(), - Stdlib = global_data.Stdlib, - Stdlib_Bytes = global_data.Stdlib__Bytes, - Stdlib_Sys = global_data.Stdlib__Sys, - Stdlib_Fun = global_data.Stdlib__Fun, - stdin = Stdlib[38], - open_bin = Stdlib[80], - open_text = Stdlib[79], - open_gen = Stdlib[81]; - function with_open(openfun, s, f){ - /*<>*/ /*<>*/ var - ic = /*<>*/ caml_call1(openfun, s); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], - function(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[94], ic); - /*<>*/ }, - function(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, ic); - /*<>*/ }); - /*<>*/ } - function with_open_bin(s, f){ - /*<>*/ return with_open(Stdlib[80], s, f); - /*<>*/ } - function with_open_text(s, f){ - /*<>*/ return with_open(Stdlib[79], s, f); - /*<>*/ } - function with_open_gen(flags, perm, s, f){ - /*<>*/ return with_open - ( /*<>*/ caml_call2(Stdlib[81], flags, perm), - s, - f); - /*<>*/ } - var - seek = Stdlib[96][4], - pos = Stdlib[96][5], - length = Stdlib[96][6], - close = Stdlib[93], - close_noerr = Stdlib[94]; - function input_char(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - c = /*<>*/ caml_call1(Stdlib[82], ic); - } - catch(_w_){ - var _v_ = caml_wrap_exception(_w_); - if(_v_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_v_, 0); - } - /*<>*/ return [0, c]; - /*<>*/ } - function input_byte(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - n = /*<>*/ caml_call1(Stdlib[87], ic); - } - catch(_u_){ - var _t_ = caml_wrap_exception(_u_); - if(_t_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_t_, 0); - } - /*<>*/ return [0, n]; - /*<>*/ } - function input_line(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call1(Stdlib[83], ic); - } - catch(_s_){ - var _r_ = caml_wrap_exception(_s_); - if(_r_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_r_, 0); - } - /*<>*/ return [0, s]; - /*<>*/ } - var - input = Stdlib[84], - _a_ = [0, 0], - cst_In_channel_input_all_chann = - "In_channel.input_all: channel content is larger than maximum string length"; - function really_input(ic, buf, pos, len){ - /*<>*/ try{ - /*<>*/ /*<>*/ caml_call4 - (Stdlib[85], ic, buf, pos, len); - /*<>*/ return _a_; - } - catch(_q_){ - var _p_ = caml_wrap_exception(_q_); - if(_p_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_p_, 0); - } - /*<>*/ } - function really_input_string(ic, len){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - s = /*<>*/ caml_call2(Stdlib[86], ic, len); - } - catch(_o_){ - var _n_ = caml_wrap_exception(_o_); - if(_n_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_n_, 0); - } - /*<>*/ return [0, s]; - /*<>*/ } - function read_upto(ic, buf, ofs, len){ - /*<>*/ var ofs$0 = ofs, len$0 = len; - /*<>*/ for(;;){ - if(0 !== len$0){ - /*<>*/ /*<>*/ var - r = - /*<>*/ caml_call4 - (Stdlib[84], ic, buf, ofs$0, len$0); - /*<>*/ if(0 !== r){ - var len$1 = len$0 - r | 0, ofs$1 = ofs$0 + r | 0; - ofs$0 = ofs$1; - len$0 = len$1; - continue; - } - } - /*<>*/ return ofs$0 - ofs | 0; - } - /*<>*/ } - function ensure(buf, ofs, n){ - /*<>*/ var len = caml_ml_bytes_length(buf); - if((ofs + n | 0) <= len) /*<>*/ return buf; - /*<>*/ /*<>*/ var - new_len = [0, len]; - for(;;){ - if(new_len[1] >= (ofs + n | 0)) break; - new_len[1] = (2 * new_len[1] | 0) + 1 | 0; - } - /*<>*/ var - new_len$0 = new_len[1], - new_len$1 = - new_len$0 <= Stdlib_Sys[12] - ? new_len$0 - : ofs - < Stdlib_Sys[12] - ? Stdlib_Sys[12] - : /*<>*/ caml_call1 - (Stdlib[2], cst_In_channel_input_all_chann), - /*<>*/ new_buf = - /*<>*/ caml_create_bytes(new_len$1); - /*<>*/ /*<>*/ caml_call5 - (Stdlib_Bytes[11], buf, 0, new_buf, 0, ofs); - /*<>*/ return new_buf; - /*<>*/ } - function input_all(ic){ - /*<>*/ /*<>*/ var - chunk_size = 65536; - /*<>*/ try{ - /*<>*/ var - /*<>*/ _j_ = - /*<>*/ caml_call1(Stdlib[91], ic), - /*<>*/ _k_ = - /*<>*/ caml_call1(Stdlib[92], ic) - _j_ | 0, - initial_size = _k_; - } - catch(_m_){ - var _h_ = caml_wrap_exception(_m_); - if(_h_[1] !== Stdlib[11]) throw caml_maybe_attach_backtrace(_h_, 0); - var initial_size = -1; - } - /*<>*/ var - /*<>*/ initial_size$0 = - 0 <= initial_size ? initial_size : chunk_size, - initial_size$1 = - initial_size$0 <= Stdlib_Sys[12] ? initial_size$0 : Stdlib_Sys[12], - /*<>*/ buf = - /*<>*/ caml_create_bytes(initial_size$1), - /*<>*/ nread = - read_upto(ic, buf, 0, initial_size$1); - if(nread < initial_size$1) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bytes[8], buf, 0, nread); - /*<>*/ try{ - /*<>*/ /*<>*/ var - c = /*<>*/ caml_call1(Stdlib[82], ic); - } - catch(_l_){ - var _i_ = caml_wrap_exception(_l_); - if(_i_ === Stdlib[12]) - /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Bytes[44], buf); - throw caml_maybe_attach_backtrace(_i_, 0); - } - /*<>*/ /*<>*/ var - buf$2 = ensure(buf, nread, 65537); - /*<>*/ /*<>*/ runtime.caml_bytes_set - (buf$2, nread, c); - /*<>*/ var - /*<>*/ ofs$1 = nread + 1 | 0, - buf$0 = buf$2, - ofs = ofs$1; - /*<>*/ for(;;){ - /*<>*/ var - /*<>*/ buf$1 = ensure(buf$0, ofs, chunk_size), - rem = caml_ml_bytes_length(buf$1) - ofs | 0, - /*<>*/ r = read_upto(ic, buf$1, ofs, rem); - if(r < rem) - /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Bytes[8], buf$1, 0, ofs + r | 0); - var ofs$0 = ofs + rem | 0; - buf$0 = buf$1; - ofs = ofs$0; - } - /*<>*/ } - function input_lines(ic){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - line = /*<>*/ caml_call1(Stdlib[83], ic); - } - catch(_g_){ - var _d_ = caml_wrap_exception(_g_); - if(_d_ === Stdlib[12]) /*<>*/ return 0; - throw caml_maybe_attach_backtrace(_d_, 0); - } - /*<>*/ var - /*<>*/ block = [0, line, 24029], - dst = block, - offset = 1; - /*<>*/ for(;;){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - line$0 = /*<>*/ caml_call1(Stdlib[83], ic); - } - catch(_f_){ - var _e_ = caml_wrap_exception(_f_); - if(_e_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_e_, 0); - dst[1 + offset] = 0; - /*<>*/ return block; - } - /*<>*/ /*<>*/ var - dst$0 = [0, line$0, 24029]; - dst[1 + offset] = dst$0; - dst = dst$0; - offset = 1; - } - /*<>*/ } - function fold_lines(f, accu, ic){ - /*<>*/ var accu$0 = accu; - /*<>*/ for(;;){ - /*<>*/ try{ - /*<>*/ /*<>*/ var - line = /*<>*/ caml_call1(Stdlib[83], ic); - } - catch(_c_){ - var _b_ = caml_wrap_exception(_c_); - if(_b_ === Stdlib[12]) /*<>*/ return accu$0; - throw caml_maybe_attach_backtrace(_b_, 0); - } - /*<>*/ /*<>*/ var - accu$1 = /*<>*/ caml_call2(f, accu$0, line); - accu$0 = accu$1; - } - /*<>*/ } - var - set_binary_mode = Stdlib[95], - Stdlib_In_channel = - [0, - stdin, - open_bin, - open_text, - open_gen, - with_open_bin, - with_open_text, - with_open_gen, - close, - close_noerr, - input_char, - input_byte, - input_line, - really_input_string, - input_all, - input_lines, - input, - really_input, - fold_lines, - seek, - pos, - length, - set_binary_mode, - runtime.caml_sys_isatty]; - runtime.caml_register_global(6, Stdlib_In_channel, "Stdlib__In_channel"); - return; - /*<>*/ } - (globalThis)); - -//# unitInfo: Provides: Stdlib__Out_channel -//# unitInfo: Requires: Stdlib, Stdlib__Fun -(function - (globalThis){ - "use strict"; - var runtime = globalThis.jsoo_runtime; - /*<>*/ 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]); - } - var - global_data = runtime.caml_get_global_data(), - Stdlib = global_data.Stdlib, - Stdlib_Fun = global_data.Stdlib__Fun, - stdout = Stdlib[39], - stderr = Stdlib[40], - open_bin = Stdlib[61], - open_text = Stdlib[60], - open_gen = Stdlib[62]; - function with_open(openfun, s, f){ - /*<>*/ /*<>*/ var - oc = /*<>*/ caml_call1(openfun, s); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], - function(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[77], oc); - /*<>*/ }, - function(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, oc); - /*<>*/ }); - /*<>*/ } - function with_open_bin(s, f){ - /*<>*/ return with_open(Stdlib[61], s, f); - /*<>*/ } - function with_open_text(s, f){ - /*<>*/ return with_open(Stdlib[60], s, f); - /*<>*/ } - function with_open_gen(flags, perm, s, f){ - /*<>*/ return with_open - ( /*<>*/ caml_call2(Stdlib[62], flags, perm), - s, - f); - /*<>*/ } - var - seek = Stdlib[96][1], - pos = Stdlib[96][2], - length = Stdlib[96][3], - close = Stdlib[76], - close_noerr = Stdlib[77], - flush = Stdlib[63], - flush_all = Stdlib[64], - output_char = Stdlib[65], - output_byte = Stdlib[70], - output_string = Stdlib[66], - output_bytes = Stdlib[67], - output = Stdlib[68], - output_substring = Stdlib[69], - set_binary_mode = Stdlib[78], - Stdlib_Out_channel = - [0, - stdout, - stderr, - open_bin, - open_text, - open_gen, - with_open_bin, - with_open_text, - with_open_gen, - close, - close_noerr, - output_char, - output_byte, - output_string, - output_bytes, - output, - output_substring, - flush, - flush_all, - seek, - pos, - length, - set_binary_mode, - runtime.caml_ml_set_buffered, - runtime.caml_ml_is_buffered, - runtime.caml_sys_isatty]; - runtime.caml_register_global(2, Stdlib_Out_channel, "Stdlib__Out_channel"); - return; - /*<>*/ } - (globalThis)); - //# unitInfo: Provides: Stdlib__Effect //# unitInfo: Requires: Stdlib, Stdlib__Callback, Stdlib__Printexc, Stdlib__Printf //# unitInfo: Effects_without_cps: true @@ -34472,77 +35988,79 @@ "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]; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + k[2] = last_fiber; + /*<>*/ 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]; - /*<>*/ return /*<>*/ caml_call1(f, k); - /*<>*/ } - /*<>*/ /*<>*/ var + k[2] = last_fiber; + /*<>*/ 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 = + /*<>*/ } + /*<>*/ var + /*<>*/ Deep = [0, continue$0, discontinue, @@ -34553,27 +36071,28 @@ 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) - /*<>*/ throw [0, E, k]; - /*<>*/ return error(0); - /*<>*/ } - /*<>*/ /*<>*/ var - s = /*<>*/ caml_alloc_stack(error, error, effc); - /*<>*/ try{ - /*<>*/ /*<>*/ jsoo_effect_not_supported + /*<>*/ 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 (); var _b_ = 0; } @@ -34581,58 +36100,59 @@ 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]; - /*<>*/ return /*<>*/ caml_call1 + k[2] = last_fiber; + /*<>*/ 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/compiler/tests-toplevel/test_toplevel.reference b/compiler/tests-toplevel/test_toplevel.reference index 58eb84ed85..f5de8af322 100644 --- a/compiler/tests-toplevel/test_toplevel.reference +++ b/compiler/tests-toplevel/test_toplevel.reference @@ -3,4 +3,4 @@ hello Line 4, characters 2-4: Error: Syntax error Line 5, characters 0-16: -Error: Unbound module Missing_module +Error: Unbound module "Missing_module" diff --git a/dune-project b/dune-project index ef7f1d9be4..154208ad4f 100644 --- a/dune-project +++ b/dune-project @@ -18,7 +18,7 @@ (description "Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it possible to run pure OCaml programs in JavaScript environment like browsers and Node.js") (depends - (ocaml (and (>= 4.08) (< 5.3))) + (ocaml (and (>= 4.08) (< 5.4))) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (ppxlib (>= 0.15.0)) diff --git a/js_of_ocaml-compiler.opam b/js_of_ocaml-compiler.opam index 217878193f..6c9ba412f2 100644 --- a/js_of_ocaml-compiler.opam +++ b/js_of_ocaml-compiler.opam @@ -13,7 +13,7 @@ doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ "dune" {>= "3.7"} - "ocaml" {>= "4.08" & < "5.3"} + "ocaml" {>= "4.08" & < "5.4"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "ppxlib" {>= "0.15.0"} diff --git a/ppx/ppx_deriving_json/tests/gen.mlt b/ppx/ppx_deriving_json/tests/gen.mlt index 80a3abe287..4c324e596d 100644 --- a/ppx/ppx_deriving_json/tests/gen.mlt +++ b/ppx/ppx_deriving_json/tests/gen.mlt @@ -16,7 +16,6 @@ type int_list = int list [@@deriving json] [%%expect {| - type int_list = int list[@@deriving json] include struct @@ -27,10 +26,9 @@ include buf let _ = int_list_of_json let rec int_list_to_json : Buffer.t -> int_list -> unit = - fun buf -> - fun a -> - Deriving_Json.write_list - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + fun buf a -> + Deriving_Json.write_list + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_list_to_json let int_list_json : int_list Deriving_Json.t = Deriving_Json.make int_list_to_json int_list_of_json @@ -46,7 +44,6 @@ type int_ref = int ref [@@deriving json] [%%expect {| - type int_ref = int ref[@@deriving json] include struct @@ -57,10 +54,9 @@ include buf let _ = int_ref_of_json let rec int_ref_to_json : Buffer.t -> int_ref -> unit = - fun buf -> - fun a -> - Deriving_Json.write_ref - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + fun buf a -> + Deriving_Json.write_ref + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_ref_to_json let int_ref_json : int_ref Deriving_Json.t = Deriving_Json.make int_ref_to_json int_ref_of_json @@ -76,7 +72,6 @@ type int_option = int option [@@deriving json] [%%expect {| - type int_option = int option[@@deriving json] include struct @@ -87,10 +82,9 @@ include (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_option_of_json let rec int_option_to_json : Buffer.t -> int_option -> unit = - fun buf -> - fun a -> - Deriving_Json.write_option - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + fun buf a -> + Deriving_Json.write_option + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_option_to_json let int_option_json : int_option Deriving_Json.t = Deriving_Json.make int_option_to_json int_option_of_json @@ -106,7 +100,6 @@ type int_array = int array [@@deriving json] [%%expect {| - type int_array = int array[@@deriving json] include struct @@ -117,10 +110,9 @@ include buf let _ = int_array_of_json let rec int_array_to_json : Buffer.t -> int_array -> unit = - fun buf -> - fun a -> - Deriving_Json.write_array - (fun buf -> fun a -> Deriving_Json.Json_int.write buf a) buf a + fun buf a -> + Deriving_Json.write_array + (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_array_to_json let int_array_json : int_array Deriving_Json.t = Deriving_Json.make int_array_to_json int_array_of_json @@ -136,7 +128,6 @@ type tuple1 = int * string [@@deriving json] [%%expect {| - type tuple1 = (int * string)[@@deriving json] include struct @@ -152,14 +143,13 @@ include Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = tuple1_of_json let rec tuple1_to_json : Buffer.t -> tuple1 -> unit = - fun buf -> - fun a -> - let (a, b) = a in - Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_string.write buf b); - Buffer.add_string buf "]" + fun buf a -> + let (a, b) = a in + Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_string.write buf b); + Buffer.add_string buf "]" let _ = tuple1_to_json let tuple1_json : tuple1 Deriving_Json.t = Deriving_Json.make tuple1_to_json tuple1_of_json @@ -180,7 +170,6 @@ type variant1 = [%%expect {| - type variant1 = | A | B @@ -229,7 +218,6 @@ type variant2 = [%%expect {| - type variant2 = | D of string | E of variant1 [@@deriving json] @@ -280,7 +268,6 @@ type record1 = [%%expect {| - type record1 = { f: variant1 ; g: variant2 ; @@ -302,16 +289,15 @@ include Deriving_Json_lexer.read_rbracket buf; { f = a; g = b; h = c }))) let _ = record1_of_json let rec record1_to_json : Buffer.t -> record1 -> unit = - fun buf -> - fun { f; g; h } -> - Buffer.add_string buf "[0"; - (((Buffer.add_string buf ","; variant1_to_json buf f); - Buffer.add_string buf ","; - variant2_to_json buf g); - Buffer.add_string buf ","; - Deriving_Json.write_option - (fun buf -> fun a -> record1_to_json buf a) buf h); - Buffer.add_string buf "]" + fun buf { f; g; h } -> + Buffer.add_string buf "[0"; + (((Buffer.add_string buf ","; variant1_to_json buf f); + Buffer.add_string buf ","; + variant2_to_json buf g); + Buffer.add_string buf ","; + Deriving_Json.write_option (fun buf a -> record1_to_json buf a) buf + h); + Buffer.add_string buf "]" let _ = record1_to_json let record1_json : record1 Deriving_Json.t = Deriving_Json.make record1_to_json record1_of_json @@ -330,7 +316,6 @@ type poly1 = [%%expect {| - type poly1 = [ `A | `B of string ][@@deriving json] include struct @@ -355,18 +340,16 @@ include let _ = poly1_of_json_with_tag and _ = poly1_of_json let rec poly1_to_json : Buffer.t -> [> poly1] -> unit = - fun buf -> - fun a -> - match a with - | `A -> Deriving_Json.Json_int.write buf 65 - | `B a -> - let (a, b) = (66, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_string.write buf b); - Buffer.add_string buf "]") + fun buf a -> + match a with + | `A -> Deriving_Json.Json_int.write buf 65 + | `B a -> + let (a, b) = (66, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_string.write buf b); + Buffer.add_string buf "]") let _ = poly1_to_json let poly1_json : poly1 Deriving_Json.t = Deriving_Json.make poly1_to_json poly1_of_json @@ -389,7 +372,6 @@ type poly2 = [%%expect {| - type poly2 = [ | poly1 | `C of int ][@@deriving json] include struct @@ -418,18 +400,16 @@ include let _ = poly2_of_json_with_tag and _ = poly2_of_json let rec poly2_to_json : Buffer.t -> [> poly2] -> unit = - fun buf -> - fun a -> - match a with - | #poly1 as a -> poly1_to_json buf a - | `C a -> - let (a, b) = (67, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf b); - Buffer.add_string buf "]") + fun buf a -> + match a with + | #poly1 as a -> poly1_to_json buf a + | `C a -> + let (a, b) = (67, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf b); + Buffer.add_string buf "]") let _ = poly2_to_json let poly2_json : poly2 Deriving_Json.t = Deriving_Json.make poly2_to_json poly2_of_json @@ -454,7 +434,6 @@ type inline_record = [%%expect {| - type inline_record = | I of { name: string ; @@ -511,7 +490,6 @@ val inline_record_json : inline_record Deriving_Json.t = type 'a t = 'a array [@@deriving json] [%%expect {| - type 'a t = 'a array[@@deriving json] include struct @@ -520,15 +498,11 @@ include (Deriving_Json_lexer.lexbuf -> 'a) -> Deriving_Json_lexer.lexbuf -> 'a t = - fun poly_a -> - fun buf -> Deriving_Json.read_array (fun buf -> poly_a buf) buf + fun poly_a buf -> Deriving_Json.read_array (fun buf -> poly_a buf) buf let _ = of_json let rec to_json : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit = - fun poly_a -> - fun buf -> - fun a -> - Deriving_Json.write_array (fun buf -> fun a -> poly_a buf a) buf - a + fun poly_a buf a -> + Deriving_Json.write_array (fun buf a -> poly_a buf a) buf a let _ = to_json let json : 'a Deriving_Json.t -> 'a t Deriving_Json.t = fun poly_a -> @@ -547,7 +521,6 @@ val json : 'a Deriving_Json.t -> 'a t Deriving_Json.t = type ('a,'b) t = ('a array * 'b) [@@deriving json] [%%expect {| - type ('a, 'b) t = ('a array * 'b)[@@deriving json] include struct @@ -557,44 +530,35 @@ include (Deriving_Json_lexer.lexbuf -> 'b) -> Deriving_Json_lexer.lexbuf -> ('a, 'b) t = - fun poly_a -> - fun poly_b -> - fun buf -> - Deriving_Json_lexer.read_lbracket buf; - ignore (Deriving_Json_lexer.read_tag_1 0 buf); - Deriving_Json_lexer.read_comma buf; - (let a = Deriving_Json.read_array (fun buf -> poly_a buf) buf in - Deriving_Json_lexer.read_comma buf; - (let b = poly_b buf in - Deriving_Json_lexer.read_rbracket buf; (a, b))) + fun poly_a poly_b buf -> + Deriving_Json_lexer.read_lbracket buf; + ignore (Deriving_Json_lexer.read_tag_1 0 buf); + Deriving_Json_lexer.read_comma buf; + (let a = Deriving_Json.read_array (fun buf -> poly_a buf) buf in + Deriving_Json_lexer.read_comma buf; + (let b = poly_b buf in Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = of_json let rec to_json : (Buffer.t -> 'a -> unit) -> (Buffer.t -> 'b -> unit) -> Buffer.t -> ('a, 'b) t -> unit = - fun poly_a -> - fun poly_b -> - fun buf -> - fun a -> - let (a, b) = a in - Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.write_array (fun buf -> fun a -> poly_a buf a) - buf a); - Buffer.add_string buf ","; - poly_b buf b); - Buffer.add_string buf "]" + fun poly_a poly_b buf a -> + let (a, b) = a in + Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.write_array (fun buf a -> poly_a buf a) buf a); + Buffer.add_string buf ","; + poly_b buf b); + Buffer.add_string buf "]" let _ = to_json let json : 'a Deriving_Json.t -> 'b Deriving_Json.t -> ('a, 'b) t Deriving_Json.t = - fun poly_a -> - fun poly_b -> - Deriving_Json.make - ((to_json (Deriving_Json.write poly_a)) - (Deriving_Json.write poly_b)) - ((of_json (Deriving_Json.read poly_a)) - (Deriving_Json.read poly_b)) + fun poly_a poly_b -> + Deriving_Json.make + ((to_json (Deriving_Json.write poly_a)) + (Deriving_Json.write poly_b)) + ((of_json (Deriving_Json.read poly_a)) (Deriving_Json.read poly_b)) let _ = json end[@@ocaml.doc "@inline"][@@merlin.hide ];; type ('a, 'b) t = 'a array * 'b @@ -613,7 +577,6 @@ val json : type t = A | B [@@deriving json] [%%expect {| - type t = | A | B [@@deriving json] @@ -644,24 +607,19 @@ val json : t Deriving_Json.t = let x = [%json: t option] [%%expect {| - let x = Deriving_Json.make - (fun buf -> - fun a -> - Deriving_Json.write_option (fun buf -> fun a -> to_json buf a) buf a) + (fun buf a -> + Deriving_Json.write_option (fun buf a -> to_json buf a) buf a) (fun buf -> Deriving_Json.read_option (fun buf -> of_json buf) buf);; val x : t option Deriving_Json.t = |}];; let y = [%to_json: t list] [%%expect {| - let y x = let buf = Buffer.create 50 in - ((fun buf -> - fun a -> - Deriving_Json.write_list (fun buf -> fun a -> to_json buf a) buf a)) + ((fun buf a -> Deriving_Json.write_list (fun buf a -> to_json buf a) buf a)) buf x; Buffer.contents buf;; val y : t list -> string = @@ -669,12 +627,9 @@ val y : t list -> string = let z = [%json_of: t array] [%%expect {| - let z x = let buf = Buffer.create 50 in - ((fun buf -> - fun a -> - Deriving_Json.write_array (fun buf -> fun a -> to_json buf a) buf a)) + ((fun buf a -> Deriving_Json.write_array (fun buf a -> to_json buf a) buf a)) buf x; Buffer.contents buf;; val z : t array -> string = @@ -698,7 +653,6 @@ val t : string -> t * t = ;; type id' = int [@@deriving json] [%%expect {| - type id' = int[@@deriving json] include struct @@ -707,7 +661,7 @@ include fun buf -> Deriving_Json.Json_int.read buf let _ = id'_of_json let rec id'_to_json : Buffer.t -> id' -> unit = - fun buf -> fun a -> Deriving_Json.Json_int.write buf a + fun buf a -> Deriving_Json.Json_int.write buf a let _ = id'_to_json let id'_json : id' Deriving_Json.t = Deriving_Json.make id'_to_json id'_of_json @@ -726,7 +680,6 @@ type poly3 = [%%expect {| - type poly3 = [ | poly1 | `C of [ `p1 of poly1 | `p2 of poly2 | `p3 of poly3 ] ] [@@deriving json] @@ -777,42 +730,40 @@ include let _ = poly3_of_json_with_tag and _ = poly3_of_json let rec poly3_to_json : Buffer.t -> [> poly3] -> unit = - fun buf -> - fun a -> - match a with - | #poly1 as a -> poly1_to_json buf a - | `C a -> - let (a, b) = (67, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - (match b with - | `p1 a -> - let (a, b) = (25025, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly1_to_json buf b); - Buffer.add_string buf "]") - | `p2 a -> - let (a, b) = (25026, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly2_to_json buf b); - Buffer.add_string buf "]") - | `p3 a -> - let (a, b) = (25027, a) in - (Buffer.add_string buf "[0"; - ((Buffer.add_string buf ","; - Deriving_Json.Json_int.write buf a); - Buffer.add_string buf ","; - poly3_to_json buf b); - Buffer.add_string buf "]"))); - Buffer.add_string buf "]") + fun buf a -> + match a with + | #poly1 as a -> poly1_to_json buf a + | `C a -> + let (a, b) = (67, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + (match b with + | `p1 a -> + let (a, b) = (25025, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly1_to_json buf b); + Buffer.add_string buf "]") + | `p2 a -> + let (a, b) = (25026, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly2_to_json buf b); + Buffer.add_string buf "]") + | `p3 a -> + let (a, b) = (25027, a) in + (Buffer.add_string buf "[0"; + ((Buffer.add_string buf ","; + Deriving_Json.Json_int.write buf a); + Buffer.add_string buf ","; + poly3_to_json buf b); + Buffer.add_string buf "]"))); + Buffer.add_string buf "]") let _ = poly3_to_json let poly3_json : poly3 Deriving_Json.t = Deriving_Json.make poly3_to_json poly3_of_json diff --git a/ppx/ppx_js/tests/ppx.mlt b/ppx/ppx_js/tests/ppx.mlt index e20663af96..e1c1510135 100644 --- a/ppx/ppx_js/tests/ppx.mlt +++ b/ppx/ppx_js/tests/ppx.mlt @@ -274,7 +274,8 @@ Error: This expression has type < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop but an expression was expected of type < set : int -> unit; .. > Js_of_ocaml.Js.gen_prop - Types for method set are incompatible + The method set has type float -> unit, + but the expected method type was int -> unit |}] ;; @@ -325,7 +326,7 @@ Error: This expression has type is not compatible with type float Js_of_ocaml.Js.prop = < get : float; set : float -> unit > Js_of_ocaml.Js.gen_prop - Types for method get are incompatible + The method get has type int, but the expected method type was float |}] ;; @@ -349,7 +350,8 @@ Error: This expression has type Js_of_ocaml.Js.t but an expression was expected of type < m : int Js_of_ocaml.Js.meth; .. > Js_of_ocaml.Js.t - Types for method m are incompatible + The method m has type string Js_of_ocaml.Js.meth, + but the expected method type was int Js_of_ocaml.Js.meth |}] ;; @@ -479,7 +481,8 @@ Error: This expression has type is not compatible with type int Js_of_ocaml.Js.prop = < get : int; set : int -> unit > Js_of_ocaml.Js.gen_prop - Types for method get are incompatible + The method get has type int Js_of_ocaml.Js.optdef, + but the expected method type was int |}] ;; diff --git a/tools/toplevel_expect/dune b/tools/toplevel_expect/dune index 372664e168..f08ae362fa 100644 --- a/tools/toplevel_expect/dune +++ b/tools/toplevel_expect/dune @@ -9,6 +9,7 @@ toplevel_expect_test.ml-4.08 toplevel_expect_test.ml-4.09 toplevel_expect_test.ml-4.10 + toplevel_expect_test.ml-5.3 toplevel_expect_test.ml-default) (action (with-stdout-to diff --git a/tools/toplevel_expect/toplevel_expect_test.ml-5.3 b/tools/toplevel_expect/toplevel_expect_test.ml-5.3 new file mode 100644 index 0000000000..36e38c3b9e --- /dev/null +++ b/tools/toplevel_expect/toplevel_expect_test.ml-5.3 @@ -0,0 +1,388 @@ +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* Jeremie Dimino, Jane Street Europe *) +(* *) +(* Copyright 2016 Jane Street Group LLC *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Execute a list of phrases from a .ml file and compare the result to the + expected output, written inside [%%expect ...] nodes. At the end, create + a .corrected file containing the corrected expectations. The test is + successful if there is no differences between the two files. + + An [%%expect] node always contains both the expected outcome with and + without -principal. When the two differ the expectation is written as + follows: + + {[ + [%%expect {| + output without -principal + |}, Principal{| + output with -principal + |}] + ]} +*) + +[@@@ocaml.warning "-40"] + +open StdLabels + +(* representation of: {tag|str|tag} *) +type string_constant = + { str : string + ; tag : string + } + +type expectation = + { extid_loc : Location.t (* Location of "expect" in "[%%expect ...]" *) + ; payload_loc : Location.t (* Location of the whole payload *) + ; normal : string_constant (* expectation without -principal *) + ; principal : string_constant (* expectation with -principal *) + } + +(* A list of phrases with the expected toplevel output *) +type chunk = + { phrases : Parsetree.toplevel_phrase list + ; expectation : expectation + } + +type correction = + { corrected_expectations : expectation list + ; trailing_output : string + } + +let match_expect_extension (ext : Parsetree.extension) = + match ext with + | ({Asttypes.txt="expect"|"ocaml.expect"; loc = extid_loc}, payload) -> + let invalid_payload () = + Location.raise_errorf ~loc:extid_loc + "invalid [%%%%expect payload]" + in + let string_constant (e : Parsetree.expression) = + match e.pexp_desc with + | Pexp_constant ({ pconst_desc =Pconst_string (str, _, Some tag); _}) -> + { str; tag } + | _ -> invalid_payload () + in + let expectation = + match payload with + | PStr [{ pstr_desc = Pstr_eval (e, []); _ }] -> + let normal, principal = + match e.pexp_desc with + | Pexp_tuple + [ a + ; { pexp_desc = Pexp_construct + ({ txt = Lident "Principal"; _ }, Some b); _ } + ] -> + (string_constant a, string_constant b) + | _ -> let s = string_constant e in (s, s) + in + { extid_loc + ; payload_loc = e.pexp_loc + ; normal + ; principal + } + | PStr [] -> + let s = { tag = ""; str = "" } in + { extid_loc + ; payload_loc = { extid_loc with loc_start = extid_loc.loc_end } + ; normal = s + ; principal = s + } + | _ -> invalid_payload () + in + Some expectation + | _ -> + None + +(* Split a list of phrases from a .ml file *) +let split_chunks phrases = + let rec loop (phrases : Parsetree.toplevel_phrase list) code_acc acc = + match phrases with + | [] -> + if code_acc = [] then + (List.rev acc, None) + else + (List.rev acc, Some (List.rev code_acc)) + | phrase :: phrases -> + match phrase with + | Ptop_def [] -> loop phrases code_acc acc + | Ptop_def [{pstr_desc = Pstr_extension(ext, []); _}] -> begin + match match_expect_extension ext with + | None -> loop phrases (phrase :: code_acc) acc + | Some expectation -> + let chunk = + { phrases = List.rev code_acc + ; expectation + } + in + loop phrases [] (chunk :: acc) + end + | _ -> loop phrases (phrase :: code_acc) acc + in + loop phrases [] [] + +module Compiler_messages = struct + let print_loc ppf (loc : Location.t) = + let startchar = loc.loc_start.pos_cnum - loc.loc_start.pos_bol in + let endchar = loc.loc_end.pos_cnum - loc.loc_start.pos_cnum + startchar in + Format.fprintf ppf "Line _"; + if startchar >= 0 then + Format.fprintf ppf ", characters %d-%d" startchar endchar; + Format.fprintf ppf ":@." + + let () = + let default = !Location.report_printer () in + Location.report_printer := (fun _ -> + { default with + Location.pp_main_loc = (fun _ _ fmt loc -> print_loc fmt loc); + Location.pp_submsg_loc = (fun _ _ fmt loc -> print_loc fmt loc); + }) + + let capture ppf ~f = + Misc.protect_refs + [ R (Location.formatter_for_warnings , ppf ) + ] + f +end + +let collect_formatters buf pps ~f = + List.iter ~f:(fun pp -> Format.pp_print_flush pp ()) pps; + let save = + List.map ~f:(fun pp -> Format.pp_get_formatter_out_functions pp ()) pps + in + let restore () = + List.iter2 + ~f:(fun pp out_functions -> + Format.pp_print_flush pp (); + Format.pp_set_formatter_out_functions pp out_functions) + pps save + in + let out_string str ofs len = Buffer.add_substring buf str ofs len + and out_flush = ignore + and out_newline () = Buffer.add_char buf '\n' + and out_spaces n = for _i = 1 to n do Buffer.add_char buf ' ' done + and out_indent n = for _i = 1 to n do Buffer.add_char buf ' ' done in + let out_functions = + { Format.out_string; out_flush; out_newline; out_spaces; out_indent } + in + List.iter + ~f:(fun pp -> Format.pp_set_formatter_out_functions pp out_functions) + pps; + match f () with + | x -> restore (); x + | exception exn -> restore (); raise exn + +(* Invariant: ppf = Format.formatter_of_buffer buf *) +let capture_everything buf ppf ~f = + collect_formatters buf [Format.std_formatter; Format.err_formatter] + ~f:(fun () -> Compiler_messages.capture ppf ~f) + +let exec_phrase ppf phrase = + if !Clflags.dump_parsetree then Printast. top_phrase ppf phrase; + if !Clflags.dump_source then Pprintast.top_phrase ppf phrase; + Toploop.execute_phrase true ppf phrase + +let parse_contents ~fname contents = + let lexbuf = Lexing.from_string contents in + Location.init lexbuf fname; + Location.input_name := fname; + Parse.use_file lexbuf + +let eval_expectation expectation ~output = + let s = + if !Clflags.principal then + expectation.principal + else + expectation.normal + in + if s.str = output then + None + else + let trimmed = String.trim output in + let normalized = if String.exists ~f:(function '\n' -> true | _ -> false) output + then "\n" ^ trimmed ^ "\n" + else trimmed + in + let s = { s with str = normalized } in + Some ( + if !Clflags.principal then + { expectation with principal = s } + else + { expectation with normal = s } + ) + +let preprocess_structure mappers str = + let open Ast_mapper in + List.fold_right + ~f:(fun ppx_rewriter str -> + let mapper : Ast_mapper.mapper = ppx_rewriter [] in + mapper.structure mapper str) + mappers + ~init:str + +let preprocess_phrase mappers phrase = + let open Parsetree in + match phrase with + | Ptop_def str -> Ptop_def (preprocess_structure mappers str) + | Ptop_dir _ as x -> x + + +let shift_lines delta = + let position (pos : Lexing.position) = + { pos with pos_lnum = pos.pos_lnum + delta } + in + let location _this (loc : Location.t) = + { loc with + loc_start = position loc.loc_start + ; loc_end = position loc.loc_end + } + in + fun _ -> { Ast_mapper.default_mapper with location } + +let rec min_line_number : Parsetree.toplevel_phrase list -> int option = +function + | [] -> None + | (Ptop_dir _ | Ptop_def []) :: l -> min_line_number l + | Ptop_def (st :: _) :: _ -> Some st.pstr_loc.loc_start.pos_lnum + +let eval_expect_file mapper fname ~file_contents = + Warnings.reset_fatal (); + let chunks, trailing_code = + parse_contents ~fname:fname file_contents |> split_chunks + in + let buf = Buffer.create 1024 in + let ppf = Format.formatter_of_buffer buf in + let out_fun = Format.pp_get_formatter_out_functions ppf () in + Format.pp_set_formatter_out_functions Format.std_formatter out_fun; + + let exec_phrases phrases = + + let mappers = + match min_line_number phrases with + | None -> [] + | Some lnum -> [shift_lines (1 - lnum)] + in + let mappers = mapper :: mappers in + let phrases = List.map ~f:(preprocess_phrase mappers) phrases in + + (* For formatting purposes *) + Buffer.add_char buf '\n'; + let _ : bool = + List.fold_left phrases ~init:true ~f:(fun acc phrase -> + acc && + try + Location.reset (); + exec_phrase ppf phrase + with exn -> + Location.report_exception ppf exn; + false) + in + Format.pp_print_flush ppf (); + let len = Buffer.length buf in + if len > 0 && Buffer.nth buf (len - 1) <> '\n' then + (* For formatting purposes *) + Buffer.add_char buf '\n'; + let s = Buffer.contents buf in + Buffer.clear buf; + Misc.delete_eol_spaces s + in + let corrected_expectations = + capture_everything buf ppf ~f:(fun () -> + List.fold_left chunks ~init:[] ~f:(fun acc chunk -> + let output = exec_phrases chunk.phrases in + match eval_expectation chunk.expectation ~output with + | None -> acc + | Some correction -> correction :: acc) + |> List.rev) + in + let trailing_output = + match trailing_code with + | None -> "" + | Some phrases -> + capture_everything buf ppf ~f:(fun () -> exec_phrases phrases) + in + { corrected_expectations; trailing_output } + +let output_slice oc s a b = + output_string oc (String.sub s ~pos:a ~len:(b - a)) + +let output_corrected oc ~file_contents correction = + let output_body oc { str; tag } = + Printf.fprintf oc "{%s|%s|%s}" tag str tag + in + let ofs = + List.fold_left correction.corrected_expectations ~init:0 + ~f:(fun ofs c -> + output_slice oc file_contents ofs c.payload_loc.loc_start.pos_cnum; + output_body oc c.normal; + if !Clflags.principal && c.normal.str <> c.principal.str then begin + output_string oc ", Principal"; + output_body oc c.principal + end; + c.payload_loc.loc_end.pos_cnum) + in + output_slice oc file_contents ofs (String.length file_contents); + match correction.trailing_output with + | "" -> () + | s -> Printf.fprintf oc "\n[%%%%expect{|%s|}]\n" s + +let write_corrected ~file ~file_contents correction = + let oc = open_out file in + output_corrected oc ~file_contents correction; + close_out oc + +let process_expect_file mapper fname = + let corrected_fname = fname ^ ".corrected" in + let file_contents = + let ic = open_in_bin fname in + match really_input_string ic (in_channel_length ic) with + | s -> close_in ic; Misc.normalise_eol s + | exception e -> close_in ic; raise e + in + let correction = eval_expect_file mapper fname ~file_contents in + write_corrected ~file:corrected_fname ~file_contents correction + +let repo_root = ref "" + +let main mapper fname = + Toploop.override_sys_argv + (Array.sub Sys.argv ~pos:!Arg.current + ~len:(Array.length Sys.argv - !Arg.current)); + (* Ignore OCAMLRUNPARAM=b to be reproducible *) + Printexc.record_backtrace false; + List.iter [ "stdlib" ] ~f:(fun s -> + Topdirs.dir_directory (Filename.concat !repo_root s)); + Toploop.initialize_toplevel_env (); + Sys.interactive := false; + process_expect_file mapper fname; + exit 0 + +let args = + Arg.align + [ "-repo-root", Set_string repo_root, + " root of the OCaml repository" + ; "-principal", Set Clflags.principal, + " Evaluate the file with -principal set" + ] + +let usage = "Usage: expect_test [script-file [arguments]]\n\ + options are:" + +let run mapper = + Toploop.set_paths (); + Clflags.error_style := Some Misc.Error_style.Short; + try + Arg.parse args (main mapper) usage; + Printf.eprintf "expect_test: no input file\n"; + exit 2 + with exn -> + Location.report_exception Format.err_formatter exn; + exit 2