diff --git a/compiler/tests-check-prim/main.output5 b/compiler/tests-check-prim/main.output5 index 6c5be331cd..7cc646bdce 100644 --- a/compiler/tests-check-prim/main.output5 +++ b/compiler/tests-check-prim/main.output5 @@ -214,6 +214,5 @@ caml_unix_time caml_unix_unlink From +zstd.js: -caml_compression_available caml_zstd_initialize diff --git a/compiler/tests-check-prim/unix-unix.output5 b/compiler/tests-check-prim/unix-unix.output5 index 24cc014389..624e1251d8 100644 --- a/compiler/tests-check-prim/unix-unix.output5 +++ b/compiler/tests-check-prim/unix-unix.output5 @@ -302,6 +302,5 @@ caml_unix_findnext caml_unix_startup From +zstd.js: -caml_compression_available caml_zstd_initialize 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 decbbce386..1d3955adcc 100644 --- a/compiler/tests-full/stdlib.cma.expected.js +++ b/compiler/tests-full/stdlib.cma.expected.js @@ -827,12 +827,12 @@ var str = param[2]; /*<>*/ return str; } - function symbol$1(param, _n_){ + function symbol$1(_n_, param){ /*<>*/ var - str2 = _n_[2], - fmt2 = _n_[1], - str1 = param[2], - fmt1 = param[1], + str2 = param[2], + fmt2 = param[1], + str1 = _n_[2], + fmt1 = _n_[1], /*<>*/ _o_ = symbol(str1, symbol(cst$0, str2)); /*<>*/ return [0, /*<>*/ caml_call2 @@ -1136,8 +1136,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.2.0+dev0-2023-04-11", + ocaml_release = [0, 5, 2, 0, [0, [0, 0, "dev0-2023-04-11"]]], Stdlib = global_data.Stdlib, /*<>*/ executable_name = /*<>*/ runtime.caml_sys_executable_name(0), @@ -1202,7 +1202,7 @@ function catch_break(on){ /*<>*/ return on ? 0 : 0; /*<>*/ } - var development_version = 0; + var development_version = 1; function Make(_b_, _a_){ /*<>*/ return [0, 1];} /*<>*/ var /*<>*/ Immediate64 = [0, Make], @@ -1272,7 +1272,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 @@ -1282,7 +1281,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, cst_Obj_Ephemeron_blit_key = "Obj.Ephemeron.blit_key", cst_Obj_Ephemeron_check_key = "Obj.Ephemeron.check_key", @@ -1292,8 +1290,7 @@ cst_Obj_Ephemeron_get_key = "Obj.Ephemeron.get_key", cst_Obj_Ephemeron_create = "Obj.Ephemeron.create", cst_Obj_extension_constructor$0 = cst_Obj_extension_constructor$1, - cst_Obj_extension_constructor = cst_Obj_extension_constructor$1, - _a_ = [0, "obj.ml", 94, 4]; + cst_Obj_extension_constructor = cst_Obj_extension_constructor$1; function is_block(a){ /*<>*/ return 1 - (typeof a === "number" ? 1 : 0); /*<>*/ } @@ -1318,115 +1315,104 @@ int_tag = 1000, out_of_heap_tag = 1001, unaligned_tag = 1002; - 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; 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 - 1 - 2 | 0; - /*<>*/ } + /*<>*/ return x.length - 1 - 2 | 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, @@ -1451,7 +1437,6 @@ int_tag, out_of_heap_tag, unaligned_tag, - [0, info], Extension_constructor, [0, create, @@ -1469,7 +1454,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)); @@ -1497,9 +1482,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; @@ -1520,25 +1505,27 @@ 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 _a_ = caml_atomic_fetch_add, _b_ = runtime.caml_atomic_cas, _c_ = caml_atomic_exchange, _d_ = runtime.caml_atomic_load, + _e_ = runtime.caml_atomic_make_contended, Stdlib_Atomic = [0, - function(_e_){ /*<>*/ return [0, _e_];}, + function(_f_){ /*<>*/ return [0, _f_];}, + _e_, _d_, set, _c_, @@ -1782,19 +1769,19 @@ var next = match[2], x = match[1]; /*<>*/ return [0, x, - function(_aM_){ /*<>*/ return append(next, seq2, _aM_);}]; + function(_aL_){ /*<>*/ return append(next, seq2, _aL_);}]; /*<>*/ } function map(f, seq, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; var next = match[2], x = match[1]; - /*<>*/ function _aK_(_aL_){ - /*<>*/ return map(f, next, _aL_); + /*<>*/ function _aJ_(_aK_){ + /*<>*/ return map(f, next, _aK_); } /*<>*/ return [0, /*<>*/ caml_call1(f, x), - _aK_]; + _aJ_]; /*<>*/ } function filter_map(f, seq, param){ /*<>*/ var seq$0 = seq; @@ -1810,7 +1797,7 @@ var y = match$0[1]; /*<>*/ return [0, y, - function(_aJ_){ /*<>*/ return filter_map(f, next, _aJ_);}]; + function(_aI_){ /*<>*/ return filter_map(f, next, _aI_);}]; } var seq$0 = next; } @@ -1825,7 +1812,7 @@ /*<>*/ if( /*<>*/ caml_call1(f, x)) /*<>*/ return [0, x, - function(_aI_){ /*<>*/ return filter(f, next, _aI_);}]; + function(_aH_){ /*<>*/ return filter(f, next, _aH_);}]; var seq$0 = next; } /*<>*/ } @@ -1833,20 +1820,20 @@ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; - var next = match[2], x = match[1], _aG_ = 0; + var next = match[2], x = match[1], _aF_ = 0; /*<>*/ return append - (x, function(_aH_){ /*<>*/ return concat(next, _aH_);}, _aG_); + (x, function(_aG_){ /*<>*/ return concat(next, _aG_);}, _aF_); /*<>*/ } function flat_map(f, seq, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(seq, 0); if(! match) /*<>*/ return 0; - var next = match[2], x = match[1], _aD_ = 0; - /*<>*/ function _aE_(_aF_){ - /*<>*/ return flat_map(f, next, _aF_); + var next = match[2], x = match[1], _aC_ = 0; + /*<>*/ function _aD_(_aE_){ + /*<>*/ return flat_map(f, next, _aE_); } /*<>*/ return append - ( /*<>*/ caml_call1(f, x), _aE_, _aD_); + ( /*<>*/ caml_call1(f, x), _aD_, _aC_); /*<>*/ } function fold_left(f, acc, seq){ /*<>*/ var acc$0 = acc, seq$0 = seq; @@ -1881,7 +1868,7 @@ var match$0 = match[1], u$0 = match$0[2], x = match$0[1]; /*<>*/ return [0, x, - function(_aC_){ /*<>*/ return unfold(f, u$0, _aC_);}]; + function(_aB_){ /*<>*/ return unfold(f, u$0, _aB_);}]; /*<>*/ } function is_empty(xs){ /*<>*/ return /*<>*/ caml_call1(xs, 0) ? 0 : 1; @@ -1943,8 +1930,8 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _aB_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(! _aB_) /*<>*/ return _aB_; + /*<>*/ _aA_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(! _aA_) /*<>*/ return _aA_; var xs$0 = xs$1; } /*<>*/ } @@ -1957,8 +1944,8 @@ /*<>*/ var xs$1 = match[2], x = match[1], - /*<>*/ _aA_ = /*<>*/ caml_call1(p, x); - /*<>*/ if(_aA_) /*<>*/ return _aA_; + /*<>*/ _az_ = /*<>*/ caml_call1(p, x); + /*<>*/ if(_az_) /*<>*/ return _az_; var xs$0 = xs$1; } /*<>*/ } @@ -2069,8 +2056,8 @@ /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _az_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(! _az_) /*<>*/ return _az_; + /*<>*/ _ay_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(! _ay_) /*<>*/ return _ay_; var xs$0 = xs$1, ys$0 = ys$1; } /*<>*/ } @@ -2089,8 +2076,8 @@ /*<>*/ var ys$1 = match$0[2], y = match$0[1], - /*<>*/ _ay_ = /*<>*/ caml_call2(f, x, y); - /*<>*/ if(_ay_) /*<>*/ return _ay_; + /*<>*/ _ax_ = /*<>*/ caml_call2(f, x, y); + /*<>*/ if(_ax_) /*<>*/ return _ax_; var xs$0 = xs$1, ys$0 = ys$1; } /*<>*/ } @@ -2108,9 +2095,9 @@ y = match$0[1], xs$1 = match[2], x = match[1], - /*<>*/ _ax_ = + /*<>*/ _aw_ = /*<>*/ caml_call2(eq, x, y); - /*<>*/ if(! _ax_) /*<>*/ return _ax_; + /*<>*/ if(! _aw_) /*<>*/ return _aw_; var xs$0 = xs$1, ys$0 = ys$1; continue; } @@ -2139,67 +2126,67 @@ /*<>*/ } function init_aux(f, i, j, param){ /*<>*/ if(i >= j) /*<>*/ return 0; - var _au_ = i + 1 | 0; - /*<>*/ function _av_(_aw_){ - /*<>*/ return init_aux(f, _au_, j, _aw_); + var _at_ = i + 1 | 0; + /*<>*/ function _au_(_av_){ + /*<>*/ return init_aux(f, _at_, j, _av_); } /*<>*/ return [0, /*<>*/ caml_call1(f, i), - _av_]; + _au_]; /*<>*/ } function init(n, f){ /*<>*/ if(0 > n) /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Seq_init); - var _as_ = 0; - /*<>*/ return function(_at_){ - /*<>*/ return init_aux(f, _as_, n, _at_);}; + var _ar_ = 0; + /*<>*/ return function(_as_){ + /*<>*/ return init_aux(f, _ar_, n, _as_);}; /*<>*/ } function repeat(x, param){ /*<>*/ return [0, x, - function(_ar_){ /*<>*/ return repeat(x, _ar_);}]; + function(_aq_){ /*<>*/ return repeat(x, _aq_);}]; /*<>*/ } function forever(f, param){ - /*<>*/ function _ap_(_aq_){ - /*<>*/ return forever(f, _aq_); + /*<>*/ function _ao_(_ap_){ + /*<>*/ return forever(f, _ap_); } /*<>*/ return [0, /*<>*/ caml_call1(f, 0), - _ap_]; + _ao_]; /*<>*/ } function cycle_nonempty(xs, param){ - /*<>*/ /*<>*/ var _an_ = 0; + /*<>*/ /*<>*/ var _am_ = 0; /*<>*/ return append (xs, - function(_ao_){ /*<>*/ return cycle_nonempty(xs, _ao_);}, - _an_); + function(_an_){ /*<>*/ return cycle_nonempty(xs, _an_);}, + _am_); /*<>*/ } function cycle(xs, param){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(xs, 0); if(! match) /*<>*/ return 0; var xs$0 = match[2], x = match[1]; - /*<>*/ function _ak_(_am_){ - /*<>*/ return cycle_nonempty(xs, _am_); + /*<>*/ function _aj_(_al_){ + /*<>*/ return cycle_nonempty(xs, _al_); } /*<>*/ return [0, x, - function(_al_){ /*<>*/ return append(xs$0, _ak_, _al_);}]; + function(_ak_){ /*<>*/ return append(xs$0, _aj_, _ak_);}]; /*<>*/ } function iterate1(f, x, param){ /*<>*/ /*<>*/ var y = /*<>*/ caml_call1(f, x); /*<>*/ return [0, y, - function(_aj_){ /*<>*/ return iterate1(f, y, _aj_);}]; + function(_ai_){ /*<>*/ return iterate1(f, y, _ai_);}]; /*<>*/ } function iterate(f, x){ - /*<>*/ function _ag_(_ai_){ - /*<>*/ return iterate1(f, x, _ai_); + /*<>*/ function _af_(_ah_){ + /*<>*/ return iterate1(f, x, _ah_); } - /*<>*/ return function(_ah_){ - /*<>*/ return [0, x, _ag_];}; + /*<>*/ return function(_ag_){ + /*<>*/ return [0, x, _af_];}; /*<>*/ } function mapi_aux(f, i, xs, param){ /*<>*/ /*<>*/ var @@ -2208,18 +2195,18 @@ /*<>*/ var xs$0 = match[2], x = match[1], - /*<>*/ _ad_ = i + 1 | 0; - /*<>*/ function _ae_(_af_){ - /*<>*/ return mapi_aux(f, _ad_, xs$0, _af_); + /*<>*/ _ac_ = i + 1 | 0; + /*<>*/ function _ad_(_ae_){ + /*<>*/ return mapi_aux(f, _ac_, xs$0, _ae_); } /*<>*/ return [0, /*<>*/ caml_call2(f, i, x), - _ae_]; + _ad_]; /*<>*/ } function mapi(f, xs){ - /*<>*/ var _ab_ = 0; - /*<>*/ return function(_ac_){ - /*<>*/ return mapi_aux(f, _ab_, xs, _ac_);}; + /*<>*/ var _aa_ = 0; + /*<>*/ return function(_ab_){ + /*<>*/ return mapi_aux(f, _aa_, xs, _ab_);}; /*<>*/ } function tail_scan(f, s, xs, param){ /*<>*/ /*<>*/ var @@ -2231,14 +2218,14 @@ /*<>*/ s$0 = /*<>*/ caml_call2(f, s, x); /*<>*/ return [0, s$0, - function(_aa_){ /*<>*/ return tail_scan(f, s$0, xs$0, _aa_);}]; + function(_$_){ /*<>*/ return tail_scan(f, s$0, xs$0, _$_);}]; /*<>*/ } function scan(f, s, xs){ - /*<>*/ function _Z_(_$_){ - /*<>*/ return tail_scan(f, s, xs, _$_); + /*<>*/ function _Y_(___){ + /*<>*/ return tail_scan(f, s, xs, ___); } - /*<>*/ return function(___){ - /*<>*/ return [0, s, _Z_];}; + /*<>*/ return function(_Z_){ + /*<>*/ return [0, s, _Y_];}; /*<>*/ } function take_aux(n, xs){ /*<>*/ return 0 === n @@ -2289,7 +2276,7 @@ /*<>*/ return /*<>*/ caml_call1(p, x) ? [0, x, - function(_Y_){ /*<>*/ return take_while(p, xs$0, _Y_);}] + function(_X_){ /*<>*/ return take_while(p, xs$0, _X_);}] : 0; /*<>*/ } function drop_while(p, xs, param){ @@ -2311,21 +2298,21 @@ /*<>*/ var xs$0 = match[2], x = match[1], - /*<>*/ _P_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function _Q_(_X_){ - /*<>*/ return drop_while(_P_, xs$0, _X_); + /*<>*/ _O_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function _P_(_W_){ + /*<>*/ return drop_while(_O_, xs$0, _W_); } - /*<>*/ function _R_(_W_){ - /*<>*/ return group(eq, _Q_, _W_); + /*<>*/ function _Q_(_V_){ + /*<>*/ return group(eq, _P_, _V_); } /*<>*/ /*<>*/ var - _S_ = /*<>*/ caml_call1(eq, x); - /*<>*/ function _T_(_V_){ - /*<>*/ return take_while(_S_, xs$0, _V_); + _R_ = /*<>*/ caml_call1(eq, x); + /*<>*/ function _S_(_U_){ + /*<>*/ return take_while(_R_, xs$0, _U_); } /*<>*/ return [0, - function(_U_){ /*<>*/ return [0, x, _T_];}, - _R_]; + function(_T_){ /*<>*/ return [0, x, _S_];}, + _Q_]; /*<>*/ } /*<>*/ var /*<>*/ Forced_twice = @@ -2345,12 +2332,12 @@ /*<>*/ } /*<>*/ /*<>*/ var s = /*<>*/ caml_call1(to_lazy, s$0); - /*<>*/ return function(_O_){ - var _N_ = runtime.caml_obj_tag(s); + /*<>*/ return function(param){ + /*<>*/ var _N_ = runtime.caml_obj_tag(s); if(250 === _N_) return s[1]; - if(246 !== _N_ && 244 !== _N_) /*<>*/ return s; - /*<>*/ return /*<>*/ caml_call1 - (CamlinternalLazy[2], s);}; + if(246 !== _N_ && 244 !== _N_) /*<>*/ return s; + /*<>*/ return /*<>*/ caml_call1 + (CamlinternalLazy[2], s); /*<>*/ }; /*<>*/ } function once(xs){ function f(param){ @@ -2364,7 +2351,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){ @@ -7169,10 +7156,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){ @@ -7193,6 +7180,7 @@ runtime = globalThis.jsoo_runtime, cst_Marshal_from_bytes$1 = "Marshal.from_bytes", caml_marshal_data_size = runtime.caml_marshal_data_size, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, caml_ml_bytes_length = runtime.caml_ml_bytes_length; /*<>*/ function caml_call1(f, a0){ return (f.l >= 0 ? f.l : f.l = f.length) == 1 @@ -7201,8 +7189,11 @@ } var global_data = runtime.caml_get_global_data(), + Assert_failure = global_data.Assert_failure, Stdlib_Bytes = global_data.Stdlib__Bytes, Stdlib = global_data.Stdlib, + _a_ = [0, 3, 0], + _b_ = [0, "marshal.ml", 75, 9], cst_Marshal_from_bytes = cst_Marshal_from_bytes$1, cst_Marshal_from_bytes$0 = cst_Marshal_from_bytes$1, cst_Marshal_data_size = "Marshal.data_size", @@ -7247,6 +7238,17 @@ ( /*<>*/ caml_call1(Stdlib_Bytes[45], buff), ofs); /*<>*/ } + function compression_supported(param){ + /*<>*/ var + /*<>*/ s = + /*<>*/ runtime.caml_output_value_to_string(0, _a_), + /*<>*/ match = + /*<>*/ runtime.caml_string_get(s, 3); + if(189 === match) /*<>*/ return 1; + if(190 === match) /*<>*/ return 0; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Assert_failure, _b_], 1); + /*<>*/ } var Stdlib_Marshal = [0, @@ -7257,8 +7259,9 @@ from_string, header_size, data_size, - total_size]; - runtime.caml_register_global(6, Stdlib_Marshal, "Stdlib__Marshal"); + total_size, + compression_supported]; + runtime.caml_register_global(9, Stdlib_Marshal, "Stdlib__Marshal"); return; /*<>*/ } (globalThis)); @@ -7296,7 +7299,7 @@ Assert_failure = global_data.Assert_failure, Stdlib = global_data.Stdlib, /*<>*/ Floatarray = [0], - _a_ = [0, "array.ml", 348, 4], + _a_ = [0, "array.ml", 369, 4], cst_Array_combine = "Array.combine", cst_Array_exists2 = "Array.exists2", cst_Array_for_all2 = "Array.for_all2", @@ -7307,6 +7310,8 @@ cst_Array_blit = "Array.blit", cst_Array_fill = "Array.fill", cst_Array_sub = "Array.sub", + cst_Array_init_matrix = "Array.init_matrix", + cst_Array_make_matrix = "Array.make_matrix", cst_Array_init = "Array.init", cst_Stdlib_Array_Bottom = "Stdlib.Array.Bottom"; function init(l, f){ @@ -7314,608 +7319,652 @@ if(0 > l) /*<>*/ return /*<>*/ caml_call1 (Stdlib[1], cst_Array_init); - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect - (l, /*<>*/ caml_call1(f, 0)), - /*<>*/ _ay_ = l - 1 | 0, - /*<>*/ _ax_ = 1; - if(_ay_ >= 1){ - var i = _ax_; + /*<>*/ var + /*<>*/ res = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, 0)), + /*<>*/ _aG_ = l - 1 | 0, + /*<>*/ _aF_ = 1; + if(_aG_ >= 1){ + var i = _aF_; for(;;){ - /*<>*/ res[1 + i] = - /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _az_ = i + 1 | 0; - if(_ay_ === i) break; - var i = _az_; + /*<>*/ res[1 + i] = + /*<>*/ caml_call1(f, i); + /*<>*/ /*<>*/ var _aH_ = i + 1 | 0; + if(_aG_ === i) break; + var i = _aH_; } } - /*<>*/ return res; - /*<>*/ } + /*<>*/ return res; + /*<>*/ } function make_matrix(sx, sy, init){ - /*<>*/ var - /*<>*/ res = - /*<>*/ caml_make_vect(sx, [0]), - /*<>*/ _av_ = sx - 1 | 0, - /*<>*/ _au_ = 0; - if(_av_ >= 0){ - var x = _au_; - for(;;){ - res[1 + x] = /*<>*/ caml_make_vect(sy, init); - /*<>*/ /*<>*/ var _aw_ = x + 1 | 0; - if(_av_ === x) break; + /*<>*/ if(sy < 0) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Array_make_matrix); + /*<>*/ /*<>*/ var + res = /*<>*/ caml_make_vect(sx, [0]); + if(0 < sy){ + /*<>*/ var + _aD_ = sx - 1 | 0, + /*<>*/ _aC_ = 0; + if(_aD_ >= 0){ + var x = _aC_; + for(;;){ + res[1 + x] = /*<>*/ caml_make_vect(sy, init); + /*<>*/ /*<>*/ var _aE_ = x + 1 | 0; + if(_aD_ === x) break; + var x = _aE_; + } + } + } + /*<>*/ 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 + _ax_ = sx - 1 | 0, + /*<>*/ _aw_ = 0; + if(_ax_ >= 0){ var x = _aw_; + for(;;){ + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_make_vect + (sy, /*<>*/ caml_call2(f, x, 0)), + /*<>*/ _az_ = sy - 1 | 0, + /*<>*/ _ay_ = 1; + if(_az_ >= 1){ + var y = _ay_; + for(;;){ + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var _aB_ = y + 1 | 0; + if(_az_ === y) break; + var y = _aB_; + } + } + res[1 + x] = row; + /*<>*/ /*<>*/ var _aA_ = x + 1 | 0; + if(_ax_ === x) break; + var x = _aA_; + } } } - /*<>*/ 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 - _as_ = a.length - 1 - 1 | 0, - /*<>*/ _ar_ = 0; - if(_as_ >= 0){ - var i = _ar_; + /*<>*/ var + _au_ = a.length - 1 - 1 | 0, + /*<>*/ _at_ = 0; + if(_au_ >= 0){ + var i = _at_; for(;;){ - /*<>*/ /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _at_ = i + 1 | 0; - if(_as_ === i) break; - var i = _at_; + /*<>*/ /*<>*/ caml_call1 + (f, a[1 + i]); + /*<>*/ /*<>*/ var _av_ = i + 1 | 0; + if(_au_ === i) break; + var i = _av_; } } 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 - _ap_ = a.length - 1 - 1 | 0, - /*<>*/ _ao_ = 0; - if(_ap_ >= 0){ - var i = _ao_; + /*<>*/ var + _ar_ = a.length - 1 - 1 | 0, + /*<>*/ _aq_ = 0; + if(_ar_ >= 0){ + var i = _aq_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _aq_ = i + 1 | 0; - if(_ap_ === i) break; - var i = _aq_; + /*<>*/ /*<>*/ var _as_ = i + 1 | 0; + if(_ar_ === i) break; + var i = _as_; } } 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])), - /*<>*/ _am_ = l - 1 | 0, - /*<>*/ _al_ = 1; - if(_am_ >= 1){ - var i = _al_; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _ao_ = l - 1 | 0, + /*<>*/ _an_ = 1; + if(_ao_ >= 1){ + var i = _an_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _an_ = i + 1 | 0; - if(_am_ === i) break; - var i = _an_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ap_ = i + 1 | 0; + if(_ao_ === i) break; + var i = _ap_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_inplace(f, a){ - /*<>*/ var - _aj_ = a.length - 1 - 1 | 0, - /*<>*/ _ai_ = 0; - if(_aj_ >= 0){ - var i = _ai_; + /*<>*/ var + _al_ = a.length - 1 - 1 | 0, + /*<>*/ _ak_ = 0; + if(_al_ >= 0){ + var i = _ak_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; - if(_aj_ === i) break; - var i = _ak_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _am_ = i + 1 | 0; + if(_al_ === i) break; + var i = _am_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi_inplace(f, a){ - /*<>*/ var - _ag_ = a.length - 1 - 1 | 0, - /*<>*/ _af_ = 0; - if(_ag_ >= 0){ - var i = _af_; + /*<>*/ var + _ai_ = a.length - 1 - 1 | 0, + /*<>*/ _ah_ = 0; + if(_ai_ >= 0){ + var i = _ah_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; - if(_ag_ === i) break; - var i = _ah_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _aj_ = i + 1 | 0; + if(_ai_ === i) break; + var i = _aj_; } } 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])), - /*<>*/ _ad_ = la - 1 | 0, - /*<>*/ _ac_ = 1; - if(_ad_ >= 1){ - var i = _ac_; + if(0 === la) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (la, /*<>*/ caml_call2(f, a[1], b[1])), + /*<>*/ _af_ = la - 1 | 0, + /*<>*/ _ae_ = 1; + if(_af_ >= 1){ + var i = _ae_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; - if(_ad_ === i) break; - var i = _ae_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _ag_ = i + 1 | 0; + if(_af_ === i) break; + var i = _ag_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - _aa_ = a.length - 1 - 1 | 0, - /*<>*/ _$_ = 0; - if(_aa_ >= 0){ - var i = _$_; + /*<>*/ var + _ac_ = a.length - 1 - 1 | 0, + /*<>*/ _ab_ = 0; + if(_ac_ >= 0){ + var i = _ab_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; - if(_aa_ === i) break; - var i = _ab_; + /*<>*/ /*<>*/ var _ad_ = i + 1 | 0; + if(_ac_ === i) break; + var i = _ad_; } } 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])), - /*<>*/ _Z_ = l - 1 | 0, - /*<>*/ _Y_ = 1; - if(_Z_ >= 1){ - var i = _Y_; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call2(f, 0, a[1])), + /*<>*/ _$_ = l - 1 | 0, + /*<>*/ ___ = 1; + if(_$_ >= 1){ + var i = ___; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var ___ = i + 1 | 0; - if(_Z_ === i) break; - var i = ___; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _aa_ = i + 1 | 0; + if(_$_ === i) break; + var i = _aa_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function to_list(a){ - /*<>*/ var i$1 = a.length - 1 - 1 | 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 - 1 - 1 | 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], - _W_ = a.length - 1 - 1 | 0, - /*<>*/ _V_ = 0; - if(_W_ >= 0){ - var i = _V_; + /*<>*/ var + /*<>*/ r = [0, x], + _Y_ = a.length - 1 - 1 | 0, + /*<>*/ _X_ = 0; + if(_Y_ >= 0){ + var i = _X_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _X_ = i + 1 | 0; - if(_W_ === i) break; - var i = _X_; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _Z_ = i + 1 | 0; + if(_Y_ === i) break; + var i = _Z_; } } 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], - /*<>*/ _T_ = len - 1 | 0, - /*<>*/ _S_ = 1; - if(_T_ >= 1){ - var i = _S_; + /*<>*/ output_array = + /*<>*/ caml_make_vect(len, elt), + /*<>*/ acc$1 = [0, acc$0], + /*<>*/ _V_ = len - 1 | 0, + /*<>*/ _U_ = 1; + if(_V_ >= 1){ + var i = _U_; 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 _U_ = i + 1 | 0; - if(_T_ === i) break; - var i = _U_; + /*<>*/ output_array[1 + i] = elt$0; + /*<>*/ /*<>*/ var _W_ = i + 1 | 0; + if(_V_ === i) break; + var i = _W_; } } - /*<>*/ return [0, acc$1[1], output_array]; - /*<>*/ } + /*<>*/ return [0, acc$1[1], output_array]; + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _Q_ = a.length - 1 - 1 | 0; - if(_Q_ >= 0){ - var i = _Q_; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _S_ = a.length - 1 - 1 | 0; + if(_S_ >= 0){ + var i = _S_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _R_ = i - 1 | 0; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _T_ = i - 1 | 0; if(0 === i) break; - var i = _R_; + var i = _T_; } } 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), - /*<>*/ _O_ = n - 1 | 0, - /*<>*/ _N_ = 1; - if(_O_ >= 1){ - var i = _N_; + /*<>*/ n = x.length - 1, + /*<>*/ a = + /*<>*/ caml_make_vect(n, a0), + /*<>*/ b = + /*<>*/ caml_make_vect(n, b0), + /*<>*/ _Q_ = n - 1 | 0, + /*<>*/ _P_ = 1; + if(_Q_ >= 1){ + var i = _P_; for(;;){ var match$0 = x[1 + i], bi = match$0[2], ai = match$0[1]; - /*<>*/ a[1 + i] = ai; - /*<>*/ b[1 + i] = bi; - /*<>*/ /*<>*/ var _P_ = i + 1 | 0; - if(_O_ === i) break; - var i = _P_; + /*<>*/ a[1 + i] = ai; + /*<>*/ b[1 + i] = bi; + /*<>*/ /*<>*/ var _R_ = i + 1 | 0; + if(_Q_ === i) break; + var i = _R_; } } - /*<>*/ 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]]), - /*<>*/ _L_ = na - 1 | 0, - /*<>*/ _K_ = 1; - if(_L_ >= 1){ - var i = _K_; + if(0 === na) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_make_vect(na, [0, a[1], b[1]]), + /*<>*/ _N_ = na - 1 | 0, + /*<>*/ _M_ = 1; + if(_N_ >= 1){ + var i = _M_; for(;;){ x[1 + i] = [0, a[1 + i], b[1 + i]]; - /*<>*/ /*<>*/ var _M_ = i + 1 | 0; - if(_L_ === i) break; - var i = _M_; + /*<>*/ /*<>*/ var _O_ = i + 1 | 0; + if(_N_ === i) break; + var i = _O_; } } - /*<>*/ return x; - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return x; + /*<>*/ } + /*<>*/ /*<>*/ var Bottom = [248, cst_Stdlib_Array_Bottom, runtime.caml_fresh_oo_id(0)]; 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 - /*<>*/ _D_ = i31 + 1 | 0, - /*<>*/ _E_ = caml_check_bound(a, _D_)[1 + _D_]; + /*<>*/ var + /*<>*/ _F_ = i31 + 1 | 0, + /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _E_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _G_) < 0) x[1] = i31 + 1 | 0; - /*<>*/ var - /*<>*/ _F_ = i31 + 2 | 0, - /*<>*/ _G_ = caml_check_bound(a, _F_)[1 + _F_], - _H_ = x[1]; + /*<>*/ var + /*<>*/ _H_ = i31 + 2 | 0, + /*<>*/ _I_ = caml_check_bound(a, _H_)[1 + _H_], + _J_ = x[1]; if - ( /*<>*/ caml_call2 - (cmp, caml_check_bound(a, _H_)[1 + _H_], _G_) + ( /*<>*/ caml_call2 + (cmp, caml_check_bound(a, _J_)[1 + _J_], _I_) < 0) x[1] = i31 + 2 | 0; return x[1]; } if((i31 + 1 | 0) < l){ - /*<>*/ var - _I_ = i31 + 1 | 0, - /*<>*/ _J_ = caml_check_bound(a, _I_)[1 + _I_]; - /*<>*/ if + /*<>*/ var + _K_ = i31 + 1 | 0, + /*<>*/ _L_ = caml_check_bound(a, _K_)[1 + _K_]; + /*<>*/ if (0 > - /*<>*/ caml_call2 - (cmp, caml_check_bound(a, i31)[1 + i31], _J_)) - /*<>*/ return i31 + 1 | 0; + /*<>*/ caml_call2 + (cmp, caml_check_bound(a, i31)[1 + i31], _L_)) + /*<>*/ 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, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_x_ >= 0){ - var i$6 = _x_; + /*<>*/ } + var l = a.length - 1, _z_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_z_ >= 0){ + var i$6 = _z_; 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 - _u_ = caml_check_bound(a, j)[1 + j]; - /*<>*/ caml_check_bound(a, i)[1 + i] = _u_; + /*<>*/ /*<>*/ var + _w_ = caml_check_bound(a, j)[1 + j]; + /*<>*/ caml_check_bound(a, i)[1 + i] = _w_; var 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 _C_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _E_ = i$6 - 1 | 0; if(0 === i$6) break; - var i$6 = _C_; + var i$6 = _E_; } } - /*<>*/ /*<>*/ var _y_ = l - 1 | 0; - if(_y_ >= 2){ - var i$4 = _y_; + /*<>*/ /*<>*/ var _A_ = l - 1 | 0; + if(_A_ >= 2){ + var i$4 = _A_; 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), - /*<>*/ _v_ = caml_check_bound(a, j$0)[1 + j$0]; - /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _v_; + /*<>*/ for(;;){ + /*<>*/ var + /*<>*/ j$0 = maxson(i$4, i$1), + /*<>*/ _x_ = caml_check_bound(a, j$0)[1 + j$0]; + /*<>*/ caml_check_bound(a, i$1)[1 + i$1] = _x_; var i$1 = j$0; } } @@ -7928,204 +7977,223 @@ 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 - _w_ = caml_check_bound(a, father)[1 + father]; - /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _w_; + /*<>*/ /*<>*/ var + _y_ = caml_check_bound(a, father)[1 + father]; + /*<>*/ caml_check_bound(a, i$3)[1 + i$3] = _y_; if(0 >= father) break b; var 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 _B_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _D_ = i$4 - 1 | 0; if(2 === i$4) break; - var i$4 = _B_; + var i$4 = _D_; } } } - var _z_ = 1 < l ? 1 : 0; - if(_z_){ - /*<>*/ /*<>*/ var + var _B_ = 1 < l ? 1 : 0; + if(_B_){ + /*<>*/ /*<>*/ var e = caml_check_bound(a, 1)[2]; - /*<>*/ a[2] = caml_check_bound(a, 0)[1]; - /*<>*/ a[1] = e; - var _A_ = 0; + /*<>*/ a[2] = caml_check_bound(a, 0)[1]; + /*<>*/ a[1] = e; + var _C_ = 0; } else - var _A_ = _z_; - /*<>*/ return _A_; - /*<>*/ } + var _C_ = _B_; + /*<>*/ return _C_; + /*<>*/ } 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 - _m_ = len - 1 | 0, - /*<>*/ _l_ = 0; - if(_m_ >= 0){ - var i = _l_; + /*<>*/ var + _o_ = len - 1 | 0, + /*<>*/ _n_ = 0; + if(_o_ >= 0){ + var i = _n_; for(;;){ - /*<>*/ var - _n_ = srcofs + i | 0, - /*<>*/ e = caml_check_bound(a, _n_)[1 + _n_], - /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; + /*<>*/ var + _p_ = srcofs + i | 0, + /*<>*/ e = caml_check_bound(a, _p_)[1 + _p_], + /*<>*/ j = [0, (dstofs + i | 0) - 1 | 0]; for(;;){ if(dstofs > j[1]) break; - var _o_ = j[1]; - /*<>*/ if + var _q_ = j[1]; + /*<>*/ if (0 >= - /*<>*/ caml_call2 - (cmp, caml_check_bound(dst, _o_)[1 + _o_], e)) + /*<>*/ caml_call2 + (cmp, caml_check_bound(dst, _q_)[1 + _q_], e)) break; - /*<>*/ var - _p_ = j[1], - /*<>*/ _q_ = caml_check_bound(dst, _p_)[1 + _p_], - _r_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _r_)[1 + _r_] = _q_; + /*<>*/ var + _r_ = j[1], + /*<>*/ _s_ = caml_check_bound(dst, _r_)[1 + _r_], + _t_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _t_)[1 + _t_] = _s_; j[1] += -1; } - var _s_ = j[1] + 1 | 0; - /*<>*/ caml_check_bound(dst, _s_)[1 + _s_] = e; - /*<>*/ /*<>*/ var _t_ = i + 1 | 0; - if(_m_ === i) break; - var i = _t_; + var _u_ = j[1] + 1 | 0; + /*<>*/ caml_check_bound(dst, _u_)[1 + _u_] = e; + /*<>*/ /*<>*/ var _v_ = i + 1 | 0; + if(_o_ === i) break; + var i = _v_; } } 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 _l_ = a.length - 1 - 1 | 0; + if(_l_ >= 1){ + var i = _l_; + 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 _m_ = i - 1 | 0; + if(1 === i) break; + var i = _m_; + } + } + return 0; + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _j_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _j_ = i + 1 | 0; + /*<>*/ return [0, x, function(_k_){ /*<>*/ return aux(_j_, _k_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _h_ = 0; - /*<>*/ return function(_i_){ + /*<>*/ } + /*<>*/ /*<>*/ var _h_ = 0; + /*<>*/ return function(_i_){ /*<>*/ return aux(_h_, _i_);}; - /*<>*/ } + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _f_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _f_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_g_){ /*<>*/ return aux(_f_, _g_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _d_ = 0; - /*<>*/ return function(_e_){ + /*<>*/ } + /*<>*/ /*<>*/ var _d_ = 0; + /*<>*/ return function(_e_){ /*<>*/ return aux(_d_, _e_);}; - /*<>*/ } + /*<>*/ } function of_seq(i$2){ - /*<>*/ var _b_ = 0; + /*<>*/ var _b_ = 0; function _c_(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ } - /*<>*/ /*<>*/ var - l = /*<>*/ caml_call3(Stdlib_Seq[5], _c_, _b_, i$2); - if(! l) /*<>*/ return [0]; - /*<>*/ var + /*<>*/ return [0, x, acc]; + /*<>*/ } + /*<>*/ /*<>*/ var + l = /*<>*/ caml_call3(Stdlib_Seq[5], _c_, _b_, i$2); + 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, @@ -8160,11 +8228,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)); @@ -8184,6 +8253,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, @@ -8215,7 +8285,7 @@ /*<>*/ signaling_nan = /*<>*/ runtime.caml_int64_float_of_bits (runtime.caml_int64_create_lo_mi_hi(1, 0, 32752)), - _b_ = [0, cst_float_ml, 458, 6], + _b_ = [0, cst_float_ml, 484, 6], cst_Float_Array_map2_arrays_mu = "Float.Array.map2: arrays must have the same length", cst_Float_Array_iter2_arrays_m = @@ -8224,8 +8294,10 @@ cst_Float_array_blit$0 = cst_Float_array_blit$1, cst_Float_Array_fill = "Float.Array.fill", cst_Float_Array_sub = "Float.Array.sub", - _a_ = [0, cst_float_ml, 228, 14], + _a_ = [0, cst_float_ml, 254, 14], cst_Float_Array_concat = "Float.Array.concat", + cst_Float_Array_init_matrix = "Float.Array.init_matrix", + cst_Float_Array_make_matrix = "Float.Array.make_matrix", cst_Float_Array_init = "Float.Array.init", cst_Stdlib_Float_Array_Bottom = "Stdlib.Float.Array.Bottom", zero = 0., @@ -8249,8 +8321,8 @@ pi = 3.141592653589793; function is_integer(x){ /*<>*/ var - _aw_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; - return _aw_ ? is_finite(x) : _aw_; + _aH_ = x == /*<>*/ runtime.caml_trunc_float(x) ? 1 : 0; + return _aH_ ? is_finite(x) : _aH_; /*<>*/ } function succ(x){ /*<>*/ return /*<>*/ caml_nextafter_float @@ -8351,32 +8423,32 @@ (10, 100, 0, x); /*<>*/ } function unsafe_fill(a, ofs, len, v){ - /*<>*/ var _au_ = (ofs + len | 0) - 1 | 0; - if(_au_ >= ofs){ + /*<>*/ var _aF_ = (ofs + len | 0) - 1 | 0; + if(_aF_ >= ofs){ var i = ofs; for(;;){ /*<>*/ a[1 + i] = v; - /*<>*/ /*<>*/ var _av_ = i + 1 | 0; - if(_au_ === i) break; - var i = _av_; + /*<>*/ /*<>*/ var _aG_ = i + 1 | 0; + if(_aF_ === i) break; + var i = _aG_; } } return 0; /*<>*/ } function check(a, ofs, len, msg){ - /*<>*/ var _aq_ = ofs < 0 ? 1 : 0; - if(_aq_) - var _ar_ = _aq_; + /*<>*/ var _aB_ = ofs < 0 ? 1 : 0; + if(_aB_) + var _aC_ = _aB_; else{ - var _as_ = len < 0 ? 1 : 0; - if(_as_) - var _ar_ = _as_; + var _aD_ = len < 0 ? 1 : 0; + if(_aD_) + var _aC_ = _aD_; else var - _at_ = (ofs + len | 0) < 0 ? 1 : 0, - _ar_ = _at_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); + _aE_ = (ofs + len | 0) < 0 ? 1 : 0, + _aC_ = _aE_ || (a.length - 1 < (ofs + len | 0) ? 1 : 0); } - return _ar_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _ar_; + return _aC_ ? /*<>*/ caml_call1(Stdlib[1], msg) : _aC_; /*<>*/ } function make(n, v){ /*<>*/ /*<>*/ var @@ -8391,34 +8463,98 @@ /*<>*/ var /*<>*/ res = /*<>*/ caml_floatarray_create(l), - /*<>*/ _ao_ = l - 1 | 0, - /*<>*/ _an_ = 0; - if(_ao_ >= 0){ - var i = _an_; + /*<>*/ _az_ = l - 1 | 0, + /*<>*/ _ay_ = 0; + if(_az_ >= 0){ + var i = _ay_; for(;;){ /*<>*/ res[1 + i] = /*<>*/ caml_call1(f, i); - /*<>*/ /*<>*/ var _ap_ = i + 1 | 0; - if(_ao_ === i) break; - var i = _ap_; + /*<>*/ /*<>*/ var _aA_ = i + 1 | 0; + if(_az_ === i) break; + var i = _aA_; } } /*<>*/ 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 + _aw_ = sx - 1 | 0, + /*<>*/ _av_ = 0; + if(_aw_ >= 0){ + var x = _av_; + for(;;){ + /*<>*/ res[1 + x] = make(sy, v); + /*<>*/ /*<>*/ var _ax_ = x + 1 | 0; + if(_aw_ === x) break; + var x = _ax_; + } + } + } + /*<>*/ 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 + _aq_ = sx - 1 | 0, + /*<>*/ _ap_ = 0; + if(_aq_ >= 0){ + var x = _ap_; + for(;;){ + /*<>*/ var + /*<>*/ row = + /*<>*/ caml_floatarray_create(sy), + /*<>*/ _as_ = sy - 1 | 0, + /*<>*/ _ar_ = 0; + if(_as_ >= 0){ + var y = _ar_; + for(;;){ + /*<>*/ row[1 + y] = + /*<>*/ caml_call2(f, x, y); + /*<>*/ /*<>*/ var + _au_ = y + 1 | 0; + if(_as_ === y) break; + var y = _au_; + } + } + /*<>*/ res[1 + x] = row; + /*<>*/ /*<>*/ var _at_ = x + 1 | 0; + if(_aq_ === x) break; + var x = _at_; + } + } + } + /*<>*/ 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 @@ -8428,441 +8564,441 @@ acc$0 = acc <= x ? x - : /*<>*/ caml_call1 + : /*<>*/ caml_call1 (Stdlib[1], cst_Float_Array_concat), acc = acc$0, param = tl; } - /*<>*/ var - /*<>*/ result = - /*<>*/ caml_floatarray_create(acc), + /*<>*/ var + /*<>*/ result = + /*<>*/ caml_floatarray_create(acc), l$0 = l, i = 0; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(! l$0){ - if(i === acc) /*<>*/ return result; - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + if(i === acc) /*<>*/ return result; + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace ([0, Assert_failure, _a_], 1); } - /*<>*/ var + /*<>*/ var tl$0 = l$0[2], hd$0 = l$0[1], - /*<>*/ hlen = hd$0.length - 1; - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ hlen = hd$0.length - 1; + /*<>*/ /*<>*/ caml_floatarray_blit (hd$0, 0, result, i, hlen); var i$0 = i + hlen | 0, l$0 = tl$0, i = i$0; } - /*<>*/ } + /*<>*/ } function sub(a, ofs, len){ - /*<>*/ check(a, ofs, len, cst_Float_Array_sub); - /*<>*/ /*<>*/ var - result = /*<>*/ caml_floatarray_create(len); - /*<>*/ /*<>*/ caml_floatarray_blit + /*<>*/ 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){ - /*<>*/ function _al_(_am_){ - /*<>*/ return a[1 + _am_]; + /*<>*/ function _an_(_ao_){ + /*<>*/ return a[1 + _ao_]; } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_List[11], a.length - 1, _al_); - /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_List[11], a.length - 1, _an_); + /*<>*/ } 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 - _aj_ = a.length - 1 - 1 | 0, - /*<>*/ _ai_ = 0; - if(_aj_ >= 0){ - var i = _ai_; + /*<>*/ var + _al_ = a.length - 1 - 1 | 0, + /*<>*/ _ak_ = 0; + if(_al_ >= 0){ + var i = _ak_; for(;;){ - /*<>*/ /*<>*/ caml_call1 + /*<>*/ /*<>*/ caml_call1 (f, a[1 + i]); - /*<>*/ /*<>*/ var _ak_ = i + 1 | 0; - if(_aj_ === i) break; - var i = _ak_; + /*<>*/ /*<>*/ var _am_ = i + 1 | 0; + if(_al_ === i) break; + var i = _am_; } } 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 - _ag_ = a.length - 1 - 1 | 0, - /*<>*/ _af_ = 0; - if(_ag_ >= 0){ - var i = _af_; + /*<>*/ var + _ai_ = a.length - 1 - 1 | 0, + /*<>*/ _ah_ = 0; + if(_ai_ >= 0){ + var i = _ah_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var _ah_ = i + 1 | 0; - if(_ag_ === i) break; - var i = _ah_; + /*<>*/ /*<>*/ var _aj_ = i + 1 | 0; + if(_ai_ === i) break; + var i = _aj_; } } return 0; - /*<>*/ } + /*<>*/ } function map(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _ad_ = l - 1 | 0, - /*<>*/ _ac_ = 0; - if(_ad_ >= 0){ - var i = _ac_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _af_ = l - 1 | 0, + /*<>*/ _ae_ = 0; + if(_af_ >= 0){ + var i = _ae_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ae_ = i + 1 | 0; - if(_ad_ === i) break; - var i = _ae_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ag_ = i + 1 | 0; + if(_af_ === i) break; + var i = _ag_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_inplace(f, a){ - /*<>*/ var - _aa_ = a.length - 1 - 1 | 0, - /*<>*/ _$_ = 0; - if(_aa_ >= 0){ - var i = _$_; + /*<>*/ var + _ac_ = a.length - 1 - 1 | 0, + /*<>*/ _ab_ = 0; + if(_ac_ >= 0){ + var i = _ab_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _ab_ = i + 1 | 0; - if(_aa_ === i) break; - var i = _ab_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _ad_ = i + 1 | 0; + if(_ac_ === i) break; + var i = _ad_; } } 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), - /*<>*/ _Z_ = la - 1 | 0, - /*<>*/ _Y_ = 0; - if(_Z_ >= 0){ - var i = _Y_; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_floatarray_create(la), + /*<>*/ _$_ = la - 1 | 0, + /*<>*/ ___ = 0; + if(_$_ >= 0){ + var i = ___; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); - /*<>*/ /*<>*/ var ___ = i + 1 | 0; - if(_Z_ === i) break; - var i = ___; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, a[1 + i], b[1 + i]); + /*<>*/ /*<>*/ var _aa_ = i + 1 | 0; + if(_$_ === i) break; + var i = _aa_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function iteri(f, a){ - /*<>*/ var - _W_ = a.length - 1 - 1 | 0, - /*<>*/ _V_ = 0; - if(_W_ >= 0){ - var i = _V_; + /*<>*/ var + _Y_ = a.length - 1 - 1 | 0, + /*<>*/ _X_ = 0; + if(_Y_ >= 0){ + var i = _X_; for(;;){ - /*<>*/ /*<>*/ caml_call2 + /*<>*/ /*<>*/ caml_call2 (f, i, a[1 + i]); - /*<>*/ /*<>*/ var _X_ = i + 1 | 0; - if(_W_ === i) break; - var i = _X_; + /*<>*/ /*<>*/ var _Z_ = i + 1 | 0; + if(_Y_ === i) break; + var i = _Z_; } } return 0; - /*<>*/ } + /*<>*/ } function mapi(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _T_ = l - 1 | 0, - /*<>*/ _S_ = 0; - if(_T_ >= 0){ - var i = _S_; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _V_ = l - 1 | 0, + /*<>*/ _U_ = 0; + if(_V_ >= 0){ + var i = _U_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _U_ = i + 1 | 0; - if(_T_ === i) break; - var i = _U_; + /*<>*/ r[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _W_ = i + 1 | 0; + if(_V_ === i) break; + var i = _W_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function mapi_inplace(f, a){ - /*<>*/ var - _Q_ = a.length - 1 - 1 | 0, - /*<>*/ _P_ = 0; - if(_Q_ >= 0){ - var i = _P_; + /*<>*/ var + _S_ = a.length - 1 - 1 | 0, + /*<>*/ _R_ = 0; + if(_S_ >= 0){ + var i = _R_; for(;;){ - /*<>*/ a[1 + i] = - /*<>*/ caml_call2(f, i, a[1 + i]); - /*<>*/ /*<>*/ var _R_ = i + 1 | 0; - if(_Q_ === i) break; - var i = _R_; + /*<>*/ a[1 + i] = + /*<>*/ caml_call2(f, i, a[1 + i]); + /*<>*/ /*<>*/ var _T_ = i + 1 | 0; + if(_S_ === i) break; + var i = _T_; } } return 0; - /*<>*/ } + /*<>*/ } function fold_left(f, x, a){ - /*<>*/ var - /*<>*/ r = [0, x], - _N_ = a.length - 1 - 1 | 0, - /*<>*/ _M_ = 0; - if(_N_ >= 0){ - var i = _M_; + /*<>*/ var + /*<>*/ r = [0, x], + _P_ = a.length - 1 - 1 | 0, + /*<>*/ _O_ = 0; + if(_P_ >= 0){ + var i = _O_; for(;;){ - r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); - /*<>*/ /*<>*/ var _O_ = i + 1 | 0; - if(_N_ === i) break; - var i = _O_; + r[1] = /*<>*/ caml_call2(f, r[1], a[1 + i]); + /*<>*/ /*<>*/ var _Q_ = i + 1 | 0; + if(_P_ === i) break; + var i = _Q_; } } return r[1]; - /*<>*/ } + /*<>*/ } function fold_right(f, a, x){ - /*<>*/ var - /*<>*/ r = [0, x], - /*<>*/ _K_ = a.length - 1 - 1 | 0; - if(_K_ >= 0){ - var i = _K_; + /*<>*/ var + /*<>*/ r = [0, x], + /*<>*/ _M_ = a.length - 1 - 1 | 0; + if(_M_ >= 0){ + var i = _M_; for(;;){ - r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); - /*<>*/ /*<>*/ var _L_ = i - 1 | 0; + r[1] = /*<>*/ caml_call2(f, a[1 + i], r[1]); + /*<>*/ /*<>*/ var _N_ = i - 1 | 0; if(0 === i) break; - var i = _L_; + var i = _N_; } } 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 + /*<>*/ } + /*<>*/ /*<>*/ var Bottom = [248, cst_Stdlib_Float_Array_Bottom, runtime.caml_fresh_oo_id(0)]; 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, _E_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; - if(_E_ >= 0){ - var i$6 = _E_; + /*<>*/ } + var l = a.length - 1, _G_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_G_ >= 0){ + var i$6 = _G_; 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)); var 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 _J_ = i$6 - 1 | 0; + /*<>*/ /*<>*/ var _L_ = i$6 - 1 | 0; if(0 === i$6) break; - var i$6 = _J_; + var i$6 = _L_; } } - /*<>*/ /*<>*/ var _F_ = l - 1 | 0; - if(_F_ >= 2){ - var i$4 = _F_; + /*<>*/ /*<>*/ var _H_ = l - 1 | 0; + if(_H_ >= 2){ + var i$4 = _H_; 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)); var i$1 = j$0; } } @@ -8875,242 +9011,261 @@ 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; var 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 _I_ = i$4 - 1 | 0; + /*<>*/ /*<>*/ var _K_ = i$4 - 1 | 0; if(2 === i$4) break; - var i$4 = _I_; + var i$4 = _K_; } } } - var _G_ = 1 < l ? 1 : 0; - if(_G_){ - /*<>*/ /*<>*/ var - e = /*<>*/ caml_array_get(a, 1); - /*<>*/ /*<>*/ caml_array_set - (a, 1, /*<>*/ caml_array_get(a, 0)); - var _H_ = /*<>*/ caml_array_set(a, 0, e); + var _I_ = 1 < l ? 1 : 0; + if(_I_){ + /*<>*/ /*<>*/ var + e = /*<>*/ caml_array_get(a, 1); + /*<>*/ /*<>*/ caml_array_set + (a, 1, /*<>*/ caml_array_get(a, 0)); + var _J_ = /*<>*/ caml_array_set(a, 0, e); } else - var _H_ = _G_; - /*<>*/ return _H_; - /*<>*/ } + var _J_ = _I_; + /*<>*/ return _J_; + /*<>*/ } 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 - _C_ = len - 1 | 0, - /*<>*/ _B_ = 0; - if(_C_ >= 0){ - var i = _B_; + /*<>*/ var + _E_ = len - 1 | 0, + /*<>*/ _D_ = 0; + if(_E_ >= 0){ + var i = _D_; 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] += -1; } - /*<>*/ /*<>*/ caml_array_set + /*<>*/ /*<>*/ caml_array_set (dst, j[1] + 1 | 0, e); - /*<>*/ /*<>*/ var _D_ = i + 1 | 0; - if(_C_ === i) break; - var i = _D_; + /*<>*/ /*<>*/ var _F_ = i + 1 | 0; + if(_E_ === i) break; + var i = _F_; } } 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 _B_ = a.length - 1 - 1 | 0; + if(_B_ >= 1){ + var i = _B_; + 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 _C_ = i - 1 | 0; + if(1 === i) break; + var i = _C_; + } + } + return 0; + /*<>*/ } function to_seq(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _z_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _z_ = i + 1 | 0; + /*<>*/ return [0, x, function(_A_){ /*<>*/ return aux(_z_, _A_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _x_ = 0; - /*<>*/ return function(_y_){ + /*<>*/ } + /*<>*/ /*<>*/ var _x_ = 0; + /*<>*/ return function(_y_){ /*<>*/ return aux(_x_, _y_);}; - /*<>*/ } + /*<>*/ } function to_seqi(a){ function aux(i, param){ - /*<>*/ if(i >= a.length - 1) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = a[1 + i], - /*<>*/ _v_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(i >= a.length - 1) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = a[1 + i], + /*<>*/ _v_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_w_){ /*<>*/ return aux(_v_, _w_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _t_ = 0; - /*<>*/ return function(_u_){ + /*<>*/ } + /*<>*/ /*<>*/ var _t_ = 0; + /*<>*/ return function(_u_){ /*<>*/ return aux(_t_, _u_);}; - /*<>*/ } + /*<>*/ } function of_seq(i$2){ - /*<>*/ var _r_ = 0; + /*<>*/ var _r_ = 0; function _s_(acc, x){ - /*<>*/ return [0, x, acc]; - /*<>*/ } - /*<>*/ var - /*<>*/ l = - /*<>*/ caml_call3(Stdlib_Seq[5], _s_, _r_, i$2), - /*<>*/ len = - /*<>*/ caml_call1(Stdlib_List[1], l), - /*<>*/ a = - /*<>*/ caml_floatarray_create(len), - /*<>*/ i$1 = len - 1 | 0, + /*<>*/ return [0, x, acc]; + /*<>*/ } + /*<>*/ var + /*<>*/ l = + /*<>*/ caml_call3(Stdlib_Seq[5], _s_, _r_, i$2), + /*<>*/ 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])), - /*<>*/ _p_ = l - 1 | 0, - /*<>*/ _o_ = 1; + /*<>*/ var l = a.length - 1; + /*<>*/ if(0 === l) /*<>*/ return [0]; + /*<>*/ var + /*<>*/ r = + /*<>*/ caml_make_vect + (l, /*<>*/ caml_call1(f, a[1])), + /*<>*/ _p_ = l - 1 | 0, + /*<>*/ _o_ = 1; if(_p_ >= 1){ var i = _o_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _q_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _q_ = i + 1 | 0; if(_p_ === i) break; var i = _q_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } function map_from_array(f, a){ - /*<>*/ var + /*<>*/ var l = a.length - 1, - /*<>*/ r = - /*<>*/ caml_floatarray_create(l), - /*<>*/ _m_ = l - 1 | 0, - /*<>*/ _l_ = 0; + /*<>*/ r = + /*<>*/ caml_floatarray_create(l), + /*<>*/ _m_ = l - 1 | 0, + /*<>*/ _l_ = 0; if(_m_ >= 0){ var i = _l_; for(;;){ - /*<>*/ r[1 + i] = - /*<>*/ caml_call1(f, a[1 + i]); - /*<>*/ /*<>*/ var _n_ = i + 1 | 0; + /*<>*/ r[1 + i] = + /*<>*/ caml_call1(f, a[1 + i]); + /*<>*/ /*<>*/ var _n_ = i + 1 | 0; if(_m_ === i) break; var i = _n_; } } - /*<>*/ return r; - /*<>*/ } + /*<>*/ return r; + /*<>*/ } var _c_ = caml_floatarray_create, _d_ = caml_array_set, @@ -9123,6 +9278,8 @@ make, _c_, init, + make_matrix, + init_matrix, append, concat, sub, @@ -9152,6 +9309,7 @@ sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, @@ -9199,6 +9357,8 @@ make, _g_, init, + make_matrix, + init_matrix, append, concat, sub, @@ -9228,13 +9388,14 @@ sort, stable_sort, stable_sort, + shuffle, to_seq, to_seqi, of_seq, map_to_array, map_from_array], _f_]; - runtime.caml_register_global(23, Stdlib_Float, "Stdlib__Float"); + runtime.caml_register_global(25, Stdlib_Float, "Stdlib__Float"); return; /*<>*/ } (globalThis)); @@ -9249,6 +9410,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, @@ -9283,8 +9446,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; /*<>*/ }; @@ -9303,64 +9466,61 @@ ("%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){ - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ return /*<>*/ caml_int_compare (n + 2147483648 | 0, m + 2147483648 | 0); - /*<>*/ } + /*<>*/ } + 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, @@ -9385,7 +9545,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)); @@ -9402,6 +9562,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(), @@ -9411,6 +9573,7 @@ min_int = runtime.caml_int64_create_lo_mi_hi(0, 0, 32768), max_int = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32767), Stdlib = global_data.Stdlib, + _e_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535), _c_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), _b_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), @@ -9436,10 +9599,10 @@ /*<>*/ /*<>*/ var max_int$0 = /*<>*/ runtime.caml_int64_of_int32(Stdlib[19]); - function unsigned_to_int(n){ + /*<>*/ 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; /*<>*/ } @@ -9448,34 +9611,34 @@ ("%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){ - /*<>*/ return /*<>*/ caml_int64_compare - ( /*<>*/ caml_int64_sub(n, min_int), - /*<>*/ caml_int64_sub(m, min_int)); - /*<>*/ } + /*<>*/ return /*<>*/ caml_int64_compare + ( /*<>*/ caml_int64_sub(n, min_int), + /*<>*/ caml_int64_sub(m, min_int)); + /*<>*/ } + 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; @@ -9487,9 +9650,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 @@ -9501,8 +9663,8 @@ /*<>*/ r = /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(q, d)); - /*<>*/ return 0 <= unsigned_compare(r, d) ? succ(q) : q; - /*<>*/ } + /*<>*/ return unsigned_lt(r, d) ? q : succ(q); + /*<>*/ } function unsigned_rem(n, d){ /*<>*/ return /*<>*/ caml_int64_sub (n, /*<>*/ caml_int64_mul(unsigned_div(n, d), d)); @@ -9539,7 +9701,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)); @@ -9554,6 +9716,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, @@ -9583,10 +9747,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; /*<>*/ } @@ -9595,68 +9759,68 @@ ("%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){ - /*<>*/ return /*<>*/ caml_int_compare + /*<>*/ return /*<>*/ caml_int_compare (n - min_int | 0, m - min_int | 0); - /*<>*/ } + /*<>*/ } + 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, @@ -9682,7 +9846,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)); @@ -9760,11 +9924,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, /*<>*/ _o_ = with_positions ? zero_pos : dummy_pos, _p_ = with_positions ? zero_pos : dummy_pos, /*<>*/ aux_buffer = @@ -9855,7 +10016,7 @@ _q_, _p_, _o_]; - /*<>*/ } + } function from_channel(with_positions, ic){ /*<>*/ return from_function (with_positions, @@ -9865,11 +10026,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, _f_ = [0], @@ -9898,7 +10056,7 @@ _f_, _e_, _d_]; - /*<>*/ } + } function set_position(lexbuf, position){ /*<>*/ lexbuf[12] = [0, lexbuf[12][1], position[2], position[3], position[4]]; @@ -10072,23 +10230,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; /*<>*/ } @@ -12629,7 +12787,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) @@ -12813,14 +12972,14 @@ } /*<>*/ } function add_substring(b, s, offset, len){ - /*<>*/ var _r_ = offset < 0 ? 1 : 0; - if(_r_) - var _s_ = _r_; + /*<>*/ var _t_ = offset < 0 ? 1 : 0; + if(_t_) + var _u_ = _t_; else var - _t_ = len < 0 ? 1 : 0, - _s_ = _t_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); - if(_s_) + _v_ = len < 0 ? 1 : 0, + _u_ = _v_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); + if(_u_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_substring_add_s); /*<>*/ var @@ -12875,9 +13034,9 @@ /*<>*/ } function add_channel(b, ic, to_read$1){ /*<>*/ var - _p_ = to_read$1 < 0 ? 1 : 0, - _q_ = _p_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); - if(_q_) + _r_ = to_read$1 < 0 ? 1 : 0, + _s_ = _r_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); + if(_s_) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Buffer_add_channel); if(b[1][2] < (b[2] + to_read$1 | 0)) @@ -12917,285 +13076,283 @@ (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 _o_ = 92 === previous ? 1 : 0; - return _o_ ? add_char(b, previous) : _o_; + var _p_ = 92 === previous ? 1 : 0; + return _p_ ? add_char(b, previous) : _p_; } - /*<>*/ /*<>*/ 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 - /*<>*/ i$5 = i$4 + 1 | 0, + /*<>*/ 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; - } - 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; + /*<>*/ caml_call3 + (Stdlib_String[16], s, new_start, (stop - start | 0) - 1 | 0), + stop + 1 | 0]; } - 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(_q_){ + var _o_ = caml_wrap_exception(_q_); + if(_o_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_o_, 0); + /*<>*/ add_char(b, 36); + var previous = 32, i$4 = start; + continue; + } + var next_i = val[2], ident = val[1]; + /*<>*/ add_string + (b, /*<>*/ caml_call1(f, ident)); var 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), - /*<>*/ _m_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _m_ = i + 1 | 0; + /*<>*/ return [0, x, function(_n_){ /*<>*/ return aux(_m_, _n_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _k_ = 0; - /*<>*/ return function(_l_){ + /*<>*/ } + /*<>*/ /*<>*/ var _k_ = 0; + /*<>*/ return function(_l_){ /*<>*/ return aux(_k_, _l_);}; - /*<>*/ } + /*<>*/ } function to_seqi(b){ function aux(i, param){ - /*<>*/ if(b[2] <= i) - /*<>*/ return 0; - /*<>*/ var - /*<>*/ x = - /*<>*/ caml_bytes_get(b[1][1], i), - /*<>*/ _i_ = i + 1 | 0; - /*<>*/ return [0, + /*<>*/ if(b[2] <= i) + /*<>*/ return 0; + /*<>*/ var + /*<>*/ x = + /*<>*/ caml_bytes_get(b[1][1], i), + /*<>*/ _i_ = i + 1 | 0; + /*<>*/ return [0, [0, i, x], function(_j_){ /*<>*/ return aux(_i_, _j_);}]; - /*<>*/ } - /*<>*/ /*<>*/ var _g_ = 0; - /*<>*/ return function(_h_){ + /*<>*/ } + /*<>*/ /*<>*/ var _g_ = 0; + /*<>*/ return function(_h_){ /*<>*/ return aux(_g_, _h_);}; - /*<>*/ } + /*<>*/ } function add_seq(b, seq){ - /*<>*/ function _e_(_f_){ + /*<>*/ function _e_(_f_){ /*<>*/ return add_char(b, _f_); } - /*<>*/ return /*<>*/ caml_call2 + /*<>*/ return /*<>*/ caml_call2 (Stdlib_Seq[4], _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, @@ -13458,259 +13615,234 @@ 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_List = global_data.Stdlib__List, Stdlib_Array = global_data.Stdlib__Array, - cst_internal_error_Am_I_alread = "internal error: Am I already finished?", cst_first_domain_already_spawn = "first domain already spawned"; function cpu_relax(param){ - /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax + /*<>*/ return /*<>*/ runtime.caml_ml_domain_cpu_relax (0); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var unique_value = [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, 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); 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 + /*<>*/ var st = runtime.caml_domain_dls_get(0), - /*<>*/ sz = st.length - 1; - if(idx < sz) /*<>*/ return st; + /*<>*/ sz = st.length - 1; + if(idx < sz) /*<>*/ return st; var new_sz = sz; - /*<>*/ for(;;){ + /*<>*/ 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 + /*<>*/ /*<>*/ var + new_st = /*<>*/ caml_make_vect(new_sz, unique_value); + /*<>*/ /*<>*/ caml_call5 + (Stdlib_Array[9], st, 0, new_st, 0, sz); + /*<>*/ /*<>*/ caml_domain_dls_set (new_st); - /*<>*/ return new_st; + /*<>*/ return new_st; } var s = 2 * new_sz | 0, new_sz = s; } - /*<>*/ } + /*<>*/ } 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), + /*<>*/ 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; } 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; + /*<>*/ }]; 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, _e_){ - /*<>*/ 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; 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; - /*<>*/ }; + /*<>*/ return 0; + /*<>*/ }; } - /*<>*/ /*<>*/ var - _a_ = /*<>*/ caml_call1(Stdlib_Atomic[2], parent_keys); + /*<>*/ /*<>*/ var + _a_ = /*<>*/ caml_call1(Stdlib_Atomic[3], parent_keys); function _b_(param){ - /*<>*/ var split = param[2], k = param[1], idx = k[1]; - /*<>*/ return [0, + /*<>*/ var split = param[2], k = param[1], idx = k[1]; + /*<>*/ return [0, idx, - /*<>*/ caml_call1(split, get(k))]; - /*<>*/ } - /*<>*/ var - /*<>*/ pk = - /*<>*/ caml_call2(Stdlib_List[20], _b_, _a_), - /*<>*/ term_mutex = - /*<>*/ caml_call1(Stdlib_Mutex[1], 0), - /*<>*/ term_condition = - /*<>*/ caml_call1(Stdlib_Condition[1], 0), - /*<>*/ term_state = [0, 0]; + /*<>*/ caml_call1(split, get(k))]; + /*<>*/ } + /*<>*/ var + /*<>*/ pk = + /*<>*/ caml_call2(Stdlib_List[20], _b_, _a_), + /*<>*/ _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); - var - _c_ = - function(param){ - /*<>*/ var - v = param[2], - idx = param[1], - /*<>*/ st = maybe_grow(idx); - /*<>*/ caml_check_bound(st, idx)[1 + idx] = v; - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ /*<>*/ caml_call2 - (Stdlib_List[18], _c_, 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), - /*<>*/ _d_ = 0 === result[0] ? [1, ex$0] : result, - result$0 = _d_; - } - /*<>*/ /*<>*/ 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); + var + _d_ = + function(param){ + /*<>*/ var + v = param[2], + idx = param[1], + /*<>*/ st = maybe_grow(idx); + /*<>*/ caml_check_bound(st, idx)[1 + idx] = v; + /*<>*/ return 0; + /*<>*/ }; + /*<>*/ /*<>*/ caml_call2 + (Stdlib_List[18], _d_, 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(_e_){} + /*<>*/ 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, @@ -13726,7 +13858,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(7, Stdlib_Domain, "Stdlib__Domain"); return; /*<>*/ } (globalThis)); @@ -14313,10 +14445,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; @@ -14336,7 +14465,7 @@ /*<>*/ return 72; default: /*<>*/ return 70; } - /*<>*/ } + } function bprint_padty(buf, padty){ /*<>*/ switch(padty){ case 0: @@ -17850,7 +17979,7 @@ fmt); /*<>*/ }; case 10: var rest$9 = fmtty[1]; - /*<>*/ return function(param, _cO_){ + /*<>*/ return function(_cO_, param){ /*<>*/ return make_from_fmtty (k, acc, rest$9, fmt); /*<>*/ }; case 11: @@ -20666,28 +20795,911 @@ /*<>*/ } (globalThis)); -//# unitInfo: Provides: Stdlib__Arg -//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Buffer, Stdlib__Int, Stdlib__List, Stdlib__Printf, Stdlib__String, Stdlib__Sys +//# 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$8 = "", - cst$10 = " ", - cst_Display_this_list_of_optio$1 = " Display this list of options", - cst_s = "%s", - cst_help$4 = "--help", - cst_help$3 = "-help", - cst$9 = ".\n", - cst_a_float$1 = "a float", - cst_an_integer$1 = "an integer", + 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_equal = runtime.caml_equal, - caml_fresh_oo_id = runtime.caml_fresh_oo_id, + caml_make_vect = runtime.caml_make_vect, caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, - caml_ml_string_length = runtime.caml_ml_string_length, - 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) + : 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, + cst_to_seq_rev = "to_seq_rev", + cst_to_seq = "to_seq", + cst_to_list = "to_list", + cst_to_array = "to_array", + cst_filter_map = "filter_map", + cst_filter = "filter", + cst_for_all = "for_all", + cst_exists = "exists", + cst_fold_right = "fold_right", + cst_fold_left = "fold_left", + cst_mapi = "mapi", + cst_map = "map", + cst_iteri = "iteri", + cst_iter = "iter", + cst_append$0 = cst_append$1, + cst_append = cst_append$1, + cst_set_capacity = "set_capacity", + cst_ensure_capacity = cst_ensure_capacity$0, + _k_ = [0, cst_dynarray_ml, 381, 4], + _j_ = [0, cst_dynarray_ml, 382, 4], + cst_truncate = "truncate", + cst_set = "set", + cst_get = "get", + cst_init = "init", + cst_make = "make", + _i_ = + [0, + [11, cst_Dynarray, [2, 0, [11, ": empty array", 0]]], + "Dynarray.%s: empty array"], + _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"], + _g_ = + [0, + [2, + 0, + [11, ": length ", [4, 0, 0, 0, [11, " > capacity ", [4, 0, 0, 0, 0]]]]], + "%s: length %d > capacity %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"], + _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)"], + _d_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative capacity ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative capacity %d requested"], + _c_ = + [0, + [11, + cst_Dynarray, + [2, + 0, + [11, ": negative length ", [4, 0, 0, 0, [11, cst_requested, 0]]]]], + "Dynarray.%s: negative length %d requested"], + _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)"]; + 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], + _ad_ = expected !== length_a ? 1 : 0; + return _ad_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], Stdlib[1], _h_, f, expected, length_a) + : _ad_; + /*<>*/ } + function check_valid_length(length, arr){ + /*<>*/ var + capacity = arr.length - 1, + _ac_ = capacity < length ? 1 : 0; + return _ac_ + ? /*<>*/ caml_call5 + (Stdlib_Printf[10], + Stdlib[1], + _g_, + invalid_state_description, + length, + capacity) + : _ac_; + /*<>*/ } + 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); + function _ab_(param){ + /*<>*/ return [0, x]; + /*<>*/ } + /*<>*/ return [0, + n, + /*<>*/ caml_call2(Stdlib_Array[1], n, _ab_)]; + /*<>*/ } + function init(n, f){ + /*<>*/ if(n < 0) + /*<>*/ negative_length_requested(cst_init, n); + function _aa_(i){ + /*<>*/ return [0, + /*<>*/ caml_call1(f, i)]; + /*<>*/ } + /*<>*/ return [0, + n, + /*<>*/ caml_call2(Stdlib_Array[1], n, _aa_)]; + /*<>*/ } + 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); + function _$_(i){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v]; + /*<>*/ } + /*<>*/ return [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], length, _$_)]; + } + 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(___){ + var _Z_ = caml_wrap_exception(___); + if(_Z_ === Stdlib[8]) /*<>*/ return 0; + throw caml_maybe_attach_backtrace(_Z_, 0); + } + /*<>*/ return [0, x]; + /*<>*/ } + function remove_last(a){ + /*<>*/ var + /*<>*/ last = a[1] - 1 | 0, + _X_ = 0 <= last ? 1 : 0, + _Y_ = + _X_ + ? (a[1] = last, caml_check_bound(a[2], last)[1 + last] = 0, 0) + : _X_; + /*<>*/ return _Y_; + /*<>*/ } + 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, + _U_ = Stdlib_Sys[13], + /*<>*/ _V_ = + /*<>*/ caml_call2(Stdlib[17], 8, n), + /*<>*/ _W_ = + /*<>*/ caml_call2(Stdlib[16], _V_, _U_), + /*<>*/ new_capacity = + /*<>*/ caml_call2 + (Stdlib[17], _W_, 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 _T_ = a[1]; + return capacity(a) === _T_ + ? 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 _R_ = cur_capacity < n ? 1 : 0; + if(_R_){ + /*<>*/ /*<>*/ 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 _S_ = 0; + } + else + var _S_ = _R_; + return _S_; + /*<>*/ } + 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 + _Q_ = 1 - add_last_if_room(a, elem); + if(! _Q_) /*<>*/ return _Q_; + } + /*<>*/ } + 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); + var 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){ + function _P_(x){ + /*<>*/ return add_last(a, x); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Seq[4], _P_, 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 + /*<>*/ _N_ = length_b - 1 | 0, + /*<>*/ _M_ = 0; + if(_N_ >= 0){ + var i = _M_; + for(;;){ + /*<>*/ /*<>*/ var + x = b[1 + i]; + arr[1 + (length_a + i | 0)] = [0, x]; + /*<>*/ /*<>*/ var + _O_ = i + 1 | 0; + if(_N_ === i) break; + var i = _O_; + } + } + /*<>*/ 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 + _L_ = 1 - append_array_if_room(a, b); + if(! _L_) /*<>*/ return _L_; + } + /*<>*/ } + 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 + _J_ = length_b - 1 | 0, + /*<>*/ _I_ = 0; + if(_J_ >= 0){ + var i = _I_; + for(;;){ + /*<>*/ /*<>*/ var + x = unsafe_get(arr_b, i, length_b); + arr_a[1 + (length_a + i | 0)] = [0, x]; + /*<>*/ /*<>*/ var + _K_ = i + 1 | 0; + if(_J_ === i) break; + var i = _K_; + } + } + /*<>*/ 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 + _H_ = 1 - append_if_room(a, b, length_b); + if(! _H_) /*<>*/ return _H_; + } + /*<>*/ } + function iter(f, k, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + /*<>*/ var + _F_ = length - 1 | 0, + /*<>*/ _E_ = 0; + if(_F_ >= 0){ + var i = _E_; + for(;;){ + /*<>*/ /*<>*/ caml_call1 + (k, unsafe_get(arr, i, length)); + /*<>*/ /*<>*/ var + _G_ = i + 1 | 0; + if(_F_ === i) break; + var i = _G_; + } + } + /*<>*/ 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 + _C_ = length - 1 | 0, + /*<>*/ _B_ = 0; + if(_C_ >= 0){ + var i = _B_; + for(;;){ + /*<>*/ /*<>*/ caml_call2 + (k, i, unsafe_get(arr, i, length)); + /*<>*/ /*<>*/ var + _D_ = i + 1 | 0; + if(_C_ === i) break; + var i = _D_; + } + } + /*<>*/ return check_same_length(cst_iteri, a, length); + /*<>*/ } + function map(f, a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function _A_(i){ + /*<>*/ return [0, + /*<>*/ caml_call1 + (f, unsafe_get(arr, i, length))]; + /*<>*/ } + /*<>*/ /*<>*/ var + res = + [0, + length, + /*<>*/ caml_call2(Stdlib_Array[1], length, _A_)]; + /*<>*/ 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); + function _z_(i){ + /*<>*/ return [0, + /*<>*/ caml_call2 + (f, i, unsafe_get(arr, i, length))]; + /*<>*/ } + /*<>*/ /*<>*/ var + res = + [0, + length, + /*<>*/ caml_call2(Stdlib_Array[1], length, _z_)]; + /*<>*/ 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], + /*<>*/ _x_ = length - 1 | 0, + /*<>*/ _w_ = 0; + if(_x_ >= 0){ + var i = _w_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + r[1] = /*<>*/ caml_call2(f, r[1], v); + /*<>*/ /*<>*/ var + _y_ = i + 1 | 0; + if(_x_ === i) break; + var i = _y_; + } + } + /*<>*/ 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], + /*<>*/ _u_ = length - 1 | 0; + if(_u_ >= 0){ + var i = _u_; + for(;;){ + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + r[1] = /*<>*/ caml_call2(f, v, r[1]); + /*<>*/ /*<>*/ var + _v_ = i - 1 | 0; + if(0 === i) break; + var i = _v_; + } + } + /*<>*/ 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 + _t_ = + /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); + /*<>*/ if(! _t_){ + var i$0 = i + 1 | 0, i = i$0; + continue; + } + var res = _t_; + } + /*<>*/ 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 + _s_ = + /*<>*/ caml_call1(p, unsafe_get(arr, i, length)); + /*<>*/ if(_s_){ + var i$0 = i + 1 | 0, i = i$0; + continue; + } + var res = _s_; + } + /*<>*/ check_same_length(cst_for_all, a, length); + /*<>*/ return res; + } + /*<>*/ } + function filter(f, a){ + /*<>*/ /*<>*/ var b = create(0); + /*<>*/ iter + (cst_filter, + function(x){ + /*<>*/ /*<>*/ var + _r_ = /*<>*/ caml_call1(f, x); + /*<>*/ return _r_ ? add_last(b, x) : _r_; + /*<>*/ }, + 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; + /*<>*/ function _q_(i){ + /*<>*/ return [0, a[1 + i]]; + /*<>*/ } + /*<>*/ return [0, + length, + /*<>*/ caml_call2 + (Stdlib_Array[1], length, _q_)]; + /*<>*/ } + function to_array(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function _p_(i){ + /*<>*/ return unsafe_get(arr, i, length); + /*<>*/ } + /*<>*/ /*<>*/ var + res = + /*<>*/ caml_call2(Stdlib_Array[1], length, _p_); + /*<>*/ check_same_length(cst_to_array, a, length); + /*<>*/ return res; + /*<>*/ } + function of_list(li){ + /*<>*/ /*<>*/ var a = create(0); + function _o_(x){ + /*<>*/ return add_last(a, x); + /*<>*/ } + /*<>*/ /*<>*/ caml_call2 + (Stdlib_List[18], _o_, 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; + var i = _n_; + } + } + /*<>*/ check_same_length(cst_to_list, a, length); + return l[1]; + /*<>*/ } + function of_seq(seq){ + /*<>*/ /*<>*/ var + init = create(0); + /*<>*/ append_seq(init, seq); + /*<>*/ return init; + /*<>*/ } + function to_seq(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq, a, length); + if(length <= i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(a[1] <= i) + /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i + 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(0); + /*<>*/ } + function to_seq_rev(a){ + /*<>*/ var length = a[1], arr = a[2]; + /*<>*/ check_valid_length(length, arr); + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ check_same_length(cst_to_seq_rev, a, length); + if(0 > i) /*<>*/ return 0; + /*<>*/ /*<>*/ var + v = unsafe_get(arr, i, length); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(length - 1 | 0); + /*<>*/ } + function to_seq_rev_reentrant(a){ + function aux(i){ + /*<>*/ return function(param){ + /*<>*/ if(0 > i) + /*<>*/ return 0; + if(a[1] <= i) /*<>*/ return aux(a[1] - 1 | 0)(0); + /*<>*/ /*<>*/ var + v = get(a, i); + /*<>*/ return [0, v, aux(i - 1 | 0)]; /*<>*/ }; + /*<>*/ } + /*<>*/ return aux(a[1] - 1 | 0); + /*<>*/ } + var + Stdlib_Dynarray = + [0, + create, + make, + init, + get, + set, + length, + is_empty, + get_last, + find_last, + copy, + add_last, + append_array, + append_list, + append, + append_seq, + append_iter, + pop_last_opt, + pop_last, + remove_last, + truncate, + clear, + iter$0, + iteri, + map, + mapi, + fold_left, + fold_right, + exists, + for_all, + filter, + filter_map, + of_array, + to_array, + of_list, + to_list, + of_seq, + to_seq, + to_seq_reentrant, + to_seq_rev, + to_seq_rev_reentrant, + capacity, + ensure_capacity, + ensure_extra_capacity, + fit_capacity, + set_capacity, + reset]; + runtime.caml_register_global(44, Stdlib_Dynarray, "Stdlib__Dynarray"); + return; + /*<>*/ } + (globalThis)); + +//# unitInfo: Provides: Stdlib__Arg +//# unitInfo: Requires: Stdlib, Stdlib__Array, Stdlib__Buffer, Stdlib__Int, Stdlib__List, Stdlib__Printf, Stdlib__String, Stdlib__Sys +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$8 = "", + cst$10 = " ", + cst_Display_this_list_of_optio$1 = " Display this list of options", + cst_s = "%s", + cst_help$4 = "--help", + cst_help$3 = "-help", + cst$9 = ".\n", + cst_a_float$1 = "a float", + cst_an_integer$1 = "an integer", + caml_check_bound = runtime.caml_check_bound, + caml_equal = runtime.caml_equal, + caml_fresh_oo_id = runtime.caml_fresh_oo_id, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get, caml_string_notequal = runtime.caml_string_notequal, caml_sys_argv = runtime.caml_sys_argv, caml_wrap_exception = runtime.caml_wrap_exception; @@ -21218,16 +22230,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; } /*<>*/ } @@ -21260,21 +22272,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 @@ -21402,11 +22408,8 @@ (Stdlib_String[18], _P_, 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 @@ -21466,7 +22469,7 @@ } /*<>*/ return /*<>*/ caml_call2 (Stdlib_List[20], _J_, completed); - /*<>*/ } + } function read_aux(trim, sep, file){ /*<>*/ var /*<>*/ ic = @@ -21520,7 +22523,7 @@ /*<>*/ /*<>*/ var _G_ = /*<>*/ caml_call1(Stdlib_List[10], words[1]); /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[10], _G_); + (Stdlib_Array[11], _G_); } /*<>*/ } var _r_ = 10, _s_ = 1; @@ -21539,7 +22542,7 @@ (Stdlib_Printf[1], oc, _v_, s, sep); /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _C_, args); + (Stdlib_Array[12], _C_, args); /*<>*/ return /*<>*/ caml_call1 (Stdlib[76], oc); /*<>*/ } @@ -21653,11 +22656,11 @@ /*<>*/ printers = /*<>*/ caml_call1(Stdlib_Atomic[1], 0), _c_ = [0, [11, ", ", [2, 0, [2, 0, 0]]], ", %s%s"], - _o_ = + _q_ = [0, [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], cst_Fatal_error_exception_s], - _p_ = + _r_ = [0, [11, "Fatal error in uncaught exception handler: exception ", @@ -21665,14 +22668,14 @@ "Fatal error in uncaught exception handler: exception %s\n"], 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], - _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, - _j_ = [0, [2, 0, [12, 10, 0]], cst_s], - _k_ = + _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], @@ -21680,8 +22683,10 @@ 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"], + _j_ = [0, [11, "s ", [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]]], "s %d-%d"], cst_inlined = " (inlined)", - _h_ = + _i_ = [0, [2, 0, @@ -21695,11 +22700,9 @@ 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"], + [2, 0, [11, ", line", [2, 0, [11, cst_characters, partial]]]]]]]]]], + '%s %s in file "%s"%s, line%s, characters %d-%d'], + _k_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], _g_ = [0, [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], @@ -21717,7 +22720,7 @@ _e_ = [0, [12, 40, [2, 0, [12, 41, 0]]], "(%s)"], _b_ = [0, [4, 0, 0, 0, 0], "%d"], _a_ = [0, [3, 0, 0], "%S"], - _m_ = + _o_ = [0, cst$4, "(Cannot print locations:\n bytecode executable program file not found)", @@ -21731,13 +22734,13 @@ /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _b_, f); /*<>*/ /*<>*/ var - _al_ = Stdlib_Obj[15]; - if( /*<>*/ caml_obj_tag(f) === _al_) + _am_ = Stdlib_Obj[15]; + if( /*<>*/ caml_obj_tag(f) === _am_) /*<>*/ return /*<>*/ caml_call2 (Stdlib_Printf[4], _a_, f); /*<>*/ /*<>*/ var - _am_ = Stdlib_Obj[16]; - return /*<>*/ caml_obj_tag(f) === _am_ + _an_ = Stdlib_Obj[16]; + return /*<>*/ caml_obj_tag(f) === _an_ ? /*<>*/ caml_call1(Stdlib[35], f) : cst; /*<>*/ } @@ -21745,14 +22748,14 @@ /*<>*/ if(x.length - 1 <= i) /*<>*/ return cst$0; /*<>*/ var - /*<>*/ _aj_ = other_fields(x, i + 1 | 0), - /*<>*/ _ak_ = field(x, i); + /*<>*/ _ak_ = other_fields(x, i + 1 | 0), + /*<>*/ _al_ = field(x, i); /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Printf[4], _c_, _ak_, _aj_); + (Stdlib_Printf[4], _c_, _al_, _ak_); /*<>*/ } 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]; @@ -21762,7 +22765,7 @@ /*<>*/ /*<>*/ var val = /*<>*/ caml_call1(hd, x); } - catch(_ai_){break a;} + catch(_aj_){break a;} if(val){var s = val[1]; /*<>*/ return [0, s];} } var param = tl; @@ -21776,24 +22779,24 @@ match = t.length - 1; if(2 < match >>> 0) /*<>*/ var - /*<>*/ _ae_ = other_fields(t, 2), - /*<>*/ _af_ = field(t, 1), - _ah_ = + /*<>*/ _af_ = other_fields(t, 2), + /*<>*/ _ag_ = field(t, 1), + _ai_ = /*<>*/ caml_call3 - (Stdlib_Printf[4], _d_, _af_, _ae_); + (Stdlib_Printf[4], _d_, _ag_, _af_); else switch(match){ case 0: - var _ah_ = cst$1; break; + var _ai_ = cst$1; break; case 1: - var _ah_ = cst$2; break; + var _ai_ = cst$2; break; default: /*<>*/ var - /*<>*/ _ag_ = field(t, 1), - _ah_ = - /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ag_); + /*<>*/ _ah_ = field(t, 1), + _ai_ = + /*<>*/ caml_call2(Stdlib_Printf[4], _e_, _ah_); } - var match$0 = [0, constructor, [0, _ah_]]; + var match$0 = [0, constructor, [0, _ai_]]; } else var match$0 = [0, t[1], 0]; @@ -21860,15 +22863,15 @@ function print(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _ad_ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return _ad_; + _ae_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _ae_; } catch(x$0){ /*<>*/ var x = caml_wrap_exception(x$0), - /*<>*/ _ac_ = to_string(x); + /*<>*/ _ad_ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _f_, _ac_); + (Stdlib_Printf[3], _f_, _ad_); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[40]); /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace @@ -21878,17 +22881,17 @@ function catch$0(fct, arg){ /*<>*/ try{ /*<>*/ /*<>*/ var - _ab_ = /*<>*/ caml_call1(fct, arg); - /*<>*/ return _ab_; + _ac_ = /*<>*/ caml_call1(fct, arg); + /*<>*/ return _ac_; } catch(x$0){ var x = caml_wrap_exception(x$0); /*<>*/ /*<>*/ caml_call1 (Stdlib[63], Stdlib[39]); /*<>*/ /*<>*/ var - _aa_ = to_string(x); + _ab_ = to_string(x); /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _g_, _aa_); + (Stdlib_Printf[3], _g_, _ab_); /*<>*/ return /*<>*/ caml_call1 (Stdlib[99], 2); } @@ -21897,261 +22900,269 @@ /*<>*/ 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 - _U_ = slot[5], - _V_ = slot[4], - _W_ = slot[3], - _X_ = slot[6] ? cst_inlined : cst$3, - _Y_ = slot[2], - _Z_ = slot[7], - /*<>*/ ___ = info(slot[1]); - /*<>*/ return [0, - /*<>*/ caml_call8 - (Stdlib_Printf[4], _h_, ___, _Z_, _Y_, _X_, _W_, _V_, _U_)]; - } - if(slot[1]) /*<>*/ return 0; - /*<>*/ /*<>*/ var _$_ = info(0); - /*<>*/ return [0, - /*<>*/ caml_call2(Stdlib_Printf[4], _i_, _$_)]; - /*<>*/ } + /*<>*/ } + /*<>*/ 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]), + _W_ = slot[7], + _X_ = slot[4], + _Y_ = slot[8] ? cst_inlined : cst$3, + _Z_ = slot[2], + ___ = slot[9], + /*<>*/ _$_ = info(slot[1]); + /*<>*/ return [0, + /*<>*/ caml_call8 + (Stdlib_Printf[4], _i_, _$_, ___, _Z_, _Y_, lines, _X_, _W_)]; + } + if(slot[1]) /*<>*/ return 0; + /*<>*/ /*<>*/ var + _aa_ = info(0); + /*<>*/ return [0, + /*<>*/ caml_call2 + (Stdlib_Printf[4], _k_, _aa_)]; + /*<>*/ } 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], _S_ = a.length - 1 - 1 | 0, _R_ = 0; - if(_S_ >= 0){ - var i = _R_; + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Printf[1], outchan, _m_); + var a = backtrace[1], _U_ = a.length - 1 - 1 | 0, _T_ = 0; + if(_U_ >= 0){ + var i = _T_; 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 - _T_ = i + 1 | 0; - if(_S_ === i) break; - var i = _T_; + /*<>*/ /*<>*/ var + _V_ = i + 1 | 0; + if(_U_ === i) break; + var i = _V_; } } 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), - _P_ = a.length - 1 - 1 | 0, - /*<>*/ _O_ = 0; - if(_P_ >= 0){ - var i = _O_; + /*<>*/ b = + /*<>*/ caml_call1(Stdlib_Buffer[1], 1024), + _R_ = a.length - 1 - 1 | 0, + /*<>*/ _Q_ = 0; + if(_R_ >= 0){ + var i = _Q_; 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 - _Q_ = i + 1 | 0; - if(_P_ === i) break; - var i = _Q_; + /*<>*/ /*<>*/ var + _S_ = i + 1 | 0; + if(_R_ === i) break; + var i = _S_; } } - /*<>*/ 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] && runtime.caml_string_notequal(param[7], cst$4)) - /*<>*/ return [0, param[7]]; - /*<>*/ return 0; - /*<>*/ } + /*<>*/ if + (0 === param[0] && runtime.caml_string_notequal(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 - 1 - 1 | 0, i = i$1; - /*<>*/ for(;;){ + /*<>*/ for(;;){ if(-1 === i) - var _N_ = 0; + var _P_ = 0; else{ - var _M_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; - /*<>*/ if(! _M_){ + var _O_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; + /*<>*/ if(! _O_){ var i$0 = i - 1 | 0, i = i$0; continue; } - var _N_ = _M_; + var _P_ = _O_; } - /*<>*/ return _N_ ? [0, backtrace] : 0; + /*<>*/ return _P_ ? [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), - /*<>*/ _L_ = 1 - success; - if(! _L_) /*<>*/ return _L_; - } - /*<>*/ } + /*<>*/ 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), + /*<>*/ _N_ = 1 - success; + if(! _N_) /*<>*/ return _N_; + } + /*<>*/ } 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]; - /*<>*/ } - var errors = _m_.slice(); + /*<>*/ return slot[1]; + /*<>*/ } + var errors = _o_.slice(); function default_uncaught_exception_han(exn, raw_backtrace){ - /*<>*/ /*<>*/ var - _I_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _n_, _I_); - /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - status = /*<>*/ runtime.caml_ml_debug_info_status(0); + /*<>*/ /*<>*/ var + _K_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _p_, _K_); + /*<>*/ print_raw_backtrace(Stdlib[40], raw_backtrace); + /*<>*/ /*<>*/ var + status = /*<>*/ runtime.caml_ml_debug_info_status(0); if(status < 0){ - /*<>*/ var - /*<>*/ _J_ = - /*<>*/ caml_call1(Stdlib[18], status), - /*<>*/ _K_ = caml_check_bound(errors, _J_)[1 + _J_]; - /*<>*/ /*<>*/ caml_call1 - (Stdlib[53], _K_); - } - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ var + /*<>*/ _L_ = + /*<>*/ caml_call1(Stdlib[18], status), + /*<>*/ _M_ = caml_check_bound(errors, _L_)[1 + _L_]; + /*<>*/ /*<>*/ caml_call1 + (Stdlib[53], _M_); + } + /*<>*/ 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]; 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(_H_){} - /*<>*/ try{ - /*<>*/ var - /*<>*/ _D_ = - /*<>*/ caml_call2 + catch(_J_){} + /*<>*/ try{ + /*<>*/ var + /*<>*/ _F_ = + /*<>*/ caml_call2 (uncaught_exception_handler[1], exn$0, raw_backtrace), - _C_ = _D_; + _E_ = _F_; } catch(exn$1){ - /*<>*/ var + /*<>*/ var exn = caml_wrap_exception(exn$1), - /*<>*/ raw_backtrace$0 = - /*<>*/ caml_get_exception_raw_backtra(0), - /*<>*/ _A_ = to_string(exn$0); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _o_, _A_); - /*<>*/ print_raw_backtrace + /*<>*/ raw_backtrace$0 = + /*<>*/ caml_get_exception_raw_backtra(0), + /*<>*/ _C_ = to_string(exn$0); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _q_, _C_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace); - /*<>*/ /*<>*/ var - _B_ = to_string(exn); - /*<>*/ /*<>*/ caml_call2 - (Stdlib_Printf[3], _p_, _B_); - /*<>*/ print_raw_backtrace + /*<>*/ /*<>*/ var + _D_ = to_string(exn); + /*<>*/ /*<>*/ caml_call2 + (Stdlib_Printf[3], _r_, _D_); + /*<>*/ print_raw_backtrace (Stdlib[40], raw_backtrace$0); var - _C_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); + _E_ = /*<>*/ caml_call1(Stdlib[63], Stdlib[40]); } - var _E_ = _C_; + var _G_ = _E_; } - catch(_G_){ - var _z_ = caml_wrap_exception(_G_); - if(_z_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_z_, 0); + catch(_I_){ + var _B_ = caml_wrap_exception(_I_); + if(_B_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_B_, 0); var - _E_ = - /*<>*/ caml_call1 + _G_ = + /*<>*/ caml_call1 (Stdlib[53], cst_Fatal_error_out_of_memory_); } - /*<>*/ return _E_; + /*<>*/ return _G_; } - catch(_F_){ /*<>*/ return 0;} - /*<>*/ } - /*<>*/ /*<>*/ runtime.caml_register_named_value + catch(_H_){ /*<>*/ return 0;} + /*<>*/ } + /*<>*/ /*<>*/ runtime.caml_register_named_value ("Printexc.handle_uncaught_exception", handle_uncaught_exception); - function _q_(_y_){ - /*<>*/ return runtime.caml_raw_backtrace_next_slot(_y_); + function _s_(_A_){ + /*<>*/ return runtime.caml_raw_backtrace_next_slot(_A_); } - function _r_(_x_){ - /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_x_); + function _t_(_z_){ + /*<>*/ return runtime.caml_convert_raw_backtrace_slot(_z_); } - function _s_(_w_, _v_){ - /*<>*/ return runtime.caml_raw_backtrace_slot(_w_, _v_); + function _u_(_y_, _x_){ + /*<>*/ return runtime.caml_raw_backtrace_slot(_y_, _x_); } var - _t_ = + _v_ = [0, backtrace_slot_is_raise, backtrace_slot_is_inline, @@ -22171,22 +23182,22 @@ register_printer, use_printers, raw_backtrace_entries, - function(_u_){ /*<>*/ return caml_get_exception_raw_backtra(_u_);}, + function(_w_){ /*<>*/ return caml_get_exception_raw_backtra(_w_);}, print_raw_backtrace, raw_backtrace_to_string, default_uncaught_exception_han, set_uncaught_exception_handler, backtrace_slots, backtrace_slots_of_raw_entry, - _t_, + _v_, raw_backtrace_length, + _u_, + _t_, _s_, - _r_, - _q_, 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)); @@ -22221,70 +23232,75 @@ 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 + /*<>*/ return 1 - /*<>*/ caml_call1(p, v); + /*<>*/ } + /*<>*/ /*<>*/ var Finally_raised = [248, cst_Stdlib_Fun_Finally_raised, runtime.caml_fresh_oo_id(0)]; function _a_(param){ - /*<>*/ if(param[1] !== Finally_raised) - /*<>*/ return 0; - /*<>*/ var + /*<>*/ if(param[1] !== Finally_raised) + /*<>*/ return 0; + /*<>*/ var exn = param[2], - /*<>*/ _b_ = - /*<>*/ caml_call1(Stdlib_Printexc[1], exn); - /*<>*/ return [0, - /*<>*/ caml_call2 + /*<>*/ _b_ = + /*<>*/ caml_call1(Stdlib_Printexc[1], exn); + /*<>*/ return [0, + /*<>*/ caml_call2 (Stdlib[28], cst_Fun_Finally_raised, _b_)]; - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 + /*<>*/ } + /*<>*/ /*<>*/ caml_call1 (Stdlib_Printexc[9], _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"; @@ -22318,6 +23334,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_ = @@ -22452,35 +23469,44 @@ 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); - /*<>*/ } - function _v_(param){ /*<>*/ return 0; /*<>*/ } - function _w_(param){ /*<>*/ return 0; /*<>*/ } - function _x_(param){ /*<>*/ return 0; /*<>*/ } - function _y_(param){ /*<>*/ return 0; /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Atomic[4], a, 0); + /*<>*/ } + function create_alarm(f){ + /*<>*/ /*<>*/ var + _F_ = /*<>*/ caml_call1(Stdlib_Atomic[1], 1); + function _G_(param){ + /*<>*/ return delete_alarm(_F_); + /*<>*/ } + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], _G_); + return _F_; + /*<>*/ } + function _v_(param){ /*<>*/ return 0; /*<>*/ } + function _w_(param){ /*<>*/ return 0; /*<>*/ } + function _x_(param){ /*<>*/ return 0; /*<>*/ } + function _y_(param){ /*<>*/ return 0; /*<>*/ } + /*<>*/ /*<>*/ var null_tracker = [0, - function(param){ /*<>*/ return 0; /*<>*/ }, + function(param){ /*<>*/ return 0; /*<>*/ }, _y_, _x_, _w_, _v_]; 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 _z_ = [0, null_tracker, start, runtime.caml_memprof_stop]; + } + var + _z_ = + [0, + null_tracker, + start, + runtime.caml_memprof_stop, + runtime.caml_memprof_discard]; function _A_(_E_){ /*<>*/ return runtime.caml_final_release(_E_);} var _B_ = runtime.caml_final_register_called_without_value, @@ -22498,25 +23524,23 @@ eventlog_pause, eventlog_resume, _z_]; - runtime.caml_register_global(26, Stdlib_Gc, "Stdlib__Gc"); + 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 @@ -22527,161 +23551,804 @@ 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_Char = global_data.Stdlib__Char, Stdlib_Bytes = global_data.Stdlib__Bytes, - Stdlib_String = global_data.Stdlib__String, - compare = Stdlib_String[10], - equal = Stdlib_String[9], - cst_Digest_from_hex$0 = cst_Digest_from_hex$1, - cst_Digest_from_hex = cst_Digest_from_hex$1, - cst_Digest_to_hex = "Digest.to_hex", - cst_Digest_substring = "Digest.substring"; - 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], + _b_ = [0, 0], + cst_In_channel_input_all_chann = + "In_channel.input_all: channel content is larger than maximum string length", + cst_really_input_bigarray = "really_input_bigarray", + _a_ = [0, 0], + cst_input_bigarray = "input_bigarray"; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + ic = /*<>*/ caml_call1(openfun, s); + function _y_(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, ic); + /*<>*/ } + function _z_(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[94], ic); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], _z_, _y_); + /*<>*/ } + 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); - var 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]; + 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); - var 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; + var 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_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, + 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], + cst_output_bigarray = "output_bigarray"; + function with_open(openfun, s, f){ + /*<>*/ /*<>*/ var + oc = /*<>*/ caml_call1(openfun, s); + function _a_(param){ + /*<>*/ return /*<>*/ caml_call1 + (f, oc); + /*<>*/ } + function _b_(param){ + /*<>*/ return /*<>*/ caml_call1 + (Stdlib[77], oc); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Fun[5], _b_, _a_); + /*<>*/ } + 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]; + 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_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_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_from_hex = "Digest.from_hex", + cst_Digest_to_hex$0 = cst_Digest_to_hex$1, + cst_Digest_substring$0 = cst_Digest_substring$1, + cst_Digest_of_hex$0 = cst_Digest_of_hex$1, + cst_Digest_to_hex = cst_Digest_to_hex$1, + cst_Digest_substring = cst_Digest_substring$1, + cst_Digest_BLAKE2_wrong_hash_s = "Digest.BLAKE2: wrong hash size", + cst_Digest_of_hex = cst_Digest_of_hex$1; + function hex_of_string(d){ + /*<>*/ function char_hex(n){ + /*<>*/ var + _o_ = 10 <= n ? (97 + n | 0) - 10 | 0 : 48 + n | 0; + return caml_call1(Stdlib_Char[1], _o_); + /*<>*/ } + /*<>*/ var + /*<>*/ len = + /*<>*/ caml_ml_string_length(d), + /*<>*/ result = + /*<>*/ caml_create_bytes(len * 2 | 0), + /*<>*/ _m_ = len - 1 | 0, + /*<>*/ _l_ = 0; + if(_m_ >= 0){ + var i = _l_; + 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 _n_ = i + 1 | 0; + if(_m_ === i) break; + var i = _n_; + } + } + /*<>*/ 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); + /*<>*/ } + /*<>*/ function _i_(i){ + /*<>*/ var + i$0 = 2 * i | 0, + /*<>*/ _j_ = + digit( /*<>*/ caml_string_get(s, i$0 + 1 | 0)), + _k_ = + (digit( /*<>*/ caml_string_get(s, i$0)) << 4) + _j_ + | 0; + /*<>*/ return /*<>*/ caml_call1 + (Stdlib_Char[1], _k_); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_String[2], caml_ml_string_length(s) / 2 | 0, _i_); + /*<>*/ } + function BLAKE2(X){ + var _b_ = X[1] < 1 ? 1 : 0, _c_ = _b_ || (64 < X[1] ? 1 : 0); + if(_c_) + /*<>*/ /*<>*/ 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 /*<>*/ runtime.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 _f_ = ofs < 0 ? 1 : 0; + if(_f_) + var _g_ = _f_; + else + var + _h_ = len < 0 ? 1 : 0, + _g_ = _h_ || ((caml_ml_string_length(str) - len | 0) < ofs ? 1 : 0); + if(_g_) + /*<>*/ /*<>*/ caml_call1 + (Stdlib[1], cst_Digest_substring); + /*<>*/ return /*<>*/ runtime.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 = + /*<>*/ caml_create_bytes(4096), + /*<>*/ ctx = + /*<>*/ runtime.caml_blake2_create(hash_length, cst), + /*<>*/ buf_size = 4096; + /*<>*/ if(0 <= toread){ + var toread$0 = toread; + /*<>*/ for(;;){ + if(0 === toread$0) + /*<>*/ return /*<>*/ runtime.caml_blake2_final + (ctx, hash_length); + /*<>*/ var + /*<>*/ _e_ = + /*<>*/ caml_call2 + (Stdlib_Int[10], buf_size, toread$0), + /*<>*/ n = + /*<>*/ caml_call4 + (Stdlib_In_channel[16], ic, buf, 0, _e_); + /*<>*/ if(0 === n) + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + (Stdlib[12], 1); + /*<>*/ /*<>*/ runtime.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 /*<>*/ runtime.caml_blake2_final + (ctx, hash_length); + /*<>*/ /*<>*/ runtime.caml_blake2_update + (ctx, + /*<>*/ caml_call1(Stdlib_Bytes[44], buf), + 0, + n$0); + } + /*<>*/ } + function file(filename){ + function _d_(ic){ + /*<>*/ return channel(ic, -1); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], filename, _d_); + /*<>*/ } + 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], + hash_length = 16; + 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){ + /*<>*/ function _a_(ic){ + /*<>*/ return /*<>*/ caml_md5_chan + (ic, -1); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_In_channel[5], filename, _a_); + /*<>*/ } + 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, + hash_length, + 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, @@ -22720,6 +24387,7 @@ cst_Bigarray_Array3_of_array_n$0 = cst_Bigarray_Array3_of_array_n$1, cst_Bigarray_Array2_of_array_n = "Bigarray.Array2.of_array: non-rectangular data", + float16 = 13, float32 = 0, float64 = 1, int8_signed = 2, @@ -22736,574 +24404,577 @@ 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 c_layout = 0, fortran_layout = 1; 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; var 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; var 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; var 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; var 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; var 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 - 1 - 1 | 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; var 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; var i$0 = _Q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _P_ = j$0 + 1 | 0; if(dim2 === j$0) break; var 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; var j = _M_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _L_ = i + 1 | 0; if(_I_ === i) break; var 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; var j = _G_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _F_ = i + 1 | 0; if(_C_ === i) break; var 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; var i$0 = _x_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _w_ = j$0 + 1 | 0; if(dim2 === j$0) break; var j$0 = _w_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _u_ = k$0 + 1 | 0; if(dim3 === k$0) break; var 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; var k = _r_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _q_ = j + 1 | 0; if(_m_ === j) break; var j = _q_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _n_ = i + 1 | 0; if(_k_ === i) break; var 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; var k = _i_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _h_ = j + 1 | 0; if(_d_ === j) break; var j = _h_; } } - /*<>*/ /*<>*/ var + /*<>*/ /*<>*/ var _e_ = i + 1 | 0; if(_b_ === i) break; var 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, + float16, float32, float64, complex32, @@ -23380,11 +25051,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, @@ -23413,13 +25086,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, _j_ = runtime.caml_int64_create_lo_mi_hi(14371852, 15349651, 22696), @@ -23429,9 +25102,12 @@ _f_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), _h_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), _i_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + cst_Random_int64_in_range = "Random.int64_in_range", _g_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), cst_Random_int64 = "Random.int64", + cst_Random_int32_in_range = "Random.int32_in_range", cst_Random_int32 = "Random.int32", + cst_Random_int_in_range = "Random.int_in_range", cst_Random_full_int = "Random.full_int", cst_Random_int = "Random.int", cst_Random_State_of_binary_str = @@ -23443,7 +25119,7 @@ _d_ = runtime.caml_int64_create_lo_mi_hi(2, 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 @@ -23572,234 +25248,349 @@ /*<>*/ return make ( /*<>*/ caml_sys_random_seed(0)); /*<>*/ } + var max_int31 = 1073741823, max_int32 = 2147483647; 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; + 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 nativebits = 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){ - /*<>*/ return /*<>*/ caml_lxm_next - ( /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_lxm_next + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } 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(s){ - /*<>*/ return /*<>*/ caml_ba_blit + /*<>*/ return /*<>*/ caml_ba_blit (s, - /*<>*/ caml_call1 + /*<>*/ caml_call1 (Stdlib_Domain[10][2], random_key)); - /*<>*/ } + /*<>*/ } var Stdlib_Random = [0, @@ -23809,9 +25600,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, @@ -23824,9 +25619,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, @@ -23838,7 +25637,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)); @@ -23933,15 +25732,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(;;){ @@ -23951,19 +25750,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 /*<>*/ _ay_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], prng_key), - seed = /*<>*/ caml_call1(Stdlib_Random[15][4], _ay_); + seed = /*<>*/ caml_call1(Stdlib_Random[19][4], _ay_); else var seed = 0; /*<>*/ return [0, @@ -23971,7 +25768,7 @@ /*<>*/ caml_make_vect(s, 0), seed, s]; - /*<>*/ } + } function clear(h){ /*<>*/ var _ax_ = 0 < h[1] ? 1 : 0; return _ax_ @@ -23979,7 +25776,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)) : _ax_; /*<>*/ } function reset(h){ @@ -24021,7 +25818,7 @@ _av_ = h[3], /*<>*/ _aw_ = /*<>*/ caml_call2 - (Stdlib_Array[13], copy_bucketlist, h[2]); + (Stdlib_Array[14], copy_bucketlist, h[2]); /*<>*/ return [0, h[1], _aw_, _av_, _au_]; /*<>*/ } function length(h){ @@ -24266,7 +26063,7 @@ /*<>*/ } /*<>*/ var /*<>*/ mbl = - /*<>*/ caml_call3(Stdlib_Array[17], _W_, _V_, _U_), + /*<>*/ caml_call3(Stdlib_Array[18], _W_, _V_, _U_), /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0), /*<>*/ _X_ = h[2]; @@ -24278,7 +26075,7 @@ /*<>*/ return 0; /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _Y_, _X_); + (Stdlib_Array[12], _Y_, _X_); /*<>*/ return [0, h[1], h[2].length - 1, mbl, histo]; /*<>*/ } function to_seq(tbl){ @@ -24821,19 +26618,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 @@ -24846,7 +26641,7 @@ /*<>*/ insert_all_buckets (function(_l_){ /*<>*/ return key_index(h$0, _l_);}, _k_, _j_, _i_); /*<>*/ return h$0; - /*<>*/ } + } var Stdlib_Hashtbl = [0, @@ -24940,7 +26735,7 @@ function create(l){ /*<>*/ var _Z_ = 0 <= l ? 1 : 0, - ___ = _Z_ ? l <= Stdlib_Obj[24][15] ? 1 : 0 : _Z_; + ___ = _Z_ ? l <= Stdlib_Obj[23][15] ? 1 : 0 : _Z_; if(1 - ___) /*<>*/ /*<>*/ caml_call1 (Stdlib[1], cst_Weak_create); @@ -25074,7 +26869,7 @@ } } /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[19], _O_, _N_, init); + (Stdlib_Array[20], _O_, _N_, init); /*<>*/ } function iter(f, t){ /*<>*/ var _L_ = t[1], i = 0; @@ -25094,7 +26889,7 @@ } } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[11], _M_, _L_); + (Stdlib_Array[12], _M_, _L_); /*<>*/ } function count_bucket(i, b, accu){ /*<>*/ var i$0 = i, accu$0 = accu; @@ -25117,7 +26912,7 @@ /*<>*/ return count_bucket(_G_, _I_, _J_); } /*<>*/ return /*<>*/ caml_call3 - (Stdlib_Array[19], _H_, _F_, _E_); + (Stdlib_Array[20], _H_, _F_, _E_); /*<>*/ } function add_aux(t, setter, d, h, index){ /*<>*/ var @@ -25154,7 +26949,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; @@ -25213,7 +27008,7 @@ /*<>*/ var /*<>*/ _y_ = /*<>*/ caml_call3 - (Stdlib_Array[5], hbucket, 0, prev_len), + (Stdlib_Array[6], hbucket, 0, prev_len), _z_ = t[5]; /*<>*/ caml_check_bound(t[2], _z_)[1 + _z_] = _y_; } @@ -25266,7 +27061,7 @@ } }; /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], _p_, _o_); + (Stdlib_Array[13], _p_, _o_); t[1] = newt[1]; t[2] = newt[2]; t[3] = newt[3]; @@ -25418,14 +27213,14 @@ /*<>*/ 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 _a_ = 0; function _b_(_i_, _h_){ /*<>*/ return _i_ + _h_ | 0;} /*<>*/ var /*<>*/ totlen = - /*<>*/ caml_call3(Stdlib_Array[17], _b_, _a_, lens), + /*<>*/ caml_call3(Stdlib_Array[18], _b_, _a_, lens), /*<>*/ _c_ = len - 1 | 0, _e_ = len / 2 | 0, /*<>*/ _d_ = caml_check_bound(lens, _c_)[1 + _c_], @@ -25518,11 +27313,12 @@ Stdlib_Stack = global_data.Stdlib__Stack, Stdlib_Int = global_data.Stdlib__Int, Stdlib_Bytes = global_data.Stdlib__Bytes, - _f_ = [3, 0, 3], + _g_ = [3, 0, 3], cst_Format_pp_set_geometry = "Format.pp_set_geometry: ", - _e_ = [1, "max_indent < 2"], + _f_ = [1, "max_indent < 2"], _c_ = [1, "margin <= max_indent"], - _d_ = [0, 0], + _d_ = [1, "margin >= pp_infinity"], + _e_ = [0, 0], _b_ = [0, cst$16], _a_ = [0, cst$16, 0, cst$16], cst_Stdlib_Format_String_tag = "Stdlib.Format.String_tag"; @@ -25553,10 +27349,10 @@ /*<>*/ } function format_string(state, s){ /*<>*/ /*<>*/ var - _bN_ = /*<>*/ runtime.caml_string_notequal(s, cst$16); - /*<>*/ return _bN_ + _bO_ = /*<>*/ runtime.caml_string_notequal(s, cst$16); + /*<>*/ return _bO_ ? format_pp_text(state, caml_ml_string_length(s), s) - : _bN_; + : _bO_; /*<>*/ } function break_new_line(state, param, width){ var after = param[3], offset = param[2], before = param[1]; @@ -25623,8 +27419,8 @@ var width$0 = match$4[1][2]; /*<>*/ return break_line(state, width$0); case 4: - var _bL_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; - if(! _bL_) return _bL_; + var _bM_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; + if(! _bM_) return _bM_; /*<>*/ /*<>*/ var match$1 = /*<>*/ caml_call1(Stdlib_Queue[6], state[28]); @@ -25710,11 +27506,11 @@ if(param$0){ var tail = param$0[2], head = param$0[1]; if(insertion_point > head){var param$0 = tail; continue;} - var _bM_ = head; + var _bN_ = head; } else - var _bM_ = first; - var tab = _bM_; + var _bN_ = first; + var tab = _bN_; break; } } @@ -25772,10 +27568,10 @@ length = match$0[3], token = match$0[2], pending_count = state[13] - state[12] | 0, - /*<>*/ _bJ_ = 0 <= size ? 1 : 0, - /*<>*/ _bK_ = - _bJ_ || (state[9] <= pending_count ? 1 : 0); - if(! _bK_) /*<>*/ return _bK_; + /*<>*/ _bK_ = 0 <= size ? 1 : 0, + /*<>*/ _bL_ = + _bK_ || (state[9] <= pending_count ? 1 : 0); + if(! _bL_) /*<>*/ return _bL_; /*<>*/ /*<>*/ caml_call1 (Stdlib_Queue[5], state[28]); /*<>*/ /*<>*/ var @@ -25810,9 +27606,9 @@ left_total = match$0[1], /*<>*/ size = queue_elem[1]; if(left_total < state[12]) return initialize_scan_stack(state[1]); - var _bI_ = queue_elem[2]; - if(typeof _bI_ !== "number") - switch(_bI_[0]){ + var _bJ_ = queue_elem[2]; + if(typeof _bJ_ !== "number") + switch(_bJ_[0]){ case 3: if(1 - ty){ queue_elem[1] = state[13] + size | 0; @@ -25847,26 +27643,26 @@ /*<>*/ elem = [0, size, [3, indent, br_ty], 0]; /*<>*/ return scan_push(state, 0, elem); } - var _bH_ = state[14] === state[15] ? 1 : 0; - if(! _bH_) return _bH_; + var _bI_ = state[14] === state[15] ? 1 : 0; + if(! _bI_) return _bI_; var s = state[16]; /*<>*/ return enqueue_string_as (state, caml_ml_string_length(s), s); /*<>*/ } function pp_close_box(state, param){ - /*<>*/ var _bF_ = 1 < state[14] ? 1 : 0; - if(_bF_){ + /*<>*/ var _bG_ = 1 < state[14] ? 1 : 0; + if(_bG_){ if(state[14] < state[15]){ /*<>*/ pp_enqueue(state, [0, zero, 1, 0]); /*<>*/ set_size(state, 1); /*<>*/ set_size(state, 0); } state[14] = state[14] - 1 | 0; - var _bG_ = 0; + var _bH_ = 0; } else - var _bG_ = _bF_; - return _bG_; + var _bH_ = _bG_; + return _bH_; /*<>*/ } function pp_open_stag(state, tag_name){ /*<>*/ if(state[22]){ @@ -25875,8 +27671,8 @@ /*<>*/ /*<>*/ caml_call1 (state[26], tag_name); } - var _bE_ = state[23]; - if(! _bE_) return _bE_; + var _bF_ = state[23]; + if(! _bF_) return _bF_; /*<>*/ /*<>*/ var token = [5, tag_name]; /*<>*/ return pp_enqueue(state, [0, zero, token, 0]); @@ -25884,8 +27680,8 @@ function pp_close_stag(state, param){ /*<>*/ if(state[23]) /*<>*/ pp_enqueue(state, [0, zero, 5, 0]); - var _bC_ = state[22]; - if(_bC_){ + var _bD_ = state[22]; + if(_bD_){ /*<>*/ /*<>*/ var match = /*<>*/ caml_call1(Stdlib_Stack[5], state[4]); if(match){ @@ -25893,11 +27689,11 @@ /*<>*/ return /*<>*/ caml_call1 (state[27], tag_name); } - var _bD_ = 0; + var _bE_ = 0; } else - var _bD_ = _bC_; - /*<>*/ return _bD_; + var _bE_ = _bD_; + /*<>*/ return _bE_; /*<>*/ } function pp_set_print_tags(state, b){ /*<>*/ state[22] = b; @@ -25951,12 +27747,12 @@ /*<>*/ return pp_open_box_gen(state, 0, 3); /*<>*/ } function pp_flush_queue(state, end_with_newline){ - /*<>*/ var _bA_ = state[4]; - function _bB_(param){ + /*<>*/ var _bB_ = state[4]; + function _bC_(param){ /*<>*/ return pp_close_stag(state, 0); /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Stack[13], _bB_, _bA_); + (Stdlib_Stack[13], _bC_, _bB_); /*<>*/ for(;;){ if(1 >= state[14]){ state[13] = pp_infinity; @@ -25968,8 +27764,8 @@ } /*<>*/ } function pp_print_as_size(state, size, s){ - /*<>*/ var _bz_ = state[14] < state[15] ? 1 : 0; - return _bz_ ? enqueue_string_as(state, size, s) : _bz_; + /*<>*/ var _bA_ = state[14] < state[15] ? 1 : 0; + return _bA_ ? enqueue_string_as(state, size, s) : _bA_; /*<>*/ } function pp_print_as(state, isize, s){ /*<>*/ return pp_print_as_size(state, isize, s); @@ -26002,211 +27798,213 @@ 1, /*<>*/ caml_call2(Stdlib_String[1], 1, c)); /*<>*/ } + 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 _by_ = state[14] < state[15] ? 1 : 0; - return _by_ ? enqueue_advance(state, [0, zero, 3, 0]) : _by_; - /*<>*/ } + /*<>*/ var _bz_ = state[14] < state[15] ? 1 : 0; + return _bz_ ? enqueue_advance(state, [0, zero, 3, 0]) : _bz_; + /*<>*/ } function pp_print_if_newline(state, param){ - /*<>*/ var _bx_ = state[14] < state[15] ? 1 : 0; - return _bx_ ? enqueue_advance(state, [0, zero, 4, 0]) : _bx_; - /*<>*/ } + /*<>*/ var _by_ = state[14] < state[15] ? 1 : 0; + return _by_ ? enqueue_advance(state, [0, zero, 4, 0]) : _by_; + /*<>*/ } function pp_print_custom_break(state, fits, breaks){ - /*<>*/ var + /*<>*/ var after = fits[3], width = fits[2], before = fits[1], - _bw_ = state[14] < state[15] ? 1 : 0; - if(! _bw_) return _bw_; - /*<>*/ var + _bx_ = state[14] < state[15] ? 1 : 0; + if(! _bx_) return _bx_; + /*<>*/ var size = - state[13] | 0, - /*<>*/ token = [1, fits, breaks], + /*<>*/ token = [1, 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 _bv_ = state[14] < state[15] ? 1 : 0; - if(! _bv_) return _bv_; - /*<>*/ /*<>*/ var + /*<>*/ state[14] = state[14] + 1 | 0; + var _bw_ = state[14] < state[15] ? 1 : 0; + if(! _bw_) return _bw_; + /*<>*/ /*<>*/ var elem = [0, zero, [4, [0, [0, 0]]], 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_close_tbox(state, param){ - /*<>*/ var _bs_ = 1 < state[14] ? 1 : 0; - if(_bs_){ - var _bt_ = state[14] < state[15] ? 1 : 0; - if(_bt_){ - /*<>*/ /*<>*/ var + /*<>*/ var _bt_ = 1 < state[14] ? 1 : 0; + if(_bt_){ + var _bu_ = state[14] < state[15] ? 1 : 0; + if(_bu_){ + /*<>*/ /*<>*/ var elem = [0, zero, 2, 0]; - /*<>*/ enqueue_advance(state, elem); + /*<>*/ enqueue_advance(state, elem); state[14] = state[14] - 1 | 0; - var _bu_ = 0; + var _bv_ = 0; } else - var _bu_ = _bt_; + var _bv_ = _bu_; } else - var _bu_ = _bs_; - return _bu_; - /*<>*/ } + var _bv_ = _bt_; + return _bv_; + /*<>*/ } function pp_print_tbreak(state, width, offset){ - /*<>*/ var _br_ = state[14] < state[15] ? 1 : 0; - if(! _br_) return _br_; - /*<>*/ var + /*<>*/ var _bs_ = state[14] < state[15] ? 1 : 0; + if(! _bs_) return _bs_; + /*<>*/ var size = - state[13] | 0, - /*<>*/ elem = [0, size, [2, width, offset], width]; - /*<>*/ return scan_push(state, 1, elem); - /*<>*/ } + /*<>*/ elem = [0, size, [2, 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 _bq_ = state[14] < state[15] ? 1 : 0; - if(! _bq_) return _bq_; - /*<>*/ /*<>*/ var + /*<>*/ var _br_ = state[14] < state[15] ? 1 : 0; + if(! _br_) return _br_; + /*<>*/ /*<>*/ var elem = [0, zero, 0, 0]; - /*<>*/ return enqueue_advance(state, elem); - /*<>*/ } + /*<>*/ return enqueue_advance(state, elem); + /*<>*/ } function pp_set_max_boxes(state, n){ - /*<>*/ var - _bo_ = 1 < n ? 1 : 0, - _bp_ = _bo_ ? (state[15] = n, 0) : _bo_; - return _bp_; - /*<>*/ } + /*<>*/ var + _bp_ = 1 < n ? 1 : 0, + _bq_ = _bp_ ? (state[15] = n, 0) : _bp_; + return _bq_; + /*<>*/ } 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 _bn_ = 1 < n$0 ? 1 : 0; + /*<>*/ var _bo_ = 1 < n$0 ? 1 : 0; + if(! _bo_) return _bo_; + var n$1 = state[6] - n$0 | 0, _bn_ = 1 <= n$1 ? 1 : 0; if(! _bn_) return _bn_; - var n$1 = state[6] - n$0 | 0, _bm_ = 1 <= n$1 ? 1 : 0; - if(! _bm_) return _bm_; - /*<>*/ /*<>*/ 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 _bk_ = 1 <= n ? 1 : 0; - if(! _bk_) return _bk_; - /*<>*/ /*<>*/ var n$0 = pp_limit(n); + /*<>*/ var _bl_ = 1 <= n ? 1 : 0; + if(! _bl_) return _bl_; + /*<>*/ /*<>*/ var n$0 = pp_limit(n); state[6] = n$0; if(state[8] <= state[6]) var new_max_indent = state[8]; else - /*<>*/ var - /*<>*/ _bl_ = - /*<>*/ caml_call2 + /*<>*/ var + /*<>*/ _bm_ = + /*<>*/ caml_call2 (Stdlib_Int[11], state[6] - state[7] | 0, state[6] / 2 | 0), new_max_indent = - /*<>*/ caml_call2(Stdlib_Int[11], _bl_, 1); - /*<>*/ return pp_set_max_indent(state, new_max_indent); - /*<>*/ } + /*<>*/ caml_call2(Stdlib_Int[11], _bm_, 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], - /*<>*/ _bj_ = - /*<>*/ caml_call2 + /*<>*/ _bk_ = + /*<>*/ caml_call2 (Stdlib[28], cst_Format_pp_set_geometry, msg); - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace - ([0, Stdlib[6], _bj_], 1); - /*<>*/ } + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + ([0, Stdlib[6], _bk_], 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; @@ -26217,105 +28015,105 @@ 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 + /*<>*/ } + /*<>*/ /*<>*/ var blank_line = - /*<>*/ caml_call2(Stdlib_String[1], 80, 32); + /*<>*/ caml_call2(Stdlib_String[1], 80, 32); function display_blanks(state, n){ - /*<>*/ var n$0 = n; - /*<>*/ for(;;){ - var _bi_ = 0 < n$0 ? 1 : 0; - if(! _bi_) return _bi_; + /*<>*/ var n$0 = n; + /*<>*/ for(;;){ + var _bj_ = 0 < n$0 ? 1 : 0; + if(! _bj_) return _bj_; 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(_bh_){ /*<>*/ return display_newline(state, _bh_);}; - state[20] = function(_bg_){ /*<>*/ return display_blanks(state, _bg_);}; - state[21] = function(_bf_){ /*<>*/ return display_blanks(state, _bf_);}; + function(_bi_){ /*<>*/ return display_newline(state, _bi_);}; + state[20] = function(_bh_){ /*<>*/ return display_blanks(state, _bh_);}; + state[21] = function(_bg_){ /*<>*/ return display_blanks(state, _bg_);}; 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], - /*<>*/ _be_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$8); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$9, _be_); - /*<>*/ } + /*<>*/ _bf_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$8); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], cst$9, _bf_); + /*<>*/ } 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], - /*<>*/ _bd_ = - /*<>*/ caml_call2(Stdlib[28], s, cst$11); - /*<>*/ return /*<>*/ caml_call2 - (Stdlib[28], cst$12, _bd_); - /*<>*/ } - function default_pp_print_open_tag(_bc_){ /*<>*/ return 0;} - function default_pp_print_close_tag(_bb_){ /*<>*/ return 0;} + /*<>*/ _be_ = + /*<>*/ caml_call2(Stdlib[28], s, cst$11); + /*<>*/ return /*<>*/ caml_call2 + (Stdlib[28], cst$12, _be_); + /*<>*/ } + function default_pp_print_open_tag(_bd_){ /*<>*/ return 0;} + function default_pp_print_close_tag(_bc_){ /*<>*/ 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 - _a9_ = Stdlib[19], - /*<>*/ _a__ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _a$_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0), - /*<>*/ _ba_ = - /*<>*/ caml_call1(Stdlib_Stack[2], 0); - /*<>*/ return [0, + /*<>*/ var + _a__ = Stdlib[19], + /*<>*/ _a$_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _ba_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ _bb_ = + /*<>*/ caml_call1(Stdlib_Stack[2], 0); + /*<>*/ return [0, scan_stack, - /*<>*/ caml_call1(Stdlib_Stack[2], 0), + /*<>*/ caml_call1(Stdlib_Stack[2], 0), + _bb_, _ba_, _a$_, - _a__, 78, 10, 68, @@ -26325,7 +28123,7 @@ 1, 1, 1, - _a9_, + _a__, cst$14, f, g, @@ -26341,743 +28139,731 @@ 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){ - function _a1_(_a8_){ /*<>*/ return 0;} - function _a2_(_a7_){ /*<>*/ return 0;} - /*<>*/ /*<>*/ var + function _a2_(_a9_){ /*<>*/ return 0;} + function _a3_(_a8_){ /*<>*/ return 0;} + /*<>*/ /*<>*/ var ppf = pp_make_formatter - (output, flush, function(_a6_){ /*<>*/ return 0;}, _a2_, _a1_); - ppf[19] = function(_a5_){ /*<>*/ return display_newline(ppf, _a5_);}; - ppf[20] = function(_a4_){ /*<>*/ return display_blanks(ppf, _a4_);}; - ppf[21] = function(_a3_){ /*<>*/ return display_blanks(ppf, _a3_);}; - /*<>*/ return ppf; - /*<>*/ } + (output, flush, function(_a7_){ /*<>*/ return 0;}, _a3_, _a2_); + ppf[19] = function(_a6_){ /*<>*/ return display_newline(ppf, _a6_);}; + ppf[20] = function(_a5_){ /*<>*/ return display_blanks(ppf, _a5_);}; + ppf[21] = function(_a4_){ /*<>*/ return display_blanks(ppf, _a4_);}; + /*<>*/ return ppf; + /*<>*/ } function formatter_of_out_channel(oc){ - function _a0_(param){ - /*<>*/ return /*<>*/ caml_call1 + function _a1_(param){ + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ } - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), _a0_); - /*<>*/ } + /*<>*/ } + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), _a1_); + /*<>*/ } function formatter_of_buffer(b){ - /*<>*/ function _aY_(_aZ_){ /*<>*/ return 0;} - /*<>*/ return make_formatter - ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), - _aY_); - /*<>*/ } + /*<>*/ function _aZ_(_a0_){ /*<>*/ return 0;} + /*<>*/ return make_formatter + ( /*<>*/ caml_call1(Stdlib_Buffer[18], b), + _aZ_); + /*<>*/ } 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); - function _g_(param){ - /*<>*/ return formatter_of_buffer - ( /*<>*/ caml_call1 + function _h_(param){ + /*<>*/ return formatter_of_buffer + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], stdbuf_key)); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var str_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _g_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _h_); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], str_formatter_key, str_formatter); - /*<>*/ function buffered_out_string(key, str, ofs, len){ - /*<>*/ /*<>*/ var - _aX_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); - /*<>*/ return /*<>*/ caml_call4 - (Stdlib_Buffer[18], _aX_, str, ofs, len); - /*<>*/ } + /*<>*/ function buffered_out_string(key, str, ofs, len){ + /*<>*/ /*<>*/ var + _aY_ = /*<>*/ caml_call1(Stdlib_Domain[10][2], key); + /*<>*/ return /*<>*/ caml_call4 + (Stdlib_Buffer[18], _aY_, 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); - /*<>*/ } - function _h_(param){ - /*<>*/ return caml_call1 + /*<>*/ } + function _i_(param){ + /*<>*/ return caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var std_buf_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _h_); - function _i_(param){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _i_); + function _j_(param){ + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Buffer[1], pp_buffer_size); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var err_buf_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _i_); - function _j_(param){ - function _aG_(_aW_){ /*<>*/ return 0;} - function _aH_(_aV_){ /*<>*/ return 0;} - function _aI_(_aU_){ /*<>*/ return 0;} - var _aJ_ = Stdlib[39]; - /*<>*/ function _aK_(_aT_){ - /*<>*/ return buffered_out_flush(_aJ_, std_buf_key, _aT_); - } - /*<>*/ /*<>*/ var + /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _j_); + function _k_(param){ + function _aH_(_aX_){ /*<>*/ return 0;} + function _aI_(_aW_){ /*<>*/ return 0;} + function _aJ_(_aV_){ /*<>*/ return 0;} + var _aK_ = Stdlib[39]; + /*<>*/ function _aL_(_aU_){ + /*<>*/ return buffered_out_flush(_aK_, std_buf_key, _aU_); + } + /*<>*/ /*<>*/ var ppf = pp_make_formatter - (function(_aQ_, _aR_, _aS_){ - /*<>*/ return buffered_out_string(std_buf_key, _aQ_, _aR_, _aS_); + (function(_aR_, _aS_, _aT_){ + /*<>*/ return buffered_out_string(std_buf_key, _aR_, _aS_, _aT_); }, - _aK_, + _aL_, + _aJ_, _aI_, - _aH_, - _aG_); - ppf[19] = function(_aP_){ /*<>*/ return display_newline(ppf, _aP_);}; - ppf[20] = function(_aO_){ /*<>*/ return display_blanks(ppf, _aO_);}; - ppf[21] = function(_aN_){ /*<>*/ return display_blanks(ppf, _aN_);}; - /*<>*/ function _aL_(_aM_){ - /*<>*/ return pp_print_flush(ppf, _aM_); - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[6], _aL_); - /*<>*/ return ppf; - /*<>*/ } - /*<>*/ /*<>*/ var + _aH_); + ppf[19] = function(_aQ_){ /*<>*/ return display_newline(ppf, _aQ_);}; + ppf[20] = function(_aP_){ /*<>*/ return display_blanks(ppf, _aP_);}; + ppf[21] = function(_aO_){ /*<>*/ return display_blanks(ppf, _aO_);}; + /*<>*/ function _aM_(_aN_){ + /*<>*/ return pp_print_flush(ppf, _aN_); + } + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], _aM_); + /*<>*/ return ppf; + /*<>*/ } + /*<>*/ /*<>*/ var std_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _j_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _k_); + /*<>*/ /*<>*/ caml_call2 (Stdlib_Domain[10][3], std_formatter_key, std_formatter); - function _k_(param){ - function _ap_(_aF_){ /*<>*/ return 0;} - function _aq_(_aE_){ /*<>*/ return 0;} - function _ar_(_aD_){ /*<>*/ return 0;} - var _as_ = Stdlib[40]; - /*<>*/ function _at_(_aC_){ - /*<>*/ return buffered_out_flush(_as_, err_buf_key, _aC_); - } - /*<>*/ /*<>*/ var + function _l_(param){ + function _aq_(_aG_){ /*<>*/ return 0;} + function _ar_(_aF_){ /*<>*/ return 0;} + function _as_(_aE_){ /*<>*/ return 0;} + var _at_ = Stdlib[40]; + /*<>*/ function _au_(_aD_){ + /*<>*/ return buffered_out_flush(_at_, err_buf_key, _aD_); + } + /*<>*/ /*<>*/ var ppf = pp_make_formatter - (function(_az_, _aA_, _aB_){ - /*<>*/ return buffered_out_string(err_buf_key, _az_, _aA_, _aB_); + (function(_aA_, _aB_, _aC_){ + /*<>*/ return buffered_out_string(err_buf_key, _aA_, _aB_, _aC_); }, - _at_, + _au_, + _as_, _ar_, - _aq_, - _ap_); - ppf[19] = function(_ay_){ /*<>*/ return display_newline(ppf, _ay_);}; - ppf[20] = function(_ax_){ /*<>*/ return display_blanks(ppf, _ax_);}; - ppf[21] = function(_aw_){ /*<>*/ return display_blanks(ppf, _aw_);}; - /*<>*/ function _au_(_av_){ - /*<>*/ return pp_print_flush(ppf, _av_); - } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[6], _au_); - /*<>*/ return ppf; - /*<>*/ } - /*<>*/ /*<>*/ var + _aq_); + ppf[19] = function(_az_){ /*<>*/ return display_newline(ppf, _az_);}; + ppf[20] = function(_ay_){ /*<>*/ return display_blanks(ppf, _ay_);}; + ppf[21] = function(_ax_){ /*<>*/ return display_blanks(ppf, _ax_);}; + /*<>*/ function _av_(_aw_){ + /*<>*/ return pp_print_flush(ppf, _aw_); + } + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[6], _av_); + /*<>*/ return ppf; + /*<>*/ } + /*<>*/ /*<>*/ var err_formatter_key = - /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _k_); - /*<>*/ /*<>*/ caml_call2 + /*<>*/ caml_call2(Stdlib_Domain[10][1], 0, _l_); + /*<>*/ /*<>*/ 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){ - function _an_(param){ - /*<>*/ var - /*<>*/ buf = - /*<>*/ caml_call1 + function _ao_(param){ + /*<>*/ 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 - _ao_ = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); - /*<>*/ /*<>*/ caml_call3 + /*<>*/ /*<>*/ var + _ap_ = /*<>*/ caml_call1(Stdlib_Buffer[7], buf); + /*<>*/ /*<>*/ caml_call3 (output, - /*<>*/ caml_call1(Stdlib_Buffer[2], buf), + /*<>*/ caml_call1(Stdlib_Buffer[2], buf), 0, - _ao_); - /*<>*/ /*<>*/ caml_call1 + _ap_); + /*<>*/ /*<>*/ caml_call1 (Stdlib_Buffer[8], buf); - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (flush, 0); - /*<>*/ } - /*<>*/ return make_formatter(output$0, flush$0); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Domain[10][1], 0, _an_); - /*<>*/ } + /*<>*/ } + /*<>*/ return make_formatter(output$0, flush$0); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call2 + (Stdlib_Domain[10][1], 0, _ao_); + /*<>*/ } function synchronized_formatter_of_out_(oc){ - function _am_(param){ - /*<>*/ return /*<>*/ caml_call1 + function _an_(param){ + /*<>*/ return /*<>*/ caml_call1 (Stdlib[63], oc); - /*<>*/ } - /*<>*/ return make_synchronized_formatter - ( /*<>*/ caml_call1(Stdlib[69], oc), _am_); - /*<>*/ } - function make_symbolic_output_buffer(param){ /*<>*/ return [0, 0]; - /*<>*/ } + /*<>*/ } + /*<>*/ return make_synchronized_formatter + ( /*<>*/ caml_call1(Stdlib[69], oc), _an_); + /*<>*/ } + 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(_al_){ - /*<>*/ return add_symbolic_output_item(sob, 0); + /*<>*/ function g(_am_){ + /*<>*/ return add_symbolic_output_item(sob, 0); } - /*<>*/ function h(_ak_){ - /*<>*/ return add_symbolic_output_item(sob, 1); + /*<>*/ function h(_al_){ + /*<>*/ 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(v, w){ - /*<>*/ return pp_print_as - ( /*<>*/ caml_call1 + /*<>*/ return pp_print_as + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), v, 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_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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ return /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key) [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); - /*<>*/ } - 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; + 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){ + 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 + /*<>*/ 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 + /*<>*/ pp_print_string (ppf, - /*<>*/ caml_call3 + /*<>*/ caml_call3 (Stdlib_String[16], s, left[1], right[1] - left[1] | 0)); right[1]++; left[1] = right[1]; return 0; - /*<>*/ } + /*<>*/ } for(;;){ if(right[1] === len){ - var _aj_ = left[1] !== len ? 1 : 0; - return _aj_ ? flush(0) : _aj_; + var _ak_ = left[1] !== len ? 1 : 0; + return _ak_ ? flush(0) : _ak_; } - /*<>*/ /*<>*/ 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(ppf, 0); } else if(32 === match){ - /*<>*/ flush(0); - /*<>*/ pp_print_space(ppf, 0); + /*<>*/ flush(0); + /*<>*/ pp_print_space(ppf, 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, _ai_){ - /*<>*/ return 0; - /*<>*/ }; - /*<>*/ if(! param) - /*<>*/ return /*<>*/ caml_call2 + var + none = + opt + ? opt[1] + : function + (_aj_, 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: @@ -27087,104 +28873,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 - /*<>*/ _$_ = compute_tag(output_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 - (CamlinternalFormat[20], _$_), + /*<>*/ output_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _aa_ = compute_tag(output_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 + (CamlinternalFormat[20], _aa_), 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 _aa_ = acc[1]; - if(typeof _aa_ !== "number" && 0 === _aa_[0]){ - var _ab_ = _aa_[2]; - if(typeof _ab_ !== "number" && 1 === _ab_[0]){ - var s$0 = acc[2], size = _ab_[2], p$2 = _aa_[1]; + var _ab_ = acc[1]; + if(typeof _ab_ !== "number" && 0 === _ab_[0]){ + var _ac_ = _ab_[2]; + if(typeof _ac_ !== "number" && 1 === _ac_[0]){ + var s$0 = acc[2], size = _ac_[2], p$2 = _ab_[1]; break b; } } - var s = acc[2], p$1 = _aa_; + var s = acc[2], p$1 = _ab_; break a; case 3: - var _ac_ = acc[1]; - if(typeof _ac_ !== "number" && 0 === _ac_[0]){ - var _ad_ = _ac_[2]; - if(typeof _ad_ !== "number" && 1 === _ad_[0]){ - var c$0 = acc[2], size$0 = _ad_[2], p$4 = _ac_[1]; + var _ad_ = acc[1]; + if(typeof _ad_ !== "number" && 0 === _ad_[0]){ + var _ae_ = _ad_[2]; + if(typeof _ae_ !== "number" && 1 === _ae_[0]){ + var c$0 = acc[2], size$0 = _ae_[2], p$4 = _ad_[1]; break; } } - var c = acc[2], p$3 = _ac_; + var c = acc[2], p$3 = _ad_; break c; case 4: - var _ae_ = acc[1]; - if(typeof _ae_ !== "number" && 0 === _ae_[0]){ - var _af_ = _ae_[2]; - if(typeof _af_ !== "number" && 1 === _af_[0]){ - var s$0 = acc[2], size = _af_[2], p$2 = _ae_[1]; + var _af_ = acc[1]; + if(typeof _af_ !== "number" && 0 === _af_[0]){ + var _ag_ = _af_[2]; + if(typeof _ag_ !== "number" && 1 === _ag_[0]){ + var s$0 = acc[2], size = _ag_[2], p$2 = _af_[1]; break b; } } - var s = acc[2], p$1 = _ae_; + var s = acc[2], p$1 = _af_; break a; case 5: - var _ag_ = acc[1]; - if(typeof _ag_ !== "number" && 0 === _ag_[0]){ - var _ah_ = _ag_[2]; - if(typeof _ah_ !== "number" && 1 === _ah_[0]){ - var c$0 = acc[2], size$0 = _ah_[2], p$4 = _ag_[1]; + var _ah_ = acc[1]; + if(typeof _ah_ !== "number" && 0 === _ah_[0]){ + var _ai_ = _ah_[2]; + if(typeof _ai_ !== "number" && 1 === _ai_[0]){ + var c$0 = acc[2], size$0 = _ai_[2], p$4 = _ah_[1]; break; } } - var c = acc[2], p$3 = _ag_; + var c = acc[2], p$3 = _ah_; 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: @@ -27194,69 +28980,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 - /*<>*/ _S_ = compute_tag(strput_acc, acc$1), - /*<>*/ match$0 = - /*<>*/ caml_call1 - (CamlinternalFormat[20], _S_), + /*<>*/ strput_acc(ppf, p$0); + /*<>*/ var + /*<>*/ _T_ = compute_tag(strput_acc, acc$1), + /*<>*/ match$0 = + /*<>*/ caml_call1 + (CamlinternalFormat[20], _T_), 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 _T_ = acc[1]; - if(typeof _T_ !== "number" && 0 === _T_[0]){ - var _U_ = _T_[2]; - if(typeof _U_ !== "number" && 1 === _U_[0]){ - var s$0 = acc[2], size = _U_[2], p$2 = _T_[1]; + var _U_ = acc[1]; + if(typeof _U_ !== "number" && 0 === _U_[0]){ + var _V_ = _U_[2]; + if(typeof _V_ !== "number" && 1 === _V_[0]){ + var s$0 = acc[2], size = _V_[2], p$2 = _U_[1]; break b; } } - var s = acc[2], p$1 = _T_; + var s = acc[2], p$1 = _U_; break a; case 3: - var _V_ = acc[1]; - if(typeof _V_ !== "number" && 0 === _V_[0]){ - var _W_ = _V_[2]; - if(typeof _W_ !== "number" && 1 === _W_[0]){ - var c$0 = acc[2], size$0 = _W_[2], p$4 = _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 c$0 = acc[2], size$0 = _X_[2], p$4 = _W_[1]; break; } } - var c = acc[2], p$3 = _V_; + var c = acc[2], p$3 = _W_; break c; case 4: - var _X_ = acc[1]; - if(typeof _X_ !== "number" && 0 === _X_[0]){ - var _Y_ = _X_[2]; - if(typeof _Y_ !== "number" && 1 === _Y_[0]){ - var s$0 = acc[2], size = _Y_[2], p$2 = _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 s$0 = acc[2], size = _Z_[2], p$2 = _Y_[1]; break b; } } - var s = acc[2], p$1 = _X_; + var s = acc[2], p$1 = _Y_; break a; case 5: - var _Z_ = acc[1]; - if(typeof _Z_ !== "number" && 0 === _Z_[0]){ - var ___ = _Z_[2]; - if(typeof ___ !== "number" && 1 === ___[0]){ - var c$0 = acc[2], size$0 = ___[2], p$4 = _Z_[1]; + var ___ = acc[1]; + if(typeof ___ !== "number" && 0 === ___[0]){ + var _$_ = ___[2]; + if(typeof _$_ !== "number" && 1 === _$_[0]){ + var c$0 = acc[2], size$0 = _$_[2], p$4 = ___[1]; break; } } - var c = acc[2], p$3 = _Z_; + var c = acc[2], p$3 = ___; break c; case 6: var p$5 = acc[1]; @@ -27264,207 +29050,207 @@ 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 + /*<>*/ var fmt = param[1], - /*<>*/ _Q_ = 0; - function _R_(acc){ - /*<>*/ output_acc(ppf, acc); + /*<>*/ _R_ = 0; + function _S_(acc){ + /*<>*/ output_acc(ppf, acc); return caml_call1(k, ppf); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _R_, _Q_, fmt); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], _S_, _R_, 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 + /*<>*/ var fmt = param[1], - /*<>*/ _N_ = 0; - function _O_(_P_){ /*<>*/ return 0;} - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[8], _O_, _N_, fmt); + /*<>*/ _O_ = 0; + function _P_(_Q_){ /*<>*/ return 0;} + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[8], _P_, _O_, fmt); } function fprintf(ppf){ - function _K_(_M_){ /*<>*/ return 0;} - /*<>*/ return function(_L_){ - /*<>*/ return kfprintf(_K_, ppf, _L_);}; - /*<>*/ } + function _L_(_N_){ /*<>*/ return 0;} + /*<>*/ return function(_M_){ + /*<>*/ return kfprintf(_L_, ppf, _M_);}; + /*<>*/ } function printf(param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ _I_ = 0; - function _J_(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 + /*<>*/ _J_ = 0; + function _K_(acc){ + /*<>*/ return output_acc + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], std_formatter_key), acc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _J_, _I_, fmt); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], _K_, _J_, fmt); } function eprintf(param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ _G_ = 0; - function _H_(acc){ - /*<>*/ return output_acc - ( /*<>*/ caml_call1 + /*<>*/ _H_ = 0; + function _I_(acc){ + /*<>*/ return output_acc + ( /*<>*/ caml_call1 (Stdlib_Domain[10][2], err_formatter_key), acc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _H_, _G_, fmt); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], _I_, _H_, fmt); } function kdprintf(k, param){ - /*<>*/ var + /*<>*/ var fmt = param[1], - /*<>*/ _E_ = 0; - function _F_(acc){ - /*<>*/ return /*<>*/ caml_call1 + /*<>*/ _F_ = 0; + function _G_(acc){ + /*<>*/ return /*<>*/ caml_call1 (k, function(ppf){ - /*<>*/ return output_acc(ppf, acc); - /*<>*/ }); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call3 - (CamlinternalFormat[7], _F_, _E_, fmt); + /*<>*/ return output_acc(ppf, acc); + /*<>*/ }); + /*<>*/ } + /*<>*/ return /*<>*/ caml_call3 + (CamlinternalFormat[7], _G_, _F_, 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); - function _l_(param){ - /*<>*/ flush_standard_formatters(0); - /*<>*/ var - /*<>*/ fs = + function _m_(param){ + /*<>*/ flush_standard_formatters(0); + /*<>*/ var + /*<>*/ fs = pp_get_formatter_out_functions(std_formatter, 0), - _m_ = fs[5], - _n_ = fs[4], - _o_ = fs[3], - _p_ = Stdlib[39]; - /*<>*/ function _q_(_D_){ - /*<>*/ return buffered_out_flush(_p_, std_buf_key, _D_); - } - /*<>*/ pp_set_formatter_out_functions + _n_ = fs[5], + _o_ = fs[4], + _p_ = fs[3], + _q_ = Stdlib[39]; + /*<>*/ function _r_(_E_){ + /*<>*/ return buffered_out_flush(_q_, std_buf_key, _E_); + } + /*<>*/ pp_set_formatter_out_functions (std_formatter, [0, - function(_A_, _B_, _C_){ - /*<>*/ return buffered_out_string(std_buf_key, _A_, _B_, _C_); + function(_B_, _C_, _D_){ + /*<>*/ return buffered_out_string(std_buf_key, _B_, _C_, _D_); }, - _q_, + _r_, + _p_, _o_, - _n_, - _m_]); - /*<>*/ var - /*<>*/ fs$0 = + _n_]); + /*<>*/ var + /*<>*/ fs$0 = pp_get_formatter_out_functions(err_formatter, 0), - _r_ = fs$0[5], - _s_ = fs$0[4], - _t_ = fs$0[3], - _u_ = Stdlib[40]; - /*<>*/ function _v_(_z_){ - /*<>*/ return buffered_out_flush(_u_, err_buf_key, _z_); - } - /*<>*/ return pp_set_formatter_out_functions + _s_ = fs$0[5], + _t_ = fs$0[4], + _u_ = fs$0[3], + _v_ = Stdlib[40]; + /*<>*/ function _w_(_A_){ + /*<>*/ return buffered_out_flush(_v_, err_buf_key, _A_); + } + /*<>*/ return pp_set_formatter_out_functions (err_formatter, [0, - function(_w_, _x_, _y_){ + function(_x_, _y_, _z_){ /*<>*/ return buffered_out_string - (err_buf_key, _w_, _x_, _y_); + (err_buf_key, _x_, _y_, _z_); }, - _v_, + _w_, + _u_, _t_, - _s_, - _r_]); - /*<>*/ } - /*<>*/ /*<>*/ caml_call1 - (Stdlib_Domain[5], _l_); + _s_]); + /*<>*/ } + /*<>*/ /*<>*/ caml_call1 + (Stdlib_Domain[5], _m_); var Stdlib_Format = [0, @@ -27494,6 +29280,7 @@ print_char, pp_print_bool, print_bool, + pp_print_nothing, pp_print_space, print_space, pp_print_cut, @@ -27509,6 +29296,7 @@ print_flush, pp_print_newline, print_newline, + pp_infinity, pp_set_margin, set_margin, pp_get_margin, @@ -27616,7 +29404,7 @@ ikfprintf, ksprintf, kasprintf]; - runtime.caml_register_global(37, Stdlib_Format, "Stdlib__Format"); + runtime.caml_register_global(38, Stdlib_Format, "Stdlib__Format"); return; /*<>*/ } (globalThis)); @@ -29361,7 +31149,7 @@ rest$13 = fmt$0[2], pad$8 = fmt$0[1], /*<>*/ scan$8 = - function(param, _T_, ib){ + function(_T_, param, ib){ /*<>*/ var /*<>*/ c = checked_peek_char(ib), /*<>*/ m = @@ -29699,7 +31487,7 @@ /*<>*/ } /*<>*/ return kscanf_gen (ib, - function(param, _B_){ + function(_B_, param){ /*<>*/ return 0; /*<>*/ }, _A_, @@ -29993,7 +31781,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 _av_ = 0; } @@ -30035,7 +31823,7 @@ /*<>*/ return get_method_label(table, _aq_); } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], _ap_, names); + (Stdlib_Array[14], _ap_, names); /*<>*/ } function set_method(table, label, element){ /*<>*/ method_count[1]++; @@ -30068,7 +31856,7 @@ /*<>*/ return 0 === arr ? 0 : /*<>*/ caml_call1 - (Stdlib_Array[9], arr); + (Stdlib_Array[10], arr); /*<>*/ } function narrow(table, vars, virt_meths, concr_meths){ /*<>*/ var @@ -30280,7 +32068,7 @@ /*<>*/ return get_variable(table, _D_); } /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Array[13], _C_, names); + (Stdlib_Array[14], _C_, names); /*<>*/ } function add_initializer(table, f){ /*<>*/ table[8] = [0, f, table[8]]; @@ -30292,7 +32080,7 @@ /*<>*/ var /*<>*/ tags = /*<>*/ caml_call2 - (Stdlib_Array[13], public_method_label, public_methods), + (Stdlib_Array[14], public_method_label, public_methods), /*<>*/ table = new_table(tags); function _B_(i, met){ /*<>*/ var lab = (i * 2 | 0) + 2 | 0; @@ -30304,7 +32092,7 @@ return 0; /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[12], _B_, public_methods); + (Stdlib_Array[13], _B_, public_methods); /*<>*/ return table; /*<>*/ } function init_class(table){ @@ -30339,7 +32127,7 @@ _v_ = [0, /*<>*/ caml_call2 - (Stdlib_Array[13], _u_, _t_), + (Stdlib_Array[14], _u_, _t_), _s_], /*<>*/ _w_ = to_array(vals); /*<>*/ function _x_(_z_){ @@ -30351,10 +32139,10 @@ [0, init], [0, /*<>*/ caml_call2 - (Stdlib_Array[13], _x_, _w_), + (Stdlib_Array[14], _x_, _w_), _v_]]; /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Array[4], _y_); + (Stdlib_Array[5], _y_); } function make_class(pub_meths, class_init){ /*<>*/ var @@ -31156,13 +32944,13 @@ /*<>*/ /*<>*/ var prng = [246, - function(_aM_){ /*<>*/ return caml_call1(Stdlib_Random[15][2], 0);}]; + function(_aM_){ /*<>*/ 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: { @@ -31185,7 +32973,7 @@ } var seed = - /*<>*/ caml_call1(Stdlib_Random[15][4], _aL_); + /*<>*/ caml_call1(Stdlib_Random[19][4], _aL_); } else var seed = 0; @@ -31194,7 +32982,7 @@ /*<>*/ caml_make_vect(x, 0), seed, x]; - /*<>*/ } + } function clear(h){ /*<>*/ h[1] = 0; /*<>*/ var @@ -31228,7 +33016,7 @@ _aE_ = h[4], _aF_ = h[3], /*<>*/ _aG_ = - /*<>*/ caml_call1(Stdlib_Array[6], h[2]); + /*<>*/ caml_call1(Stdlib_Array[7], h[2]); /*<>*/ return [0, h[1], _aG_, _aF_, _aE_]; /*<>*/ } function key_index(h, hkey){ @@ -31516,7 +33304,7 @@ /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[17], _ah_, _ag_, _af_), + (Stdlib_Array[18], _ah_, _ag_, _af_), /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0), /*<>*/ _ai_ = h[2]; @@ -31528,7 +33316,7 @@ /*<>*/ return 0; /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _aj_, _ai_); + (Stdlib_Array[12], _aj_, _ai_); /*<>*/ return [0, h[1], h[2].length - 1, mbl, histo]; /*<>*/ } function bucket_length_alive(accu, param){ @@ -31557,7 +33345,7 @@ /*<>*/ var /*<>*/ mbl = /*<>*/ caml_call3 - (Stdlib_Array[17], _ab_, _aa_, _$_), + (Stdlib_Array[18], _ab_, _aa_, _$_), /*<>*/ histo = /*<>*/ caml_make_vect(mbl + 1 | 0, 0), /*<>*/ _ac_ = h[2]; @@ -31570,7 +33358,7 @@ /*<>*/ return 0; /*<>*/ } /*<>*/ /*<>*/ caml_call2 - (Stdlib_Array[11], _ad_, _ac_); + (Stdlib_Array[12], _ad_, _ac_); /*<>*/ return [0, size[1], h[2].length - 1, @@ -31621,27 +33409,27 @@ } function create(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 1); + (Stdlib_Obj[23][1], 1); /*<>*/ } function get_key(t){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 0); + (Stdlib_Obj[23][3], t, 0); /*<>*/ } 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){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + (Stdlib_Obj[23][9], t); /*<>*/ } 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 @@ -31678,7 +33466,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); /*<>*/ } @@ -31801,31 +33589,31 @@ /*<>*/ } function create$0(param){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][1], 2); + (Stdlib_Obj[23][1], 2); /*<>*/ } function get_key1(t){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 0); + (Stdlib_Obj[23][3], t, 0); /*<>*/ } 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){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, 1); + (Stdlib_Obj[23][3], t, 1); /*<>*/ } 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){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + (Stdlib_Obj[23][9], t); /*<>*/ } 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 @@ -31888,17 +33676,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 - _S_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, 0); + _S_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, 0); /*<>*/ return _S_ ? /*<>*/ caml_call2 - (Stdlib_Obj[24][7], c, 1) + (Stdlib_Obj[23][7], c, 1) : _S_; /*<>*/ } /*<>*/ return MakeSeeded @@ -32028,27 +33816,27 @@ /*<>*/ } 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){ /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Obj[24][3], t, n); + (Stdlib_Obj[23][3], t, n); /*<>*/ } 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){ /*<>*/ return /*<>*/ caml_call1 - (Stdlib_Obj[24][9], t); + (Stdlib_Obj[23][9], t); /*<>*/ } 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 @@ -32179,7 +33967,7 @@ /*<>*/ } function set_key_data(c, k, d){ /*<>*/ /*<>*/ caml_call1 - (Stdlib_Obj[24][12], c); + (Stdlib_Obj[23][12], c); /*<>*/ var _s_ = k.length - 1 - 1 | 0, /*<>*/ _r_ = 0; @@ -32206,7 +33994,7 @@ var _q_ = _p_; else{ /*<>*/ /*<>*/ var - _o_ = /*<>*/ caml_call2(Stdlib_Obj[24][7], c, i); + _o_ = /*<>*/ caml_call2(Stdlib_Obj[23][7], c, i); /*<>*/ if(_o_){ var i$0 = i - 1 | 0, i = i$0; continue; @@ -33268,14 +35056,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, @@ -33299,14 +35087,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); @@ -33326,24 +35113,17 @@ counter = counter$0; } } - /*<>*/ } - function open_temp_file(opt, _o_, _n_, prefix, suffix){ - /*<>*/ if(opt) - var sth = opt[1], mode = sth; - else - var mode = _j_; - /*<>*/ if(_o_) - var sth$0 = _o_[1], perms = sth$0; - else - var perms = 384; - /*<>*/ if(_n_) - var sth$1 = _n_[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(_o_, _n_, opt, prefix, suffix){ + var + mode = _o_ ? _o_[1] : _j_, + perms = _n_ ? _n_[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); @@ -33367,20 +35147,16 @@ counter = counter$0; } } - /*<>*/ } - function temp_dir(opt, _m_, 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(_m_) - var sth$0 = _m_[1], perms = sth$0; - else - var perms = 448; - var counter = 0; + } + function temp_dir(_m_, opt, prefix, suffix){ + var + temp_dir = + _m_ + ? _m_[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); @@ -33400,7 +35176,7 @@ counter = counter$0; } } - /*<>*/ } + } var Stdlib_Filename = [0, @@ -33576,48 +35352,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, @@ -33652,6 +35431,7 @@ sort, stable_sort, fast_sort, + shuffle, to_seq, to_seqi, of_seq, @@ -34168,430 +35948,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], - cst_In_channel_input_all_chann = - "In_channel.input_all: channel content is larger than maximum string length", - _a_ = [0, 0]; - function with_open(openfun, s, f){ - /*<>*/ /*<>*/ var - ic = /*<>*/ caml_call1(openfun, s); - function _x_(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, ic); - /*<>*/ } - function _y_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[94], ic); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], _y_, _x_); - /*<>*/ } - 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]; - 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; - var 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); - function _a_(param){ - /*<>*/ return /*<>*/ caml_call1 - (f, oc); - /*<>*/ } - function _b_(param){ - /*<>*/ return /*<>*/ caml_call1 - (Stdlib[77], oc); - /*<>*/ } - /*<>*/ return /*<>*/ caml_call2 - (Stdlib_Fun[4], _b_, _a_); - /*<>*/ } - 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 @@ -34663,76 +36019,78 @@ Continuation_already_resumed); /*<>*/ function continue$0(k, v){ function _h_(x){ - /*<>*/ return x; - /*<>*/ } - /*<>*/ /*<>*/ var - _i_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return x; + /*<>*/ } + /*<>*/ /*<>*/ var + _i_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue(k, e){ function _f_(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ } - /*<>*/ /*<>*/ var - _g_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ /*<>*/ var + _g_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } + /*<>*/ } function discontinue_with_backtrace(k, e, bt){ function _d_(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); - /*<>*/ } - /*<>*/ /*<>*/ var - _e_ = /*<>*/ caml_continuation_use_noexc(k); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ } + /*<>*/ /*<>*/ var + _e_ = /*<>*/ caml_continuation_use_noexc(k); + /*<>*/ 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); - /*<>*/ } + k[2] = last_fiber; + /*<>*/ return /*<>*/ caml_call1(f, k); + /*<>*/ } function _c_(e){ - /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace + /*<>*/ throw /*<>*/ caml_maybe_attach_backtrace (e, 1); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var s = - /*<>*/ caml_alloc_stack + /*<>*/ caml_alloc_stack (function(x){ - /*<>*/ return x; - /*<>*/ }, + /*<>*/ return x; + /*<>*/ }, _c_, effc); - /*<>*/ return /*<>*/ jsoo_effect_not_supported + /*<>*/ return /*<>*/ jsoo_effect_not_supported (); - /*<>*/ } - /*<>*/ /*<>*/ var + /*<>*/ } + /*<>*/ /*<>*/ var Deep = [0, continue$0, @@ -34741,27 +36099,28 @@ match_with, try_with]; 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; } @@ -34769,58 +36128,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,