Accumulated changes from WASM browser development sessions: - sx_runtime.ml: signal subscription + notify, env unwrap tolerance - sx_browser.bc.js: rebuilt js_of_ocaml browser kernel - sx_browser.bc.wasm.js + assets: WASM browser kernel build - sx-platform.js browser tests (test_js, test_platform, test_wasm) - Playwright sx-inspect.js: interactive page inspector tool - harness-web.sx: DOM assertion updates - deploy.sh, Dockerfile, dune-project: build config updates - test-stepper.sx: stepper unit tests - reader-macro-demo plan update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 lines
876 KiB
Plaintext
2 lines
876 KiB
Plaintext
{"version":3,"sections":[{"offset":{"line":0,"column":79773},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/camlinternalFormatBasics.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Benoit Vaugon, ENSTA *)\n(* *)\n(* Copyright 2014 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Padding position. *)\ntype padty =\n | Left (* Text is left justified ('-' option). *)\n | Right (* Text is right justified (no '-' option). *)\n | Zeros (* Text is right justified by zeros (see '0' option). *)\n\n(***)\n\n(* Integer conversion. *)\ntype int_conv =\n | Int_d | Int_pd | Int_sd (* %d | %+d | % d *)\n | Int_i | Int_pi | Int_si (* %i | %+i | % i *)\n | Int_x | Int_Cx (* %x | %#x *)\n | Int_X | Int_CX (* %X | %#X *)\n | Int_o | Int_Co (* %o | %#o *)\n | Int_u (* %u *)\n | Int_Cd | Int_Ci | Int_Cu (* %#d | %#i | %#u *)\n\n(* Float conversion. *)\ntype float_flag_conv =\n | Float_flag_ (* %[feEgGFhH] *)\n | Float_flag_p (* %+[feEgGFhH] *)\n | Float_flag_s (* % [feEgGFhH] *)\ntype float_kind_conv =\n | Float_f (* %f | %+f | % f *)\n | Float_e (* %e | %+e | % e *)\n | Float_E (* %E | %+E | % E *)\n | Float_g (* %g | %+g | % g *)\n | Float_G (* %G | %+G | % G *)\n | Float_F (* %F | %+F | % F *)\n | Float_h (* %h | %+h | % h *)\n | Float_H (* %H | %+H | % H *)\n | Float_CF (* %#F| %+#F| % #F *)\ntype float_conv = float_flag_conv * float_kind_conv\n\n(***)\n\n(* Char sets (see %[...]) are bitmaps implemented as 32-char strings. *)\ntype char_set = string\n\n(***)\n\n(* Counter used in Scanf. *)\ntype counter =\n | Line_counter (* %l *)\n | Char_counter (* %n *)\n | Token_counter (* %N, %L *)\n\n(***)\n\n(* Padding of strings and numbers. *)\ntype ('a, 'b) padding =\n (* No padding (ex: \"%d\") *)\n | No_padding : ('a, 'a) padding\n (* Literal padding (ex: \"%8d\") *)\n | Lit_padding : padty * int -> ('a, 'a) padding\n (* Padding as extra argument (ex: \"%*d\") *)\n | Arg_padding : padty -> (int -> 'a, 'a) padding\n\n(* Some formats, such as %_d,\n only accept an optional number as padding option (no extra argument) *)\ntype pad_option = int option\n\n(* Precision of floats and '0'-padding of integers. *)\ntype ('a, 'b) precision =\n (* No precision (ex: \"%f\") *)\n | No_precision : ('a, 'a) precision\n (* Literal precision (ex: \"%.3f\") *)\n | Lit_precision : int -> ('a, 'a) precision\n (* Precision as extra argument (ex: \"%.*f\") *)\n | Arg_precision : (int -> 'a, 'a) precision\n\n(* Some formats, such as %_f,\n only accept an optional number as precision option (no extra argument) *)\ntype prec_option = int option\n\n(* see the Custom format combinator *)\ntype ('a, 'b, 'c) custom_arity =\n | Custom_zero : ('a, string, 'a) custom_arity\n | Custom_succ : ('a, 'b, 'c) custom_arity ->\n ('a, 'x -> 'b, 'x -> 'c) custom_arity\n\n(***)\n\n(* Relational format types\n\nIn the first format+gadts implementation, the type for %(..%) in the\nfmt GADT was as follows:\n\n| Format_subst : (* %(...%) *)\n pad_option * ('d1, 'q1, 'd2, 'q2) reader_nb_unifier *\n ('x, 'b, 'c, 'd1, 'q1, 'u) fmtty *\n ('u, 'b, 'c, 'q1, 'e1, 'f) fmt ->\n (('x, 'b, 'c, 'd2, 'q2, 'u) format6 -> 'x, 'b, 'c, 'd1, 'e1, 'f) fmt\n\nNotice that the 'u parameter in 'f position in the format argument\n(('x, .., 'u) format6 -> ..) is equal to the 'u parameter in 'a\nposition in the format tail (('u, .., 'f) fmt). This means that the\ntype of the expected format parameter depends of where the %(...%)\nare in the format string:\n\n # Printf.printf \"%(%)\"\n - : (unit, out_channel, unit, '_a, '_a, unit)\n CamlinternalFormatBasics.format6 -> unit\n = <fun>\n # Printf.printf \"%(%)%d\"\n - : (int -> unit, out_channel, unit, '_a, '_a, int -> unit)\n CamlinternalFormatBasics.format6 -> int -> unit\n = <fun>\n\nOn the contrary, the legacy typer gives a clever type that does not\ndepend on the position of %(..%) in the format string. For example,\n%(%) will have the polymorphic type ('a, 'b, 'c, 'd, 'd, 'a): it can\nbe concatenated to any format type, and only enforces the constraint\nthat its 'a and 'f parameters are equal (no format arguments) and 'd\nand 'e are equal (no reader argument).\n\nThe weakening of this parameter type in the GADT version broke user\ncode (in fact it essentially made %(...%) unusable except at the last\nposition of a format). In particular, the following would not work\nanymore:\n\n fun sep ->\n Format.printf \"foo%(%)bar%(%)baz\" sep sep\n\nAs the type-checker would require two *incompatible* types for the %(%)\nin different positions.\n\nThe solution to regain a general type for %(..%) is to generalize this\ntechnique, not only on the 'd, 'e parameters, but on all six\nparameters of a format: we introduce a \"relational\" type\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\nwhose values are proofs that ('a1, .., 'f1) and ('a2, .., 'f2) morally\ncorrespond to the same format type: 'a1 is obtained from 'f1,'b1,'c1\nin the exact same way that 'a2 is obtained from 'f2,'b2,'c2, etc.\n\nFor example, the relation between two format types beginning with a Char\nparameter is as follows:\n\n| Char_ty : (* %c *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (char -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n char -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n\nIn the general case, the term structure of fmtty_rel is (almost[1])\nisomorphic to the fmtty of the previous implementation: every\nconstructor is re-read with a binary, relational type, instead of the\nprevious unary typing. fmtty can then be re-defined as the diagonal of\nfmtty_rel:\n\n type ('a, 'b, 'c, 'd, 'e, 'f) fmtty =\n ('a, 'b, 'c, 'd, 'e, 'f,\n 'a, 'b, 'c, 'd, 'e, 'f) fmtty_rel\n\nOnce we have this fmtty_rel type in place, we can give the more\ngeneral type to %(...%):\n\n| Format_subst : (* %(...%) *)\n pad_option *\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g2, 'b, 'c, 'j2, 'd, 'a) fmtty_rel *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g2, 'b, 'c, 'j2, 'e, 'f) fmt\n\nWe accept any format (('g, 'h, 'i, 'j, 'k, 'l) format6) (this is\ncompletely unrelated to the type of the current format), but also\nrequire a proof that this format is in relation to another format that\nis concatenable to the format tail. When executing a %(...%) format\n(in camlinternalFormat.ml:make_printf or scanf.ml:make_scanf), we\ntranstype the format along this relation using the 'recast' function\nto transpose between related format types.\n\n val recast :\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1) fmt\n -> ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n -> ('a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmt\n\nNOTE [1]: the typing of Format_subst_ty requires not one format type, but\ntwo, one to establish the link between the format argument and the\nfirst six parameters, and the other for the link between the format\nargument and the last six parameters.\n\n| Format_subst_ty : (* %(...%) *)\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g1, 'b1, 'c1, 'j1, 'd1, 'a1) fmtty_rel *\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g2, 'b2, 'c2, 'j2, 'd2, 'a2) fmtty_rel *\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g1, 'b1, 'c1, 'j1, 'e1, 'f1,\n ('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g2, 'b2, 'c2, 'j2, 'e2, 'f2) fmtty_rel\n\nWhen we generate a format AST, we generate exactly the same witness\nfor both relations, and the witness-conversion functions in\ncamlinternalFormat do rely on this invariant. For example, the\nfunction that proves that the relation is transitive\n\n val trans :\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n -> ('a2, 'b2, 'c2, 'd2, 'e2, 'f2,\n 'a3, 'b3, 'c3, 'd3, 'e3, 'f3) fmtty_rel\n -> ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a3, 'b3, 'c3, 'd3, 'e3, 'f3) fmtty_rel\n\ndoes assume that the two inputs have exactly the same term structure\n(and is only every used for argument witnesses of the\nFormat_subst_ty constructor).\n*)\n\n(* Type of a block used by the Format pretty-printer. *)\ntype block_type =\n | Pp_hbox (* Horizontal block no line breaking *)\n | Pp_vbox (* Vertical block each break leads to a new line *)\n | Pp_hvbox (* Horizontal-vertical block: same as vbox, except if this block\n is small enough to fit on a single line *)\n | Pp_hovbox (* Horizontal or Vertical block: breaks lead to new line\n only when necessary to print the content of the block *)\n | Pp_box (* Horizontal or Indent block: breaks lead to new line\n only when necessary to print the content of the block, or\n when it leads to a new indentation of the current line *)\n | Pp_fits (* Internal usage: when a block fits on a single line *)\n\n(* Formatting element used by the Format pretty-printer. *)\ntype formatting_lit =\n | Close_box (* @] *)\n | Close_tag (* @} *)\n | Break of string * int * int (* @, | @ | @; | @;<> *)\n | FFlush (* @? *)\n | Force_newline (* @\\n *)\n | Flush_newline (* @. *)\n | Magic_size of string * int (* @<n> *)\n | Escaped_at (* @@ *)\n | Escaped_percent (* @%% *)\n | Scan_indic of char (* @X *)\n\n(* Formatting element used by the Format pretty-printer. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) formatting_gen =\n | Open_tag : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> (* @{ *)\n ('a, 'b, 'c, 'd, 'e, 'f) formatting_gen\n | Open_box : ('a, 'b, 'c, 'd, 'e, 'f) format6 -> (* @[ *)\n ('a, 'b, 'c, 'd, 'e, 'f) formatting_gen\n\n(***)\n\n(* List of format type elements. *)\n(* In particular used to represent %(...%) and %{...%} contents. *)\nand ('a, 'b, 'c, 'd, 'e, 'f) fmtty =\n ('a, 'b, 'c, 'd, 'e, 'f,\n 'a, 'b, 'c, 'd, 'e, 'f) fmtty_rel\nand ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel =\n | Char_ty : (* %c *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (char -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n char -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | String_ty : (* %s *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (string -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n string -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Int_ty : (* %d *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (int -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n int -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Int32_ty : (* %ld *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (int32 -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n int32 -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Nativeint_ty : (* %nd *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (nativeint -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n nativeint -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Int64_ty : (* %Ld *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (int64 -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n int64 -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Float_ty : (* %f *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (float -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n float -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Bool_ty : (* %B *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (bool -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n bool -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n\n | Format_arg_ty : (* %{...%} *)\n ('g, 'h, 'i, 'j, 'k, 'l) fmtty *\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n ('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2)\n fmtty_rel\n | Format_subst_ty : (* %(...%) *)\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g1, 'b1, 'c1, 'j1, 'd1, 'a1) fmtty_rel *\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g2, 'b2, 'c2, 'j2, 'd2, 'a2) fmtty_rel *\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g1, 'b1, 'c1, 'j1, 'e1, 'f1,\n ('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g2, 'b2, 'c2, 'j2, 'e2, 'f2)\n fmtty_rel\n\n (* Printf and Format specific constructors. *)\n | Alpha_ty : (* %a *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (('b1 -> 'x -> 'c1) -> 'x -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n ('b2 -> 'x -> 'c2) -> 'x -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Theta_ty : (* %t *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n (('b1 -> 'c1) -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n ('b2 -> 'c2) -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n | Any_ty : (* Used for custom formats *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n ('x -> 'a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'x -> 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel\n\n (* Scanf specific constructor. *)\n | Reader_ty : (* %r *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n ('x -> 'a1, 'b1, 'c1, ('b1 -> 'x) -> 'd1, 'e1, 'f1,\n 'x -> 'a2, 'b2, 'c2, ('b2 -> 'x) -> 'd2, 'e2, 'f2) fmtty_rel\n | Ignored_reader_ty : (* %_r *)\n ('a1, 'b1, 'c1, 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, 'd2, 'e2, 'f2) fmtty_rel ->\n ('a1, 'b1, 'c1, ('b1 -> 'x) -> 'd1, 'e1, 'f1,\n 'a2, 'b2, 'c2, ('b2 -> 'x) -> 'd2, 'e2, 'f2) fmtty_rel\n\n | End_of_fmtty :\n ('f1, 'b1, 'c1, 'd1, 'd1, 'f1,\n 'f2, 'b2, 'c2, 'd2, 'd2, 'f2) fmtty_rel\n\n(***)\n\n(* List of format elements. *)\nand ('a, 'b, 'c, 'd, 'e, 'f) fmt =\n | Char : (* %c *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (char -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Caml_char : (* %C *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (char -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | String : (* %s *)\n ('x, string -> 'a) padding * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Caml_string : (* %S *)\n ('x, string -> 'a) padding * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Int : (* %[dixXuo] *)\n int_conv * ('x, 'y) padding * ('y, int -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Int32 : (* %l[dixXuo] *)\n int_conv * ('x, 'y) padding * ('y, int32 -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Nativeint : (* %n[dixXuo] *)\n int_conv * ('x, 'y) padding * ('y, nativeint -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Int64 : (* %L[dixXuo] *)\n int_conv * ('x, 'y) padding * ('y, int64 -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Float : (* %[feEgGFhH] *)\n float_conv * ('x, 'y) padding * ('y, float -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Bool : (* %[bB] *)\n ('x, bool -> 'a) padding * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'd, 'e, 'f) fmt\n | Flush : (* %! *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt\n\n | String_literal : (* abc *)\n string * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt\n | Char_literal : (* x *)\n char * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt\n\n | Format_arg : (* %{...%} *)\n pad_option * ('g, 'h, 'i, 'j, 'k, 'l) fmtty *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Format_subst : (* %(...%) *)\n pad_option *\n ('g, 'h, 'i, 'j, 'k, 'l,\n 'g2, 'b, 'c, 'j2, 'd, 'a) fmtty_rel *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (('g, 'h, 'i, 'j, 'k, 'l) format6 -> 'g2, 'b, 'c, 'j2, 'e, 'f) fmt\n\n (* Printf and Format specific constructor. *)\n | Alpha : (* %a *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (('b -> 'x -> 'c) -> 'x -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Theta : (* %t *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (('b -> 'c) -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n\n (* Format specific constructor: *)\n | Formatting_lit : (* @_ *)\n formatting_lit * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt\n | Formatting_gen : (* @_ *)\n ('a1, 'b, 'c, 'd1, 'e1, 'f1) formatting_gen *\n ('f1, 'b, 'c, 'e1, 'e2, 'f2) fmt -> ('a1, 'b, 'c, 'd1, 'e2, 'f2) fmt\n\n (* Scanf specific constructors: *)\n | Reader : (* %r *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x -> 'a, 'b, 'c, ('b -> 'x) -> 'd, 'e, 'f) fmt\n | Scan_char_set : (* %[...] *)\n pad_option * char_set * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (string -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Scan_get_counter : (* %[nlNL] *)\n counter * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (int -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Scan_next_char : (* %0c *)\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n (char -> 'a, 'b, 'c, 'd, 'e, 'f) fmt\n | Ignored_param : (* %_ *)\n ('a, 'b, 'c, 'd, 'y, 'x) ignored * ('x, 'b, 'c, 'y, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt\n\n (* Custom printing format (PR#6452, GPR#140)\n\n We include a type Custom of \"custom converters\", where an\n arbitrary function can be used to convert one or more\n arguments. There is no syntax for custom converters, it is only\n intended for custom processors that wish to rely on the\n stdlib-defined format GADTs.\n\n For instance a pre-processor could choose to interpret strings\n prefixed with [\"!\"] as format strings where [%{{ ... }}] is\n a special form to pass a to_string function, so that one could\n write:\n\n {[\n type t = { x : int; y : int }\n\n let string_of_t t = Printf.sprintf \"{ x = %d; y = %d }\" t.x t.y\n\n Printf.printf !\"t = %{{string_of_t}}\" { x = 42; y = 42 }\n ]}\n *)\n | Custom :\n ('a, 'x, 'y) custom_arity * (unit -> 'x) * ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('y, 'b, 'c, 'd, 'e, 'f) fmt\n\n (* end of a format specification *)\n | End_of_format :\n ('f, 'b, 'c, 'e, 'e, 'f) fmt\n\n(***)\n\n(* Type for ignored parameters (see \"%_\"). *)\nand ('a, 'b, 'c, 'd, 'e, 'f) ignored =\n | Ignored_char : (* %_c *)\n ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_caml_char : (* %_C *)\n ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_string : (* %_s *)\n pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_caml_string : (* %_S *)\n pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_int : (* %_d *)\n int_conv * pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_int32 : (* %_ld *)\n int_conv * pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_nativeint : (* %_nd *)\n int_conv * pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_int64 : (* %_Ld *)\n int_conv * pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_float : (* %_f *)\n pad_option * prec_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_bool : (* %_B *)\n pad_option -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_format_arg : (* %_{...%} *)\n pad_option * ('g, 'h, 'i, 'j, 'k, 'l) fmtty ->\n ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_format_subst : (* %_(...%) *)\n pad_option * ('a, 'b, 'c, 'd, 'e, 'f) fmtty ->\n ('a, 'b, 'c, 'd, 'e, 'f) ignored\n | Ignored_reader : (* %_r *)\n ('a, 'b, 'c, ('b -> 'x) -> 'd, 'd, 'a) ignored\n | Ignored_scan_char_set : (* %_[...] *)\n pad_option * char_set -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_scan_get_counter : (* %_[nlNL] *)\n counter -> ('a, 'b, 'c, 'd, 'd, 'a) ignored\n | Ignored_scan_next_char : (* %_0c *)\n ('a, 'b, 'c, 'd, 'd, 'a) ignored\n\nand ('a, 'b, 'c, 'd, 'e, 'f) format6 =\n Format of ('a, 'b, 'c, 'd, 'e, 'f) fmt * string\n\nlet rec erase_rel : type a b c d e f g h i j k l .\n (a, b, c, d, e, f,\n g, h, i, j, k, l) fmtty_rel -> (a, b, c, d, e, f) fmtty\n= function\n | Char_ty rest ->\n Char_ty (erase_rel rest)\n | String_ty rest ->\n String_ty (erase_rel rest)\n | Int_ty rest ->\n Int_ty (erase_rel rest)\n | Int32_ty rest ->\n Int32_ty (erase_rel rest)\n | Int64_ty rest ->\n Int64_ty (erase_rel rest)\n | Nativeint_ty rest ->\n Nativeint_ty (erase_rel rest)\n | Float_ty rest ->\n Float_ty (erase_rel rest)\n | Bool_ty rest ->\n Bool_ty (erase_rel rest)\n | Format_arg_ty (ty, rest) ->\n Format_arg_ty (ty, erase_rel rest)\n | Format_subst_ty (ty1, _ty2, rest) ->\n Format_subst_ty (ty1, ty1, erase_rel rest)\n | Alpha_ty rest ->\n Alpha_ty (erase_rel rest)\n | Theta_ty rest ->\n Theta_ty (erase_rel rest)\n | Any_ty rest ->\n Any_ty (erase_rel rest)\n | Reader_ty rest ->\n Reader_ty (erase_rel rest)\n | Ignored_reader_ty rest ->\n Ignored_reader_ty (erase_rel rest)\n | End_of_fmtty -> End_of_fmtty\n\n(******************************************************************************)\n (* Format type concatenation *)\n\n(* Concatenate two format types. *)\n(* Used by:\n * reader_nb_unifier_of_fmtty to count readers in an fmtty,\n * Scanf.take_fmtty_format_readers to extract readers inside %(...%),\n * CamlinternalFormat.fmtty_of_ignored_format to extract format type. *)\n\n(*\nlet rec concat_fmtty : type a b c d e f g h .\n (a, b, c, d, e, f) fmtty ->\n (f, b, c, e, g, h) fmtty ->\n (a, b, c, d, g, h) fmtty =\n*)\nlet rec concat_fmtty :\n type a1 b1 c1 d1 e1 f1\n a2 b2 c2 d2 e2 f2\n g1 j1 g2 j2\n .\n (g1, b1, c1, j1, d1, a1,\n g2, b2, c2, j2, d2, a2) fmtty_rel ->\n (a1, b1, c1, d1, e1, f1,\n a2, b2, c2, d2, e2, f2) fmtty_rel ->\n (g1, b1, c1, j1, e1, f1,\n g2, b2, c2, j2, e2, f2) fmtty_rel =\nfun fmtty1 fmtty2 -> match fmtty1 with\n | Char_ty rest ->\n Char_ty (concat_fmtty rest fmtty2)\n | String_ty rest ->\n String_ty (concat_fmtty rest fmtty2)\n | Int_ty rest ->\n Int_ty (concat_fmtty rest fmtty2)\n | Int32_ty rest ->\n Int32_ty (concat_fmtty rest fmtty2)\n | Nativeint_ty rest ->\n Nativeint_ty (concat_fmtty rest fmtty2)\n | Int64_ty rest ->\n Int64_ty (concat_fmtty rest fmtty2)\n | Float_ty rest ->\n Float_ty (concat_fmtty rest fmtty2)\n | Bool_ty rest ->\n Bool_ty (concat_fmtty rest fmtty2)\n | Alpha_ty rest ->\n Alpha_ty (concat_fmtty rest fmtty2)\n | Theta_ty rest ->\n Theta_ty (concat_fmtty rest fmtty2)\n | Any_ty rest ->\n Any_ty (concat_fmtty rest fmtty2)\n | Reader_ty rest ->\n Reader_ty (concat_fmtty rest fmtty2)\n | Ignored_reader_ty rest ->\n Ignored_reader_ty (concat_fmtty rest fmtty2)\n | Format_arg_ty (ty, rest) ->\n Format_arg_ty (ty, concat_fmtty rest fmtty2)\n | Format_subst_ty (ty1, ty2, rest) ->\n Format_subst_ty (ty1, ty2, concat_fmtty rest fmtty2)\n | End_of_fmtty -> fmtty2\n\n(******************************************************************************)\n (* Format concatenation *)\n\n(* Concatenate two formats. *)\nlet rec concat_fmt : type a b c d e f g h .\n (a, b, c, d, e, f) fmt ->\n (f, b, c, e, g, h) fmt ->\n (a, b, c, d, g, h) fmt =\nfun fmt1 fmt2 -> match fmt1 with\n | String (pad, rest) ->\n String (pad, concat_fmt rest fmt2)\n | Caml_string (pad, rest) ->\n Caml_string (pad, concat_fmt rest fmt2)\n\n | Int (iconv, pad, prec, rest) ->\n Int (iconv, pad, prec, concat_fmt rest fmt2)\n | Int32 (iconv, pad, prec, rest) ->\n Int32 (iconv, pad, prec, concat_fmt rest fmt2)\n | Nativeint (iconv, pad, prec, rest) ->\n Nativeint (iconv, pad, prec, concat_fmt rest fmt2)\n | Int64 (iconv, pad, prec, rest) ->\n Int64 (iconv, pad, prec, concat_fmt rest fmt2)\n | Float (fconv, pad, prec, rest) ->\n Float (fconv, pad, prec, concat_fmt rest fmt2)\n\n | Char (rest) ->\n Char (concat_fmt rest fmt2)\n | Caml_char rest ->\n Caml_char (concat_fmt rest fmt2)\n | Bool (pad, rest) ->\n Bool (pad, concat_fmt rest fmt2)\n | Alpha rest ->\n Alpha (concat_fmt rest fmt2)\n | Theta rest ->\n Theta (concat_fmt rest fmt2)\n | Custom (arity, f, rest) ->\n Custom (arity, f, concat_fmt rest fmt2)\n | Reader rest ->\n Reader (concat_fmt rest fmt2)\n | Flush rest ->\n Flush (concat_fmt rest fmt2)\n\n | String_literal (str, rest) ->\n String_literal (str, concat_fmt rest fmt2)\n | Char_literal (chr, rest) ->\n Char_literal (chr, concat_fmt rest fmt2)\n\n | Format_arg (pad, fmtty, rest) ->\n Format_arg (pad, fmtty, concat_fmt rest fmt2)\n | Format_subst (pad, fmtty, rest) ->\n Format_subst (pad, fmtty, concat_fmt rest fmt2)\n\n | Scan_char_set (width_opt, char_set, rest) ->\n Scan_char_set (width_opt, char_set, concat_fmt rest fmt2)\n | Scan_get_counter (counter, rest) ->\n Scan_get_counter (counter, concat_fmt rest fmt2)\n | Scan_next_char (rest) ->\n Scan_next_char (concat_fmt rest fmt2)\n | Ignored_param (ign, rest) ->\n Ignored_param (ign, concat_fmt rest fmt2)\n\n | Formatting_lit (fmting_lit, rest) ->\n Formatting_lit (fmting_lit, concat_fmt rest fmt2)\n | Formatting_gen (fmting_gen, rest) ->\n Formatting_gen (fmting_gen, concat_fmt rest fmt2)\n\n | End_of_format ->\n fmt2\n","(* generated code *)"],"names":[],"mappings":"MAsnBiB,QA2Db,gGA/BsC,IA+BtC,0BA/BkB,SAAoB,MAuBE,IAvBF,mBAuBlB,SAAoB,MAFH,IAEG,UAFzB,SAAsB,MAFU,IAEV,mBAFV,SAAoB,MAFS,IAET,0BAFX,SAAoB,MAf3B,IAe2B,UAfjD,SAAsB,MA0BmB,IA1BnB,mBA0BD,SAAoB,MAFA,IAEA,mBAFpB,SAAoB,MA5BpB,IA4BoB,UA5B1C,SAAsB,MAFA,IAEA,UAFtB,SAAsB,MAkBkB,IAlBlB,0BAkBF,SAAoB,MAFA,IAEA,0BAFpB,SAAoB,MAHL,IAGK,mBAHzB,SAAoB,MAFA,IAEA,mBAFpB,SAAoB,MAHb,IAGa,UAHnC,SAAsB,MAVG,IAUH,mBAVjB,SAAoB,MAPc,IAOd,iCAPN,SAAoB,MAFA,IAEA,iCAFpB,SAAoB,MAFI,IAEJ,iCAFhB,SAAoB,MAFJ,IAEI,iCAFxB,SAAoB,MAFF,IAEE,iCAFtB,SAAoB,MAHL,IAGK,mBAHzB,SAAoB,MAFL,IAEK,mBAFzB,SAAoB,MAkBD,IAlBC,UAkBvB,SAAsB,MAFL,IAEK,UAF3B,SAAsB,KAyCvB,C,MApGa,QA+BD,kEAL4B,IAK5B,UALE,SAA0B,MAFR,IAEQ,UAFlC,SAA0B,MAFH,IAEG,UAF7B,SAA0B,MAFE,IAEF,UAFxB,SAA0B,MAFA,IAEA,UAF1B,SAA0B,MAYgB,IAZhB,0BAYR,SAAwB,MAFR,IAEQ,mBAFhC,SAAwB,MAZT,IAYS,UAZnC,SAA0B,MAFC,IAED,UAFzB,SAA0B,MAFA,IAEA,UAF1B,SAA0B,MAFI,IAEJ,UAFtB,SAA0B,MAFJ,IAEI,UAF9B,SAA0B,MAFF,IAEE,UAF5B,SAA0B,MAFG,IAEH,UAFvB,SAA0B,MAFF,IAEE,UAF5B,SAA0B,KA6BZ,C,MA7FlB,QAkCY,oEADkB,IAClB,UADE,OAAgB,MAFR,IAEQ,UAFxB,OAAgB,MAFH,IAEG,UAFnB,OAAgB,MAFE,IAEF,UAFd,OAAgB,MAFA,IAEA,UAFhB,OAAgB,MAFgB,IAEhB,cAFgB,EAEhB,OAFE,OAAc,MAFR,IAEQ,mBAFtB,OAAc,MAFT,IAES,UAFzB,OAAgB,MAFC,IAED,UAFf,OAAgB,MAJA,IAIA,UAJhB,OAAgB,MAEI,IAFJ,UAEZ,OAAgB,MAJJ,IAII,UAJpB,OAAgB,MAFF,IAEE,UAFlB,OAAgB,MAFG,IAEH,UAFb,OAAgB,MAFF,IAEE,UAFlB,OAAgB,KA6BI,C,ECjjBhC,qB,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":81994},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/stdlib.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Exceptions *)\n\nexternal register_named_value : string -> 'a -> unit\n = \"caml_register_named_value\"\n\nlet () =\n (* for runtime/fail_nat.c *)\n register_named_value \"Pervasives.array_bound_error\"\n (Invalid_argument \"index out of bounds\")\n\nexternal raise : exn -> 'a = \"%raise\"\nexternal raise_notrace : exn -> 'a = \"%raise_notrace\"\n\nlet failwith s = raise(Failure s)\nlet invalid_arg s = raise(Invalid_argument s)\n\nexception Exit\nexception Match_failure = Match_failure\nexception Assert_failure = Assert_failure\nexception Invalid_argument = Invalid_argument\nexception Failure = Failure\nexception Not_found = Not_found\nexception Out_of_memory = Out_of_memory\nexception Stack_overflow = Stack_overflow\nexception Sys_error = Sys_error\nexception End_of_file = End_of_file\nexception Division_by_zero = Division_by_zero\nexception Sys_blocked_io = Sys_blocked_io\nexception Undefined_recursive_module = Undefined_recursive_module\n\n(* Composition operators *)\n\nexternal ( |> ) : 'a -> ('a -> 'b) -> 'b = \"%revapply\"\nexternal ( @@ ) : ('a -> 'b) -> 'a -> 'b = \"%apply\"\n\n(* Debugging *)\n\nexternal __LOC__ : string = \"%loc_LOC\"\nexternal __FILE__ : string = \"%loc_FILE\"\nexternal __LINE__ : int = \"%loc_LINE\"\nexternal __MODULE__ : string = \"%loc_MODULE\"\nexternal __POS__ : string * int * int * int = \"%loc_POS\"\nexternal __FUNCTION__ : string = \"%loc_FUNCTION\"\n\nexternal __LOC_OF__ : 'a -> string * 'a = \"%loc_LOC\"\nexternal __LINE_OF__ : 'a -> int * 'a = \"%loc_LINE\"\nexternal __POS_OF__ : 'a -> (string * int * int * int) * 'a = \"%loc_POS\"\n\n(* Comparisons *)\n\nexternal ( = ) : 'a -> 'a -> bool = \"%equal\"\nexternal ( <> ) : 'a -> 'a -> bool = \"%notequal\"\nexternal ( < ) : 'a -> 'a -> bool = \"%lessthan\"\nexternal ( > ) : 'a -> 'a -> bool = \"%greaterthan\"\nexternal ( <= ) : 'a -> 'a -> bool = \"%lessequal\"\nexternal ( >= ) : 'a -> 'a -> bool = \"%greaterequal\"\nexternal compare : 'a -> 'a -> int = \"%compare\"\n\nlet min x y = if x <= y then x else y\nlet max x y = if x >= y then x else y\n\nexternal ( == ) : 'a -> 'a -> bool = \"%eq\"\nexternal ( != ) : 'a -> 'a -> bool = \"%noteq\"\n\n(* Boolean operations *)\n\nexternal not : bool -> bool = \"%boolnot\"\nexternal ( && ) : bool -> bool -> bool = \"%sequand\"\nexternal ( || ) : bool -> bool -> bool = \"%sequor\"\n\n(* Integer operations *)\n\nexternal ( ~- ) : int -> int = \"%negint\"\nexternal ( ~+ ) : int -> int = \"%identity\"\nexternal succ : int -> int = \"%succint\"\nexternal pred : int -> int = \"%predint\"\nexternal ( + ) : int -> int -> int = \"%addint\"\nexternal ( - ) : int -> int -> int = \"%subint\"\nexternal ( * ) : int -> int -> int = \"%mulint\"\nexternal ( / ) : int -> int -> int = \"%divint\"\nexternal ( mod ) : int -> int -> int = \"%modint\"\n\nlet abs x = if x >= 0 then x else -x\n\nexternal ( land ) : int -> int -> int = \"%andint\"\nexternal ( lor ) : int -> int -> int = \"%orint\"\nexternal ( lxor ) : int -> int -> int = \"%xorint\"\n\nlet lnot x = x lxor (-1)\n\nexternal ( lsl ) : int -> int -> int = \"%lslint\"\nexternal ( lsr ) : int -> int -> int = \"%lsrint\"\nexternal ( asr ) : int -> int -> int = \"%asrint\"\n\nlet max_int = (-1) lsr 1\nlet min_int = max_int + 1\n\n(* Floating-point operations *)\n\nexternal ( ~-. ) : float -> float = \"%negfloat\"\nexternal ( ~+. ) : float -> float = \"%identity\"\nexternal ( +. ) : float -> float -> float = \"%addfloat\"\nexternal ( -. ) : float -> float -> float = \"%subfloat\"\nexternal ( *. ) : float -> float -> float = \"%mulfloat\"\nexternal ( /. ) : float -> float -> float = \"%divfloat\"\nexternal ( ** ) : float -> float -> float = \"caml_power_float\" \"pow\"\n [@@unboxed] [@@noalloc]\nexternal exp : float -> float = \"caml_exp_float\" \"exp\" [@@unboxed] [@@noalloc]\nexternal expm1 : float -> float = \"caml_expm1_float\" \"caml_expm1\"\n [@@unboxed] [@@noalloc]\nexternal acos : float -> float = \"caml_acos_float\" \"acos\"\n [@@unboxed] [@@noalloc]\nexternal asin : float -> float = \"caml_asin_float\" \"asin\"\n [@@unboxed] [@@noalloc]\nexternal atan : float -> float = \"caml_atan_float\" \"atan\"\n [@@unboxed] [@@noalloc]\nexternal atan2 : float -> float -> float = \"caml_atan2_float\" \"atan2\"\n [@@unboxed] [@@noalloc]\nexternal hypot : float -> float -> float\n = \"caml_hypot_float\" \"caml_hypot\" [@@unboxed] [@@noalloc]\nexternal cos : float -> float = \"caml_cos_float\" \"cos\" [@@unboxed] [@@noalloc]\nexternal cosh : float -> float = \"caml_cosh_float\" \"cosh\"\n [@@unboxed] [@@noalloc]\nexternal acosh : float -> float = \"caml_acosh_float\" \"caml_acosh\"\n [@@unboxed] [@@noalloc]\nexternal log : float -> float = \"caml_log_float\" \"log\" [@@unboxed] [@@noalloc]\nexternal log10 : float -> float = \"caml_log10_float\" \"log10\"\n [@@unboxed] [@@noalloc]\nexternal log1p : float -> float = \"caml_log1p_float\" \"caml_log1p\"\n [@@unboxed] [@@noalloc]\nexternal sin : float -> float = \"caml_sin_float\" \"sin\" [@@unboxed] [@@noalloc]\nexternal sinh : float -> float = \"caml_sinh_float\" \"sinh\"\n [@@unboxed] [@@noalloc]\nexternal asinh : float -> float = \"caml_asinh_float\" \"caml_asinh\"\n [@@unboxed] [@@noalloc]\nexternal sqrt : float -> float = \"caml_sqrt_float\" \"sqrt\"\n [@@unboxed] [@@noalloc]\nexternal tan : float -> float = \"caml_tan_float\" \"tan\" [@@unboxed] [@@noalloc]\nexternal tanh : float -> float = \"caml_tanh_float\" \"tanh\"\n [@@unboxed] [@@noalloc]\nexternal atanh : float -> float = \"caml_atanh_float\" \"caml_atanh\"\n [@@unboxed] [@@noalloc]\nexternal ceil : float -> float = \"caml_ceil_float\" \"ceil\"\n [@@unboxed] [@@noalloc]\nexternal floor : float -> float = \"caml_floor_float\" \"floor\"\n [@@unboxed] [@@noalloc]\nexternal abs_float : float -> float = \"%absfloat\"\nexternal copysign : float -> float -> float\n = \"caml_copysign_float\" \"caml_copysign\"\n [@@unboxed] [@@noalloc]\nexternal mod_float : float -> float -> float = \"caml_fmod_float\" \"fmod\"\n [@@unboxed] [@@noalloc]\nexternal frexp : float -> float * int = \"caml_frexp_float\"\nexternal ldexp : (float [@unboxed]) -> (int [@untagged]) -> (float [@unboxed]) =\n \"caml_ldexp_float\" \"caml_ldexp_float_unboxed\" [@@noalloc]\nexternal modf : float -> float * float = \"caml_modf_float\"\nexternal float : int -> float = \"%floatofint\"\nexternal float_of_int : int -> float = \"%floatofint\"\nexternal truncate : float -> int = \"%intoffloat\"\nexternal int_of_float : float -> int = \"%intoffloat\"\nexternal float_of_bits : int64 -> float\n = \"caml_int64_float_of_bits\" \"caml_int64_float_of_bits_unboxed\"\n [@@unboxed] [@@noalloc]\nlet infinity =\n float_of_bits 0x7F_F0_00_00_00_00_00_00L\nlet neg_infinity =\n float_of_bits 0xFF_F0_00_00_00_00_00_00L\nlet nan =\n float_of_bits 0x7F_F8_00_00_00_00_00_01L\nlet max_float =\n float_of_bits 0x7F_EF_FF_FF_FF_FF_FF_FFL\nlet min_float =\n float_of_bits 0x00_10_00_00_00_00_00_00L\nlet epsilon_float =\n float_of_bits 0x3C_B0_00_00_00_00_00_00L\n\ntype fpclass =\n FP_normal\n | FP_subnormal\n | FP_zero\n | FP_infinite\n | FP_nan\nexternal classify_float : (float [@unboxed]) -> fpclass =\n \"caml_classify_float\" \"caml_classify_float_unboxed\" [@@noalloc]\n\n(* String and byte sequence operations -- more in modules String and Bytes *)\n\nexternal string_length : string -> int = \"%string_length\"\nexternal bytes_length : bytes -> int = \"%bytes_length\"\nexternal bytes_create : int -> bytes = \"caml_create_bytes\"\nexternal string_blit : string -> int -> bytes -> int -> int -> unit\n = \"caml_blit_string\" [@@noalloc]\nexternal bytes_blit : bytes -> int -> bytes -> int -> int -> unit\n = \"caml_blit_bytes\" [@@noalloc]\nexternal bytes_unsafe_to_string : bytes -> string = \"%bytes_to_string\"\n\nlet ( ^ ) s1 s2 =\n let l1 = string_length s1 and l2 = string_length s2 in\n let s = bytes_create (l1 + l2) in\n string_blit s1 0 s 0 l1;\n string_blit s2 0 s l1 l2;\n bytes_unsafe_to_string s\n\n(* Character operations -- more in module Char *)\n\nexternal int_of_char : char -> int = \"%identity\"\nexternal unsafe_char_of_int : int -> char = \"%identity\"\nlet char_of_int n =\n if n < 0 || n > 255 then invalid_arg \"char_of_int\" else unsafe_char_of_int n\n\n(* Unit operations *)\n\nexternal ignore : 'a -> unit = \"%ignore\"\n\n(* Pair operations *)\n\nexternal fst : 'a * 'b -> 'a = \"%field0\"\nexternal snd : 'a * 'b -> 'b = \"%field1\"\n\n(* References *)\n\ntype 'a ref = { mutable contents : 'a }\nexternal ref : 'a -> 'a ref = \"%makemutable\"\nexternal ( ! ) : 'a ref -> 'a = \"%field0\"\nexternal ( := ) : 'a ref -> 'a -> unit = \"%setfield0\"\nexternal incr : int ref -> unit = \"%incr\"\nexternal decr : int ref -> unit = \"%decr\"\n\n(* Result type *)\n\ntype ('a,'b) result = Ok of 'a | Error of 'b\n\n(* String conversion functions *)\n\nexternal format_int : string -> int -> string = \"caml_format_int\"\nexternal format_float : string -> float -> string = \"caml_format_float\"\n\nlet string_of_bool b =\n if b then \"true\" else \"false\"\nlet bool_of_string = function\n | \"true\" -> true\n | \"false\" -> false\n | _ -> invalid_arg \"bool_of_string\"\n\nlet bool_of_string_opt = function\n | \"true\" -> Some true\n | \"false\" -> Some false\n | _ -> None\n\nlet string_of_int n =\n format_int \"%d\" n\n\nexternal int_of_string : string -> int = \"caml_int_of_string\"\n\nlet int_of_string_opt s =\n (* TODO: provide this directly as a non-raising primitive. *)\n try Some (int_of_string s)\n with Failure _ -> None\n\nexternal string_get : string -> int -> char = \"%string_safe_get\"\n\nlet valid_float_lexem s =\n let l = string_length s in\n let rec loop i =\n if i >= l then s ^ \".\" else\n match string_get s i with\n | '0' .. '9' | '-' -> loop (i + 1)\n | _ -> s\n in\n loop 0\n\nlet string_of_float f = valid_float_lexem (format_float \"%.12g\" f)\n\nexternal float_of_string : string -> float = \"caml_float_of_string\"\n\nlet float_of_string_opt s =\n (* TODO: provide this directly as a non-raising primitive. *)\n try Some (float_of_string s)\n with Failure _ -> None\n\n(* List operations -- more in module List *)\n\nlet[@tail_mod_cons] rec ( @ ) l1 l2 =\n match l1 with\n | [] -> l2\n | h1 :: [] -> h1 :: l2\n | h1 :: h2 :: [] -> h1 :: h2 :: l2\n | h1 :: h2 :: h3 :: tl -> h1 :: h2 :: h3 :: (tl @ l2)\n\n(* I/O operations *)\n\ntype in_channel\ntype out_channel\n\nexternal open_descriptor_out : int -> out_channel\n = \"caml_ml_open_descriptor_out\"\nexternal open_descriptor_in : int -> in_channel = \"caml_ml_open_descriptor_in\"\n\nlet stdin = open_descriptor_in 0\nlet stdout = open_descriptor_out 1\nlet stderr = open_descriptor_out 2\n\n(* General output functions *)\n\ntype open_flag =\n Open_rdonly | Open_wronly | Open_append\n | Open_creat | Open_trunc | Open_excl\n | Open_binary | Open_text | Open_nonblock\n\nexternal open_desc : string -> open_flag list -> int -> int = \"caml_sys_open\"\n\nexternal set_out_channel_name: out_channel -> string -> unit =\n \"caml_ml_set_channel_name\"\n\nlet open_out_gen mode perm name =\n let c = open_descriptor_out(open_desc name mode perm) in\n set_out_channel_name c name;\n c\n\nlet open_out name =\n open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_text] 0o666 name\n\nlet open_out_bin name =\n open_out_gen [Open_wronly; Open_creat; Open_trunc; Open_binary] 0o666 name\n\nexternal flush : out_channel -> unit = \"caml_ml_flush\"\n\nexternal out_channels_list : unit -> out_channel list\n = \"caml_ml_out_channels_list\"\n\nlet flush_all () =\n let rec iter = function\n [] -> ()\n | a::l ->\n begin try\n flush a\n with Sys_error _ ->\n () (* ignore channels closed during a preceding flush. *)\n end;\n iter l\n in iter (out_channels_list ())\n\nexternal unsafe_output : out_channel -> bytes -> int -> int -> unit\n = \"caml_ml_output_bytes\"\nexternal unsafe_output_string : out_channel -> string -> int -> int -> unit\n = \"caml_ml_output\"\n\nexternal output_char : out_channel -> char -> unit = \"caml_ml_output_char\"\n\nlet output_bytes oc s =\n unsafe_output oc s 0 (bytes_length s)\n\nlet output_string oc s =\n unsafe_output_string oc s 0 (string_length s)\n\nlet output oc s ofs len =\n if ofs < 0 || len < 0 || ofs > bytes_length s - len\n then invalid_arg \"output\"\n else unsafe_output oc s ofs len\n\nlet output_substring oc s ofs len =\n if ofs < 0 || len < 0 || ofs > string_length s - len\n then invalid_arg \"output_substring\"\n else unsafe_output_string oc s ofs len\n\nexternal output_byte : out_channel -> int -> unit = \"caml_ml_output_char\"\nexternal output_binary_int : out_channel -> int -> unit = \"caml_ml_output_int\"\n\nexternal marshal_to_channel : out_channel -> 'a -> unit list -> unit\n = \"caml_output_value\"\nlet output_value chan v = marshal_to_channel chan v []\n\nexternal seek_out : out_channel -> int -> unit = \"caml_ml_seek_out\"\nexternal pos_out : out_channel -> int = \"caml_ml_pos_out\"\nexternal out_channel_length : out_channel -> int = \"caml_ml_channel_size\"\nexternal close_out_channel : out_channel -> unit = \"caml_ml_close_channel\"\nlet close_out oc = flush oc; close_out_channel oc\nlet close_out_noerr oc =\n (try flush oc with _ -> ());\n (try close_out_channel oc with _ -> ())\nexternal set_binary_mode_out : out_channel -> bool -> unit\n = \"caml_ml_set_binary_mode\"\n\n(* General input functions *)\n\nexternal set_in_channel_name: in_channel -> string -> unit =\n \"caml_ml_set_channel_name\"\n\nlet open_in_gen mode perm name =\n let c = open_descriptor_in(open_desc name mode perm) in\n set_in_channel_name c name;\n c\n\nlet open_in name =\n open_in_gen [Open_rdonly; Open_text] 0 name\n\nlet open_in_bin name =\n open_in_gen [Open_rdonly; Open_binary] 0 name\n\nexternal input_char : in_channel -> char = \"caml_ml_input_char\"\n\nexternal unsafe_input : in_channel -> bytes -> int -> int -> int\n = \"caml_ml_input\"\n\nlet input ic s ofs len =\n if ofs < 0 || len < 0 || ofs > bytes_length s - len\n then invalid_arg \"input\"\n else unsafe_input ic s ofs len\n\nlet rec unsafe_really_input ic s ofs len =\n if len <= 0 then () else begin\n let r = unsafe_input ic s ofs len in\n if r = 0\n then raise End_of_file\n else unsafe_really_input ic s (ofs + r) (len - r)\n end\n\nlet really_input ic s ofs len =\n if ofs < 0 || len < 0 || ofs > bytes_length s - len\n then invalid_arg \"really_input\"\n else unsafe_really_input ic s ofs len\n\nlet really_input_string ic len =\n let s = bytes_create len in\n really_input ic s 0 len;\n bytes_unsafe_to_string s\n\nexternal input_scan_line : in_channel -> int = \"caml_ml_input_scan_line\"\n\nlet input_line chan =\n let rec build_result buf pos = function\n [] -> buf\n | hd :: tl ->\n let len = bytes_length hd in\n bytes_blit hd 0 buf (pos - len) len;\n build_result buf (pos - len) tl in\n let rec scan accu len =\n let n = input_scan_line chan in\n if n = 0 then begin (* n = 0: we are at EOF *)\n match accu with\n [] -> raise End_of_file\n | _ -> build_result (bytes_create len) len accu\n end else if n > 0 then begin (* n > 0: newline found in buffer *)\n let res = bytes_create (n - 1) in\n ignore (unsafe_input chan res 0 (n - 1));\n ignore (input_char chan); (* skip the newline *)\n match accu with\n [] -> res\n | _ -> let len = len + n - 1 in\n build_result (bytes_create len) len (res :: accu)\n end else begin (* n < 0: newline not found *)\n let beg = bytes_create (-n) in\n ignore(unsafe_input chan beg 0 (-n));\n scan (beg :: accu) (len - n)\n end\n in bytes_unsafe_to_string (scan [] 0)\n\nexternal input_byte : in_channel -> int = \"caml_ml_input_char\"\nexternal input_binary_int : in_channel -> int = \"caml_ml_input_int\"\nexternal input_value : in_channel -> 'a = \"caml_input_value\"\nexternal seek_in : in_channel -> int -> unit = \"caml_ml_seek_in\"\nexternal pos_in : in_channel -> int = \"caml_ml_pos_in\"\nexternal in_channel_length : in_channel -> int = \"caml_ml_channel_size\"\nexternal close_in : in_channel -> unit = \"caml_ml_close_channel\"\nlet close_in_noerr ic = (try close_in ic with _ -> ())\nexternal set_binary_mode_in : in_channel -> bool -> unit\n = \"caml_ml_set_binary_mode\"\n\n(* Output functions on standard output *)\n\nlet print_char c = output_char stdout c\nlet print_string s = output_string stdout s\nlet print_bytes s = output_bytes stdout s\nlet print_int i = output_string stdout (string_of_int i)\nlet print_float f = output_string stdout (string_of_float f)\nlet print_endline s =\n output_string stdout s; output_char stdout '\\n'; flush stdout\nlet print_newline () = output_char stdout '\\n'; flush stdout\n\n(* Output functions on standard error *)\n\nlet prerr_char c = output_char stderr c\nlet prerr_string s = output_string stderr s\nlet prerr_bytes s = output_bytes stderr s\nlet prerr_int i = output_string stderr (string_of_int i)\nlet prerr_float f = output_string stderr (string_of_float f)\nlet prerr_endline s =\n output_string stderr s; output_char stderr '\\n'; flush stderr\nlet prerr_newline () = output_char stderr '\\n'; flush stderr\n\n(* Input functions on standard input *)\n\nlet read_line () = flush stdout; input_line stdin\nlet read_int () = int_of_string(read_line())\nlet read_int_opt () = int_of_string_opt(read_line())\nlet read_float () = float_of_string(read_line())\nlet read_float_opt () = float_of_string_opt(read_line())\n\n(* Operations on large files *)\n\nmodule LargeFile =\n struct\n external seek_out : out_channel -> int64 -> unit = \"caml_ml_seek_out_64\"\n external pos_out : out_channel -> int64 = \"caml_ml_pos_out_64\"\n external out_channel_length : out_channel -> int64\n = \"caml_ml_channel_size_64\"\n external seek_in : in_channel -> int64 -> unit = \"caml_ml_seek_in_64\"\n external pos_in : in_channel -> int64 = \"caml_ml_pos_in_64\"\n external in_channel_length : in_channel -> int64 = \"caml_ml_channel_size_64\"\n end\n\n(* Formats *)\n\ntype ('a, 'b, 'c, 'd, 'e, 'f) format6\n = ('a, 'b, 'c, 'd, 'e, 'f) CamlinternalFormatBasics.format6\n = Format of ('a, 'b, 'c, 'd, 'e, 'f) CamlinternalFormatBasics.fmt\n * string\n\ntype ('a, 'b, 'c, 'd) format4 = ('a, 'b, 'c, 'c, 'c, 'd) format6\n\ntype ('a, 'b, 'c) format = ('a, 'b, 'c, 'c) format4\n\nlet string_of_format (Format (_fmt, str)) = str\n\nexternal format_of_string :\n ('a, 'b, 'c, 'd, 'e, 'f) format6 ->\n ('a, 'b, 'c, 'd, 'e, 'f) format6 = \"%identity\"\n\nlet ( ^^ ) (Format (fmt1, str1)) (Format (fmt2, str2)) =\n Format (CamlinternalFormatBasics.concat_fmt fmt1 fmt2,\n str1 ^ \"%,\" ^ str2)\n\n(* Miscellaneous *)\n\nexternal sys_exit : int -> 'a = \"caml_sys_exit\"\n\n(* for at_exit *)\ntype 'a atomic_t\nexternal atomic_make : 'a -> 'a atomic_t = \"%makemutable\"\nexternal atomic_get : 'a atomic_t -> 'a = \"%atomic_load\"\nexternal atomic_compare_and_set : 'a atomic_t -> 'a -> 'a -> bool\n = \"%atomic_cas\"\n\nlet exit_function = atomic_make flush_all\n\nlet rec at_exit f =\n (* MPR#7253, MPR#7796: make sure \"f\" is executed only once *)\n let f_yet_to_run = atomic_make true in\n let old_exit = atomic_get exit_function in\n let new_exit () =\n if atomic_compare_and_set f_yet_to_run true false then f () ;\n old_exit ()\n in\n let success = atomic_compare_and_set exit_function old_exit new_exit in\n if not success then at_exit f\n\nlet do_domain_local_at_exit = ref (fun () -> ())\n\nlet do_at_exit () =\n (!do_domain_local_at_exit) ();\n (atomic_get exit_function) ()\n\nlet exit retcode =\n do_at_exit ();\n sys_exit retcode\n\nlet _ = register_named_value \"Pervasives.do_at_exit\" do_at_exit\n\n(*MODULE_ALIASES*)\nmodule Arg = Arg\nmodule Array = Array\nmodule ArrayLabels = ArrayLabels\nmodule Atomic = Atomic\nmodule Bigarray = Bigarray\nmodule Bool = Bool\nmodule Buffer = Buffer\nmodule Bytes = Bytes\nmodule BytesLabels = BytesLabels\nmodule Callback = Callback\nmodule Char = Char\nmodule Complex = Complex\nmodule Condition = Condition\nmodule Digest = Digest\nmodule Domain = Domain\nmodule Dynarray = Dynarray\nmodule Effect = Effect\nmodule Either = Either\nmodule Ephemeron = Ephemeron\nmodule Filename = Filename\nmodule Float = Float\nmodule Format = Format\nmodule Fun = Fun\nmodule Gc = Gc\nmodule Hashtbl = Hashtbl\nmodule In_channel = In_channel\nmodule Int = Int\nmodule Int32 = Int32\nmodule Int64 = Int64\nmodule Lazy = Lazy\nmodule Lexing = Lexing\nmodule List = List\nmodule ListLabels = ListLabels\nmodule Map = Map\nmodule Marshal = Marshal\nmodule MoreLabels = MoreLabels\nmodule Mutex = Mutex\nmodule Nativeint = Nativeint\nmodule Obj = Obj\nmodule Oo = Oo\nmodule Option = Option\nmodule Out_channel = Out_channel\nmodule Parsing = Parsing\nmodule Printexc = Printexc\nmodule Printf = Printf\nmodule Queue = Queue\nmodule Random = Random\nmodule Result = Result\nmodule Scanf = Scanf\nmodule Semaphore = Semaphore\nmodule Seq = Seq\nmodule Set = Set\nmodule Stack = Stack\nmodule StdLabels = StdLabels\nmodule String = String\nmodule StringLabels = StringLabels\nmodule Sys = Sys\nmodule Type = Type\nmodule Uchar = Uchar\nmodule Unit = Unit\nmodule Weak = Weak\n"],"names":[],"mappings":"8ICkkBE,iBACA,IAAgB,C,KALhB,kCAA6B,yBACA,C,EAJc,IAAE,C,KAN3C,0B,CAAA,EAAuD,yBACvD,uBAAW,C,UAJb,wBAMA,MALA,UACA,YAIA,EACA,eAA6B,C,KA1BpB,mCAEM,EAFN,OAEM,EAAP,IAD6C,IAA7C,IACkB,OADlB,aAA6C,MAC1B,C,EARR,UAA0B,C,KA1BJ,IAAnB,OAAmB,OAAa,U,EADrB,IAAf,KAAe,OAAf,EAA4B,C,KADT,IAAjB,OAAiB,OAAa,U,EADrB,IAAb,KAAa,OAAb,EAA0B,C,KADzB,cAAY,eAAkB,C,KAJ1B,kBAAyB,QAAY,C,KAD1D,qBAAwB,aAAyB,QAAY,C,EAFtB,KAAmB,IAAnB,SAAmB,Q,EA3O1D,KA0OsD,IA1OtD,MA0OsD,Q,EADpC,kBAAqB,C,EADpB,kBAAsB,C,EADxB,aAAoB,C,EAjBf,OAAK,IAAW,G,AAAA,I,AAAA,G,EAAA,IAAW,IAAG,C,UAlC/B,aACb,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I,C,EAPtB,MAAiB,C,EANM,cAEV,GADD,EAEL,IADM,gBACF,C,EARQ,cAEN,mBADD,KAEL,WAA4B,C,EAJb,EAAZ,EAAV,WAA6B,C,KA9B7B,wBAAwD,KAA/B,SAAmD,C,QAPpD,C,EAjHb,YAAW,C,KANZ,eAAe,GAAO,aAAE,C,EAvBP,EAAO,EAAnB,MAAM,IAAc,C,EADR,EAAO,EAAnB,MAAM,IAAc,C,EA5CjB,cAAyB,C,EAD5B,cAAgB,C,uCALW,+DAsKF,GAtKE,IAsKF,eA4H9B,QACC,QACA,QAAqB,ySA0Q1B,OAAuD,6P","ignoreList":[0]}},{"offset":{"line":0,"column":86178},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/either.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Gabriel Scherer, projet Parsifal, INRIA Saclay *)\n(* *)\n(* Copyright 2019 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype ('a, 'b) t = Left of 'a | Right of 'b\n\nlet left v = Left v\nlet right v = Right v\n\nlet is_left = function\n| Left _ -> true\n| Right _ -> false\n\nlet is_right = function\n| Left _ -> false\n| Right _ -> true\n\nlet find_left = function\n| Left v -> Some v\n| Right _ -> None\n\nlet find_right = function\n| Left _ -> None\n| Right v -> Some v\n\nlet map_left f = function\n| Left v -> Left (f v)\n| Right _ as e -> e\n\nlet map_right f = function\n| Left _ as e -> e\n| Right v -> Right (f v)\n\nlet map ~left ~right = function\n| Left v -> Left (left v)\n| Right v -> Right (right v)\n\nlet fold ~left ~right = function\n| Left v -> left v\n| Right v -> right v\n\nlet iter = fold\n\nlet for_all = fold\n\nlet equal ~left ~right e1 e2 = match e1, e2 with\n| Left v1, Left v2 -> left v1 v2\n| Right v1, Right v2 -> right v1 v2\n| Left _, Right _ | Right _, Left _ -> false\n\nlet compare ~left ~right e1 e2 = match e1, e2 with\n| Left v1, Left v2 -> left v1 v2\n| Right v1, Right v2 -> right v1 v2\n| Left _, Right _ -> (-1)\n| Right _, Left _ -> 1\n","(* generated code *)"],"names":[],"mappings":"KA6DiC,sDACX,MAED,wBACA,KADA,UACA,UAFG,OAEF,C,KATS,oDACT,wB,CAAA,mBACE,OACe,IAAK,C,QAXnC,0BACG,0BACC,gB,CAAO,C,QANZ,oBACiB,IADjB,OACS,eAAQ,KACG,IADH,UACN,eAAS,M,QANd,oBACG,GACO,IADP,UACE,eAAK,M,QANX,oBACS,IADT,OACI,eAAK,KACJ,GAAC,C,EANF,kBACL,KACC,IADD,UACC,KAAM,C,KANH,oBACJ,IADI,OACJ,KACC,KAAI,C,EANF,gBAEF,EAAI,C,EANH,eAED,EAAK,C,EAJJ,UAAO,C,EADR,UAAM,C,ECjBnB,2C,QAAA,4D,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}},{"offset":{"line":0,"column":87241},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/sys.ml.in"],"sourcesContent":["(* generated code *)","(* @configure_input@ *)\n#3 \"sys.ml.in\"\n(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype backend_type =\n | Native\n | Bytecode\n | Other of string\n(* System interface *)\n\nexternal get_config: unit -> string * int * bool = \"caml_sys_get_config\"\nexternal get_executable_name : unit -> string = \"caml_sys_executable_name\"\nexternal argv : string array = \"%sys_argv\"\nexternal big_endian : unit -> bool = \"%big_endian\"\nexternal word_size : unit -> int = \"%word_size\"\nexternal int_size : unit -> int = \"%int_size\"\nexternal max_wosize : unit -> int = \"%max_wosize\"\nexternal unix : unit -> bool = \"%ostype_unix\"\nexternal win32 : unit -> bool = \"%ostype_win32\"\nexternal cygwin : unit -> bool = \"%ostype_cygwin\"\nexternal get_backend_type : unit -> backend_type = \"%backend_type\"\n\nlet executable_name = get_executable_name()\nlet (os_type, _, _) = get_config()\nlet backend_type = get_backend_type ()\nlet big_endian = big_endian ()\nlet word_size = word_size ()\nlet int_size = int_size ()\nlet unix = unix ()\nlet win32 = win32 ()\nlet cygwin = cygwin ()\nlet max_array_length = max_wosize ()\nlet max_floatarray_length = max_array_length / (64 / word_size)\nlet max_string_length = word_size / 8 * max_array_length - 1\nexternal runtime_variant : unit -> string = \"caml_runtime_variant\"\nexternal runtime_parameters : unit -> string = \"caml_runtime_parameters\"\n\nexternal file_exists: string -> bool = \"caml_sys_file_exists\"\nexternal is_directory : string -> bool = \"caml_sys_is_directory\"\nexternal is_regular_file : string -> bool = \"caml_sys_is_regular_file\"\nexternal remove: string -> unit = \"caml_sys_remove\"\nexternal rename : string -> string -> unit = \"caml_sys_rename\"\nexternal getenv: string -> string = \"caml_sys_getenv\"\n\nlet getenv_opt s =\n (* TODO: expose a non-raising primitive directly. *)\n try Some (getenv s)\n with Not_found -> None\n\nexternal command: string -> int = \"caml_sys_system_command\"\nexternal time: unit -> (float [@unboxed]) =\n \"caml_sys_time\" \"caml_sys_time_unboxed\" [@@noalloc]\nexternal chdir: string -> unit = \"caml_sys_chdir\"\nexternal mkdir: string -> int -> unit = \"caml_sys_mkdir\"\nexternal rmdir: string -> unit = \"caml_sys_rmdir\"\nexternal getcwd: unit -> string = \"caml_sys_getcwd\"\nexternal readdir : string -> string array = \"caml_sys_read_directory\"\n\nlet interactive = ref false\n\ntype signal_behavior =\n Signal_default\n | Signal_ignore\n | Signal_handle of (int -> unit)\n\nexternal signal : int -> signal_behavior -> signal_behavior\n = \"caml_install_signal_handler\"\n\nlet set_signal sig_num sig_beh = ignore(signal sig_num sig_beh)\n\nlet sigabrt = -1\nlet sigalrm = -2\nlet sigfpe = -3\nlet sighup = -4\nlet sigill = -5\nlet sigint = -6\nlet sigkill = -7\nlet sigpipe = -8\nlet sigquit = -9\nlet sigsegv = -10\nlet sigterm = -11\nlet sigusr1 = -12\nlet sigusr2 = -13\nlet sigchld = -14\nlet sigcont = -15\nlet sigstop = -16\nlet sigtstp = -17\nlet sigttin = -18\nlet sigttou = -19\nlet sigvtalrm = -20\nlet sigprof = -21\nlet sigbus = -22\nlet sigpoll = -23\nlet sigsys = -24\nlet sigtrap = -25\nlet sigurg = -26\nlet sigxcpu = -27\nlet sigxfsz = -28\n\nexception Break\n\nlet catch_break on =\n if on then\n set_signal sigint (Signal_handle(fun _ -> raise Break))\n else\n set_signal sigint Signal_default\n\n\nexternal enable_runtime_warnings: bool -> unit =\n \"caml_ml_enable_runtime_warnings\"\nexternal runtime_warnings_enabled: unit -> bool =\n \"caml_ml_runtime_warnings_enabled\"\n\n(* The version string is found in file ../VERSION *)\n\nlet ocaml_version = \"@VERSION@\"\n\nlet development_version = @OCAML_DEVELOPMENT_VERSION@\n\ntype extra_prefix = Plus | Tilde\n\ntype extra_info = extra_prefix * string\n\ntype ocaml_release_info = {\n major : int;\n minor : int;\n patchlevel : int;\n extra : extra_info option\n}\n\nlet ocaml_release = {\n major = @OCAML_VERSION_MAJOR@;\n minor = @OCAML_VERSION_MINOR@;\n patchlevel = @OCAML_VERSION_PATCHLEVEL@;\n extra = @OCAML_RELEASE_EXTRA@\n}\n\n(* Optimization *)\n\nexternal opaque_identity : 'a -> 'a = \"%opaque\"\n\nmodule Immediate64 = struct\n module type Non_immediate = sig\n type t\n end\n module type Immediate = sig\n type t [@@immediate]\n end\n\n module Make(Immediate : Immediate)(Non_immediate : Non_immediate) = struct\n type t [@@immediate64]\n type 'a repr =\n | Immediate : Immediate.t repr\n | Non_immediate : Non_immediate.t repr\n external magic : _ repr -> t repr = \"%identity\"\n let repr =\n if word_size = 64 then\n magic Immediate\n else\n magic Non_immediate\n end\nend\n"],"names":[],"mappings":"gBC4KQ,a,EA3FuD,IAqC3B,C,EArC2B,K,EAtB7D,OAAmB,IAAV,IAAU,O,AAAA,I,AAAA,G,EAAA,GD3DrB,kDC4DoB,UAAI,C,cAzBF,QACA,MAAY,4E,EAAA,mN","ignoreList":[0]}},{"offset":{"line":0,"column":87752},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/obj.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Operations on internal representations of values *)\n\ntype t\n\ntype raw_data = nativeint\n\nexternal repr : 'a -> t = \"%identity\"\nexternal obj : t -> 'a = \"%identity\"\nexternal magic : 'a -> 'b = \"%identity\"\nexternal is_int : t -> bool = \"%obj_is_int\"\nlet [@inline always] is_block a = not (is_int a)\nexternal tag : t -> int = \"caml_obj_tag\" [@@noalloc]\nexternal size : t -> int = \"%obj_size\"\nexternal reachable_words : t -> int = \"caml_obj_reachable_words\"\nexternal field : t -> int -> t = \"%obj_field\"\nexternal set_field : t -> int -> t -> unit = \"%obj_set_field\"\nexternal floatarray_get : floatarray -> int -> float = \"caml_floatarray_get\"\nexternal floatarray_set :\n floatarray -> int -> float -> unit = \"caml_floatarray_set\"\nlet [@inline always] double_field x i = floatarray_get (obj x : floatarray) i\nlet [@inline always] set_double_field x i v =\n floatarray_set (obj x : floatarray) i v\nexternal raw_field : t -> int -> raw_data = \"caml_obj_raw_field\"\nexternal set_raw_field : t -> int -> raw_data -> unit\n = \"caml_obj_set_raw_field\"\n\nexternal new_block : int -> int -> t = \"caml_obj_block\"\nexternal dup : t -> t = \"caml_obj_dup\"\nexternal add_offset : t -> Int32.t -> t = \"caml_obj_add_offset\"\nexternal with_tag : int -> t -> t = \"caml_obj_with_tag\"\n\nlet first_non_constant_constructor_tag = 0\nlet last_non_constant_constructor_tag = 243\n\nlet forcing_tag = 244\nlet cont_tag = 245\nlet lazy_tag = 246\nlet closure_tag = 247\nlet object_tag = 248\nlet infix_tag = 249\nlet forward_tag = 250\n\nlet no_scan_tag = 251\n\nlet abstract_tag = 251\nlet string_tag = 252\nlet double_tag = 253\nlet double_array_tag = 254\nlet custom_tag = 255\n\n\nlet int_tag = 1000\nlet out_of_heap_tag = 1001\nlet unaligned_tag = 1002\n\nmodule Extension_constructor =\nstruct\n type t = extension_constructor\n let of_val x =\n let x = repr x in\n let slot =\n if (is_block x) && (tag x) <> object_tag && (size x) >= 1 then field x 0\n else x\n in\n let name =\n if (is_block slot) && (tag slot) = object_tag then field slot 0\n else invalid_arg \"Obj.extension_constructor\"\n in\n if (tag name) = string_tag then (obj slot : t)\n else invalid_arg \"Obj.extension_constructor\"\n\n let [@inline always] name (slot : t) =\n (obj (field (repr slot) 0) : string)\n\n let [@inline always] id (slot : t) =\n (obj (field (repr slot) 1) : int)\nend\n\nmodule Ephemeron = struct\n type obj_t = t\n\n type t (** ephemeron *)\n\n (** To change in sync with weak.h *)\n let additional_values = 2\n let max_ephe_length = Sys.max_array_length - additional_values\n\n external create : int -> t = \"caml_ephe_create\"\n let create l =\n if not (0 <= l && l <= max_ephe_length) then\n invalid_arg \"Obj.Ephemeron.create\";\n create l\n\n let length x = size(repr x) - additional_values\n\n let raise_if_invalid_offset e o msg =\n if not (0 <= o && o < length e) then\n invalid_arg msg\n\n external get_key: t -> int -> obj_t option = \"caml_ephe_get_key\"\n let get_key e o =\n raise_if_invalid_offset e o \"Obj.Ephemeron.get_key\";\n get_key e o\n\n external get_key_copy: t -> int -> obj_t option = \"caml_ephe_get_key_copy\"\n let get_key_copy e o =\n raise_if_invalid_offset e o \"Obj.Ephemeron.get_key_copy\";\n get_key_copy e o\n\n external set_key: t -> int -> obj_t -> unit = \"caml_ephe_set_key\"\n let set_key e o x =\n raise_if_invalid_offset e o \"Obj.Ephemeron.set_key\";\n set_key e o x\n\n external unset_key: t -> int -> unit = \"caml_ephe_unset_key\"\n let unset_key e o =\n raise_if_invalid_offset e o \"Obj.Ephemeron.unset_key\";\n unset_key e o\n\n external check_key: t -> int -> bool = \"caml_ephe_check_key\"\n let check_key e o =\n raise_if_invalid_offset e o \"Obj.Ephemeron.check_key\";\n check_key e o\n\n external blit_key : t -> int -> t -> int -> int -> unit\n = \"caml_ephe_blit_key\"\n\n let blit_key e1 o1 e2 o2 l =\n if l < 0 || o1 < 0 || o1 > length e1 - l\n || o2 < 0 || o2 > length e2 - l\n then invalid_arg \"Obj.Ephemeron.blit_key\"\n else if l <> 0 then blit_key e1 o1 e2 o2 l\n\n external get_data: t -> obj_t option = \"caml_ephe_get_data\"\n external get_data_copy: t -> obj_t option = \"caml_ephe_get_data_copy\"\n external set_data: t -> obj_t -> unit = \"caml_ephe_set_data\"\n external unset_data: t -> unit = \"caml_ephe_unset_data\"\n external check_data: t -> bool = \"caml_ephe_check_data\"\n external blit_data : t -> t -> unit = \"caml_ephe_blit_data\"\n\nend\n"],"names":[],"mappings":"sDC+II,4BAA2B,SAAS,qCACf,SAAS,uBAEzB,aAAe,aAAsB,WADrC,uBACqC,C,EAV1C,WACA,MAAa,C,EANb,WACA,MAAa,C,EANb,WACA,QAAa,C,EANb,WACA,MAAgB,C,EANhB,WACA,MAAW,C,OANX,gBAA8B,IAAR,SAAQ,O,GAAA,MAC5B,4BAAe,C,IAJJ,S,CAAA,4BAAgC,C,OAJ7C,4CACE,yBACF,IAAQ,C,IAhBH,U,CAAA,6BAAqB,C,IAHrB,U,CAAA,6BAAqB,C,KAXrB,SAAY,K,CAAA,EAAI,IAAO,kB,CAAA,4BAAqC,Q,CAAA,6BAAS,KAItD,GAAf,SAAe,K,CAAA,EAAI,IAAU,QAAmB,U,CAAA,6BAAY,IAC1D,wBAEF,EAAU,SAAoB,GAC5B,wBAAuC,C,QAhDhD,iDAAuC,U,QAFD,2CAAqC,M,EAT3C,QAAc,C","ignoreList":[0]}},{"offset":{"line":0,"column":89257},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/type.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2022 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Type equality witness *)\n\ntype (_, _) eq = Equal: ('a, 'a) eq\n\n(* Type identifiers *)\n\nmodule Id = struct\n type _ id = ..\n module type ID = sig\n type t\n type _ id += Id : t id\n end\n\n type !'a t = (module ID with type t = 'a)\n\n let make (type a) () : a t =\n (module struct type t = a type _ id += Id : t id end)\n\n let[@inline] uid (type a) ((module A) : a t) =\n Obj.Extension_constructor.id (Obj.Extension_constructor.of_val A.Id)\n\n let provably_equal\n (type a b) ((module A) : a t) ((module B) : b t) : (a, b) eq option\n =\n match A.Id with B.Id -> Some Equal | _ -> None\nend\n","(* generated code *)"],"names":[],"mappings":"EAuCI,YAAwB,GAAkB,IAA1C,kDAA8C,C,EAL9C,0BAA6B,aAAuC,8B,EAHpE,0BAAqD,C,EC/BzD,iC,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":89518},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/atomic.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Stephen Dolan, University of Cambridge *)\n(* *)\n(* Copyright 2017-2018 University of Cambridge. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype !'a t\n\nexternal make : 'a -> 'a t = \"%makemutable\"\nexternal make_contended : 'a -> 'a t = \"caml_atomic_make_contended\"\nexternal get : 'a t -> 'a = \"%atomic_load\"\nexternal exchange : 'a t -> 'a -> 'a = \"%atomic_exchange\"\nexternal compare_and_set : 'a t -> 'a -> 'a -> bool = \"%atomic_cas\"\nexternal fetch_and_add : int t -> int -> int = \"%atomic_fetch_add\"\nexternal ignore : 'a -> unit = \"%ignore\"\n\nlet set r x = ignore (exchange r x)\nlet incr r = ignore (fetch_and_add r 1)\nlet decr r = ignore (fetch_and_add r (-1))\n"],"names":[],"mappings":"0DC0Ba,aAA6B,C,EAD7B,aAA0B,C,EADzB,WAAqB,C","ignoreList":[0]}},{"offset":{"line":0,"column":89804},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/camlinternalLazy.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1997 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Internals of forcing lazy values. *)\n\ntype 'a t = 'a lazy_t\n\nexception Undefined\n\n(* [update_to_forcing blk] tries to update a [blk] with [lazy_tag] to\n [forcing_tag] using compare-and-swap (CAS), taking care to handle concurrent\n marking of the header word by a concurrent GC thread. Returns [0] if the\n CAS is successful. If the CAS fails, then the tag was observed to be\n something other than [lazy_tag] due to a concurrent mutator. In this case,\n the function returns [1]. *)\nexternal update_to_forcing : Obj.t -> int =\n \"caml_lazy_update_to_forcing\" [@@noalloc]\n\n(* [reset_to_lazy blk] expects [blk] to be a lazy object with [Obj.forcing_tag]\n and updates the tag to [Obj.lazy_tag], taking care to handle concurrent\n marking of this object's header by a concurrent GC thread. *)\nexternal reset_to_lazy : Obj.t -> unit = \"caml_lazy_reset_to_lazy\" [@@noalloc]\n\n(* [update_to_forward blk] expects [blk] to be a lazy object with\n [Obj.forcing_tag] and updates the tag to [Obj.forward_tag], taking care to\n handle concurrent marking of this object's header by a concurrent GC thread.\n *)\nexternal update_to_forward : Obj.t -> unit =\n \"caml_lazy_update_to_forward\" [@@noalloc]\n\n(* Assumes [blk] is a block with tag forcing *)\nlet do_force_block blk =\n let b = Obj.repr blk in\n let closure = (Obj.obj (Obj.field b 0) : unit -> 'arg) in\n Obj.set_field b 0 (Obj.repr ()); (* Release the closure *)\n try\n let result = closure () in\n Obj.set_field b 0 (Obj.repr result);\n update_to_forward b;\n result\n with e ->\n Obj.set_field b 0 (Obj.repr (fun () -> raise e));\n reset_to_lazy b;\n raise e\n\n(* Assumes [blk] is a block with tag forcing *)\nlet do_force_val_block blk =\n let b = Obj.repr blk in\n let closure = (Obj.obj (Obj.field b 0) : unit -> 'arg) in\n Obj.set_field b 0 (Obj.repr ()); (* Release the closure *)\n let result = closure () in\n Obj.set_field b 0 (Obj.repr result);\n update_to_forward b;\n result\n\n(* Called by [force_gen] *)\nlet force_gen_lazy_block ~only_val (blk : 'arg lazy_t) =\n (* We expect the tag to be [lazy_tag], but may be other tags due to\n concurrent forcing of lazy values. *)\n match update_to_forcing (Obj.repr blk) with\n | 0 when only_val -> do_force_val_block blk\n | 0 -> do_force_block blk\n | _ -> raise Undefined\n\n(* used in the %lazy_force primitive *)\nlet force_lazy_block blk = force_gen_lazy_block ~only_val:false blk\n\n(* [force_gen ~only_val:false] is not used, since [Lazy.force] is\n declared as a primitive whose code inlines the tag tests of its\n argument, except when afl instrumentation is turned on. *)\nlet force_gen ~only_val (lzv : 'arg lazy_t) =\n (* Using [Sys.opaque_identity] prevents two potential problems:\n - If the value is known to have Forward_tag, then it could have been\n shortcut during GC, so that information must be forgotten (see GPR#713\n and issue #7301). This is not an issue here at the moment since\n [Obj.tag] is not simplified by the compiler, and GPR#713 also\n ensures that no value will be known to have Forward_tag.\n - If the value is known to be immutable, then if the compiler\n cannot prove that the last branch is not taken it will issue a\n warning 59 (modification of an immutable value) *)\n let lzv = Sys.opaque_identity lzv in\n let x = Obj.repr lzv in\n (* START no safe points. If a GC occurs here, then the object [x] may be\n short-circuited, and getting the first field of [x] would get us the wrong\n value. Luckily, the compiler does not insert GC safe points at this place,\n so it is ok. *)\n let t = Obj.tag x in\n if t = Obj.forward_tag then\n (Obj.obj (Obj.field x 0) : 'arg)\n (* END no safe points *)\n else if t = Obj.forcing_tag then raise Undefined\n else if t <> Obj.lazy_tag then (Obj.obj x : 'arg)\n else force_gen_lazy_block ~only_val lzv\n","(* generated code *)"],"names":[],"mappings":"WAkGU,WACR,EADiB,QACjB,yCACW,U,CAAA,8BAEN,iDAA4B,SAC5B,iDACA,cAD2B,KACO,C,EA3Bd,kBAAwC,C,EAxBxB,WAAO,C,SAkBV,IAAhC,IAAgC,IAC7B,UA3Bc,uCACvB,2BAOE,GAP6B,OAEhB,mBACb,8CACA,KAAmB,K,AAAA,I,AAAA,G,EAAA,KAGnB,8BACA,KAAe,KAMM,uCACvB,2BACa,mBACb,8CACA,KAAmB,IAOb,EAGC,OAAe,C,QC1ExB,gE,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":90592},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/lazy.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1997 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Lazy]: deferred computations *)\n\n\n(*\n WARNING: some purple magic is going on here. Do not take this file\n as an example of how to program in OCaml.\n*)\n\n\n(* We make use of two special tags provided by the runtime:\n [lazy_tag] and [forward_tag].\n\n A value of type ['a Lazy.t] can be one of three things:\n 1. A block of size 1 with tag [lazy_tag]. Its field is a closure of\n type [unit -> 'a] that computes the value.\n 2. A block of size 1 with tag [forward_tag]. Its field is the value\n of type ['a] that was computed.\n 3. Anything else except a float. This has type ['a] and is the value\n that was computed.\n Exceptions are stored in format (1).\n The GC will magically change things from (2) to (3) according to its\n fancy.\n\n If OCaml was configured with the -flat-float-array option (which is\n currently the default), the following is also true:\n We cannot use representation (3) for a [float Lazy.t] because\n [caml_make_array] assumes that only a [float] value can have tag\n [Double_tag].\n\n We have to use the built-in type constructor [lazy_t] to\n let the compiler implement the special typing and compilation\n rules for the [lazy] keyword.\n*)\n\ntype 'a t = 'a CamlinternalLazy.t\n\nexception Undefined = CamlinternalLazy.Undefined\nexternal make_forward : 'a -> 'a lazy_t = \"caml_lazy_make_forward\"\nexternal force : 'a t -> 'a = \"%lazy_force\"\n\nlet force_val l = CamlinternalLazy.force_gen ~only_val:true l\n\nlet from_fun (f : unit -> 'arg) =\n let x = Obj.new_block Obj.lazy_tag 1 in\n Obj.set_field x 0 (Obj.repr f);\n (Obj.obj x : 'arg t)\n\nlet from_val (v : 'arg) =\n let t = Obj.tag (Obj.repr v) in\n if t = Obj.forward_tag || t = Obj.lazy_tag ||\n t = Obj.forcing_tag || t = Obj.double_tag then begin\n make_forward v\n end else begin\n (Obj.magic v : 'arg t)\n end\n\nlet is_val (l : 'arg t) = Obj.tag (Obj.repr l) <> Obj.lazy_tag\n\nlet map f x =\n lazy (f (force x))\n\nlet map_val f x =\n if is_val x\n then from_val (f (force x))\n else lazy (f (force x))\n"],"names":[],"mappings":"oIC6EK,SAAQ,QAEN,oBADA,2B,EAAA,Q,CAAA,U,CAAA,8BAAS,iBAAa,QACJ,C,EALvB,mBAAkB,C,EAHM,cAAoB,uCAAgB,C,MARpD,IACR,EAD4B,QAC5B,sC,CAAA,gD,CAAA,gD,CAAA,gD,CAAA,EAIG,OAH+C,IAI/C,C,EAVH,KADA,QAAQ,MACR,uCAA8B,EACV,C,EALJ,2BAA2C,C","ignoreList":[0]}},{"offset":{"line":0,"column":91355},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/seq.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Simon Cruanes *)\n(* *)\n(* Copyright 2017 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Seq]: functional iterators *)\n\ntype +'a node =\n | Nil\n | Cons of 'a * 'a t\n\nand 'a t = unit -> 'a node\n\nlet empty () = Nil\n\nlet return x () = Cons (x, empty)\n\nlet cons x next () = Cons (x, next)\n\nlet rec append seq1 seq2 () =\n match seq1() with\n | Nil -> seq2()\n | Cons (x, next) -> Cons (x, append next seq2)\n\nlet rec map f seq () = match seq() with\n | Nil -> Nil\n | Cons (x, next) -> Cons (f x, map f next)\n\nlet rec filter_map f seq () = match seq() with\n | Nil -> Nil\n | Cons (x, next) ->\n match f x with\n | None -> filter_map f next ()\n | Some y -> Cons (y, filter_map f next)\n\nlet rec filter f seq () = match seq() with\n | Nil -> Nil\n | Cons (x, next) ->\n if f x\n then Cons (x, filter f next)\n else filter f next ()\n\nlet rec concat seq () = match seq () with\n | Nil -> Nil\n | Cons (x, next) ->\n append x (concat next) ()\n\nlet rec flat_map f seq () = match seq () with\n | Nil -> Nil\n | Cons (x, next) ->\n append (f x) (flat_map f next) ()\n\nlet concat_map = flat_map\n\nlet rec fold_left f acc seq =\n match seq () with\n | Nil -> acc\n | Cons (x, next) ->\n let acc = f acc x in\n fold_left f acc next\n\nlet rec iter f seq =\n match seq () with\n | Nil -> ()\n | Cons (x, next) ->\n f x;\n iter f next\n\nlet rec unfold f u () =\n match f u with\n | None -> Nil\n | Some (x, u') -> Cons (x, unfold f u')\n\nlet is_empty xs =\n match xs() with\n | Nil ->\n true\n | Cons (_, _) ->\n false\n\nlet uncons xs =\n match xs() with\n | Cons (x, xs) ->\n Some (x, xs)\n | Nil ->\n None\n\n\n\nlet rec length_aux accu xs =\n match xs() with\n | Nil ->\n accu\n | Cons (_, xs) ->\n length_aux (accu + 1) xs\n\nlet[@inline] length xs =\n length_aux 0 xs\n\nlet rec iteri_aux f i xs =\n match xs() with\n | Nil ->\n ()\n | Cons (x, xs) ->\n f i x;\n iteri_aux f (i+1) xs\n\nlet[@inline] iteri f xs =\n iteri_aux f 0 xs\n\nlet rec fold_lefti_aux f accu i xs =\n match xs() with\n | Nil ->\n accu\n | Cons (x, xs) ->\n let accu = f accu i x in\n fold_lefti_aux f accu (i+1) xs\n\nlet[@inline] fold_lefti f accu xs =\n fold_lefti_aux f accu 0 xs\n\nlet rec for_all p xs =\n match xs() with\n | Nil ->\n true\n | Cons (x, xs) ->\n p x && for_all p xs\n\nlet rec exists p xs =\n match xs() with\n | Nil ->\n false\n | Cons (x, xs) ->\n p x || exists p xs\n\nlet rec find p xs =\n match xs() with\n | Nil ->\n None\n | Cons (x, xs) ->\n if p x then Some x else find p xs\n\nlet find_index p xs =\n let rec aux i xs = match xs() with\n | Nil ->\n None\n | Cons (x, xs) ->\n if p x then Some i else aux (i+1) xs in\n aux 0 xs\n\nlet rec find_map f xs =\n match xs() with\n | Nil ->\n None\n | Cons (x, xs) ->\n match f x with\n | None ->\n find_map f xs\n | Some _ as result ->\n result\n\nlet find_mapi f xs =\n let rec aux i xs = match xs() with\n | Nil ->\n None\n | Cons (x, xs) ->\n match f i x with\n | None ->\n aux (i+1) xs\n | Some _ as result ->\n result in\n aux 0 xs\n\n(* [iter2], [fold_left2], [for_all2], [exists2], [map2], [zip] work also in\n the case where the two sequences have different lengths. They stop as soon\n as one sequence is exhausted. Their behavior is slightly asymmetric: when\n [xs] is empty, they do not force [ys]; however, when [ys] is empty, [xs] is\n forced, even though the result of the function application [xs()] turns out\n to be useless. *)\n\nlet rec iter2 f xs ys =\n match xs() with\n | Nil ->\n ()\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n ()\n | Cons (y, ys) ->\n f x y;\n iter2 f xs ys\n\nlet rec fold_left2 f accu xs ys =\n match xs() with\n | Nil ->\n accu\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n accu\n | Cons (y, ys) ->\n let accu = f accu x y in\n fold_left2 f accu xs ys\n\nlet rec for_all2 f xs ys =\n match xs() with\n | Nil ->\n true\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n true\n | Cons (y, ys) ->\n f x y && for_all2 f xs ys\n\nlet rec exists2 f xs ys =\n match xs() with\n | Nil ->\n false\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n false\n | Cons (y, ys) ->\n f x y || exists2 f xs ys\n\nlet rec equal eq xs ys =\n match xs(), ys() with\n | Nil, Nil ->\n true\n | Cons (x, xs), Cons (y, ys) ->\n eq x y && equal eq xs ys\n | Nil, Cons (_, _)\n | Cons (_, _), Nil ->\n false\n\nlet rec compare cmp xs ys =\n match xs(), ys() with\n | Nil, Nil ->\n 0\n | Cons (x, xs), Cons (y, ys) ->\n let c = cmp x y in\n if c <> 0 then c else compare cmp xs ys\n | Nil, Cons (_, _) ->\n -1\n | Cons (_, _), Nil ->\n +1\n\n\n\n(* [init_aux f i j] is the sequence [f i, ..., f (j-1)]. *)\n\nlet rec init_aux f i j () =\n if i < j then begin\n Cons (f i, init_aux f (i + 1) j)\n end\n else\n Nil\n\nlet init n f =\n if n < 0 then\n invalid_arg \"Seq.init\"\n else\n init_aux f 0 n\n\nlet rec repeat x () =\n Cons (x, repeat x)\n\nlet rec forever f () =\n Cons (f(), forever f)\n\n(* This preliminary definition of [cycle] requires the sequence [xs]\n to be nonempty. Applying it to an empty sequence would produce a\n sequence that diverges when it is forced. *)\n\nlet rec cycle_nonempty xs () =\n append xs (cycle_nonempty xs) ()\n\n(* [cycle xs] checks whether [xs] is empty and, if so, returns an empty\n sequence. Otherwise, [cycle xs] produces one copy of [xs] followed\n with the infinite sequence [cycle_nonempty xs]. Thus, the nonemptiness\n check is performed just once. *)\n\nlet cycle xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs') ->\n Cons (x, append xs' (cycle_nonempty xs))\n\n(* [iterate1 f x] is the sequence [f x, f (f x), ...].\n It is equivalent to [tail (iterate f x)].\n [iterate1] is used as a building block in the definition of [iterate]. *)\n\nlet rec iterate1 f x () =\n let y = f x in\n Cons (y, iterate1 f y)\n\n(* [iterate f x] is the sequence [x, f x, ...]. *)\n\n(* The reason why we give this slightly indirect definition of [iterate],\n as opposed to the more naive definition that may come to mind, is that\n we are careful to avoid evaluating [f x] until this function call is\n actually necessary. The naive definition (not shown here) computes the\n second argument of the sequence, [f x], when the first argument is\n requested by the user. *)\n\nlet iterate f x =\n cons x (iterate1 f x)\n\n\n\nlet rec mapi_aux f i xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n Cons (f i x, mapi_aux f (i+1) xs)\n\nlet[@inline] mapi f xs =\n mapi_aux f 0 xs\n\n(* [tail_scan f s xs] is equivalent to [tail (scan f s xs)].\n [tail_scan] is used as a building block in the definition of [scan]. *)\n\n(* This slightly indirect definition of [scan] is meant to avoid computing\n elements too early; see the above comment about [iterate1] and [iterate]. *)\n\nlet rec tail_scan f s xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n let s = f s x in\n Cons (s, tail_scan f s xs)\n\nlet scan f s xs =\n cons s (tail_scan f s xs)\n\n(* [take] is defined in such a way that [take 0 xs] returns [empty]\n immediately, without allocating any memory. *)\n\nlet rec take_aux n xs =\n if n = 0 then\n empty\n else\n fun () ->\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n Cons (x, take_aux (n-1) xs)\n\nlet take n xs =\n if n < 0 then invalid_arg \"Seq.take\";\n take_aux n xs\n\n(* [force_drop n xs] is equivalent to [drop n xs ()].\n [force_drop n xs] requires [n > 0].\n [force_drop] is used as a building block in the definition of [drop]. *)\n\nlet rec force_drop n xs =\n match xs() with\n | Nil ->\n Nil\n | Cons (_, xs) ->\n let n = n - 1 in\n if n = 0 then\n xs()\n else\n force_drop n xs\n\n(* [drop] is defined in such a way that [drop 0 xs] returns [xs] immediately,\n without allocating any memory. *)\n\nlet drop n xs =\n if n < 0 then invalid_arg \"Seq.drop\"\n else if n = 0 then\n xs\n else\n fun () ->\n force_drop n xs\n\nlet rec take_while p xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n if p x then Cons (x, take_while p xs) else Nil\n\nlet rec drop_while p xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) as node ->\n if p x then drop_while p xs () else node\n\nlet rec group eq xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n Cons (cons x (take_while (eq x) xs), group eq (drop_while (eq x) xs))\n\nexception Forced_twice\n\nmodule Suspension = struct\n\n type 'a suspension =\n unit -> 'a\n\n (* Conversions. *)\n\n let to_lazy : 'a suspension -> 'a Lazy.t =\n Lazy.from_fun\n (* fun s -> lazy (s()) *)\n\n let from_lazy (s : 'a Lazy.t) : 'a suspension =\n fun () -> Lazy.force s\n\n (* [memoize] turns an arbitrary suspension into a persistent suspension. *)\n\n let memoize (s : 'a suspension) : 'a suspension =\n from_lazy (to_lazy s)\n\n (* [failure] is a suspension that fails when forced. *)\n\n let failure : _ suspension =\n fun () ->\n (* A suspension created by [once] has been forced twice. *)\n raise Forced_twice\n\n (* If [f] is a suspension, then [once f] is a suspension that can be forced\n at most once. If it is forced more than once, then [Forced_twice] is\n raised. *)\n\n let once (f : 'a suspension) : 'a suspension =\n let action = Atomic.make f in\n fun () ->\n (* Get the function currently stored in [action], and write the\n function [failure] in its place, so the next access will result\n in a call to [failure()]. *)\n let f = Atomic.exchange action failure in\n f()\n\nend (* Suspension *)\n\nlet rec memoize xs =\n Suspension.memoize (fun () ->\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n Cons (x, memoize xs)\n )\n\nlet rec once xs =\n Suspension.once (fun () ->\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n Cons (x, once xs)\n )\n\n\nlet rec zip xs ys () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n Nil\n | Cons (y, ys) ->\n Cons ((x, y), zip xs ys)\n\nlet rec map2 f xs ys () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n match ys() with\n | Nil ->\n Nil\n | Cons (y, ys) ->\n Cons (f x y, map2 f xs ys)\n\nlet rec interleave xs ys () =\n match xs() with\n | Nil ->\n ys()\n | Cons (x, xs) ->\n Cons (x, interleave ys xs)\n\n(* [sorted_merge1l cmp x xs ys] is equivalent to\n [sorted_merge cmp (cons x xs) ys].\n\n [sorted_merge1r cmp xs y ys] is equivalent to\n [sorted_merge cmp xs (cons y ys)].\n\n [sorted_merge1 cmp x xs y ys] is equivalent to\n [sorted_merge cmp (cons x xs) (cons y ys)].\n\n These three functions are used as building blocks in the definition\n of [sorted_merge]. *)\n\nlet rec sorted_merge1l cmp x xs ys () =\n match ys() with\n | Nil ->\n Cons (x, xs)\n | Cons (y, ys) ->\n sorted_merge1 cmp x xs y ys\n\nand sorted_merge1r cmp xs y ys () =\n match xs() with\n | Nil ->\n Cons (y, ys)\n | Cons (x, xs) ->\n sorted_merge1 cmp x xs y ys\n\nand sorted_merge1 cmp x xs y ys =\n if cmp x y <= 0 then\n Cons (x, sorted_merge1r cmp xs y ys)\n else\n Cons (y, sorted_merge1l cmp x xs ys)\n\nlet sorted_merge cmp xs ys () =\n match xs(), ys() with\n | Nil, Nil ->\n Nil\n | Nil, c\n | c, Nil ->\n c\n | Cons (x, xs), Cons (y, ys) ->\n sorted_merge1 cmp x xs y ys\n\n\nlet rec map_fst xys () =\n match xys() with\n | Nil ->\n Nil\n | Cons ((x, _), xys) ->\n Cons (x, map_fst xys)\n\nlet rec map_snd xys () =\n match xys() with\n | Nil ->\n Nil\n | Cons ((_, y), xys) ->\n Cons (y, map_snd xys)\n\nlet unzip xys =\n map_fst xys, map_snd xys\n\nlet split =\n unzip\n\n(* [filter_map_find_left_map f xs] is equivalent to\n [filter_map Either.find_left (map f xs)]. *)\n\nlet rec filter_map_find_left_map f xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n match f x with\n | Either.Left y ->\n Cons (y, filter_map_find_left_map f xs)\n | Either.Right _ ->\n filter_map_find_left_map f xs ()\n\nlet rec filter_map_find_right_map f xs () =\n match xs() with\n | Nil ->\n Nil\n | Cons (x, xs) ->\n match f x with\n | Either.Left _ ->\n filter_map_find_right_map f xs ()\n | Either.Right z ->\n Cons (z, filter_map_find_right_map f xs)\n\nlet partition_map f xs =\n filter_map_find_left_map f xs,\n filter_map_find_right_map f xs\n\nlet partition p xs =\n filter p xs, filter (fun x -> not (p x)) xs\n\n(* If [xss] is a matrix (a sequence of rows), then [peel xss] is a pair of\n the first column (a sequence of elements) and of the remainder of the\n matrix (a sequence of shorter rows). These two sequences have the same\n length. The rows of the matrix [xss] are not required to have the same\n length. An empty row is ignored. *)\n\n(* Because [peel] uses [unzip], its argument must be persistent. The same\n remark applies to [transpose], [diagonals], [product], etc. *)\n\nlet peel xss =\n unzip (filter_map uncons xss)\n\nlet rec transpose xss () =\n let heads, tails = peel xss in\n if is_empty heads then begin\n assert (is_empty tails);\n Nil\n end\n else\n Cons (heads, transpose tails)\n\n(* The internal function [diagonals] takes an extra argument, [remainders],\n which contains the remainders of the rows that have already been\n discovered. *)\n\nlet rec diagonals remainders xss () =\n match xss() with\n | Cons (xs, xss) ->\n begin match xs() with\n | Cons (x, xs) ->\n (* We discover a new nonempty row [x :: xs]. Thus, the next diagonal\n is [x :: heads]: this diagonal begins with [x] and continues with\n the first element of every row in [remainders]. In the recursive\n call, the argument [remainders] is instantiated with [xs ::\n tails], which means that we have one more remaining row, [xs],\n and that we keep the tails of the pre-existing remaining rows. *)\n let heads, tails = peel remainders in\n Cons (cons x heads, diagonals (cons xs tails) xss)\n | Nil ->\n (* We discover a new empty row. In this case, the new diagonal is\n just [heads], and [remainders] is instantiated with just [tails],\n as we do not have one more remaining row. *)\n let heads, tails = peel remainders in\n Cons (heads, diagonals tails xss)\n end\n | Nil ->\n (* There are no more rows to be discovered. There remains to exhaust\n the remaining rows. *)\n transpose remainders ()\n\n(* If [xss] is a matrix (a sequence of rows), then [diagonals xss] is\n the sequence of its diagonals.\n\n The first diagonal contains just the first element of the\n first row. The second diagonal contains the first element of the\n second row and the second element of the first row; and so on.\n This kind of diagonal is in fact sometimes known as an antidiagonal.\n\n - Every diagonal is a finite sequence.\n - The rows of the matrix [xss] are not required to have the same length.\n - The matrix [xss] is not required to be finite (in either direction).\n - The matrix [xss] must be persistent. *)\n\nlet diagonals xss =\n diagonals empty xss\n\nlet map_product f xs ys =\n concat (diagonals (\n map (fun x ->\n map (fun y ->\n f x y\n ) ys\n ) xs\n ))\n\nlet product xs ys =\n map_product (fun x y -> (x, y)) xs ys\n\nlet of_dispenser it =\n let rec c () =\n match it() with\n | None ->\n Nil\n | Some x ->\n Cons (x, c)\n in\n c\n\nlet to_dispenser xs =\n let s = ref xs in\n fun () ->\n match (!s)() with\n | Nil ->\n None\n | Cons (x, xs) ->\n s := xs;\n Some x\n\n\n\nlet rec ints i () =\n Cons (i, ints (i + 1))\n","(* generated code *)"],"names":[],"mappings":"EA6rBW,qB,KAAY,WAAZ,GAAT,OAAS,GAAY,IAAC,C,QAVd,IAAN,gBAAM,eAAM,QAER,mBAEA,QAFA,OAEA,GACA,WAAM,C,EANZ,GADA,UACA,GAMY,C,EAhBJ,IAAN,KAAM,mBAAI,QAEN,K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,IADpC,YACoB,KADpB,OACoB,GAAgB,KAAC,C,EAL3B,YAAc,C,EAFjB,aAAe,C,EAFlB,IAAG,C,MCvBlB,0O,QAAA,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}},{"offset":{"line":0,"column":99754},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/option.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype 'a t = 'a option = None | Some of 'a\n\nlet none = None\nlet some v = Some v\nlet value o ~default = match o with Some v -> v | None -> default\nlet get = function Some v -> v | None -> invalid_arg \"option is None\"\nlet bind o f = match o with None -> None | Some v -> f v\nlet join = function Some o -> o | None -> None\nlet map f o = match o with None -> None | Some v -> Some (f v)\nlet fold ~none ~some = function Some v -> some v | None -> none\nlet iter f = function Some v -> f v | None -> ()\nlet is_none = function None -> true | Some _ -> false\nlet is_some = function None -> false | Some _ -> true\n\nlet equal eq o0 o1 = match o0, o1 with\n| Some v0, Some v1 -> eq v0 v1\n| None, None -> true\n| _ -> false\n\nlet compare cmp o0 o1 = match o0, o1 with\n| Some v0, Some v1 -> cmp v0 v1\n| None, None -> 0\n| None, Some _ -> -1\n| Some _, None -> 1\n\nlet to_result ~none = function None -> Error none | Some v -> Ok v\nlet to_list = function None -> [] | Some v -> [v]\nlet to_seq = function None -> Seq.empty | Some v -> Seq.return v\n"],"names":[],"mappings":"wCC0Ca,UAAiB,SAAsB,GAAtB,UAAsB,YAAY,C,EADlD,UAAiB,KAAe,IAAf,UAAe,SAAG,C,EADnC,UAAyB,WAAuB,IAAvB,UAAuB,KAAI,C,EAN1C,UAER,EACE,EAHM,QAGN,aACA,KADA,UACA,UAHI,OAGH,C,EATE,kBAEL,c,CAAA,sBADM,OAEf,IAAK,C,EALE,QAAmC,EAAI,C,EADvC,OAAkC,EAAK,C,KAD5C,UAAqC,eAAd,gBAAgB,C,KADvC,UAAkD,aAAjB,gBAAqB,C,KADjD,UAAqB,KAA2B,IAA3B,UAAsB,eAAK,M,EADnD,UAA+B,gBAAI,C,KAD/B,UAAqB,eAAiB,gBAAG,C,EAD9C,UAA+B,mCAA4B,C,EAD9C,UAAmC,cAAO,C,EADpD,UAAM,C","ignoreList":[0]}},{"offset":{"line":0,"column":100672},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/result.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype ('a, 'e) t = ('a, 'e) result = Ok of 'a | Error of 'e\n\nlet ok v = Ok v\nlet error e = Error e\nlet value r ~default = match r with Ok v -> v | Error _ -> default\nlet get_ok = function Ok v -> v | Error _ -> invalid_arg \"result is Error _\"\nlet get_error = function Error e -> e | Ok _ -> invalid_arg \"result is Ok _\"\nlet bind r f = match r with Ok v -> f v | Error _ as e -> e\nlet join = function Ok r -> r | Error _ as e -> e\nlet map f = function Ok v -> Ok (f v) | Error _ as e -> e\nlet map_error f = function Error e -> Error (f e) | Ok _ as v -> v\nlet fold ~ok ~error = function Ok v -> ok v | Error e -> error e\nlet iter f = function Ok v -> f v | Error _ -> ()\nlet iter_error f = function Error e -> f e | Ok _ -> ()\nlet is_ok = function Ok _ -> true | Error _ -> false\nlet is_error = function Error _ -> true | Ok _ -> false\n\nlet equal ~ok ~error r0 r1 = match r0, r1 with\n| Ok v0, Ok v1 -> ok v0 v1\n| Error e0, Error e1 -> error e0 e1\n| _, _ -> false\n\nlet compare ~ok ~error r0 r1 = match r0, r1 with\n| Ok v0, Ok v1 -> ok v0 v1\n| Error e0, Error e1 -> error e0 e1\n| Ok _, Error _ -> -1\n| Error _, Ok _ -> 1\n\nlet to_option = function Ok v -> Some v | Error _ -> None\nlet to_list = function Ok v -> [v] | Error _ -> []\nlet to_seq = function Ok v -> Seq.return v | Error _ -> Seq.empty\n"],"names":[],"mappings":"2CC6Ca,oBAAiB,GAAjB,OAAiB,YAA0B,SAAS,C,KADnD,oBAAiB,IAAjB,OAAiB,SAAiB,KAAE,C,KADlC,oBAAiB,IAAjB,OAAiB,KAAoB,KAAI,C,KAN1B,sDACb,MAEC,wBACA,KADA,UACA,UAFK,OAEJ,C,KATS,oDACX,wB,CAAA,mBACM,OACd,IAAK,C,EALA,gBAAoB,EAAoB,C,EAD3C,eAAmC,EAAK,C,KADrC,kBAAsC,eAAd,gBAAgB,C,QAD9C,2BAAqB,gBAAiB,KAAE,C,QADxC,0BAA8B,0BAAkB,gB,CAAO,C,QADlD,oBAAmD,GAAhB,IAAgB,UAArB,eAAK,KAAiB,C,QAD1D,oBAA6B,IAA7B,OAAwB,eAAK,KAAmB,GAAC,C,KAD9C,4BAAqC,GAAC,C,QADlC,2BAAqB,gBAAsB,GAAC,C,EAD3C,kBAAgC,mCAA4B,C,KAD/D,4BAAgC,wBAA+B,C,KADrD,4BAAoC,GAAO,C,EADpD,UAAO,C,EADV,UAAI,C","ignoreList":[0]}},{"offset":{"line":0,"column":102127},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/bool.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t = bool = false | true\n\nexternal not : bool -> bool = \"%boolnot\"\nexternal ( && ) : bool -> bool -> bool = \"%sequand\"\nexternal ( || ) : bool -> bool -> bool = \"%sequor\"\nlet equal : bool -> bool -> bool = ( = )\nlet compare : bool -> bool -> int = Stdlib.compare\nexternal to_int : bool -> int = \"%identity\"\nlet to_float = function false -> 0. | true -> 1.\n\n(*\nlet of_string = function\n| \"false\" -> Some false\n| \"true\" -> Some true\n| _ -> None\n*)\n\nlet to_string = function false -> \"false\" | true -> \"true\"\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n"],"names":[],"mappings":"oBCqCa,iBAA4B,C,EADhB,eAA+B,C,EAJtB,GAAkB,GAApC,WAA0C,C,EATzB,GAAa,GAA/B,WAAiC,C","ignoreList":[0]}},{"offset":{"line":0,"column":102397},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/char.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Character operations *)\n\nexternal code: char -> int = \"%identity\"\nexternal unsafe_chr: int -> char = \"%identity\"\n\nlet chr n =\n if n < 0 || n > 255 then invalid_arg \"Char.chr\" else unsafe_chr n\n\nexternal bytes_create: int -> bytes = \"caml_create_bytes\"\nexternal bytes_unsafe_set : bytes -> int -> char -> unit\n = \"%bytes_unsafe_set\"\nexternal unsafe_to_string : bytes -> string = \"%bytes_to_string\"\n\nlet escaped = function\n | '\\'' -> \"\\\\'\"\n | '\\\\' -> \"\\\\\\\\\"\n | '\\n' -> \"\\\\n\"\n | '\\t' -> \"\\\\t\"\n | '\\r' -> \"\\\\r\"\n | '\\b' -> \"\\\\b\"\n | ' ' .. '~' as c ->\n let s = bytes_create 1 in\n bytes_unsafe_set s 0 c;\n unsafe_to_string s\n | c ->\n let n = code c in\n let s = bytes_create 4 in\n bytes_unsafe_set s 0 '\\\\';\n bytes_unsafe_set s 1 (unsafe_chr (48 + n / 100));\n bytes_unsafe_set s 2 (unsafe_chr (48 + (n / 10) mod 10));\n bytes_unsafe_set s 3 (unsafe_chr (48 + n mod 10));\n unsafe_to_string s\n\nlet lowercase_ascii = function\n | 'A' .. 'Z' as c -> unsafe_chr(code c + 32)\n | c -> c\n\nlet uppercase_ascii = function\n | 'a' .. 'z' as c -> unsafe_chr(code c - 32)\n | c -> c\n\ntype t = char\n\nlet compare c1 c2 = code c1 - code c2\nlet equal (c1: t) (c2: t) = compare c1 c2 = 0\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n","(* generated code *)"],"names":[],"mappings":"EAgEa,iBAA4B,C,EADhB,eAA+B,C,EALpC,eACqB,MAAI,C,EADzB,iBAAiB,C,KANf,sBAEb,GADc,aACb,C,KANY,sBAEb,GADc,aACb,C,QAtBI,S,CAAA,c,CAAA,GAEF,O,CAAA,e,CAAA,Y,CAAA,OADA,Q,CAAA,oB,CAAA,mBAIA,KAFA,KACA,KAEA,MAEE,MACR,S,CAAA,QACA,KAGQ,MACR,aACA,M,CAAA,eACA,M,CAAA,cACA,M,CAAA,WACA,IAAkB,C,KAzBtB,wBAAqD,KAA5B,uBAAwC,C,ECrBnE,wC,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":102985},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/uchar.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Daniel C. Buenzli *)\n(* *)\n(* Copyright 2014 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nexternal format_int : string -> int -> string = \"caml_format_int\"\n\nlet err_no_pred = \"U+0000 has no predecessor\"\nlet err_no_succ = \"U+10FFFF has no successor\"\nlet err_not_sv i = format_int \"%X\" i ^ \" is not an Unicode scalar value\"\nlet err_not_latin1 u = \"U+\" ^ format_int \"%04X\" u ^ \" is not a latin1 character\"\n\ntype t = int\n\nlet min = 0x0000\nlet max = 0x10FFFF\nlet lo_bound = 0xD7FF\nlet hi_bound = 0xE000\n\nlet bom = 0xFEFF\nlet rep = 0xFFFD\n\nlet succ u =\n if u = lo_bound then hi_bound else\n if u = max then invalid_arg err_no_succ else\n u + 1\n\nlet pred u =\n if u = hi_bound then lo_bound else\n if u = min then invalid_arg err_no_pred else\n u - 1\n\nlet is_valid i = (min <= i && i <= lo_bound) || (hi_bound <= i && i <= max)\nlet of_int i = if is_valid i then i else invalid_arg (err_not_sv i)\nexternal unsafe_of_int : int -> t = \"%identity\"\nexternal to_int : t -> int = \"%identity\"\n\nlet is_char u = u < 256\nlet of_char c = Char.code c\nlet to_char u =\n if u > 255 then invalid_arg (err_not_latin1 u) else\n Char.unsafe_chr u\n\nlet unsafe_to_char = Char.unsafe_chr\n\nlet equal : int -> int -> bool = ( = )\nlet compare : int -> int -> int = Stdlib.compare\nlet hash = to_int\n\n(* UTF codecs tools *)\n\ntype utf_decode = int\n(* This is an int [0xDUUUUUU] decomposed as follows:\n - [D] is four bits for decode information, the highest bit is set if the\n decode is valid. The three lower bits indicate the number of elements\n from the source that were consumed by the decode.\n - [UUUUUU] is the decoded Unicode character or the Unicode replacement\n character U+FFFD if for invalid decodes. *)\n\nlet valid_bit = 27\nlet decode_bits = 24\n\nlet[@inline] utf_decode_is_valid d = (d lsr valid_bit) = 1\nlet[@inline] utf_decode_length d = (d lsr decode_bits) land 0b111\nlet[@inline] utf_decode_uchar d = unsafe_of_int (d land 0xFFFFFF)\nlet[@inline] utf_decode n u = ((8 lor n) lsl decode_bits) lor (to_int u)\nlet[@inline] utf_decode_invalid n = (n lsl decode_bits) lor rep\n\nlet utf_8_byte_length u = match to_int u with\n| u when u < 0 -> assert false\n| u when u <= 0x007F -> 1\n| u when u <= 0x07FF -> 2\n| u when u <= 0xFFFF -> 3\n| u when u <= 0x10FFFF -> 4\n| _ -> assert false\n\nlet utf_16_byte_length u = match to_int u with\n| u when u < 0 -> assert false\n| u when u <= 0xFFFF -> 2\n| u when u <= 0x10FFFF -> 4\n| _ -> assert false\n"],"names":[],"mappings":"UCuFS,eACA,YACA,aACF,gBADmB,MADF,MADN,gBAGC,C,KAXV,eACA,WACA,WACA,YACA,aACF,gBADmB,MADF,MADA,MADA,MADN,gBAKC,C,EARiB,iBAA2B,C,EADjC,uBAA0C,C,EADtC,eAA+B,C,EAD9B,sBAA8B,C,EAD5B,sBAAqB,C,mFAtBxD,gBA9B8E,GAAlD,UAAmB,OAAnB,aAAkD,oBA8BhC,qBAC9C,GAAiB,C,EAJH,aAAO,C,EAJL,SAAU,QAxBT,OAAiB,uBAwB+B,qBAAjC,GAAiC,C,OADlD,iC,CAAA,oCAA0D,C,EAJzE,YAAqB,OACrB,UAAgB,wBAChB,cAAK,C,EAPL,YAAqB,OACrB,aAAgB,wBAChB,cAAK,C","ignoreList":[0]}},{"offset":{"line":0,"column":103961},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/list.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* An alias for the type of lists. *)\ntype 'a t = 'a list = [] | (::) of 'a * 'a list\n\n(* List operations *)\n\nlet rec length_aux len = function\n [] -> len\n | _::l -> length_aux (len + 1) l\n\nlet length l = length_aux 0 l\n\nlet cons a l = a::l\n\nlet hd = function\n [] -> failwith \"hd\"\n | a::_ -> a\n\nlet tl = function\n [] -> failwith \"tl\"\n | _::l -> l\n\nlet nth l n =\n if n < 0 then invalid_arg \"List.nth\" else\n let rec nth_aux l n =\n match l with\n | [] -> failwith \"nth\"\n | a::l -> if n = 0 then a else nth_aux l (n-1)\n in nth_aux l n\n\nlet nth_opt l n =\n if n < 0 then invalid_arg \"List.nth\" else\n let rec nth_aux l n =\n match l with\n | [] -> None\n | a::l -> if n = 0 then Some a else nth_aux l (n-1)\n in nth_aux l n\n\nlet append = (@)\n\nlet rec rev_append l1 l2 =\n match l1 with\n [] -> l2\n | a :: l -> rev_append l (a :: l2)\n\nlet rev l = rev_append l []\n\nlet[@tail_mod_cons] rec init i last f =\n if i > last then []\n else if i = last then [f i]\n else\n let r1 = f i in\n let r2 = f (i+1) in\n r1 :: r2 :: init (i+2) last f\n\nlet init len f =\n if len < 0 then invalid_arg \"List.init\" else\n init 0 (len - 1) f\n\nlet rec flatten = function\n [] -> []\n | l::r -> l @ flatten r\n\nlet concat = flatten\n\nlet[@tail_mod_cons] rec map f = function\n [] -> []\n | [a1] ->\n let r1 = f a1 in\n [r1]\n | a1::a2::l ->\n let r1 = f a1 in\n let r2 = f a2 in\n r1::r2::map f l\n\nlet[@tail_mod_cons] rec mapi i f = function\n [] -> []\n | [a1] ->\n let r1 = f i a1 in\n [r1]\n | a1::a2::l ->\n let r1 = f i a1 in\n let r2 = f (i+1) a2 in\n r1::r2::mapi (i+2) f l\n\nlet mapi f l = mapi 0 f l\n\nlet rev_map f l =\n let rec rmap_f accu = function\n | [] -> accu\n | a::l -> rmap_f (f a :: accu) l\n in\n rmap_f [] l\n\n\nlet rec iter f = function\n [] -> ()\n | a::l -> f a; iter f l\n\nlet rec iteri i f = function\n [] -> ()\n | a::l -> f i a; iteri (i + 1) f l\n\nlet iteri f l = iteri 0 f l\n\nlet rec fold_left f accu l =\n match l with\n [] -> accu\n | a::l -> fold_left f (f accu a) l\n\nlet rec fold_right f l accu =\n match l with\n [] -> accu\n | a::l -> f a (fold_right f l accu)\n\nlet[@tail_mod_cons] rec map2 f l1 l2 =\n match (l1, l2) with\n ([], []) -> []\n | ([a1], [b1]) ->\n let r1 = f a1 b1 in\n [r1]\n | (a1::a2::l1, b1::b2::l2) ->\n let r1 = f a1 b1 in\n let r2 = f a2 b2 in\n r1::r2::map2 f l1 l2\n | (_, _) -> invalid_arg \"List.map2\"\n\nlet rev_map2 f l1 l2 =\n let rec rmap2_f accu l1 l2 =\n match (l1, l2) with\n | ([], []) -> accu\n | (a1::l1, a2::l2) -> rmap2_f (f a1 a2 :: accu) l1 l2\n | (_, _) -> invalid_arg \"List.rev_map2\"\n in\n rmap2_f [] l1 l2\n\n\nlet rec iter2 f l1 l2 =\n match (l1, l2) with\n ([], []) -> ()\n | (a1::l1, a2::l2) -> f a1 a2; iter2 f l1 l2\n | (_, _) -> invalid_arg \"List.iter2\"\n\nlet rec fold_left2 f accu l1 l2 =\n match (l1, l2) with\n ([], []) -> accu\n | (a1::l1, a2::l2) -> fold_left2 f (f accu a1 a2) l1 l2\n | (_, _) -> invalid_arg \"List.fold_left2\"\n\nlet rec fold_right2 f l1 l2 accu =\n match (l1, l2) with\n ([], []) -> accu\n | (a1::l1, a2::l2) -> f a1 a2 (fold_right2 f l1 l2 accu)\n | (_, _) -> invalid_arg \"List.fold_right2\"\n\nlet rec for_all p = function\n [] -> true\n | a::l -> p a && for_all p l\n\nlet rec exists p = function\n [] -> false\n | a::l -> p a || exists p l\n\nlet rec for_all2 p l1 l2 =\n match (l1, l2) with\n ([], []) -> true\n | (a1::l1, a2::l2) -> p a1 a2 && for_all2 p l1 l2\n | (_, _) -> invalid_arg \"List.for_all2\"\n\nlet rec exists2 p l1 l2 =\n match (l1, l2) with\n ([], []) -> false\n | (a1::l1, a2::l2) -> p a1 a2 || exists2 p l1 l2\n | (_, _) -> invalid_arg \"List.exists2\"\n\nlet rec mem x = function\n [] -> false\n | a::l -> compare a x = 0 || mem x l\n\nlet rec memq x = function\n [] -> false\n | a::l -> a == x || memq x l\n\nlet rec assoc x = function\n [] -> raise Not_found\n | (a,b)::l -> if compare a x = 0 then b else assoc x l\n\nlet rec assoc_opt x = function\n [] -> None\n | (a,b)::l -> if compare a x = 0 then Some b else assoc_opt x l\n\nlet rec assq x = function\n [] -> raise Not_found\n | (a,b)::l -> if a == x then b else assq x l\n\nlet rec assq_opt x = function\n [] -> None\n | (a,b)::l -> if a == x then Some b else assq_opt x l\n\nlet rec mem_assoc x = function\n | [] -> false\n | (a, _) :: l -> compare a x = 0 || mem_assoc x l\n\nlet rec mem_assq x = function\n | [] -> false\n | (a, _) :: l -> a == x || mem_assq x l\n\nlet rec remove_assoc x = function\n | [] -> []\n | (a, _ as pair) :: l ->\n if compare a x = 0 then l else pair :: remove_assoc x l\n\nlet rec remove_assq x = function\n | [] -> []\n | (a, _ as pair) :: l -> if a == x then l else pair :: remove_assq x l\n\nlet rec find p = function\n | [] -> raise Not_found\n | x :: l -> if p x then x else find p l\n\nlet rec find_opt p = function\n | [] -> None\n | x :: l -> if p x then Some x else find_opt p l\n\nlet find_index p =\n let rec aux i = function\n [] -> None\n | a::l -> if p a then Some i else aux (i+1) l in\n aux 0\n\nlet rec find_map f = function\n | [] -> None\n | x :: l ->\n begin match f x with\n | Some _ as result -> result\n | None -> find_map f l\n end\n\nlet find_mapi f =\n let rec aux i = function\n | [] -> None\n | x :: l ->\n begin match f i x with\n | Some _ as result -> result\n | None -> aux (i+1) l\n end in\n aux 0\n\nlet[@tail_mod_cons] rec find_all p = function\n | [] -> []\n | x :: l -> if p x then x :: find_all p l else find_all p l\n\nlet filter = find_all\n\nlet[@tail_mod_cons] rec filteri p i = function\n | [] -> []\n | x::l ->\n let i' = i + 1 in\n if p i x then x :: filteri p i' l else filteri p i' l\n\nlet filteri p l = filteri p 0 l\n\nlet[@tail_mod_cons] rec filter_map f = function\n | [] -> []\n | x :: l ->\n match f x with\n | None -> filter_map f l\n | Some v -> v :: filter_map f l\n\nlet[@tail_mod_cons] rec concat_map f = function\n | [] -> []\n | x::xs -> prepend_concat_map (f x) f xs\nand[@tail_mod_cons] prepend_concat_map ys f xs =\n match ys with\n | [] -> concat_map f xs\n | y :: ys -> y :: prepend_concat_map ys f xs\n\nlet fold_left_map f accu l =\n let rec aux accu l_accu = function\n | [] -> accu, rev l_accu\n | x :: l ->\n let accu, x = f accu x in\n aux accu (x :: l_accu) l in\n aux accu [] l\n\nlet partition p l =\n let rec part yes no = function\n | [] -> (rev yes, rev no)\n | x :: l -> if p x then part (x :: yes) no l else part yes (x :: no) l in\n part [] [] l\n\nlet partition_map p l =\n let rec part left right = function\n | [] -> (rev left, rev right)\n | x :: l ->\n begin match p x with\n | Either.Left v -> part (v :: left) right l\n | Either.Right v -> part left (v :: right) l\n end\n in\n part [] [] l\n\nlet rec split = function\n [] -> ([], [])\n | (x,y)::l ->\n let (rx, ry) = split l in (x::rx, y::ry)\n\nlet rec combine l1 l2 =\n match (l1, l2) with\n ([], []) -> []\n | (a1::l1, a2::l2) -> (a1, a2) :: combine l1 l2\n | (_, _) -> invalid_arg \"List.combine\"\n\n(** sorting *)\n\nlet rec merge cmp l1 l2 =\n match l1, l2 with\n | [], l2 -> l2\n | l1, [] -> l1\n | h1 :: t1, h2 :: t2 ->\n if cmp h1 h2 <= 0\n then h1 :: merge cmp t1 l2\n else h2 :: merge cmp l1 t2\n\n\nlet stable_sort cmp l =\n let rec rev_merge l1 l2 accu =\n match l1, l2 with\n | [], l2 -> rev_append l2 accu\n | l1, [] -> rev_append l1 accu\n | h1::t1, h2::t2 ->\n if cmp h1 h2 <= 0\n then rev_merge t1 l2 (h1::accu)\n else rev_merge l1 t2 (h2::accu)\n in\n let rec rev_merge_rev l1 l2 accu =\n match l1, l2 with\n | [], l2 -> rev_append l2 accu\n | l1, [] -> rev_append l1 accu\n | h1::t1, h2::t2 ->\n if cmp h1 h2 > 0\n then rev_merge_rev t1 l2 (h1::accu)\n else rev_merge_rev l1 t2 (h2::accu)\n in\n let rec sort n l =\n match n, l with\n | 2, x1 :: x2 :: tl ->\n let s = if cmp x1 x2 <= 0 then [x1; x2] else [x2; x1] in\n (s, tl)\n | 3, x1 :: x2 :: x3 :: tl ->\n let s =\n if cmp x1 x2 <= 0 then\n if cmp x2 x3 <= 0 then [x1; x2; x3]\n else if cmp x1 x3 <= 0 then [x1; x3; x2]\n else [x3; x1; x2]\n else if cmp x1 x3 <= 0 then [x2; x1; x3]\n else if cmp x2 x3 <= 0 then [x2; x3; x1]\n else [x3; x2; x1]\n in\n (s, tl)\n | n, l ->\n let n1 = n asr 1 in\n let n2 = n - n1 in\n let s1, l2 = rev_sort n1 l in\n let s2, tl = rev_sort n2 l2 in\n (rev_merge_rev s1 s2 [], tl)\n and rev_sort n l =\n match n, l with\n | 2, x1 :: x2 :: tl ->\n let s = if cmp x1 x2 > 0 then [x1; x2] else [x2; x1] in\n (s, tl)\n | 3, x1 :: x2 :: x3 :: tl ->\n let s =\n if cmp x1 x2 > 0 then\n if cmp x2 x3 > 0 then [x1; x2; x3]\n else if cmp x1 x3 > 0 then [x1; x3; x2]\n else [x3; x1; x2]\n else if cmp x1 x3 > 0 then [x2; x1; x3]\n else if cmp x2 x3 > 0 then [x2; x3; x1]\n else [x3; x2; x1]\n in\n (s, tl)\n | n, l ->\n let n1 = n asr 1 in\n let n2 = n - n1 in\n let s1, l2 = sort n1 l in\n let s2, tl = sort n2 l2 in\n (rev_merge s1 s2 [], tl)\n in\n let len = length l in\n if len < 2 then l else fst (sort len l)\n\n\nlet sort = stable_sort\nlet fast_sort = stable_sort\n\n(* Note: on a very long list (length over about 100000), it used to be\n faster to convert the list to an array, sort the array, and convert\n back, truncating the array object after prepending each thousand\n entries to the resulting list. Impossible now that Obj.truncate has\n been removed. *)\n\n(** sorting + removing duplicates *)\n\nlet sort_uniq cmp l =\n let rec rev_merge l1 l2 accu =\n match l1, l2 with\n | [], l2 -> rev_append l2 accu\n | l1, [] -> rev_append l1 accu\n | h1::t1, h2::t2 ->\n let c = cmp h1 h2 in\n if c = 0 then rev_merge t1 t2 (h1::accu)\n else if c < 0\n then rev_merge t1 l2 (h1::accu)\n else rev_merge l1 t2 (h2::accu)\n in\n let rec rev_merge_rev l1 l2 accu =\n match l1, l2 with\n | [], l2 -> rev_append l2 accu\n | l1, [] -> rev_append l1 accu\n | h1::t1, h2::t2 ->\n let c = cmp h1 h2 in\n if c = 0 then rev_merge_rev t1 t2 (h1::accu)\n else if c > 0\n then rev_merge_rev t1 l2 (h1::accu)\n else rev_merge_rev l1 t2 (h2::accu)\n in\n let rec sort n l =\n match n, l with\n | 2, x1 :: x2 :: tl ->\n let s =\n let c = cmp x1 x2 in\n if c = 0 then [x1] else if c < 0 then [x1; x2] else [x2; x1]\n in\n (s, tl)\n | 3, x1 :: x2 :: x3 :: tl ->\n let s =\n let c = cmp x1 x2 in\n if c = 0 then\n let c = cmp x2 x3 in\n if c = 0 then [x2] else if c < 0 then [x2; x3] else [x3; x2]\n else if c < 0 then\n let c = cmp x2 x3 in\n if c = 0 then [x1; x2]\n else if c < 0 then [x1; x2; x3]\n else\n let c = cmp x1 x3 in\n if c = 0 then [x1; x2]\n else if c < 0 then [x1; x3; x2]\n else [x3; x1; x2]\n else\n let c = cmp x1 x3 in\n if c = 0 then [x2; x1]\n else if c < 0 then [x2; x1; x3]\n else\n let c = cmp x2 x3 in\n if c = 0 then [x2; x1]\n else if c < 0 then [x2; x3; x1]\n else [x3; x2; x1]\n in\n (s, tl)\n | n, l ->\n let n1 = n asr 1 in\n let n2 = n - n1 in\n let s1, l2 = rev_sort n1 l in\n let s2, tl = rev_sort n2 l2 in\n (rev_merge_rev s1 s2 [], tl)\n and rev_sort n l =\n match n, l with\n | 2, x1 :: x2 :: tl ->\n let s =\n let c = cmp x1 x2 in\n if c = 0 then [x1] else if c > 0 then [x1; x2] else [x2; x1]\n in\n (s, tl)\n | 3, x1 :: x2 :: x3 :: tl ->\n let s =\n let c = cmp x1 x2 in\n if c = 0 then\n let c = cmp x2 x3 in\n if c = 0 then [x2] else if c > 0 then [x2; x3] else [x3; x2]\n else if c > 0 then\n let c = cmp x2 x3 in\n if c = 0 then [x1; x2]\n else if c > 0 then [x1; x2; x3]\n else\n let c = cmp x1 x3 in\n if c = 0 then [x1; x2]\n else if c > 0 then [x1; x3; x2]\n else [x3; x1; x2]\n else\n let c = cmp x1 x3 in\n if c = 0 then [x2; x1]\n else if c > 0 then [x2; x1; x3]\n else\n let c = cmp x2 x3 in\n if c = 0 then [x2; x1]\n else if c > 0 then [x2; x3; x1]\n else [x3; x2; x1]\n in\n (s, tl)\n | n, l ->\n let n1 = n asr 1 in\n let n2 = n - n1 in\n let s1, l2 = sort n1 l in\n let s2, tl = sort n2 l2 in\n (rev_merge s1 s2 [], tl)\n in\n let len = length l in\n if len < 2 then l else fst (sort len l)\n\n\nlet rec compare_lengths l1 l2 =\n match l1, l2 with\n | [], [] -> 0\n | [], _ -> -1\n | _, [] -> 1\n | _ :: l1, _ :: l2 -> compare_lengths l1 l2\n\nlet rec compare_length_with l n =\n match l with\n | [] ->\n if n = 0 then 0 else\n if n > 0 then -1 else 1\n | _ :: l ->\n if n <= 0 then 1 else\n compare_length_with l (n-1)\n\nlet is_empty = function\n | [] -> true\n | _ :: _ -> false\n\n(** {1 Comparison} *)\n\n(* Note: we are *not* shortcutting the list by using\n [List.compare_lengths] first; this may be slower on long lists\n immediately start with distinct elements. It is also incorrect for\n [compare] below, and it is better (principle of least surprise) to\n use the same approach for both functions. *)\nlet rec equal eq l1 l2 =\n match l1, l2 with\n | [], [] -> true\n | [], _::_ | _::_, [] -> false\n | a1::l1, a2::l2 -> eq a1 a2 && equal eq l1 l2\n\nlet rec compare cmp l1 l2 =\n match l1, l2 with\n | [], [] -> 0\n | [], _::_ -> -1\n | _::_, [] -> 1\n | a1::l1, a2::l2 ->\n let c = cmp a1 a2 in\n if c <> 0 then c\n else compare cmp l1 l2\n\n(** {1 Iterators} *)\n\nlet to_seq l =\n let rec aux l () = match l with\n | [] -> Seq.Nil\n | x :: tail -> Seq.Cons (x, aux tail)\n in\n aux l\n\nlet[@tail_mod_cons] rec of_seq seq =\n match seq () with\n | Seq.Nil -> []\n | Seq.Cons (x1, seq) ->\n begin match seq () with\n | Seq.Nil -> [x1]\n | Seq.Cons (x2, seq) -> x1 :: x2 :: of_seq seq\n end\n","(* generated code *)"],"names":[],"mappings":"cAmkBQ,qBAAM,QACC,mBAEG,IAFH,OAEG,eAAM,QACL,eACW,IADX,YACW,YAAY,MADvB,OACuB,KALlC,qBAAM,OACC,6BAEG,IAFH,OAEG,eAAM,OACL,uCACW,iBADX,OACW,uBAAsB,eAC3C,C,EATP,a,KAJmB,UACT,KAC4B,IAD5B,YACoB,GADpB,OACoB,GAAQ,KAAC,C,EAEvC,QAAK,C,KAhBL,aACY,EACE,EAFd,QAEc,aACA,KADA,cACA,cAGZ,IAJY,OACA,OAEJ,OACR,GAAe,KACO,C,KAbxB,qBACY,c,CAAA,4CAEQ,OAAQ,K,CAAA,OADH,KACqB,C,EAfjC,OAED,EAAK,C,KAVjB,aAEE,SAAc,GACE,EAAQ,EAAtB,YAAsB,GAExB,eAFwB,UAGtB,gBADa,OACc,C,EAb/B,aACY,EACD,EAFX,QAEW,aACA,eACW,EADX,UACW,OAAqB,C,eAzFzC,gB,EAAA,Y,CAAA,qB,CAAA,gBAMI,IAFE,IA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AZlC,kBAEE,UACQ,KACE,UAAc,IADhB,UACgB,KADhB,UAC4B,mBAJxB,wBAKA,C,MAbd,kBAEE,UACQ,wBACE,UADF,qBACuB,mBAJnB,wBAKA,C,EAVP,UACC,mCACG,C,EANJ,UACC,mCACG,C,EAJE,YAAI,C,IAFJ,GAJI,UACT,KACE,OADF,UACE,MAEiB,C,GCxB7B,uN,QAAA,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}},{"offset":{"line":0,"column":116466},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/int.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t = int\n\nlet zero = 0\nlet one = 1\nlet minus_one = -1\nexternal neg : int -> int = \"%negint\"\nexternal add : int -> int -> int = \"%addint\"\nexternal sub : int -> int -> int = \"%subint\"\nexternal mul : int -> int -> int = \"%mulint\"\nexternal div : int -> int -> int = \"%divint\"\nexternal rem : int -> int -> int = \"%modint\"\nexternal succ : int -> int = \"%succint\"\nexternal pred : int -> int = \"%predint\"\nlet abs x = if x >= 0 then x else -x\nlet max_int = (-1) lsr 1\nlet min_int = max_int + 1\nexternal logand : int -> int -> int = \"%andint\"\nexternal logor : int -> int -> int = \"%orint\"\nexternal logxor : int -> int -> int = \"%xorint\"\nlet lognot x = logxor x (-1)\nexternal shift_left : int -> int -> int = \"%lslint\"\nexternal shift_right : int -> int -> int = \"%asrint\"\nexternal shift_right_logical : int -> int -> int = \"%lsrint\"\nlet equal : int -> int -> bool = ( = )\nlet compare : int -> int -> int = Stdlib.compare\nlet min x y : t = if x <= y then x else y\nlet max x y : t = if x >= y then x else y\nexternal to_float : int -> float = \"%floatofint\"\nexternal of_float : float -> int = \"%intoffloat\"\n\n(*\nexternal int_of_string : string -> int = \"caml_int_of_string\"\nlet of_string s = try Some (int_of_string s) with Failure _ -> None\n*)\n\nexternal format_int : string -> int -> string = \"caml_format_int\"\nlet to_string x = format_int \"%d\" x\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n","(* generated code *)"],"names":[],"mappings":"EAwDa,iBAA4B,C,EADhB,eAA+B,C,EAJtC,OAAiB,C,KAVF,OAAO,OAAtB,aAAuB,C,KADR,OAAO,OAAtB,aAAuB,C,KCxCzC,gC,EAAA,uC,EDkCe,YAAa,C,KANhB,eAAe,GAAO,aAAE,C,EC5BpC,uE,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":116837},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/bytes.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Byte sequence operations *)\n\n(* WARNING: Some functions in this file are duplicated in string.ml for\n efficiency reasons. When you modify the one in this file you need to\n modify its duplicate in string.ml.\n These functions have a \"duplicated\" comment above their definition.\n*)\n\nexternal length : bytes -> int = \"%bytes_length\"\nexternal string_length : string -> int = \"%string_length\"\nexternal get : bytes -> int -> char = \"%bytes_safe_get\"\nexternal set : bytes -> int -> char -> unit = \"%bytes_safe_set\"\nexternal create : int -> bytes = \"caml_create_bytes\"\nexternal unsafe_get : bytes -> int -> char = \"%bytes_unsafe_get\"\nexternal unsafe_set : bytes -> int -> char -> unit = \"%bytes_unsafe_set\"\nexternal unsafe_fill : bytes -> int -> int -> char -> unit\n = \"caml_fill_bytes\" [@@noalloc]\nexternal unsafe_to_string : bytes -> string = \"%bytes_to_string\"\nexternal unsafe_of_string : string -> bytes = \"%bytes_of_string\"\n\nexternal unsafe_blit : bytes -> int -> bytes -> int -> int -> unit\n = \"caml_blit_bytes\" [@@noalloc]\nexternal unsafe_blit_string : string -> int -> bytes -> int -> int -> unit\n = \"caml_blit_string\" [@@noalloc]\n\nlet make n c =\n let s = create n in\n unsafe_fill s 0 n c;\n s\n\nlet init n f =\n let s = create n in\n for i = 0 to n - 1 do\n unsafe_set s i (f i)\n done;\n s\n\nlet empty = create 0\n\nlet copy s =\n let len = length s in\n let r = create len in\n unsafe_blit s 0 r 0 len;\n r\n\nlet to_string b = unsafe_to_string (copy b)\nlet of_string s = copy (unsafe_of_string s)\n\nlet sub s ofs len =\n if ofs < 0 || len < 0 || ofs > length s - len\n then invalid_arg \"String.sub / Bytes.sub\"\n else begin\n let r = create len in\n unsafe_blit s ofs r 0 len;\n r\n end\n\nlet sub_string b ofs len = unsafe_to_string (sub b ofs len)\n\n(* addition with an overflow check *)\nlet (++) a b =\n let c = a + b in\n match a < 0, b < 0, c < 0 with\n | true , true , false\n | false, false, true -> invalid_arg \"Bytes.extend\" (* overflow *)\n | _ -> c\n\nlet extend s left right =\n let len = length s ++ left ++ right in\n let r = create len in\n let (srcoff, dstoff) = if left < 0 then -left, 0 else 0, left in\n let cpylen = Int.min (length s - srcoff) (len - dstoff) in\n if cpylen > 0 then unsafe_blit s srcoff r dstoff cpylen;\n r\n\nlet fill s ofs len c =\n if ofs < 0 || len < 0 || ofs > length s - len\n then invalid_arg \"String.fill / Bytes.fill\"\n else unsafe_fill s ofs len c\n\nlet blit s1 ofs1 s2 ofs2 len =\n if len < 0 || ofs1 < 0 || ofs1 > length s1 - len\n || ofs2 < 0 || ofs2 > length s2 - len\n then invalid_arg \"Bytes.blit\"\n else unsafe_blit s1 ofs1 s2 ofs2 len\n\nlet blit_string s1 ofs1 s2 ofs2 len =\n if len < 0 || ofs1 < 0 || ofs1 > string_length s1 - len\n || ofs2 < 0 || ofs2 > length s2 - len\n then invalid_arg \"String.blit / Bytes.blit_string\"\n else unsafe_blit_string s1 ofs1 s2 ofs2 len\n\n(* duplicated in string.ml *)\nlet iter f a =\n for i = 0 to length a - 1 do f(unsafe_get a i) done\n\n(* duplicated in string.ml *)\nlet iteri f a =\n for i = 0 to length a - 1 do f i (unsafe_get a i) done\n\nlet ensure_ge (x:int) y = if x >= y then x else invalid_arg \"Bytes.concat\"\n\nlet rec sum_lengths acc seplen = function\n | [] -> acc\n | hd :: [] -> length hd + acc\n | hd :: tl -> sum_lengths (ensure_ge (length hd + seplen + acc) acc) seplen tl\n\nlet rec unsafe_blits dst pos sep seplen = function\n [] -> dst\n | hd :: [] ->\n unsafe_blit hd 0 dst pos (length hd); dst\n | hd :: tl ->\n unsafe_blit hd 0 dst pos (length hd);\n unsafe_blit sep 0 dst (pos + length hd) seplen;\n unsafe_blits dst (pos + length hd + seplen) sep seplen tl\n\nlet concat sep = function\n [] -> empty\n | l -> let seplen = length sep in\n unsafe_blits\n (create (sum_lengths 0 seplen l))\n 0 sep seplen l\n\nlet cat s1 s2 =\n let l1 = length s1 in\n let l2 = length s2 in\n let r = create (l1 + l2) in\n unsafe_blit s1 0 r 0 l1;\n unsafe_blit s2 0 r l1 l2;\n r\n\n\nexternal char_code: char -> int = \"%identity\"\nexternal char_chr: int -> char = \"%identity\"\n\nlet is_space = function\n | ' ' | '\\012' | '\\n' | '\\r' | '\\t' -> true\n | _ -> false\n\nlet trim s =\n let len = length s in\n let i = ref 0 in\n while !i < len && is_space (unsafe_get s !i) do\n incr i\n done;\n let j = ref (len - 1) in\n while !j >= !i && is_space (unsafe_get s !j) do\n decr j\n done;\n if !j >= !i then\n sub s !i (!j - !i + 1)\n else\n empty\n\nlet unsafe_escape s =\n (* We perform two passes on the input sequence, one to compute the\n result size and one to write the result.\n\n #11508, #11509: This logic would be incorrect in presence of\n concurrent modification to the input, making the use of\n [unsafe_set] below memory-unsafe.\n\n Precondition: This function may be safely called on:\n - an immutable byte sequence\n - a uniquely-owned byte sequence (the function takes ownership)\n\n In either case we return a uniquely-owned byte sequence.\n *)\n let n = ref 0 in\n for i = 0 to length s - 1 do\n n := !n +\n (match unsafe_get s i with\n | '\\\"' | '\\\\' | '\\n' | '\\t' | '\\r' | '\\b' -> 2\n | ' ' .. '~' -> 1\n | _ -> 4)\n done;\n if !n = length s then s\n else begin\n let s' = create !n in\n n := 0;\n for i = 0 to length s - 1 do\n begin match unsafe_get s i with\n | ('\\\"' | '\\\\') as c ->\n unsafe_set s' !n '\\\\'; incr n; unsafe_set s' !n c\n | '\\n' ->\n unsafe_set s' !n '\\\\'; incr n; unsafe_set s' !n 'n'\n | '\\t' ->\n unsafe_set s' !n '\\\\'; incr n; unsafe_set s' !n 't'\n | '\\r' ->\n unsafe_set s' !n '\\\\'; incr n; unsafe_set s' !n 'r'\n | '\\b' ->\n unsafe_set s' !n '\\\\'; incr n; unsafe_set s' !n 'b'\n | (' ' .. '~') as c -> unsafe_set s' !n c\n | c ->\n let a = char_code c in\n unsafe_set s' !n '\\\\';\n incr n;\n unsafe_set s' !n (char_chr (48 + a / 100));\n incr n;\n unsafe_set s' !n (char_chr (48 + (a / 10) mod 10));\n incr n;\n unsafe_set s' !n (char_chr (48 + a mod 10));\n end;\n incr n\n done;\n s'\n end\n\nlet escaped b =\n let b = copy b in\n (* We copy our input to obtain a uniquely-owned byte sequence [b]\n to satisfy [unsafe_escape]'s precondition *)\n unsafe_escape b\n\nlet map f s =\n let l = length s in\n if l = 0 then s else begin\n let r = create l in\n for i = 0 to l - 1 do unsafe_set r i (f (unsafe_get s i)) done;\n r\n end\n\nlet mapi f s =\n let l = length s in\n if l = 0 then s else begin\n let r = create l in\n for i = 0 to l - 1 do unsafe_set r i (f i (unsafe_get s i)) done;\n r\n end\n\nlet fold_left f x a =\n let r = ref x in\n for i = 0 to length a - 1 do\n r := f !r (unsafe_get a i)\n done;\n !r\n\nlet fold_right f a x =\n let r = ref x in\n for i = length a - 1 downto 0 do\n r := f (unsafe_get a i) !r\n done;\n !r\n\nlet exists p s =\n let n = length s in\n let rec loop i =\n if i = n then false\n else if p (unsafe_get s i) then true\n else loop (succ i) in\n loop 0\n\nlet for_all p s =\n let n = length s in\n let rec loop i =\n if i = n then true\n else if p (unsafe_get s i) then loop (succ i)\n else false in\n loop 0\n\nlet uppercase_ascii s = map Char.uppercase_ascii s\nlet lowercase_ascii s = map Char.lowercase_ascii s\n\nlet apply1 f s =\n if length s = 0 then s else begin\n let r = copy s in\n unsafe_set r 0 (f(unsafe_get s 0));\n r\n end\n\nlet capitalize_ascii s = apply1 Char.uppercase_ascii s\nlet uncapitalize_ascii s = apply1 Char.lowercase_ascii s\n\n(* duplicated in string.ml *)\nlet starts_with ~prefix s =\n let len_s = length s\n and len_pre = length prefix in\n let rec aux i =\n if i = len_pre then true\n else if unsafe_get s i <> unsafe_get prefix i then false\n else aux (i + 1)\n in len_s >= len_pre && aux 0\n\n(* duplicated in string.ml *)\nlet ends_with ~suffix s =\n let len_s = length s\n and len_suf = length suffix in\n let diff = len_s - len_suf in\n let rec aux i =\n if i = len_suf then true\n else if unsafe_get s (diff + i) <> unsafe_get suffix i then false\n else aux (i + 1)\n in diff >= 0 && aux 0\n\n(* duplicated in string.ml *)\nlet rec index_rec s lim i c =\n if i >= lim then raise Not_found else\n if unsafe_get s i = c then i else index_rec s lim (i + 1) c\n\n(* duplicated in string.ml *)\nlet index s c = index_rec s (length s) 0 c\n\n(* duplicated in string.ml *)\nlet rec index_rec_opt s lim i c =\n if i >= lim then None else\n if unsafe_get s i = c then Some i else index_rec_opt s lim (i + 1) c\n\n(* duplicated in string.ml *)\nlet index_opt s c = index_rec_opt s (length s) 0 c\n\n(* duplicated in string.ml *)\nlet index_from s i c =\n let l = length s in\n if i < 0 || i > l then invalid_arg \"String.index_from / Bytes.index_from\" else\n index_rec s l i c\n\n(* duplicated in string.ml *)\nlet index_from_opt s i c =\n let l = length s in\n if i < 0 || i > l then\n invalid_arg \"String.index_from_opt / Bytes.index_from_opt\"\n else\n index_rec_opt s l i c\n\n(* duplicated in string.ml *)\nlet rec rindex_rec s i c =\n if i < 0 then raise Not_found else\n if unsafe_get s i = c then i else rindex_rec s (i - 1) c\n\n(* duplicated in string.ml *)\nlet rindex s c = rindex_rec s (length s - 1) c\n\n(* duplicated in string.ml *)\nlet rindex_from s i c =\n if i < -1 || i >= length s then\n invalid_arg \"String.rindex_from / Bytes.rindex_from\"\n else\n rindex_rec s i c\n\n(* duplicated in string.ml *)\nlet rec rindex_rec_opt s i c =\n if i < 0 then None else\n if unsafe_get s i = c then Some i else rindex_rec_opt s (i - 1) c\n\n(* duplicated in string.ml *)\nlet rindex_opt s c = rindex_rec_opt s (length s - 1) c\n\n(* duplicated in string.ml *)\nlet rindex_from_opt s i c =\n if i < -1 || i >= length s then\n invalid_arg \"String.rindex_from_opt / Bytes.rindex_from_opt\"\n else\n rindex_rec_opt s i c\n\n\n(* duplicated in string.ml *)\nlet contains_from s i c =\n let l = length s in\n if i < 0 || i > l then\n invalid_arg \"String.contains_from / Bytes.contains_from\"\n else\n try ignore (index_rec s l i c); true with Not_found -> false\n\n\n(* duplicated in string.ml *)\nlet contains s c = contains_from s 0 c\n\n(* duplicated in string.ml *)\nlet rcontains_from s i c =\n if i < 0 || i >= length s then\n invalid_arg \"String.rcontains_from / Bytes.rcontains_from\"\n else\n try ignore (rindex_rec s i c); true with Not_found -> false\n\n\ntype t = bytes\n\nlet compare (x: t) (y: t) = Stdlib.compare x y\nexternal equal : t -> t -> bool = \"caml_bytes_equal\" [@@noalloc]\n\n(* duplicated in string.ml *)\nlet split_on_char sep s =\n let r = ref [] in\n let j = ref (length s) in\n for i = length s - 1 downto 0 do\n if unsafe_get s i = sep then begin\n r := sub s (i + 1) (!j - i - 1) :: !r;\n j := i\n end\n done;\n sub s 0 !j :: !r\n\n(** {1 Iterators} *)\n\nlet to_seq s =\n let rec aux i () =\n if i = length s then Seq.Nil\n else\n let x = get s i in\n Seq.Cons (x, aux (i+1))\n in\n aux 0\n\nlet to_seqi s =\n let rec aux i () =\n if i = length s then Seq.Nil\n else\n let x = get s i in\n Seq.Cons ((i,x), aux (i+1))\n in\n aux 0\n\nlet of_seq i =\n let n = ref 0 in\n let buf = ref (make 256 '\\000') in\n let resize () =\n (* resize *)\n let new_len = Int.min (2 * length !buf) Sys.max_string_length in\n if length !buf = new_len then failwith \"Bytes.of_seq: cannot grow bytes\";\n let new_buf = make new_len '\\000' in\n blit !buf 0 new_buf 0 !n;\n buf := new_buf\n in\n Seq.iter\n (fun c ->\n if !n = length !buf then resize();\n set !buf !n c;\n incr n)\n i;\n sub !buf 0 !n\n\n(** {6 Binary encoding/decoding of integers} *)\n\n(* The get_ functions are all duplicated in string.ml *)\n\nexternal unsafe_get_uint8 : bytes -> int -> int = \"%bytes_unsafe_get\"\nexternal unsafe_get_uint16_ne : bytes -> int -> int = \"%caml_bytes_get16u\"\nexternal get_uint8 : bytes -> int -> int = \"%bytes_safe_get\"\nexternal get_uint16_ne : bytes -> int -> int = \"%caml_bytes_get16\"\nexternal get_int32_ne : bytes -> int -> int32 = \"%caml_bytes_get32\"\nexternal get_int64_ne : bytes -> int -> int64 = \"%caml_bytes_get64\"\n\nexternal unsafe_set_uint8 : bytes -> int -> int -> unit = \"%bytes_unsafe_set\"\nexternal unsafe_set_uint16_ne : bytes -> int -> int -> unit\n = \"%caml_bytes_set16u\"\nexternal set_int8 : bytes -> int -> int -> unit = \"%bytes_safe_set\"\nexternal set_int16_ne : bytes -> int -> int -> unit = \"%caml_bytes_set16\"\nexternal set_int32_ne : bytes -> int -> int32 -> unit = \"%caml_bytes_set32\"\nexternal set_int64_ne : bytes -> int -> int64 -> unit = \"%caml_bytes_set64\"\nexternal swap16 : int -> int = \"%bswap16\"\nexternal swap32 : int32 -> int32 = \"%bswap_int32\"\nexternal swap64 : int64 -> int64 = \"%bswap_int64\"\n\nlet unsafe_get_uint16_le b i =\n if Sys.big_endian\n then swap16 (unsafe_get_uint16_ne b i)\n else unsafe_get_uint16_ne b i\n\nlet unsafe_get_uint16_be b i =\n if Sys.big_endian\n then unsafe_get_uint16_ne b i\n else swap16 (unsafe_get_uint16_ne b i)\n\nlet get_int8 b i =\n ((get_uint8 b i) lsl (Sys.int_size - 8)) asr (Sys.int_size - 8)\n\nlet get_uint16_le b i =\n if Sys.big_endian then swap16 (get_uint16_ne b i)\n else get_uint16_ne b i\n\nlet get_uint16_be b i =\n if not Sys.big_endian then swap16 (get_uint16_ne b i)\n else get_uint16_ne b i\n\nlet get_int16_ne b i =\n ((get_uint16_ne b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)\n\nlet get_int16_le b i =\n ((get_uint16_le b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)\n\nlet get_int16_be b i =\n ((get_uint16_be b i) lsl (Sys.int_size - 16)) asr (Sys.int_size - 16)\n\nlet get_int32_le b i =\n if Sys.big_endian then swap32 (get_int32_ne b i)\n else get_int32_ne b i\n\nlet get_int32_be b i =\n if not Sys.big_endian then swap32 (get_int32_ne b i)\n else get_int32_ne b i\n\nlet get_int64_le b i =\n if Sys.big_endian then swap64 (get_int64_ne b i)\n else get_int64_ne b i\n\nlet get_int64_be b i =\n if not Sys.big_endian then swap64 (get_int64_ne b i)\n else get_int64_ne b i\n\nlet unsafe_set_uint16_le b i x =\n if Sys.big_endian\n then unsafe_set_uint16_ne b i (swap16 x)\n else unsafe_set_uint16_ne b i x\n\nlet unsafe_set_uint16_be b i x =\n if Sys.big_endian\n then unsafe_set_uint16_ne b i x else\n unsafe_set_uint16_ne b i (swap16 x)\n\nlet set_int16_le b i x =\n if Sys.big_endian then set_int16_ne b i (swap16 x)\n else set_int16_ne b i x\n\nlet set_int16_be b i x =\n if not Sys.big_endian then set_int16_ne b i (swap16 x)\n else set_int16_ne b i x\n\nlet set_int32_le b i x =\n if Sys.big_endian then set_int32_ne b i (swap32 x)\n else set_int32_ne b i x\n\nlet set_int32_be b i x =\n if not Sys.big_endian then set_int32_ne b i (swap32 x)\n else set_int32_ne b i x\n\nlet set_int64_le b i x =\n if Sys.big_endian then set_int64_ne b i (swap64 x)\n else set_int64_ne b i x\n\nlet set_int64_be b i x =\n if not Sys.big_endian then set_int64_ne b i (swap64 x)\n else set_int64_ne b i x\n\nlet set_uint8 = set_int8\nlet set_uint16_ne = set_int16_ne\nlet set_uint16_be = set_int16_be\nlet set_uint16_le = set_int16_le\n\n(* UTF codecs and validations *)\n\nlet dec_invalid = Uchar.utf_decode_invalid\nlet[@inline] dec_ret n u = Uchar.utf_decode n (Uchar.unsafe_of_int u)\n\n(* In case of decoding error, if we error on the first byte, we\n consume the byte, otherwise we consume the [n] bytes preceding\n the erroring byte.\n\n This means that if a client uses decodes without caring about\n validity it naturally replace bogus data with Uchar.rep according\n to the WHATWG Encoding standard. Other schemes are possible by\n consulting the number of used bytes on invalid decodes. For more\n details see https://hsivonen.fi/broken-utf-8/\n\n For this reason in [get_utf_8_uchar] we gradually check the next\n byte is available rather than doing it immediately after the\n first byte. Contrast with [is_valid_utf_8]. *)\n\n(* UTF-8 *)\n\nlet[@inline] not_in_x80_to_xBF b = b lsr 6 <> 0b10\nlet[@inline] not_in_xA0_to_xBF b = b lsr 5 <> 0b101\nlet[@inline] not_in_x80_to_x9F b = b lsr 5 <> 0b100\nlet[@inline] not_in_x90_to_xBF b = b < 0x90 || 0xBF < b\nlet[@inline] not_in_x80_to_x8F b = b lsr 4 <> 0x8\n\nlet[@inline] utf_8_uchar_2 b0 b1 =\n ((b0 land 0x1F) lsl 6) lor\n ((b1 land 0x3F))\n\nlet[@inline] utf_8_uchar_3 b0 b1 b2 =\n ((b0 land 0x0F) lsl 12) lor\n ((b1 land 0x3F) lsl 6) lor\n ((b2 land 0x3F))\n\nlet[@inline] utf_8_uchar_4 b0 b1 b2 b3 =\n ((b0 land 0x07) lsl 18) lor\n ((b1 land 0x3F) lsl 12) lor\n ((b2 land 0x3F) lsl 6) lor\n ((b3 land 0x3F))\n\nlet get_utf_8_uchar b i =\n let b0 = get_uint8 b i in (* raises if [i] is not a valid index. *)\n let get = unsafe_get_uint8 in\n let max = length b - 1 in\n match Char.unsafe_chr b0 with (* See The Unicode Standard, Table 3.7 *)\n | '\\x00' .. '\\x7F' -> dec_ret 1 b0\n | '\\xC2' .. '\\xDF' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x80_to_xBF b1 then dec_invalid 1 else\n dec_ret 2 (utf_8_uchar_2 b0 b1)\n | '\\xE0' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_xA0_to_xBF b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n dec_ret 3 (utf_8_uchar_3 b0 b1 b2)\n | '\\xE1' .. '\\xEC' | '\\xEE' .. '\\xEF' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x80_to_xBF b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n dec_ret 3 (utf_8_uchar_3 b0 b1 b2)\n | '\\xED' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x80_to_x9F b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n dec_ret 3 (utf_8_uchar_3 b0 b1 b2)\n | '\\xF0' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x90_to_xBF b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n let i = i + 1 in if i > max then dec_invalid 3 else\n let b3 = get b i in if not_in_x80_to_xBF b3 then dec_invalid 3 else\n dec_ret 4 (utf_8_uchar_4 b0 b1 b2 b3)\n | '\\xF1' .. '\\xF3' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x80_to_xBF b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n let i = i + 1 in if i > max then dec_invalid 3 else\n let b3 = get b i in if not_in_x80_to_xBF b3 then dec_invalid 3 else\n dec_ret 4 (utf_8_uchar_4 b0 b1 b2 b3)\n | '\\xF4' ->\n let i = i + 1 in if i > max then dec_invalid 1 else\n let b1 = get b i in if not_in_x80_to_x8F b1 then dec_invalid 1 else\n let i = i + 1 in if i > max then dec_invalid 2 else\n let b2 = get b i in if not_in_x80_to_xBF b2 then dec_invalid 2 else\n let i = i + 1 in if i > max then dec_invalid 3 else\n let b3 = get b i in if not_in_x80_to_xBF b3 then dec_invalid 3 else\n dec_ret 4 (utf_8_uchar_4 b0 b1 b2 b3)\n | _ -> dec_invalid 1\n\nlet set_utf_8_uchar b i u =\n let set = unsafe_set_uint8 in\n let max = length b - 1 in\n match Uchar.to_int u with\n | u when u < 0 -> assert false\n | u when u <= 0x007F ->\n set_uint8 b i u;\n 1\n | u when u <= 0x07FF ->\n let last = i + 1 in\n if last > max then 0 else\n (set_uint8 b i (0xC0 lor (u lsr 6));\n set b last (0x80 lor (u land 0x3F));\n 2)\n | u when u <= 0xFFFF ->\n let last = i + 2 in\n if last > max then 0 else\n (set_uint8 b i (0xE0 lor (u lsr 12));\n set b (i + 1) (0x80 lor ((u lsr 6) land 0x3F));\n set b last (0x80 lor (u land 0x3F));\n 3)\n | u when u <= 0x10FFFF ->\n let last = i + 3 in\n if last > max then 0 else\n (set_uint8 b i (0xF0 lor (u lsr 18));\n set b (i + 1) (0x80 lor ((u lsr 12) land 0x3F));\n set b (i + 2) (0x80 lor ((u lsr 6) land 0x3F));\n set b last (0x80 lor (u land 0x3F));\n 4)\n | _ -> assert false\n\nlet is_valid_utf_8 b =\n let rec loop max b i =\n if i > max then true else\n let get = unsafe_get_uint8 in\n match Char.unsafe_chr (get b i) with\n | '\\x00' .. '\\x7F' -> loop max b (i + 1)\n | '\\xC2' .. '\\xDF' ->\n let last = i + 1 in\n if last > max\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xE0' ->\n let last = i + 2 in\n if last > max\n || not_in_xA0_to_xBF (get b (i + 1))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xE1' .. '\\xEC' | '\\xEE' .. '\\xEF' ->\n let last = i + 2 in\n if last > max\n || not_in_x80_to_xBF (get b (i + 1))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xED' ->\n let last = i + 2 in\n if last > max\n || not_in_x80_to_x9F (get b (i + 1))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xF0' ->\n let last = i + 3 in\n if last > max\n || not_in_x90_to_xBF (get b (i + 1))\n || not_in_x80_to_xBF (get b (i + 2))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xF1' .. '\\xF3' ->\n let last = i + 3 in\n if last > max\n || not_in_x80_to_xBF (get b (i + 1))\n || not_in_x80_to_xBF (get b (i + 2))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | '\\xF4' ->\n let last = i + 3 in\n if last > max\n || not_in_x80_to_x8F (get b (i + 1))\n || not_in_x80_to_xBF (get b (i + 2))\n || not_in_x80_to_xBF (get b last)\n then false\n else loop max b (last + 1)\n | _ -> false\n in\n loop (length b - 1) b 0\n\n(* UTF-16BE *)\n\nlet get_utf_16be_uchar b i =\n let get = unsafe_get_uint16_be in\n let max = length b - 1 in\n if i < 0 || i > max then invalid_arg \"index out of bounds\" else\n if i = max then dec_invalid 1 else\n match get b i with\n | u when u < 0xD800 || u > 0xDFFF -> dec_ret 2 u\n | u when u > 0xDBFF -> dec_invalid 2\n | hi -> (* combine [hi] with a low surrogate *)\n let last = i + 3 in\n if last > max then dec_invalid (max - i + 1) else\n match get b (i + 2) with\n | u when u < 0xDC00 || u > 0xDFFF -> dec_invalid 2 (* retry here *)\n | lo ->\n let u = (((hi land 0x3FF) lsl 10) lor (lo land 0x3FF)) + 0x10000 in\n dec_ret 4 u\n\nlet set_utf_16be_uchar b i u =\n let set = unsafe_set_uint16_be in\n let max = length b - 1 in\n if i < 0 || i > max then invalid_arg \"index out of bounds\" else\n match Uchar.to_int u with\n | u when u < 0 -> assert false\n | u when u <= 0xFFFF ->\n let last = i + 1 in\n if last > max then 0 else (set b i u; 2)\n | u when u <= 0x10FFFF ->\n let last = i + 3 in\n if last > max then 0 else\n let u' = u - 0x10000 in\n let hi = (0xD800 lor (u' lsr 10)) in\n let lo = (0xDC00 lor (u' land 0x3FF)) in\n set b i hi; set b (i + 2) lo; 4\n | _ -> assert false\n\nlet is_valid_utf_16be b =\n let rec loop max b i =\n let get = unsafe_get_uint16_be in\n if i > max then true else\n if i = max then false else\n match get b i with\n | u when u < 0xD800 || u > 0xDFFF -> loop max b (i + 2)\n | u when u > 0xDBFF -> false\n | _hi ->\n let last = i + 3 in\n if last > max then false else\n match get b (i + 2) with\n | u when u < 0xDC00 || u > 0xDFFF -> false\n | _lo -> loop max b (i + 4)\n in\n loop (length b - 1) b 0\n\n(* UTF-16LE *)\n\nlet get_utf_16le_uchar b i =\n let get = unsafe_get_uint16_le in\n let max = length b - 1 in\n if i < 0 || i > max then invalid_arg \"index out of bounds\" else\n if i = max then dec_invalid 1 else\n match get b i with\n | u when u < 0xD800 || u > 0xDFFF -> dec_ret 2 u\n | u when u > 0xDBFF -> dec_invalid 2\n | hi -> (* combine [hi] with a low surrogate *)\n let last = i + 3 in\n if last > max then dec_invalid (max - i + 1) else\n match get b (i + 2) with\n | u when u < 0xDC00 || u > 0xDFFF -> dec_invalid 2 (* retry here *)\n | lo ->\n let u = (((hi land 0x3FF) lsl 10) lor (lo land 0x3FF)) + 0x10000 in\n dec_ret 4 u\n\nlet set_utf_16le_uchar b i u =\n let set = unsafe_set_uint16_le in\n let max = length b - 1 in\n if i < 0 || i > max then invalid_arg \"index out of bounds\" else\n match Uchar.to_int u with\n | u when u < 0 -> assert false\n | u when u <= 0xFFFF ->\n let last = i + 1 in\n if last > max then 0 else (set b i u; 2)\n | u when u <= 0x10FFFF ->\n let last = i + 3 in\n if last > max then 0 else\n let u' = u - 0x10000 in\n let hi = (0xD800 lor (u' lsr 10)) in\n let lo = (0xDC00 lor (u' land 0x3FF)) in\n set b i hi; set b (i + 2) lo; 4\n | _ -> assert false\n\nlet is_valid_utf_16le b =\n let rec loop max b i =\n let get = unsafe_get_uint16_le in\n if i > max then true else\n if i = max then false else\n match get b i with\n | u when u < 0xD800 || u > 0xDFFF -> loop max b (i + 2)\n | u when u > 0xDBFF -> false\n | _hi ->\n let last = i + 3 in\n if last > max then false else\n match get b (i + 2) with\n | u when u < 0xDC00 || u > 0xDFFF -> false\n | _lo -> loop max b (i + 4)\n in\n loop (length b - 1) b 0\n"],"names":[],"mappings":"+PC+0BE,eAZE,cAAgB,KAChB,cAAgB,KACV,aACG,yBACA,WAAc,MAGnB,KADA,KACA,MAAmB,MACb,EAAN,KAAM,SACG,yBACA,WAD4B,M,KANJ,YAShB,C,QA9BvB,cADA,YACA,aACM,EAAN,QAAM,eACG,YACA,WAGA,YAOF,gBALH,KADA,UACA,MAAmB,MACnB,cAEA,WACA,IAFA,iBAEA,KAAY,EAAF,UAAE,SAAgB,M,IAP5B,KADA,UACA,MAAmB,MAAQ,SAAS,M,IAHtB,gB,GAFO,uBAaN,C,YA9BnB,cADA,oBACA,aACA,SAAgB,wBACV,aACG,yBACA,WAAc,wBAG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E,EAAA,YAEpC,a,CAAA,aACA,Q,CADoC,OACpC,SAA8C,kBAQxB,C,IAvBxB,sBAA6B,4BAAoB,6BAAK,C,OAJtD,sBAA6B,kCAAiB,6BAAK,C,SAPnD,gGAGK,YAAsC,MADtC,uBACsC,C,SAT3C,gGAGK,YAA+B,MAD/B,uBAC+B,C,QARpC,uDAEK,UAAuB,IADvB,uBACuB,C,WAV5B,OAAU,cACF,IAER,SADA,cACA,GADwC,iBACxC,GAAa,EAAb,cAAa,EAAb,QAAa,aACb,YAAmB,gBACnB,EAAC,C,OAXD,cADA,gBACA,yC,CAAA,IAEyB,wBAClB,IAAC,C,EARkC,aAAe,G,QARzD,uDAIE,IADQ,MACR,SAAyB,MAHtB,uBAKF,C,EATa,WAAyB,C,EADR,SAAQ,G,OAHzC,WAFA,MACQ,MACR,WAAuB,EACtB,C,OAZO,MACR,sBACiB,qBAAK,gDAEtB,EAAC,C,EATO,MACR,WAAmB,EAClB,C,MASiB,UAAR,QAAQ,qT","ignoreList":[0]}},{"offset":{"line":0,"column":130073},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/string.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Gallium, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2014 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* String operations, based on byte sequence operations *)\n\n(* WARNING: Some functions in this file are duplicated in bytes.ml for\n efficiency reasons. When you modify the one in this file you need to\n modify its duplicate in bytes.ml.\n These functions have a \"duplicated\" comment above their definition.\n*)\n\nexternal length : string -> int = \"%string_length\"\nexternal get : string -> int -> char = \"%string_safe_get\"\nexternal unsafe_get : string -> int -> char = \"%string_unsafe_get\"\nexternal unsafe_blit : string -> int -> bytes -> int -> int -> unit\n = \"caml_blit_string\" [@@noalloc]\n\nmodule B = Bytes\n\nlet bts = B.unsafe_to_string\nlet bos = B.unsafe_of_string\n\nlet make n c =\n B.make n c |> bts\nlet init n f =\n B.init n f |> bts\nlet empty = \"\"\nlet of_bytes = B.to_string\nlet to_bytes = B.of_string\nlet sub s ofs len =\n B.sub (bos s) ofs len |> bts\nlet blit =\n B.blit_string\n\nlet ensure_ge (x:int) y = if x >= y then x else invalid_arg \"String.concat\"\n\nlet rec sum_lengths acc seplen = function\n | [] -> acc\n | hd :: [] -> length hd + acc\n | hd :: tl -> sum_lengths (ensure_ge (length hd + seplen + acc) acc) seplen tl\n\nlet rec unsafe_blits dst pos sep seplen = function\n [] -> dst\n | hd :: [] ->\n unsafe_blit hd 0 dst pos (length hd); dst\n | hd :: tl ->\n unsafe_blit hd 0 dst pos (length hd);\n unsafe_blit sep 0 dst (pos + length hd) seplen;\n unsafe_blits dst (pos + length hd + seplen) sep seplen tl\n\nlet concat sep = function\n [] -> \"\"\n | l -> let seplen = length sep in bts @@\n unsafe_blits\n (B.create (sum_lengths 0 seplen l))\n 0 sep seplen l\n\nlet cat = ( ^ )\n\n(* duplicated in bytes.ml *)\nlet iter f s =\n for i = 0 to length s - 1 do f (unsafe_get s i) done\n\n(* duplicated in bytes.ml *)\nlet iteri f s =\n for i = 0 to length s - 1 do f i (unsafe_get s i) done\n\nlet map f s =\n B.map f (bos s) |> bts\nlet mapi f s =\n B.mapi f (bos s) |> bts\nlet fold_right f x a =\n B.fold_right f (bos x) a\nlet fold_left f a x =\n B.fold_left f a (bos x)\nlet exists f s =\n B.exists f (bos s)\nlet for_all f s =\n B.for_all f (bos s)\n\n(* Beware: we cannot use B.trim or B.escape because they always make a\n copy, but String.mli spells out some cases where we are not allowed\n to make a copy. *)\n\nlet is_space = function\n | ' ' | '\\012' | '\\n' | '\\r' | '\\t' -> true\n | _ -> false\n\nlet trim s =\n if s = \"\" then s\n else if is_space (unsafe_get s 0) || is_space (unsafe_get s (length s - 1))\n then bts (B.trim (bos s))\n else s\n\nlet escaped s =\n let b = bos s in\n (* We satisfy [unsafe_escape]'s precondition by passing an\n immutable byte sequence [b]. *)\n bts (B.unsafe_escape b)\n\n(* duplicated in bytes.ml *)\nlet rec index_rec s lim i c =\n if i >= lim then raise Not_found else\n if unsafe_get s i = c then i else index_rec s lim (i + 1) c\n\n(* duplicated in bytes.ml *)\nlet index s c = index_rec s (length s) 0 c\n\n(* duplicated in bytes.ml *)\nlet rec index_rec_opt s lim i c =\n if i >= lim then None else\n if unsafe_get s i = c then Some i else index_rec_opt s lim (i + 1) c\n\n(* duplicated in bytes.ml *)\nlet index_opt s c = index_rec_opt s (length s) 0 c\n\n(* duplicated in bytes.ml *)\nlet index_from s i c =\n let l = length s in\n if i < 0 || i > l then invalid_arg \"String.index_from / Bytes.index_from\" else\n index_rec s l i c\n\n(* duplicated in bytes.ml *)\nlet index_from_opt s i c =\n let l = length s in\n if i < 0 || i > l then\n invalid_arg \"String.index_from_opt / Bytes.index_from_opt\"\n else\n index_rec_opt s l i c\n\n(* duplicated in bytes.ml *)\nlet rec rindex_rec s i c =\n if i < 0 then raise Not_found else\n if unsafe_get s i = c then i else rindex_rec s (i - 1) c\n\n(* duplicated in bytes.ml *)\nlet rindex s c = rindex_rec s (length s - 1) c\n\n(* duplicated in bytes.ml *)\nlet rindex_from s i c =\n if i < -1 || i >= length s then\n invalid_arg \"String.rindex_from / Bytes.rindex_from\"\n else\n rindex_rec s i c\n\n(* duplicated in bytes.ml *)\nlet rec rindex_rec_opt s i c =\n if i < 0 then None else\n if unsafe_get s i = c then Some i else rindex_rec_opt s (i - 1) c\n\n(* duplicated in bytes.ml *)\nlet rindex_opt s c = rindex_rec_opt s (length s - 1) c\n\n(* duplicated in bytes.ml *)\nlet rindex_from_opt s i c =\n if i < -1 || i >= length s then\n invalid_arg \"String.rindex_from_opt / Bytes.rindex_from_opt\"\n else\n rindex_rec_opt s i c\n\n(* duplicated in bytes.ml *)\nlet contains_from s i c =\n let l = length s in\n if i < 0 || i > l then\n invalid_arg \"String.contains_from / Bytes.contains_from\"\n else\n try ignore (index_rec s l i c); true with Not_found -> false\n\n(* duplicated in bytes.ml *)\nlet contains s c = contains_from s 0 c\n\n(* duplicated in bytes.ml *)\nlet rcontains_from s i c =\n if i < 0 || i >= length s then\n invalid_arg \"String.rcontains_from / Bytes.rcontains_from\"\n else\n try ignore (rindex_rec s i c); true with Not_found -> false\n\nlet uppercase_ascii s =\n B.uppercase_ascii (bos s) |> bts\nlet lowercase_ascii s =\n B.lowercase_ascii (bos s) |> bts\nlet capitalize_ascii s =\n B.capitalize_ascii (bos s) |> bts\nlet uncapitalize_ascii s =\n B.uncapitalize_ascii (bos s) |> bts\n\n(* duplicated in bytes.ml *)\nlet starts_with ~prefix s =\n let len_s = length s\n and len_pre = length prefix in\n let rec aux i =\n if i = len_pre then true\n else if unsafe_get s i <> unsafe_get prefix i then false\n else aux (i + 1)\n in len_s >= len_pre && aux 0\n\n(* duplicated in bytes.ml *)\nlet ends_with ~suffix s =\n let len_s = length s\n and len_suf = length suffix in\n let diff = len_s - len_suf in\n let rec aux i =\n if i = len_suf then true\n else if unsafe_get s (diff + i) <> unsafe_get suffix i then false\n else aux (i + 1)\n in diff >= 0 && aux 0\n\nexternal seeded_hash : int -> string -> int = \"caml_string_hash\" [@@noalloc]\nlet hash x = seeded_hash 0 x\n\n(* duplicated in bytes.ml *)\nlet split_on_char sep s =\n let r = ref [] in\n let j = ref (length s) in\n for i = length s - 1 downto 0 do\n if unsafe_get s i = sep then begin\n r := sub s (i + 1) (!j - i - 1) :: !r;\n j := i\n end\n done;\n sub s 0 !j :: !r\n\ntype t = string\n\nlet compare (x: t) (y: t) = Stdlib.compare x y\nexternal equal : string -> string -> bool = \"caml_string_equal\" [@@noalloc]\n\n(** {1 Iterators} *)\n\nlet to_seq s = bos s |> B.to_seq\n\nlet to_seqi s = bos s |> B.to_seqi\n\nlet of_seq g = B.of_seq g |> bts\n\n(* UTF decoders and validators *)\n\nlet get_utf_8_uchar s i = B.get_utf_8_uchar (bos s) i\nlet is_valid_utf_8 s = B.is_valid_utf_8 (bos s)\n\nlet get_utf_16be_uchar s i = B.get_utf_16be_uchar (bos s) i\nlet is_valid_utf_16be s = B.is_valid_utf_16be (bos s)\n\nlet get_utf_16le_uchar s i = B.get_utf_16le_uchar (bos s) i\nlet is_valid_utf_16le s = B.is_valid_utf_16le (bos s)\n\n(** {6 Binary encoding/decoding of integers} *)\n\nexternal get_uint8 : string -> int -> int = \"%string_safe_get\"\nexternal get_uint16_ne : string -> int -> int = \"%caml_string_get16\"\nexternal get_int32_ne : string -> int -> int32 = \"%caml_string_get32\"\nexternal get_int64_ne : string -> int -> int64 = \"%caml_string_get64\"\n\nlet get_int8 s i = B.get_int8 (bos s) i\nlet get_uint16_le s i = B.get_uint16_le (bos s) i\nlet get_uint16_be s i = B.get_uint16_be (bos s) i\nlet get_int16_ne s i = B.get_int16_ne (bos s) i\nlet get_int16_le s i = B.get_int16_le (bos s) i\nlet get_int16_be s i = B.get_int16_be (bos s) i\nlet get_int32_le s i = B.get_int32_le (bos s) i\nlet get_int32_be s i = B.get_int32_be (bos s) i\nlet get_int64_le s i = B.get_int64_le (bos s) i\nlet get_int64_be s i = B.get_int64_be (bos s) i\n"],"names":[],"mappings":"wHCmRsC,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADT,yBAAO,wBAAE,C,EADP,yBAAO,uBAAE,C,EADT,yBAAO,uBAAE,C,EADnB,yBAAO,uBAAE,C,EATO,wBAAO,sB,EADH,yBAAO,uBAAE,C,EAFb,wBAAO,sB,EADH,yBAAO,uBAAE,C,EAFnB,wBAAO,sB,EADH,yBAAO,uBAAE,C,KAJtC,8BAAU,mBAAO,C,EAFhB,wBAAK,qBAAa,C,EAFnB,wBAAK,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AP,yBAAO,uBAAE,C,MAFxB,EAAS,2BAAO,QAAhB,aAAgB,mBAAO,C,MAFvB,EAAQ,2BAAO,QAAf,aAAe,mBAAO,C,IAHtB,sBAA6B,4BAAoB,6BAAK,C,OAJtD,sBAA6B,kCAAkB,6BAAK,C,oBAX3C,UACD,IADC,QAEF,SAEa,cAlBF,sC,CAAA,WAGJ,sBALU,sBAAsB,Y,CAAA,gB,IAIhC,oBAgBJ,E,CAAA,IADF,MAZW,O,CAAA,8BAGjB,a,CAAA,cAAoC,YAEpC,a,CAAA,aACA,Q,CADoC,OACpC,SAA8C,iBAQxB,E,CAAA,qB,MAzBlB,2BAAN,IAAa,QAAb,aAAqB,mBAAO,C,MAL5B,iCAAU,mBAAO,C,MAFjB,iCAAU,mBAAO,C","ignoreList":[0]}},{"offset":{"line":0,"column":135051},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/unit.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t = unit = ()\n\nlet equal () () = true\nlet compare () () = 0\nlet to_string () = \"()\"\n","(* generated code *)"],"names":[],"mappings":"EAmBmB,GAAI,C,EADH,IAAC,C,EADH,IAAI,C,ECjBtB,yB,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":135152},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/marshal.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1997 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype extern_flags =\n No_sharing\n | Closures\n | Compat_32\n\n(* note: this type definition is used in 'runtime/debugger.c' *)\n\nexternal to_channel: out_channel -> 'a -> extern_flags list -> unit\n = \"caml_output_value\"\nexternal to_bytes: 'a -> extern_flags list -> bytes\n = \"caml_output_value_to_bytes\"\nexternal to_string: 'a -> extern_flags list -> string\n = \"caml_output_value_to_string\"\nexternal to_buffer_unsafe:\n bytes -> int -> int -> 'a -> extern_flags list -> int\n = \"caml_output_value_to_buffer\"\n\nlet to_buffer buff ofs len v flags =\n if ofs < 0 || len < 0 || ofs > Bytes.length buff - len\n then invalid_arg \"Marshal.to_buffer: substring out of bounds\"\n else to_buffer_unsafe buff ofs len v flags\n\n(* The functions below use byte sequences as input, never using any\n mutation. It makes sense to use non-mutated [bytes] rather than\n [string], because we really work with sequences of bytes, not\n a text representation.\n*)\n\nexternal from_channel: in_channel -> 'a = \"caml_input_value\"\nexternal from_bytes_unsafe: bytes -> int -> 'a = \"caml_input_value_from_bytes\"\nexternal data_size_unsafe: bytes -> int -> int = \"caml_marshal_data_size\"\n\nlet header_size = 16\nlet data_size buff ofs =\n if ofs < 0 || ofs > Bytes.length buff - header_size\n then invalid_arg \"Marshal.data_size\"\n else data_size_unsafe buff ofs\nlet total_size buff ofs = header_size + data_size buff ofs\n\nlet from_bytes buff ofs =\n if ofs < 0 || ofs > Bytes.length buff - header_size\n then invalid_arg \"Marshal.from_bytes\"\n else begin\n let len = data_size_unsafe buff ofs in\n if ofs > Bytes.length buff - (header_size + len)\n then invalid_arg \"Marshal.from_bytes\"\n else from_bytes_unsafe buff ofs\n end\n\nlet from_string buff ofs =\n (* Bytes.unsafe_of_string is safe here, as the produced byte\n sequence is never mutated *)\n from_bytes (Bytes.unsafe_of_string buff) ofs\n"],"names":[],"mappings":"oBCmEa,EAAX,QAAW,aAA6B,SAAI,C,WAZ5C,uCAGY,MACV,8BACK,wBACA,MAA0B,E,GAL5B,uBAMF,C,EAVmC,WAAkB,W,QAHxD,uCAEK,MAAyB,GADzB,uBACyB,C,QAlB9B,uDAEK,YAAqC,IADrC,uBACqC,C","ignoreList":[0]}},{"offset":{"line":0,"column":135886},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/array.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* An alias for the type of arrays. *)\ntype 'a t = 'a array\n\n(* Array operations *)\n\nexternal length : 'a array -> int = \"%array_length\"\nexternal get: 'a array -> int -> 'a = \"%array_safe_get\"\nexternal set: 'a array -> int -> 'a -> unit = \"%array_safe_set\"\nexternal unsafe_get: 'a array -> int -> 'a = \"%array_unsafe_get\"\nexternal unsafe_set: 'a array -> int -> 'a -> unit = \"%array_unsafe_set\"\nexternal make: int -> 'a -> 'a array = \"caml_make_vect\"\nexternal create: int -> 'a -> 'a array = \"caml_make_vect\"\nexternal unsafe_sub : 'a array -> int -> int -> 'a array = \"caml_array_sub\"\nexternal append_prim : 'a array -> 'a array -> 'a array = \"caml_array_append\"\nexternal concat : 'a array list -> 'a array = \"caml_array_concat\"\nexternal unsafe_blit :\n 'a array -> int -> 'a array -> int -> int -> unit = \"caml_array_blit\"\nexternal unsafe_fill :\n 'a array -> int -> int -> 'a -> unit = \"caml_array_fill\"\nexternal create_float: int -> float array = \"caml_make_float_vect\"\n\nmodule Floatarray = struct\n external create : int -> floatarray = \"caml_floatarray_create\"\n external length : floatarray -> int = \"%floatarray_length\"\n external get : floatarray -> int -> float = \"%floatarray_safe_get\"\n external set : floatarray -> int -> float -> unit = \"%floatarray_safe_set\"\n external unsafe_get : floatarray -> int -> float = \"%floatarray_unsafe_get\"\n external unsafe_set : floatarray -> int -> float -> unit\n = \"%floatarray_unsafe_set\"\nend\n\nlet init l f =\n if l = 0 then [||] else\n if l < 0 then invalid_arg \"Array.init\"\n (* See #6575. We must not evaluate [f 0] when [l <= 0].\n We could also check for maximum array size, but this depends\n on whether we create a float array or a regular one... *)\n else\n let res = create l (f 0) in\n for i = 1 to pred l do\n unsafe_set res i (f i)\n done;\n res\n\nlet make_matrix sx sy init =\n (* We raise even if [sx = 0 && sy < 0]: *)\n if sy < 0 then invalid_arg \"Array.make_matrix\";\n let res = create sx [||] in\n if sy > 0 then begin\n for x = 0 to pred sx do\n unsafe_set res x (create sy init)\n done;\n end;\n res\n\nlet init_matrix sx sy f =\n (* We raise even if [sx = 0 && sy < 0]: *)\n if sy < 0 then invalid_arg \"Array.init_matrix\";\n let res = create sx [||] in\n (* We must not evaluate [f x 0] when [sy <= 0]: *)\n if sy > 0 then begin\n for x = 0 to pred sx do\n let row = create sy (f x 0) in\n for y = 1 to pred sy do\n unsafe_set row y (f x y)\n done;\n unsafe_set res x row\n done;\n end;\n res\n\nlet copy a =\n let l = length a in if l = 0 then [||] else unsafe_sub a 0 l\n\nlet append a1 a2 =\n let l1 = length a1 in\n if l1 = 0 then copy a2\n else if length a2 = 0 then unsafe_sub a1 0 l1\n else append_prim a1 a2\n\nlet sub a ofs len =\n if ofs < 0 || len < 0 || ofs > length a - len\n then invalid_arg \"Array.sub\"\n else unsafe_sub a ofs len\n\nlet fill a ofs len v =\n if ofs < 0 || len < 0 || ofs > length a - len\n then invalid_arg \"Array.fill\"\n else unsafe_fill a ofs len v\n\nlet blit a1 ofs1 a2 ofs2 len =\n if len < 0 || ofs1 < 0 || ofs1 > length a1 - len\n || ofs2 < 0 || ofs2 > length a2 - len\n then invalid_arg \"Array.blit\"\n else unsafe_blit a1 ofs1 a2 ofs2 len\n\nlet iter f a =\n for i = 0 to length a - 1 do f(unsafe_get a i) done\n\nlet iter2 f a b =\n if length a <> length b then\n invalid_arg \"Array.iter2: arrays must have the same length\"\n else\n for i = 0 to length a - 1 do f (unsafe_get a i) (unsafe_get b i) done\n\nlet map f a =\n let l = length a in\n if l = 0 then [||] else begin\n let r = create l (f(unsafe_get a 0)) in\n for i = 1 to l - 1 do\n unsafe_set r i (f(unsafe_get a i))\n done;\n r\n end\n\nlet map_inplace f a =\n for i = 0 to length a - 1 do\n unsafe_set a i (f (unsafe_get a i))\n done\n\nlet mapi_inplace f a =\n for i = 0 to length a - 1 do\n unsafe_set a i (f i (unsafe_get a i))\n done\n\nlet map2 f a b =\n let la = length a in\n let lb = length b in\n if la <> lb then\n invalid_arg \"Array.map2: arrays must have the same length\"\n else begin\n if la = 0 then [||] else begin\n let r = create la (f (unsafe_get a 0) (unsafe_get b 0)) in\n for i = 1 to la - 1 do\n unsafe_set r i (f (unsafe_get a i) (unsafe_get b i))\n done;\n r\n end\n end\n\nlet iteri f a =\n for i = 0 to length a - 1 do f i (unsafe_get a i) done\n\nlet mapi f a =\n let l = length a in\n if l = 0 then [||] else begin\n let r = create l (f 0 (unsafe_get a 0)) in\n for i = 1 to l - 1 do\n unsafe_set r i (f i (unsafe_get a i))\n done;\n r\n end\n\nlet to_list a =\n let rec tolist i res =\n if i < 0 then res else tolist (i - 1) (unsafe_get a i :: res) in\n tolist (length a - 1) []\n\n(* Cannot use List.length here because the List module depends on Array. *)\nlet rec list_length accu = function\n | [] -> accu\n | _::t -> list_length (succ accu) t\n\nlet of_list = function\n [] -> [||]\n | hd::tl as l ->\n let a = create (list_length 0 l) hd in\n let rec fill i = function\n [] -> a\n | hd::tl -> unsafe_set a i hd; fill (i+1) tl in\n fill 1 tl\n\nlet fold_left f x a =\n let r = ref x in\n for i = 0 to length a - 1 do\n r := f !r (unsafe_get a i)\n done;\n !r\n\nlet fold_left_map f acc input_array =\n let len = length input_array in\n if len = 0 then (acc, [||]) else begin\n let acc, elt = f acc (unsafe_get input_array 0) in\n let output_array = create len elt in\n let acc = ref acc in\n for i = 1 to len - 1 do\n let acc', elt = f !acc (unsafe_get input_array i) in\n acc := acc';\n unsafe_set output_array i elt;\n done;\n !acc, output_array\n end\n\nlet fold_right f a x =\n let r = ref x in\n for i = length a - 1 downto 0 do\n r := f (unsafe_get a i) !r\n done;\n !r\n\nlet exists p a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if p (unsafe_get a i) then true\n else loop (succ i) in\n loop 0\n\nlet for_all p a =\n let n = length a in\n let rec loop i =\n if i = n then true\n else if p (unsafe_get a i) then loop (succ i)\n else false in\n loop 0\n\nlet for_all2 p l1 l2 =\n let n1 = length l1\n and n2 = length l2 in\n if n1 <> n2 then invalid_arg \"Array.for_all2\"\n else let rec loop i =\n if i = n1 then true\n else if p (unsafe_get l1 i) (unsafe_get l2 i) then loop (succ i)\n else false in\n loop 0\n\nlet exists2 p l1 l2 =\n let n1 = length l1\n and n2 = length l2 in\n if n1 <> n2 then invalid_arg \"Array.exists2\"\n else let rec loop i =\n if i = n1 then false\n else if p (unsafe_get l1 i) (unsafe_get l2 i) then true\n else loop (succ i) in\n loop 0\n\nlet mem x a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if compare (unsafe_get a i) x = 0 then true\n else loop (succ i) in\n loop 0\n\nlet memq x a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if x == (unsafe_get a i) then true\n else loop (succ i) in\n loop 0\n\nlet find_opt p a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n let x = unsafe_get a i in\n if p x then Some x\n else loop (succ i)\n in\n loop 0\n\nlet find_index p a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else if p (unsafe_get a i) then Some i\n else loop (succ i) in\n loop 0\n\nlet find_map f a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n match f (unsafe_get a i) with\n | None -> loop (succ i)\n | Some _ as r -> r\n in\n loop 0\n\nlet find_mapi f a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n match f i (unsafe_get a i) with\n | None -> loop (succ i)\n | Some _ as r -> r\n in\n loop 0\n\nlet split x =\n if x = [||] then [||], [||]\n else begin\n let a0, b0 = unsafe_get x 0 in\n let n = length x in\n let a = create n a0 in\n let b = create n b0 in\n for i = 1 to n - 1 do\n let ai, bi = unsafe_get x i in\n unsafe_set a i ai;\n unsafe_set b i bi\n done;\n a, b\n end\n\nlet combine a b =\n let na = length a in\n let nb = length b in\n if na <> nb then invalid_arg \"Array.combine\";\n if na = 0 then [||]\n else begin\n let x = create na (unsafe_get a 0, unsafe_get b 0) in\n for i = 1 to na - 1 do\n unsafe_set x i (unsafe_get a i, unsafe_get b i)\n done;\n x\n end\n\nexception Bottom of int\nlet sort cmp a =\n let maxson l i =\n let i31 = i+i+i+1 in\n let x = ref i31 in\n if i31+2 < l then begin\n if cmp (get a i31) (get a (i31+1)) < 0 then x := i31+1;\n if cmp (get a !x) (get a (i31+2)) < 0 then x := i31+2;\n !x\n end else\n if i31+1 < l && cmp (get a i31) (get a (i31+1)) < 0\n then i31+1\n else if i31 < l then i31 else raise (Bottom i)\n in\n let rec trickledown l i e =\n let j = maxson l i in\n if cmp (get a j) e > 0 then begin\n set a i (get a j);\n trickledown l j e;\n end else begin\n set a i e;\n end;\n in\n let trickle l i e = try trickledown l i e with Bottom i -> set a i e in\n let rec bubbledown l i =\n let j = maxson l i in\n set a i (get a j);\n bubbledown l j\n in\n let bubble l i = try bubbledown l i with Bottom i -> i in\n let rec trickleup i e =\n let father = (i - 1) / 3 in\n assert (i <> father);\n if cmp (get a father) e < 0 then begin\n set a i (get a father);\n if father > 0 then trickleup father e else set a 0 e;\n end else begin\n set a i e;\n end;\n in\n let l = length a in\n for i = (l + 1) / 3 - 1 downto 0 do trickle l i (get a i); done;\n for i = l - 1 downto 2 do\n let e = (get a i) in\n set a i (get a 0);\n trickleup (bubble i 0) e;\n done;\n if l > 1 then (let e = (get a 1) in set a 1 (get a 0); set a 0 e)\n\n\nlet cutoff = 5\nlet stable_sort cmp a =\n let merge src1ofs src1len src2 src2ofs src2len dst dstofs =\n let src1r = src1ofs + src1len and src2r = src2ofs + src2len in\n let rec loop i1 s1 i2 s2 d =\n if cmp s1 s2 <= 0 then begin\n set dst d s1;\n let i1 = i1 + 1 in\n if i1 < src1r then\n loop i1 (get a i1) i2 s2 (d + 1)\n else\n blit src2 i2 dst (d + 1) (src2r - i2)\n end else begin\n set dst d s2;\n let i2 = i2 + 1 in\n if i2 < src2r then\n loop i1 s1 i2 (get src2 i2) (d + 1)\n else\n blit a i1 dst (d + 1) (src1r - i1)\n end\n in loop src1ofs (get a src1ofs) src2ofs (get src2 src2ofs) dstofs;\n in\n let isortto srcofs dst dstofs len =\n for i = 0 to len - 1 do\n let e = (get a (srcofs + i)) in\n let j = ref (dstofs + i - 1) in\n while (!j >= dstofs && cmp (get dst !j) e > 0) do\n set dst (!j + 1) (get dst !j);\n decr j;\n done;\n set dst (!j + 1) e;\n done;\n in\n let rec sortto srcofs dst dstofs len =\n if len <= cutoff then isortto srcofs dst dstofs len else begin\n let l1 = len / 2 in\n let l2 = len - l1 in\n sortto (srcofs + l1) dst (dstofs + l1) l2;\n sortto srcofs a (srcofs + l2) l1;\n merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;\n end;\n in\n let l = length a in\n if l <= cutoff then isortto 0 a 0 l else begin\n let l1 = l / 2 in\n let l2 = l - l1 in\n let t = make l2 (get a 0) in\n sortto l1 t 0 l2;\n sortto 0 a l2 l1;\n merge l2 l1 t 0 l2 a 0;\n end\n\n\nlet fast_sort = stable_sort\n\nlet shuffle ~rand a = (* Fisher-Yates *)\n for i = length a - 1 downto 1 do\n let j = rand (i + 1) in\n let v = unsafe_get a i in\n unsafe_set a i (get a j);\n unsafe_set a j v\n done\n\n(** {1 Iterators} *)\n\nlet to_seq a =\n let rec aux i () =\n if i < length a\n then\n let x = unsafe_get a i in\n Seq.Cons (x, aux (i+1))\n else Seq.Nil\n in\n aux 0\n\nlet to_seqi a =\n let rec aux i () =\n if i < length a\n then\n let x = unsafe_get a i in\n Seq.Cons ((i,x), aux (i+1))\n else Seq.Nil\n in\n aux 0\n\nlet of_rev_list = function\n [] -> [||]\n | hd::tl as l ->\n let len = list_length 0 l in\n let a = create len hd in\n let rec fill i = function\n [] -> a\n | hd::tl -> unsafe_set a i hd; fill (i-1) tl\n in\n fill (len-2) tl\n\nlet of_seq i =\n let l = Seq.fold_left (fun acc x -> x::acc) [] i in\n of_rev_list l\n"],"names":[],"mappings":"SCmesC,YAAM,C,aAAlC,SAAR,QAAQ,eAZQ,QACR,gCAEM,WACF,MAKR,eAJa,UACH,iBACI,UADJ,OACI,W,CAAA,wCAAiB,YAMtB,C,0BAlBQ,wB,WAHnB,mB,CAAA,+BAG4B,UADlB,oB,CAAA,gCACkB,IAAT,KAAjB,OAAiB,GAAS,KACvB,KAAO,C,EAEd,GAPA,KAOA,GAAK,C,0BAbY,wB,WAHf,mB,CAAA,+BAGwB,IADd,oB,CAAA,gCACK,KAAb,OAAa,GAAS,KACnB,KAAO,C,EAEd,GAPA,KAOA,GAAK,C,gBAjBL,W,CAAA,sCACE,KAAQ,mBACA,kB,CAAA,kCACO,O,CAAA,mCAAf,UAAe,c,CAAA,gCAAf,iDACA,gB,CAAA,wCAAgB,+BACd,C,KA3BF,UAAsB,oBAEpB,IAFuD,SAEvD,GACA,gCACA,QADyC,OACzC,YAAgC,0CAE/B,C,UAjBH,qBACE,SAAQ,a,CAAA,0D,CAAA,kCACR,UACA,mBAA2B,2FAAJ,WAAkB,UACtB,6FAAY,OAA7B,kGAA6B,YAG/B,yGAAkB,gCAChB,C,kBA5BJ,EAiBwC,uFAAxB,a,CAAA,mCAjBhB,yBAiBgB,oB,CAAA,gCAAe,Q,EAf1B,aAAS,UAQV,0FAAY,SAEZ,WACgB,uC,EAAd,SAA2B,MAAb,kDAAa,YAE3B,qCAZF,0FAAY,SAEZ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ACoB,kB,CAAA,gCAAH,iBAAf,iB,CAAA,wCAAmC,6BACjC,C,aAZJ,S,CAAA,yBACA,GACU,IAAW,Q,CAAA,6BAAF,eAAT,IACR,qBACmB,oB,CAAA,gCAAF,eAAf,mB,CAAA,wCAAkC,yBAEpC,GALY,SAMX,C,OAbH,S,CAAA,gC,CAAA,2BACE,wBAEA,O,CAAA,sCAAgD,oB,CAAA,kCAAjB,oB,CAAA,gCAAF,QAAmC,8BAAK,C,UANvE,S,CAAA,sCAA8B,kB,CAAA,gCAAD,gBAAiB,6BAAK,C,QANnD,iC,CAAA,oE,CAAA,mDAGK,YAA+B,MAD/B,uBAC+B,C,QARpC,iC,CAAA,mDAEK,UAAuB,IADvB,uBACuB,C,OAP5B,iC,CAAA,mDAEK,QAAoB,IADpB,uBACoB,C,MARzB,S,CAAA,yBACA,GACK,S,CAAA,0BACA,OADsB,cADZ,UAEO,C,MANtB,S,CAAA,yBAAoB,GAAwB,aAAV,SAA0B,C,UAf5D,YAAe,yBACL,EAAV,QAAU,IAEV,YAAe,sBAED,EAAU,aAAV,IACV,0BACmB,eAAjB,mB,CAAA,wCAAwB,yBAE1B,+CAGJ,EAAG,C,KAvBH,YAAe,yBACL,EAAV,QAAU,IACV,YAAe,sBAEM,QAAgB,+CAGrC,EAAG,C,aArBH,UAAc,SACd,eAKW,EAAS,mBAAT,IACV,uBACmB,mBAAjB,mB,CAAA,wCAAsB,yBAExB,GATa,yBASV,C","ignoreList":[0]}},{"offset":{"line":0,"column":149689},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/float.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* Nicolas Ojeda Bar, LexiFi *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nexternal neg : float -> float = \"%negfloat\"\nexternal add : float -> float -> float = \"%addfloat\"\nexternal sub : float -> float -> float = \"%subfloat\"\nexternal mul : float -> float -> float = \"%mulfloat\"\nexternal div : float -> float -> float = \"%divfloat\"\nexternal rem : float -> float -> float = \"caml_fmod_float\" \"fmod\"\n [@@unboxed] [@@noalloc]\nexternal fma : float -> float -> float -> float = \"caml_fma_float\" \"caml_fma\"\n [@@unboxed] [@@noalloc]\nexternal abs : float -> float = \"%absfloat\"\n\nlet zero = 0.\nlet one = 1.\nlet minus_one = -1.\nlet infinity = Stdlib.infinity\nlet neg_infinity = Stdlib.neg_infinity\nlet nan = Stdlib.nan\nlet quiet_nan = nan\nexternal float_of_bits : int64 -> float\n = \"caml_int64_float_of_bits\" \"caml_int64_float_of_bits_unboxed\"\n [@@unboxed] [@@noalloc]\nlet signaling_nan = float_of_bits 0x7F_F0_00_00_00_00_00_01L\nlet is_finite (x: float) = x -. x = 0.\nlet is_infinite (x: float) = 1. /. x = 0.\nlet is_nan (x: float) = x <> x\n\nlet pi = 0x1.921fb54442d18p+1\nlet max_float = Stdlib.max_float\nlet min_float = Stdlib.min_float\nlet epsilon = Stdlib.epsilon_float\nexternal of_int : int -> float = \"%floatofint\"\nexternal to_int : float -> int = \"%intoffloat\"\nexternal of_string : string -> float = \"caml_float_of_string\"\nlet of_string_opt = Stdlib.float_of_string_opt\nlet to_string = Stdlib.string_of_float\ntype fpclass = Stdlib.fpclass =\n FP_normal\n | FP_subnormal\n | FP_zero\n | FP_infinite\n | FP_nan\nexternal classify_float : (float [@unboxed]) -> fpclass =\n \"caml_classify_float\" \"caml_classify_float_unboxed\" [@@noalloc]\nexternal pow : float -> float -> float = \"caml_power_float\" \"pow\"\n [@@unboxed] [@@noalloc]\nexternal sqrt : float -> float = \"caml_sqrt_float\" \"sqrt\"\n [@@unboxed] [@@noalloc]\nexternal cbrt : float -> float = \"caml_cbrt_float\" \"caml_cbrt\"\n [@@unboxed] [@@noalloc]\nexternal exp : float -> float = \"caml_exp_float\" \"exp\" [@@unboxed] [@@noalloc]\nexternal exp2 : float -> float = \"caml_exp2_float\" \"caml_exp2\"\n [@@unboxed] [@@noalloc]\nexternal log : float -> float = \"caml_log_float\" \"log\" [@@unboxed] [@@noalloc]\nexternal log10 : float -> float = \"caml_log10_float\" \"log10\"\n [@@unboxed] [@@noalloc]\nexternal log2 : float -> float = \"caml_log2_float\" \"caml_log2\"\n [@@unboxed] [@@noalloc]\nexternal expm1 : float -> float = \"caml_expm1_float\" \"caml_expm1\"\n [@@unboxed] [@@noalloc]\nexternal log1p : float -> float = \"caml_log1p_float\" \"caml_log1p\"\n [@@unboxed] [@@noalloc]\nexternal cos : float -> float = \"caml_cos_float\" \"cos\" [@@unboxed] [@@noalloc]\nexternal sin : float -> float = \"caml_sin_float\" \"sin\" [@@unboxed] [@@noalloc]\nexternal tan : float -> float = \"caml_tan_float\" \"tan\" [@@unboxed] [@@noalloc]\nexternal acos : float -> float = \"caml_acos_float\" \"acos\"\n [@@unboxed] [@@noalloc]\nexternal asin : float -> float = \"caml_asin_float\" \"asin\"\n [@@unboxed] [@@noalloc]\nexternal atan : float -> float = \"caml_atan_float\" \"atan\"\n [@@unboxed] [@@noalloc]\nexternal atan2 : float -> float -> float = \"caml_atan2_float\" \"atan2\"\n [@@unboxed] [@@noalloc]\nexternal hypot : float -> float -> float\n = \"caml_hypot_float\" \"caml_hypot\" [@@unboxed] [@@noalloc]\nexternal cosh : float -> float = \"caml_cosh_float\" \"cosh\"\n [@@unboxed] [@@noalloc]\nexternal sinh : float -> float = \"caml_sinh_float\" \"sinh\"\n [@@unboxed] [@@noalloc]\nexternal tanh : float -> float = \"caml_tanh_float\" \"tanh\"\n [@@unboxed] [@@noalloc]\nexternal acosh : float -> float = \"caml_acosh_float\" \"caml_acosh\"\n [@@unboxed] [@@noalloc]\nexternal asinh : float -> float = \"caml_asinh_float\" \"caml_asinh\"\n [@@unboxed] [@@noalloc]\nexternal atanh : float -> float = \"caml_atanh_float\" \"caml_atanh\"\n [@@unboxed] [@@noalloc]\nexternal erf : float -> float = \"caml_erf_float\" \"caml_erf\"\n [@@unboxed] [@@noalloc]\nexternal erfc : float -> float = \"caml_erfc_float\" \"caml_erfc\"\n [@@unboxed] [@@noalloc]\nexternal trunc : float -> float = \"caml_trunc_float\" \"caml_trunc\"\n [@@unboxed] [@@noalloc]\nexternal round : float -> float = \"caml_round_float\" \"caml_round\"\n [@@unboxed] [@@noalloc]\nexternal ceil : float -> float = \"caml_ceil_float\" \"ceil\"\n [@@unboxed] [@@noalloc]\nexternal floor : float -> float = \"caml_floor_float\" \"floor\"\n[@@unboxed] [@@noalloc]\n\nlet is_integer x = x = trunc x && is_finite x\n\nexternal next_after : float -> float -> float\n = \"caml_nextafter_float\" \"caml_nextafter\" [@@unboxed] [@@noalloc]\n\nlet succ x = next_after x infinity\nlet pred x = next_after x neg_infinity\n\nexternal copy_sign : float -> float -> float\n = \"caml_copysign_float\" \"caml_copysign\"\n [@@unboxed] [@@noalloc]\nexternal sign_bit : (float [@unboxed]) -> bool\n = \"caml_signbit_float\" \"caml_signbit\" [@@noalloc]\n\nexternal frexp : float -> float * int = \"caml_frexp_float\"\nexternal ldexp : (float [@unboxed]) -> (int [@untagged]) -> (float [@unboxed]) =\n \"caml_ldexp_float\" \"caml_ldexp_float_unboxed\" [@@noalloc]\nexternal modf : float -> float * float = \"caml_modf_float\"\ntype t = float\nexternal compare : float -> float -> int = \"%compare\"\nlet equal x y = compare x y = 0\n\nlet[@inline] min (x: float) (y: float) =\n if y > x || (not(sign_bit y) && sign_bit x) then\n if is_nan y then y else x\n else if is_nan x then x else y\n\nlet[@inline] max (x: float) (y: float) =\n if y > x || (not(sign_bit y) && sign_bit x) then\n if is_nan x then x else y\n else if is_nan y then y else x\n\nlet[@inline] min_max (x: float) (y: float) =\n if is_nan x || is_nan y then (nan, nan)\n else if y > x || (not(sign_bit y) && sign_bit x) then (x, y) else (y, x)\n\nlet[@inline] min_num (x: float) (y: float) =\n if y > x || (not(sign_bit y) && sign_bit x) then\n if is_nan x then y else x\n else if is_nan y then x else y\n\nlet[@inline] max_num (x: float) (y: float) =\n if y > x || (not(sign_bit y) && sign_bit x) then\n if is_nan y then x else y\n else if is_nan x then y else x\n\nlet[@inline] min_max_num (x: float) (y: float) =\n if is_nan x then (y,y)\n else if is_nan y then (x,x)\n else if y > x || (not(sign_bit y) && sign_bit x) then (x,y) else (y,x)\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n\nmodule Array = struct\n\n type t = floatarray\n\n external length : t -> int = \"%floatarray_length\"\n external get : t -> int -> float = \"%floatarray_safe_get\"\n external set : t -> int -> float -> unit = \"%floatarray_safe_set\"\n external create : int -> t = \"caml_floatarray_create\"\n external unsafe_get : t -> int -> float = \"%floatarray_unsafe_get\"\n external unsafe_set : t -> int -> float -> unit = \"%floatarray_unsafe_set\"\n\n let unsafe_fill a ofs len v =\n for i = ofs to ofs + len - 1 do unsafe_set a i v done\n\n external unsafe_blit: t -> int -> t -> int -> int -> unit =\n \"caml_floatarray_blit\" [@@noalloc]\n\n let check a ofs len msg =\n if ofs < 0 || len < 0 || ofs + len < 0 || ofs + len > length a then\n invalid_arg msg\n\n let make n v =\n let result = create n in\n unsafe_fill result 0 n v;\n result\n\n let init l f =\n if l < 0 then invalid_arg \"Float.Array.init\"\n else\n let res = create l in\n for i = 0 to l - 1 do\n unsafe_set res i (f i)\n done;\n res\n\n let make_matrix sx sy v =\n (* We raise even if [sx = 0 && sy < 0]: *)\n if sy < 0 then invalid_arg \"Float.Array.make_matrix\";\n let res = Array.make sx (create 0) in\n if sy > 0 then begin\n for x = 0 to sx - 1 do\n Array.unsafe_set res x (make sy v)\n done;\n end;\n res\n\n let init_matrix sx sy f =\n (* We raise even if [sx = 0 && sy < 0]: *)\n if sy < 0 then invalid_arg \"Float.Array.init_matrix\";\n let res = Array.make sx (create 0) in\n if sy > 0 then begin\n for x = 0 to sx - 1 do\n let row = create sy in\n for y = 0 to sy - 1 do\n unsafe_set row y (f x y)\n done;\n Array.unsafe_set res x row\n done;\n end;\n res\n\n let append a1 a2 =\n let l1 = length a1 in\n let l2 = length a2 in\n let result = create (l1 + l2) in\n unsafe_blit a1 0 result 0 l1;\n unsafe_blit a2 0 result l1 l2;\n result\n\n (* next 3 functions: modified copy of code from string.ml *)\n let ensure_ge (x:int) y =\n if x >= y then x else invalid_arg \"Float.Array.concat\"\n\n let rec sum_lengths acc = function\n | [] -> acc\n | hd :: tl -> sum_lengths (ensure_ge (length hd + acc) acc) tl\n\n let concat l =\n let len = sum_lengths 0 l in\n let result = create len in\n let rec loop l i =\n match l with\n | [] -> assert (i = len)\n | hd :: tl ->\n let hlen = length hd in\n unsafe_blit hd 0 result i hlen;\n loop tl (i + hlen)\n in\n loop l 0;\n result\n\n let sub a ofs len =\n check a ofs len \"Float.Array.sub\";\n let result = create len in\n unsafe_blit a ofs result 0 len;\n result\n\n let copy a =\n let l = length a in\n let result = create l in\n unsafe_blit a 0 result 0 l;\n result\n\n let fill a ofs len v =\n check a ofs len \"Float.Array.fill\";\n unsafe_fill a ofs len v\n\n let blit src sofs dst dofs len =\n check src sofs len \"Float.array.blit\";\n check dst dofs len \"Float.array.blit\";\n unsafe_blit src sofs dst dofs len\n\n let to_list a =\n List.init (length a) (unsafe_get a)\n\n let of_list l =\n let result = create (List.length l) in\n let rec fill i l =\n match l with\n | [] -> result\n | h :: t -> unsafe_set result i h; fill (i + 1) t\n in\n fill 0 l\n\n (* duplicated from array.ml *)\n let iter f a =\n for i = 0 to length a - 1 do f (unsafe_get a i) done\n\n (* duplicated from array.ml *)\n let iter2 f a b =\n if length a <> length b then\n invalid_arg \"Float.Array.iter2: arrays must have the same length\"\n else\n for i = 0 to length a - 1 do f (unsafe_get a i) (unsafe_get b i) done\n\n let map f a =\n let l = length a in\n let r = create l in\n for i = 0 to l - 1 do\n unsafe_set r i (f (unsafe_get a i))\n done;\n r\n\n (* duplicated from array.ml *)\n let map_inplace f a =\n for i = 0 to length a - 1 do\n unsafe_set a i (f (unsafe_get a i))\n done\n\n let map2 f a b =\n let la = length a in\n let lb = length b in\n if la <> lb then\n invalid_arg \"Float.Array.map2: arrays must have the same length\"\n else begin\n let r = create la in\n for i = 0 to la - 1 do\n unsafe_set r i (f (unsafe_get a i) (unsafe_get b i))\n done;\n r\n end\n\n (* duplicated from array.ml *)\n let iteri f a =\n for i = 0 to length a - 1 do f i (unsafe_get a i) done\n\n let mapi f a =\n let l = length a in\n let r = create l in\n for i = 0 to l - 1 do\n unsafe_set r i (f i (unsafe_get a i))\n done;\n r\n\n (* duplicated from array.ml *)\n let mapi_inplace f a =\n for i = 0 to length a - 1 do\n unsafe_set a i (f i (unsafe_get a i))\n done\n\n (* duplicated from array.ml *)\n let fold_left f x a =\n let r = ref x in\n for i = 0 to length a - 1 do\n r := f !r (unsafe_get a i)\n done;\n !r\n\n (* duplicated from array.ml *)\n let fold_right f a x =\n let r = ref x in\n for i = length a - 1 downto 0 do\n r := f (unsafe_get a i) !r\n done;\n !r\n\n (* duplicated from array.ml *)\n let exists p a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if p (unsafe_get a i) then true\n else loop (i + 1) in\n loop 0\n\n (* duplicated from array.ml *)\n let for_all p a =\n let n = length a in\n let rec loop i =\n if i = n then true\n else if p (unsafe_get a i) then loop (i + 1)\n else false in\n loop 0\n\n (* duplicated from array.ml *)\n let mem x a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if compare (unsafe_get a i) x = 0 then true\n else loop (i + 1)\n in\n loop 0\n\n (* mostly duplicated from array.ml, but slightly different *)\n let mem_ieee x a =\n let n = length a in\n let rec loop i =\n if i = n then false\n else if x = (unsafe_get a i) then true\n else loop (i + 1)\n in\n loop 0\n\n (* duplicated from array.ml *)\n let find_opt p a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n let x = unsafe_get a i in\n if p x then Some x\n else loop (i + 1)\n in\n loop 0\n\n (* duplicated from array.ml *)\n let find_index p a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else if p (unsafe_get a i) then Some i\n else loop (i + 1) in\n loop 0\n\n (* duplicated from array.ml *)\n let find_map f a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n match f (unsafe_get a i) with\n | None -> loop (i + 1)\n | Some _ as r -> r\n in\n loop 0\n\n (* duplicated from array.ml *)\n let find_mapi f a =\n let n = length a in\n let rec loop i =\n if i = n then None\n else\n match f i (unsafe_get a i) with\n | None -> loop (i + 1)\n | Some _ as r -> r\n in\n loop 0\n\n (* duplicated from array.ml *)\n exception Bottom of int\n let sort cmp a =\n let maxson l i =\n let i31 = i+i+i+1 in\n let x = ref i31 in\n if i31+2 < l then begin\n if cmp (get a i31) (get a (i31+1)) < 0 then x := i31+1;\n if cmp (get a !x) (get a (i31+2)) < 0 then x := i31+2;\n !x\n end else\n if i31+1 < l && cmp (get a i31) (get a (i31+1)) < 0\n then i31+1\n else if i31 < l then i31 else raise (Bottom i)\n in\n let rec trickledown l i e =\n let j = maxson l i in\n if cmp (get a j) e > 0 then begin\n set a i (get a j);\n trickledown l j e;\n end else begin\n set a i e;\n end;\n in\n let trickle l i e = try trickledown l i e with Bottom i -> set a i e in\n let rec bubbledown l i =\n let j = maxson l i in\n set a i (get a j);\n bubbledown l j\n in\n let bubble l i = try bubbledown l i with Bottom i -> i in\n let rec trickleup i e =\n let father = (i - 1) / 3 in\n assert (i <> father);\n if cmp (get a father) e < 0 then begin\n set a i (get a father);\n if father > 0 then trickleup father e else set a 0 e;\n end else begin\n set a i e;\n end;\n in\n let l = length a in\n for i = (l + 1) / 3 - 1 downto 0 do trickle l i (get a i); done;\n for i = l - 1 downto 2 do\n let e = (get a i) in\n set a i (get a 0);\n trickleup (bubble i 0) e;\n done;\n if l > 1 then (let e = (get a 1) in set a 1 (get a 0); set a 0 e)\n\n (* duplicated from array.ml, except for the call to [create] *)\n let cutoff = 5\n let stable_sort cmp a =\n let merge src1ofs src1len src2 src2ofs src2len dst dstofs =\n let src1r = src1ofs + src1len and src2r = src2ofs + src2len in\n let rec loop i1 s1 i2 s2 d =\n if cmp s1 s2 <= 0 then begin\n set dst d s1;\n let i1 = i1 + 1 in\n if i1 < src1r then\n loop i1 (get a i1) i2 s2 (d + 1)\n else\n blit src2 i2 dst (d + 1) (src2r - i2)\n end else begin\n set dst d s2;\n let i2 = i2 + 1 in\n if i2 < src2r then\n loop i1 s1 i2 (get src2 i2) (d + 1)\n else\n blit a i1 dst (d + 1) (src1r - i1)\n end\n in loop src1ofs (get a src1ofs) src2ofs (get src2 src2ofs) dstofs;\n in\n let isortto srcofs dst dstofs len =\n for i = 0 to len - 1 do\n let e = (get a (srcofs + i)) in\n let j = ref (dstofs + i - 1) in\n while (!j >= dstofs && cmp (get dst !j) e > 0) do\n set dst (!j + 1) (get dst !j);\n decr j;\n done;\n set dst (!j + 1) e;\n done;\n in\n let rec sortto srcofs dst dstofs len =\n if len <= cutoff then isortto srcofs dst dstofs len else begin\n let l1 = len / 2 in\n let l2 = len - l1 in\n sortto (srcofs + l1) dst (dstofs + l1) l2;\n sortto srcofs a (srcofs + l2) l1;\n merge (srcofs + l2) l1 dst (dstofs + l1) l2 dst dstofs;\n end;\n in\n let l = length a in\n if l <= cutoff then isortto 0 a 0 l else begin\n let l1 = l / 2 in\n let l2 = l - l1 in\n let t = create l2 in\n sortto l1 t 0 l2;\n sortto 0 a l2 l1;\n merge l2 l1 t 0 l2 a 0;\n end\n\n let fast_sort = stable_sort\n\n (* duplicated from array.ml *)\n let shuffle ~rand a = (* Fisher-Yates *)\n for i = length a - 1 downto 1 do\n let j = rand (i + 1) in\n let v = unsafe_get a i in\n unsafe_set a i (get a j);\n unsafe_set a j v\n done\n\n (* duplicated from array.ml *)\n let to_seq a =\n let rec aux i () =\n if i < length a\n then\n let x = unsafe_get a i in\n Seq.Cons (x, aux (i+1))\n else Seq.Nil\n in\n aux 0\n\n (* duplicated from array.ml *)\n let to_seqi a =\n let rec aux i () =\n if i < length a\n then\n let x = unsafe_get a i in\n Seq.Cons ((i,x), aux (i+1))\n else Seq.Nil\n in\n aux 0\n\n (* mostly duplicated from array.ml *)\n let of_rev_list l =\n let len = List.length l in\n let a = create len in\n let rec fill i = function\n [] -> a\n | hd::tl -> unsafe_set a i hd; fill (i-1) tl\n in\n fill (len-1) l\n\n (* duplicated from array.ml *)\n let of_seq i =\n let l = Seq.fold_left (fun acc x -> x::acc) [] i in\n of_rev_list l\n\n\n let map_to_array f a =\n let l = length a in\n if l = 0 then [| |] else begin\n let r = Array.make l (f (unsafe_get a 0)) in\n for i = 1 to l - 1 do\n Array.unsafe_set r i (f (unsafe_get a i))\n done;\n r\n end\n\n let map_from_array f a =\n let l = Array.length a in\n let r = create l in\n for i = 0 to l - 1 do\n unsafe_set r i (f (Array.unsafe_get a i))\n done;\n r\n\nend\n\nmodule ArrayLabels = Array\n"],"names":[],"mappings":"iNCqmBI,S,CAAA,yBACQ,MACR,qBACoB,kB,CAAA,gCAAH,iBAAf,yBAAyC,yBAE3C,EAAC,C,aAfD,S,CAAA,yBACA,GACU,IAAgB,aAAH,eAAb,IACR,qBAC0B,mBAAH,eAArB,mB,CAAA,wCAAyC,yBAE3C,GALY,SAMX,C,EAZiC,YAAM,C,WAAlC,SAAR,QAAQ,eAVR,QAAU,eACF,IAKR,eAJa,UACH,iBACI,aADJ,OACI,UAAiB,WAOlB,C,0BAlBQ,wB,QAHnB,mB,CAAA,+BAG4B,UADlB,mBACkB,IAAT,KAAjB,OAAiB,GAAS,KACvB,KAAO,C,EAEd,GAPA,KAOA,GAAK,C,0BAdY,wB,QAHf,mB,CAAA,+BAGwB,IADd,mBACK,KAAb,OAAa,GAAS,KACnB,KAAO,C,EAEd,GAPA,KAOA,GAAK,C,kBAhBL,W,CAAA,sCACE,KAAQ,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EADhB,eAA+B,C,MAhIhC,kBA0HX,GAAM,aA1HK,kBA2HN,GAAM,aACjB,qB,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAAkB,eAAX,cAAgB,C,KAPtE,uB,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAEpB,EAAO,OAvHP,aAuHN,IAAa,GADV,EAAO,KAtHJ,aAsHT,IACiB,C,KAP9B,uB,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAEpB,EAAO,KAlHP,aAkHN,IAAa,GADV,EAAO,OAjHJ,aAiHT,IACiB,C,UAlHR,kBA4GX,EA5GW,kBA4GC,EAClB,a,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAAmB,eAAZ,eADzB,IA5GP,QA4GO,cAC2C,C,KANxE,uB,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAEpB,KAAO,EAzGP,aAyGN,IAAa,GADV,OAAO,EAxGJ,aAwGT,IACiB,C,KAP9B,uB,CAAA,E,EAAgB,WAAY,EAAI,WAAU,GAEpB,OAAO,EApGP,aAoGN,IAAa,GADV,KAAO,EAnGJ,aAmGT,IACiB,C,EALhB,uBAAe,C,EAdlB,8BAAyB,C,OANf,YAAO,2BAAe,C,KA3ErB,oBAAM,C,EADD,mBAAO,YAAK,C,KADd,kBAAM,YAAK,C,cADsB,MDrC5D,SCqC4D,qBDrC5D,SCqC4D,MDrC5D,SCqC4D,oZ","ignoreList":[0]}},{"offset":{"line":0,"column":160320},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/int32.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Int32]: 32-bit integers *)\n\nexternal neg : int32 -> int32 = \"%int32_neg\"\nexternal add : int32 -> int32 -> int32 = \"%int32_add\"\nexternal sub : int32 -> int32 -> int32 = \"%int32_sub\"\nexternal mul : int32 -> int32 -> int32 = \"%int32_mul\"\nexternal div : int32 -> int32 -> int32 = \"%int32_div\"\nexternal rem : int32 -> int32 -> int32 = \"%int32_mod\"\nexternal logand : int32 -> int32 -> int32 = \"%int32_and\"\nexternal logor : int32 -> int32 -> int32 = \"%int32_or\"\nexternal logxor : int32 -> int32 -> int32 = \"%int32_xor\"\nexternal shift_left : int32 -> int -> int32 = \"%int32_lsl\"\nexternal shift_right : int32 -> int -> int32 = \"%int32_asr\"\nexternal shift_right_logical : int32 -> int -> int32 = \"%int32_lsr\"\nexternal of_int : int -> int32 = \"%int32_of_int\"\nexternal to_int : int32 -> int = \"%int32_to_int\"\nexternal of_float : float -> int32\n = \"caml_int32_of_float\" \"caml_int32_of_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal to_float : int32 -> float\n = \"caml_int32_to_float\" \"caml_int32_to_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal bits_of_float : float -> int32\n = \"caml_int32_bits_of_float\" \"caml_int32_bits_of_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal float_of_bits : int32 -> float\n = \"caml_int32_float_of_bits\" \"caml_int32_float_of_bits_unboxed\"\n [@@unboxed] [@@noalloc]\n\nlet zero = 0l\nlet one = 1l\nlet minus_one = -1l\nlet succ n = add n 1l\nlet pred n = sub n 1l\nlet abs n = if n >= 0l then n else neg n\nlet min_int = 0x80000000l\nlet max_int = 0x7FFFFFFFl\nlet lognot n = logxor n (-1l)\n\nlet unsigned_to_int =\n match Sys.word_size with\n | 32 ->\n let max_int = of_int Stdlib.max_int in\n fun n ->\n if n >= 0l && n <= max_int then\n Some (to_int n)\n else\n None\n | 64 ->\n (* So that it compiles in 32-bit *)\n let mask = 0xFFFF lsl 16 lor 0xFFFF in\n fun n -> Some (to_int n land mask)\n | _ ->\n assert false\n\nexternal format : string -> int32 -> string = \"caml_int32_format\"\nlet to_string n = format \"%d\" n\n\nexternal of_string : string -> int32 = \"caml_int32_of_string\"\n\nlet of_string_opt s =\n try Some (of_string s)\n with Failure _ -> None\n\ntype t = int32\n\nlet compare (x: t) (y: t) = Stdlib.compare x y\nlet equal (x: t) (y: t) = x = y\n\nlet unsigned_compare n m =\n compare (sub n min_int) (sub m min_int)\n\nlet unsigned_lt n m =\n sub n min_int < sub m min_int\n\nlet min x y : t = if x <= y then x else y\nlet max x y : t = if x >= y then x else y\n\n(* Unsigned division from signed division of the same bitness.\n See Warren Jr., Henry S. (2013). Hacker's Delight (2 ed.), Sec 9-3.\n*)\nlet unsigned_div n d =\n if d < zero then\n if unsigned_lt n d then zero else one\n else\n let q = shift_left (div (shift_right_logical n 1) d) 1 in\n let r = sub n (mul q d) in\n if unsigned_lt r d then q else succ q\n\nlet unsigned_rem n d =\n sub n (mul (unsigned_div n d) d)\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n","(* generated code *)"],"names":[],"mappings":"EAoDe,kBAAc,C,EAHd,OAAO,GAAM,GAAO,mBAAK,C,EAD3B,kBAAQ,C,EADR,kBAAQ,C,EAmBN,oBAAyB,C,MAP7B,eAAO,EAAI,WAAY,EACxB,uBAEA,IAAI,C,EAgDD,iBAA4B,C,EADhB,eAA+B,C,IAJ3C,WAAL,qBAAN,kBAAgC,C,SAR7B,OAAQ,EACe,GAAU,GAVpB,iBAAhB,kBAUoB,KAAgB,EAEf,c,EAZL,aAaN,YADA,EAAgB,SAAL,E,EAAA,qBAAX,QACM,eAAN,CAbV,QAcoB,IAAM,GAvDf,eAAQ,MAuDoB,C,EAXR,EAAO,EAAnB,MAAM,IAAc,C,EADR,EAAO,EAAnB,MAAM,IAAc,C,EAL/B,iBAAgB,iBAJE,EAAkB,EAIL,C,EAHf,MAAK,G,EADH,sBAAkB,G,KAL5C,OAAsB,IAAb,IAAa,O,AAAA,I,AAAA,G,EAAA,KC5ExB,0DD6EoB,UAAI,C,EANN,OAAa,C,MAHzB,qCCpEN,kBD0DM,GADc,EAAd,OAAc,QACd,gBAQA,IAEA,wD,ECpEN,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":161246},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/int64.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Int64]: 64-bit integers *)\n\nexternal neg : int64 -> int64 = \"%int64_neg\"\nexternal add : int64 -> int64 -> int64 = \"%int64_add\"\nexternal sub : int64 -> int64 -> int64 = \"%int64_sub\"\nexternal mul : int64 -> int64 -> int64 = \"%int64_mul\"\nexternal div : int64 -> int64 -> int64 = \"%int64_div\"\nexternal rem : int64 -> int64 -> int64 = \"%int64_mod\"\nexternal logand : int64 -> int64 -> int64 = \"%int64_and\"\nexternal logor : int64 -> int64 -> int64 = \"%int64_or\"\nexternal logxor : int64 -> int64 -> int64 = \"%int64_xor\"\nexternal shift_left : int64 -> int -> int64 = \"%int64_lsl\"\nexternal shift_right : int64 -> int -> int64 = \"%int64_asr\"\nexternal shift_right_logical : int64 -> int -> int64 = \"%int64_lsr\"\nexternal of_int : int -> int64 = \"%int64_of_int\"\nexternal to_int : int64 -> int = \"%int64_to_int\"\nexternal of_float : float -> int64\n = \"caml_int64_of_float\" \"caml_int64_of_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal to_float : int64 -> float\n = \"caml_int64_to_float\" \"caml_int64_to_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal of_int32 : int32 -> int64 = \"%int64_of_int32\"\nexternal to_int32 : int64 -> int32 = \"%int64_to_int32\"\nexternal of_nativeint : nativeint -> int64 = \"%int64_of_nativeint\"\nexternal to_nativeint : int64 -> nativeint = \"%int64_to_nativeint\"\n\nlet zero = 0L\nlet one = 1L\nlet minus_one = -1L\nlet succ n = add n 1L\nlet pred n = sub n 1L\nlet abs n = if n >= 0L then n else neg n\nlet min_int = 0x8000000000000000L\nlet max_int = 0x7FFFFFFFFFFFFFFFL\nlet lognot n = logxor n (-1L)\n\nlet unsigned_to_int =\n let max_int = of_int Stdlib.max_int in\n fun n ->\n if n >= 0L && n <= max_int then\n Some (to_int n)\n else\n None\n\nexternal format : string -> int64 -> string = \"caml_int64_format\"\nlet to_string n = format \"%d\" n\n\nexternal of_string : string -> int64 = \"caml_int64_of_string\"\n\nlet of_string_opt s =\n try Some (of_string s)\n with Failure _ -> None\n\nexternal bits_of_float : float -> int64\n = \"caml_int64_bits_of_float\" \"caml_int64_bits_of_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal float_of_bits : int64 -> float\n = \"caml_int64_float_of_bits\" \"caml_int64_float_of_bits_unboxed\"\n [@@unboxed] [@@noalloc]\n\ntype t = int64\n\nlet compare (x: t) (y: t) = Stdlib.compare x y\nlet equal (x: t) (y: t) = x = y\n\nlet unsigned_compare n m =\n compare (sub n min_int) (sub m min_int)\n\nlet unsigned_lt n m =\n sub n min_int < sub m min_int\n\nlet min x y : t = if x <= y then x else y\nlet max x y : t = if x >= y then x else y\n\n(* Unsigned division from signed division of the same bitness.\n See Warren Jr., Henry S. (2013). Hacker's Delight (2 ed.), Sec 9-3.\n*)\nlet unsigned_div n d =\n if d < zero then\n if unsigned_lt n d then zero else one\n else\n let q = shift_left (div (shift_right_logical n 1) d) 1 in\n let r = sub n (mul q d) in\n if unsigned_lt r d then q else succ q\n\nlet unsigned_rem n d =\n sub n (mul (unsigned_div n d) d)\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n","(* generated code *)"],"names":[],"mappings":"EA2Ga,iBAA4B,C,EADhB,eAA+B,C,IAJ3C,WAAL,qBAAN,kBAAgC,C,SAR7B,OAAQ,EACe,GAAU,GAVpB,sBAAhB,uBAUoB,KAAgB,EAEf,c,KAZL,kBAaN,YADA,EAAgB,SAAL,E,EAAA,0BAAX,QACM,eAAN,CAbV,aAcoB,IAAM,GAtDf,eAAQ,MAsDoB,C,EAXR,EAAO,EAAnB,MAAM,IAAc,C,EADR,EAAO,EAAnB,MAAM,IAAc,C,EAL/B,sBAAgB,sBAJE,EAAkB,EAIL,C,EAHf,MAAK,G,EADH,sBAAkB,G,KAZ5C,OAAsB,IAAb,IAAa,O,AAAA,I,AAAA,G,EAAA,KClExB,0DDmEoB,UAAI,C,EANN,OAAa,C,MANxB,eAAO,EAAI,WAAY,EACxB,wBAEA,IAAI,C,EARK,kBAAc,C,EAHd,OAAO,GAAM,GAAO,mBAAK,C,EAD3B,kBAAQ,C,EADR,kBAAQ,C,EASnB,wCADc,ECrDhB,ODqDgB,SACd,2C,ECtDF,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":162134},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/nativeint.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Nativeint]: processor-native integers *)\n\nexternal neg: nativeint -> nativeint = \"%nativeint_neg\"\nexternal add: nativeint -> nativeint -> nativeint = \"%nativeint_add\"\nexternal sub: nativeint -> nativeint -> nativeint = \"%nativeint_sub\"\nexternal mul: nativeint -> nativeint -> nativeint = \"%nativeint_mul\"\nexternal div: nativeint -> nativeint -> nativeint = \"%nativeint_div\"\nexternal rem: nativeint -> nativeint -> nativeint = \"%nativeint_mod\"\nexternal logand: nativeint -> nativeint -> nativeint = \"%nativeint_and\"\nexternal logor: nativeint -> nativeint -> nativeint = \"%nativeint_or\"\nexternal logxor: nativeint -> nativeint -> nativeint = \"%nativeint_xor\"\nexternal shift_left: nativeint -> int -> nativeint = \"%nativeint_lsl\"\nexternal shift_right: nativeint -> int -> nativeint = \"%nativeint_asr\"\nexternal shift_right_logical: nativeint -> int -> nativeint = \"%nativeint_lsr\"\nexternal of_int: int -> nativeint = \"%nativeint_of_int\"\nexternal to_int: nativeint -> int = \"%nativeint_to_int\"\nexternal of_float : float -> nativeint\n = \"caml_nativeint_of_float\" \"caml_nativeint_of_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal to_float : nativeint -> float\n = \"caml_nativeint_to_float\" \"caml_nativeint_to_float_unboxed\"\n [@@unboxed] [@@noalloc]\nexternal of_int32: int32 -> nativeint = \"%nativeint_of_int32\"\nexternal to_int32: nativeint -> int32 = \"%nativeint_to_int32\"\n\nlet zero = 0n\nlet one = 1n\nlet minus_one = -1n\nlet succ n = add n 1n\nlet pred n = sub n 1n\nlet abs n = if n >= 0n then n else neg n\nlet size = Sys.word_size\nlet min_int = shift_left 1n (size - 1)\nlet max_int = sub min_int 1n\nlet lognot n = logxor n (-1n)\n\nlet unsigned_to_int =\n let max_int = of_int Stdlib.max_int in\n fun n ->\n if n >= 0n && n <= max_int then\n Some (to_int n)\n else\n None\n\nexternal format : string -> nativeint -> string = \"caml_nativeint_format\"\nlet to_string n = format \"%d\" n\n\nexternal of_string: string -> nativeint = \"caml_nativeint_of_string\"\n\nlet of_string_opt s =\n try Some (of_string s)\n with Failure _ -> None\n\ntype t = nativeint\n\nlet compare (x: t) (y: t) = Stdlib.compare x y\nlet equal (x: t) (y: t) = compare x y = 0\n\nlet unsigned_compare n m =\n compare (sub n min_int) (sub m min_int)\n\nlet unsigned_lt n m =\n sub n min_int < sub m min_int\n\nlet min x y : t = if x <= y then x else y\nlet max x y : t = if x >= y then x else y\n\n(* Unsigned division from signed division of the same bitness.\n See Warren Jr., Henry S. (2013). Hacker's Delight (2 ed.), Sec 9-3.\n*)\nlet unsigned_div n d =\n if d < zero then\n if unsigned_lt n d then zero else one\n else\n let q = shift_left (div (shift_right_logical n 1) d) 1 in\n let r = sub n (mul q d) in\n if unsigned_lt r d then q else succ q\n\nlet unsigned_rem n d =\n sub n (mul (unsigned_div n d) d)\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\nlet hash x = seeded_hash_param 10 100 0 x\n","(* generated code *)"],"names":[],"mappings":"EAmGa,iBAA4B,C,EADhB,eAA+B,C,IAJ3C,kBAAL,qBAAN,kBAAgC,C,aAR7B,eAAQ,EACe,GAAU,GAVpB,sBAAhB,uBAUoB,KAAgB,EAEf,c,EAZL,kBAaN,YADA,EAAgB,SAAL,E,EAAA,qBAAX,QACM,eAAN,CAbV,aAcoB,IAAM,GAhDf,eAAQ,MAgDoB,C,EAXR,EAAO,EAAnB,MAAM,IAAc,C,EADR,EAAO,EAAnB,MAAM,IAAc,C,MAL/B,UAAgB,QAAhB,UAAgB,sBAJE,EAAkB,EAIL,C,EAJb,sBACS,GAAI,C,EADb,sBAAkB,G,KAL5C,OAAsB,IAAb,IAAa,O,AAAA,I,AAAA,G,EAAA,KCjExB,0DDkEoB,UAAI,C,EANN,OAAa,C,MANxB,eAAO,EAAI,WAAY,EACxB,uBAEA,IAAI,C,EARK,kBAAc,C,EAJd,OAAO,GAAM,GAAO,mBAAK,C,EAD3B,kBAAQ,C,EADR,kBAAQ,C,cAUnB,mBANY,IC/Cd,kBD+Cc,MAMZ,6BALY,cAKZ,QADc,EAJY,OAIZ,QACd,oD,ECrDF,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":163137},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/lexing.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* The run-time library for lexers generated by camllex *)\n\ntype position = {\n pos_fname : string;\n pos_lnum : int;\n pos_bol : int;\n pos_cnum : int;\n}\n\nlet dummy_pos = {\n pos_fname = \"\";\n pos_lnum = 0;\n pos_bol = 0;\n pos_cnum = -1;\n}\n\ntype lexbuf =\n { refill_buff : lexbuf -> unit;\n mutable lex_buffer : bytes;\n mutable lex_buffer_len : int;\n mutable lex_abs_pos : int;\n mutable lex_start_pos : int;\n mutable lex_curr_pos : int;\n mutable lex_last_pos : int;\n mutable lex_last_action : int;\n mutable lex_eof_reached : bool;\n mutable lex_mem : int array;\n mutable lex_start_p : position;\n mutable lex_curr_p : position;\n }\n\ntype lex_tables =\n { lex_base: string;\n lex_backtrk: string;\n lex_default: string;\n lex_trans: string;\n lex_check: string;\n lex_base_code : string;\n lex_backtrk_code : string;\n lex_default_code : string;\n lex_trans_code : string;\n lex_check_code : string;\n lex_code: string;}\n\nexternal c_engine : lex_tables -> int -> lexbuf -> int = \"caml_lex_engine\"\nexternal c_new_engine : lex_tables -> int -> lexbuf -> int\n = \"caml_new_lex_engine\"\n\nlet engine tbl state buf =\n let result = c_engine tbl state buf in\n if result >= 0 && buf.lex_curr_p != dummy_pos then begin\n buf.lex_start_p <- buf.lex_curr_p;\n buf.lex_curr_p <- {buf.lex_curr_p\n with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};\n end;\n result\n\n\nlet new_engine tbl state buf =\n let result = c_new_engine tbl state buf in\n if result >= 0 && buf.lex_curr_p != dummy_pos then begin\n buf.lex_start_p <- buf.lex_curr_p;\n buf.lex_curr_p <- {buf.lex_curr_p\n with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};\n end;\n result\n\nlet lex_refill read_fun aux_buffer lexbuf =\n let read =\n read_fun aux_buffer (Bytes.length aux_buffer) in\n let n =\n if read > 0\n then read\n else (lexbuf.lex_eof_reached <- true; 0) in\n (* Current state of the buffer:\n <-------|---------------------|----------->\n | junk | valid data | junk |\n ^ ^ ^ ^\n 0 start_pos buffer_end Bytes.length buffer\n *)\n if lexbuf.lex_buffer_len + n > Bytes.length lexbuf.lex_buffer then begin\n (* There is not enough space at the end of the buffer *)\n if lexbuf.lex_buffer_len - lexbuf.lex_start_pos + n\n <= Bytes.length lexbuf.lex_buffer\n then begin\n (* But there is enough space if we reclaim the junk at the beginning\n of the buffer *)\n Bytes.blit lexbuf.lex_buffer lexbuf.lex_start_pos\n lexbuf.lex_buffer 0\n (lexbuf.lex_buffer_len - lexbuf.lex_start_pos)\n end else begin\n (* We must grow the buffer. Doubling its size will provide enough\n space since n <= String.length aux_buffer <= String.length buffer.\n Watch out for string length overflow, though. *)\n let newlen =\n Int.min (2 * Bytes.length lexbuf.lex_buffer) Sys.max_string_length in\n if lexbuf.lex_buffer_len - lexbuf.lex_start_pos + n > newlen\n then failwith \"Lexing.lex_refill: cannot grow buffer\";\n let newbuf = Bytes.create newlen in\n (* Copy the valid data to the beginning of the new buffer *)\n Bytes.blit lexbuf.lex_buffer lexbuf.lex_start_pos\n newbuf 0\n (lexbuf.lex_buffer_len - lexbuf.lex_start_pos);\n lexbuf.lex_buffer <- newbuf\n end;\n (* Reallocation or not, we have shifted the data left by\n start_pos characters; update the positions *)\n let s = lexbuf.lex_start_pos in\n lexbuf.lex_abs_pos <- lexbuf.lex_abs_pos + s;\n lexbuf.lex_curr_pos <- lexbuf.lex_curr_pos - s;\n lexbuf.lex_start_pos <- 0;\n lexbuf.lex_last_pos <- lexbuf.lex_last_pos - s;\n lexbuf.lex_buffer_len <- lexbuf.lex_buffer_len - s ;\n let t = lexbuf.lex_mem in\n for i = 0 to Array.length t-1 do\n let v = t.(i) in\n if v >= 0 then\n t.(i) <- v-s\n done\n end;\n (* There is now enough space at the end of the buffer *)\n Bytes.blit aux_buffer 0 lexbuf.lex_buffer lexbuf.lex_buffer_len n;\n lexbuf.lex_buffer_len <- lexbuf.lex_buffer_len + n\n\nlet zero_pos = {\n pos_fname = \"\";\n pos_lnum = 1;\n pos_bol = 0;\n pos_cnum = 0;\n}\n\nlet from_function ?(with_positions = true) f =\n { refill_buff = lex_refill f (Bytes.create 512);\n lex_buffer = Bytes.create 1024;\n lex_buffer_len = 0;\n lex_abs_pos = 0;\n lex_start_pos = 0;\n lex_curr_pos = 0;\n lex_last_pos = 0;\n lex_last_action = 0;\n lex_mem = [||];\n lex_eof_reached = false;\n lex_start_p = if with_positions then zero_pos else dummy_pos;\n lex_curr_p = if with_positions then zero_pos else dummy_pos;\n }\n\nlet from_channel ?with_positions ic =\n from_function ?with_positions (fun buf n -> input ic buf 0 n)\n\nlet from_string ?(with_positions = true) s =\n { refill_buff = (fun lexbuf -> lexbuf.lex_eof_reached <- true);\n lex_buffer = Bytes.of_string s; (* have to make a copy for compatibility\n with unsafe-string mode *)\n lex_buffer_len = String.length s;\n lex_abs_pos = 0;\n lex_start_pos = 0;\n lex_curr_pos = 0;\n lex_last_pos = 0;\n lex_last_action = 0;\n lex_mem = [||];\n lex_eof_reached = true;\n lex_start_p = if with_positions then zero_pos else dummy_pos;\n lex_curr_p = if with_positions then zero_pos else dummy_pos;\n }\n\nlet set_position lexbuf position =\n lexbuf.lex_curr_p <- {position with pos_fname = lexbuf.lex_curr_p.pos_fname};\n lexbuf.lex_abs_pos <- position.pos_cnum\n\nlet set_filename lexbuf fname =\n lexbuf.lex_curr_p <- {lexbuf.lex_curr_p with pos_fname = fname}\n\nlet with_positions lexbuf = lexbuf.lex_curr_p != dummy_pos\n\nlet lexeme lexbuf =\n let len = lexbuf.lex_curr_pos - lexbuf.lex_start_pos in\n Bytes.sub_string lexbuf.lex_buffer lexbuf.lex_start_pos len\n\nlet sub_lexeme lexbuf i1 i2 =\n let len = i2-i1 in\n Bytes.sub_string lexbuf.lex_buffer i1 len\n\nlet sub_lexeme_opt lexbuf i1 i2 =\n if i1 >= 0 then begin\n let len = i2-i1 in\n Some (Bytes.sub_string lexbuf.lex_buffer i1 len)\n end else begin\n None\n end\n\nlet sub_lexeme_char lexbuf i = Bytes.get lexbuf.lex_buffer i\n\nlet sub_lexeme_char_opt lexbuf i =\n if i >= 0 then\n Some (Bytes.get lexbuf.lex_buffer i)\n else\n None\n\n\nlet lexeme_char lexbuf i =\n Bytes.get lexbuf.lex_buffer (lexbuf.lex_start_pos + i)\n\nlet lexeme_start lexbuf = lexbuf.lex_start_p.pos_cnum\nlet lexeme_end lexbuf = lexbuf.lex_curr_p.pos_cnum\n\nlet lexeme_start_p lexbuf = lexbuf.lex_start_p\nlet lexeme_end_p lexbuf = lexbuf.lex_curr_p\n\nlet new_line lexbuf =\n let lcp = lexbuf.lex_curr_p in\n if lcp != dummy_pos then\n lexbuf.lex_curr_p <-\n { lcp with\n pos_lnum = lcp.pos_lnum + 1;\n pos_bol = lcp.pos_cnum;\n }\n\n\n\n(* Discard data left in lexer buffer. *)\n\nlet flush_input lb =\n lb.lex_curr_pos <- 0;\n lb.lex_abs_pos <- 0;\n let lcp = lb.lex_curr_p in\n if lcp != dummy_pos then\n lb.lex_curr_p <- {zero_pos with pos_fname = lcp.pos_fname};\n lb.lex_buffer_len <- 0;\n","(* generated code *)"],"names":[],"mappings":"KA6OE,gBACA,WACA,SACA,OACE,kDACF,kBAAuB,C,OAlBvB,cACA,SACE,mEAIG,C,EATmB,UAAiB,C,EADf,UAAkB,C,EAFtB,kBAA0B,C,EADxB,kBAA2B,C,UAFnD,+DAAsD,Q,QAPtD,cACO,IAAL,UAAK,Q,EAA+B,IAA/B,SAA+B,SAEpC,SAAI,C,QANuB,sCAA6B,Q,KAP1D,eAEkD,IAAhD,UAAK,EAFS,YAET,EAAL,QAAK,aAA2C,KACzC,KAEN,C,KARH,iBADA,YACA,uBAAyC,C,KAJzC,mBADA,yBACA,uBAA2D,C,EAJjC,iBAA8B,C,KAFxD,yDAA+D,C,KAJ/D,6DACA,kBAAuC,C,EAjBR,kBAA8B,C,WAA7D,MADc,UAAmB,gBACjC,qDACgC,OAAjB,EADf,QACe,aAAiB,sCAY/B,C,EAhB2C,uCAAgB,C,EAA5D,oBAA6D,C,mBA/E7D,OACE,IADF,WACE,WACF,YAGO,cAAiC,OALxC,EAYA,6CAAmE,mDAI5D,2EAMI,kBAKL,EALK,gBAKL,eACF,8CACK,yBACQ,MAEb,wEAE0D,UAM5D,mBADA,SACA,aACA,0BACA,WACA,0BACA,0BAEA,KADA,SACA,E,CAAA,sCACU,uCACR,YACE,iDAAY,0BAIlB,qDAAiE,oC,SAWjE,MADgB,UAAmB,gBACnC,0CACe,SADgC,IAA/B,KAAa,OAAb,GAA+B,wCAY9C,C,QArFY,UACb,qCAAmD,mBAEjD,0EAGF,EAAM,C,QAhBO,UACb,qCAAmD,mBAEjD,0EAGF,EAAM,C,ECtER,+E,QAAA,4D,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":165875},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/parsing.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* The parsing engine *)\n\nopen Lexing\n\n(* Internal interface to the parsing engine *)\n\ntype parser_env =\n { mutable s_stack : int array; (* States *)\n mutable v_stack : Obj.t array; (* Semantic attributes *)\n mutable symb_start_stack : position array; (* Start positions *)\n mutable symb_end_stack : position array; (* End positions *)\n mutable stacksize : int; (* Size of the stacks *)\n mutable stackbase : int; (* Base sp for current parse *)\n mutable curr_char : int; (* Last token read *)\n mutable lval : Obj.t; (* Its semantic attribute *)\n mutable symb_start : position; (* Start pos. of the current symbol*)\n mutable symb_end : position; (* End pos. of the current symbol *)\n mutable asp : int; (* The stack pointer for attributes *)\n mutable rule_len : int; (* Number of rhs items in the rule *)\n mutable rule_number : int; (* Rule number to reduce by *)\n mutable sp : int; (* Saved sp for parse_engine *)\n mutable state : int; (* Saved state for parse_engine *)\n mutable errflag : int } (* Saved error flag for parse_engine *)\n[@@warning \"-unused-field\"]\n\ntype parse_tables =\n { actions : (parser_env -> Obj.t) array;\n transl_const : int array;\n transl_block : int array;\n lhs : string;\n len : string;\n defred : string;\n dgoto : string;\n sindex : string;\n rindex : string;\n gindex : string;\n tablesize : int;\n table : string;\n check : string;\n error_function : string -> unit;\n names_const : string;\n names_block : string }\n\nexception YYexit of Obj.t\nexception Parse_error\n\ntype parser_input =\n Start\n | Token_read\n | Stacks_grown_1\n | Stacks_grown_2\n | Semantic_action_computed\n | Error_detected\n\ntype parser_output =\n Read_token\n | Raise_parse_error\n | Grow_stacks_1\n | Grow_stacks_2\n | Compute_semantic_action\n | Call_error_function\n\n(* to avoid warnings *)\nlet _ = [Read_token; Raise_parse_error; Grow_stacks_1; Grow_stacks_2;\n Compute_semantic_action; Call_error_function]\n\nexternal parse_engine :\n parse_tables -> parser_env -> parser_input -> Obj.t -> parser_output\n = \"caml_parse_engine\"\n\nexternal set_trace: bool -> bool\n = \"caml_set_parser_trace\"\n\nlet env =\n { s_stack = Array.make 100 0;\n v_stack = Array.make 100 (Obj.repr ());\n symb_start_stack = Array.make 100 dummy_pos;\n symb_end_stack = Array.make 100 dummy_pos;\n stacksize = 100;\n stackbase = 0;\n curr_char = 0;\n lval = Obj.repr ();\n symb_start = dummy_pos;\n symb_end = dummy_pos;\n asp = 0;\n rule_len = 0;\n rule_number = 0;\n sp = 0;\n state = 0;\n errflag = 0 }\n\nlet grow_stacks() =\n let oldsize = env.stacksize in\n let newsize = oldsize * 2 in\n let new_s = Array.make newsize 0\n and new_v = Array.make newsize (Obj.repr ())\n and new_start = Array.make newsize dummy_pos\n and new_end = Array.make newsize dummy_pos in\n Array.blit env.s_stack 0 new_s 0 oldsize;\n env.s_stack <- new_s;\n Array.blit env.v_stack 0 new_v 0 oldsize;\n env.v_stack <- new_v;\n Array.blit env.symb_start_stack 0 new_start 0 oldsize;\n env.symb_start_stack <- new_start;\n Array.blit env.symb_end_stack 0 new_end 0 oldsize;\n env.symb_end_stack <- new_end;\n env.stacksize <- newsize\n\nlet clear_parser() =\n Array.fill env.v_stack 0 env.stacksize (Obj.repr ());\n env.lval <- Obj.repr ()\n\nlet current_lookahead_fun = ref (fun (_ : Obj.t) -> false)\n\nlet yyparse tables start lexer lexbuf =\n let rec loop cmd arg =\n match parse_engine tables env cmd arg with\n Read_token ->\n let t = Obj.repr(lexer lexbuf) in\n env.symb_start <- lexbuf.lex_start_p;\n env.symb_end <- lexbuf.lex_curr_p;\n loop Token_read t\n | Raise_parse_error ->\n raise Parse_error\n | Compute_semantic_action ->\n let (action, value) =\n try\n (Semantic_action_computed, tables.actions.(env.rule_number) env)\n with Parse_error ->\n (Error_detected, Obj.repr ()) in\n loop action value\n | Grow_stacks_1 ->\n grow_stacks(); loop Stacks_grown_1 (Obj.repr ())\n | Grow_stacks_2 ->\n grow_stacks(); loop Stacks_grown_2 (Obj.repr ())\n | Call_error_function ->\n tables.error_function \"syntax error\";\n loop Error_detected (Obj.repr ()) in\n let init_asp = env.asp\n and init_sp = env.sp\n and init_stackbase = env.stackbase\n and init_state = env.state\n and init_curr_char = env.curr_char\n and init_lval = env.lval\n and init_errflag = env.errflag in\n env.stackbase <- env.sp + 1;\n env.curr_char <- start;\n env.symb_end <- lexbuf.lex_curr_p;\n try\n loop Start (Obj.repr ())\n with exn ->\n let curr_char = env.curr_char in\n env.asp <- init_asp;\n env.sp <- init_sp;\n env.stackbase <- init_stackbase;\n env.state <- init_state;\n env.curr_char <- init_curr_char;\n env.lval <- init_lval;\n env.errflag <- init_errflag;\n match exn with\n YYexit v ->\n Obj.magic v\n | _ ->\n current_lookahead_fun :=\n (fun tok ->\n if Obj.is_block tok\n then tables.transl_block.(Obj.tag tok) = curr_char\n else tables.transl_const.(Obj.magic tok) = curr_char);\n raise exn\n\nlet peek_val env n =\n Obj.magic env.v_stack.(env.asp - n)\n\nlet symbol_start_pos () =\n let rec loop i =\n if i <= 0 then env.symb_end_stack.(env.asp)\n else begin\n let st = env.symb_start_stack.(env.asp - i + 1) in\n let en = env.symb_end_stack.(env.asp - i + 1) in\n if st <> en then st else loop (i - 1)\n end\n in\n loop env.rule_len\n\nlet symbol_end_pos () = env.symb_end_stack.(env.asp)\nlet rhs_start_pos n = env.symb_start_stack.(env.asp - (env.rule_len - n))\nlet rhs_end_pos n = env.symb_end_stack.(env.asp - (env.rule_len - n))\n\nlet symbol_start () = (symbol_start_pos ()).pos_cnum\nlet symbol_end () = (symbol_end_pos ()).pos_cnum\nlet rhs_start n = (rhs_start_pos n).pos_cnum\nlet rhs_end n = (rhs_end_pos n).pos_cnum\n\nlet is_current_lookahead tok =\n (!current_lookahead_fun)(Obj.repr tok)\n\nlet parse_error (_ : string) = ()\n"],"names":[],"mappings":"UCmN+B,IAAE,C,EAF/B,6BAAsC,C,EAHxB,cAAe,QAAS,C,EADtB,cAAiB,QAAS,C,EADxB,gBAAmB,QAAS,C,EAD1B,gBAAqB,QAAS,C,UAFhC,gGAAiD,M,UAD/C,gGAAmD,M,WADjD,+DAA4B,M,cAFlD,oB,EAPE,cACK,WACM,UADN,0BACM,SACT,WAAS,UAAT,0BAAS,SADA,kBACA,gBACN,EAAQ,EAAM,IAAQ,iB,EAJZ,sDAA4B,E,GAAA,GAO5B,C,UAXjB,2BAAU,KAAV,SAAU,E,CAAA,gCAAV,EAAU,kB,CAAA,gCAAyB,M,YANzB,SAAG,EAAH,QAAG,aAAgB,OAEd,oCAAmC,QAAnC,YAAmC,wCADd,MAAW,cAAhC,sBAAiC,QAAjC,YAAiC,wC,EAAA,GACc,C,qBA7B9D,wGAOA,kCACA,cACA,sBACA,OACE,QAjCqC,YAA/B,kBAA+B,cAoBjC,2BAAoC,8BATL,UASK,YATL,QASK,EATL,kCAAoC,Y,AAAA,I,AAAA,G,EAAA,KD9I3E,U,CCgJY,E,CAAA,aAKJ,UAAa,aAFb,UAAa,aATb,UALgB,mBAChB,wBACA,mBACA,O,GAAA,I,AAAA,G,EAAA,KA8BJ,cACA,cACA,cACA,cACA,cACA,cACA,cACA,cACA,+BAII,sBAKA,KAAS,C,KA3Df,yDAAoD,mBAC7B,C,WAlBvB,WACA,YACY,UACA,YACI,IAD4B,QAC5B,IACF,IAD8B,QAC9B,IACZ,6CAAwC,aAExC,6CAAwC,aAExC,6CAAqD,aAErD,6CAAiD,aAEjD,eAAwB,C,wEA7BP,KD5FrB,QC4FqB,IADE,KACsB,QADtB,IADT,aADgB,cAAhB,WAAgB,oM","ignoreList":[0]}},{"offset":{"line":0,"column":168687},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/set.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Sets over ordered types *)\n\nmodule type OrderedType =\n sig\n type t\n val compare: t -> t -> int\n end\n\nmodule type S =\n sig\n type elt\n type t\n val empty: t\n val add: elt -> t -> t\n val singleton: elt -> t\n val remove: elt -> t -> t\n val union: t -> t -> t\n val inter: t -> t -> t\n val disjoint: t -> t -> bool\n val diff: t -> t -> t\n val cardinal: t -> int\n val elements: t -> elt list\n val min_elt: t -> elt\n val min_elt_opt: t -> elt option\n val max_elt: t -> elt\n val max_elt_opt: t -> elt option\n val choose: t -> elt\n val choose_opt: t -> elt option\n val find: elt -> t -> elt\n val find_opt: elt -> t -> elt option\n val find_first: (elt -> bool) -> t -> elt\n val find_first_opt: (elt -> bool) -> t -> elt option\n val find_last: (elt -> bool) -> t -> elt\n val find_last_opt: (elt -> bool) -> t -> elt option\n val iter: (elt -> unit) -> t -> unit\n val fold: (elt -> 'a -> 'a) -> t -> 'a -> 'a\n val map: (elt -> elt) -> t -> t\n val filter: (elt -> bool) -> t -> t\n val filter_map: (elt -> elt option) -> t -> t\n val partition: (elt -> bool) -> t -> t * t\n val split: elt -> t -> t * bool * t\n val is_empty: t -> bool\n val mem: elt -> t -> bool\n val equal: t -> t -> bool\n val compare: t -> t -> int\n val subset: t -> t -> bool\n val for_all: (elt -> bool) -> t -> bool\n val exists: (elt -> bool) -> t -> bool\n val to_list : t -> elt list\n val of_list: elt list -> t\n val to_seq_from : elt -> t -> elt Seq.t\n val to_seq : t -> elt Seq.t\n val to_rev_seq : t -> elt Seq.t\n val add_seq : elt Seq.t -> t -> t\n val of_seq : elt Seq.t -> t\n end\n\nmodule Make(Ord: OrderedType) =\n struct\n type elt = Ord.t\n type t = Empty | Node of {l:t; v:elt; r:t; h:int}\n\n (* Sets are represented by balanced binary trees (the heights of the\n children differ by at most 2 *)\n\n let height = function\n Empty -> 0\n | Node {h} -> h\n\n (* Creates a new node with left son l, value v and right son r.\n We must have all elements of l < v < all elements of r.\n l and r must be balanced and | height l - height r | <= 2.\n Inline expansion of height for better speed. *)\n\n let create l v r =\n let hl = match l with Empty -> 0 | Node {h} -> h in\n let hr = match r with Empty -> 0 | Node {h} -> h in\n Node{l; v; r; h=(if hl >= hr then hl + 1 else hr + 1)}\n\n (* Same as create, but performs one step of rebalancing if necessary.\n Assumes l and r balanced and | height l - height r | <= 3.\n Inline expansion of create for better speed in the most frequent case\n where no rebalancing is required. *)\n\n let bal l v r =\n let hl = match l with Empty -> 0 | Node {h} -> h in\n let hr = match r with Empty -> 0 | Node {h} -> h in\n if hl > hr + 2 then begin\n match l with\n Empty -> invalid_arg \"Set.bal\"\n | Node{l=ll; v=lv; r=lr} ->\n if height ll >= height lr then\n create ll lv (create lr v r)\n else begin\n match lr with\n Empty -> invalid_arg \"Set.bal\"\n | Node{l=lrl; v=lrv; r=lrr}->\n create (create ll lv lrl) lrv (create lrr v r)\n end\n end else if hr > hl + 2 then begin\n match r with\n Empty -> invalid_arg \"Set.bal\"\n | Node{l=rl; v=rv; r=rr} ->\n if height rr >= height rl then\n create (create l v rl) rv rr\n else begin\n match rl with\n Empty -> invalid_arg \"Set.bal\"\n | Node{l=rll; v=rlv; r=rlr} ->\n create (create l v rll) rlv (create rlr rv rr)\n end\n end else\n Node{l; v; r; h=(if hl >= hr then hl + 1 else hr + 1)}\n\n (* Insertion of one element *)\n\n let rec add x = function\n Empty -> Node{l=Empty; v=x; r=Empty; h=1}\n | Node{l; v; r} as t ->\n let c = Ord.compare x v in\n if c = 0 then t else\n if c < 0 then\n let ll = add x l in\n if l == ll then t else bal ll v r\n else\n let rr = add x r in\n if r == rr then t else bal l v rr\n\n let singleton x = Node{l=Empty; v=x; r=Empty; h=1}\n\n (* Beware: those two functions assume that the added v is *strictly*\n smaller (or bigger) than all the present elements in the tree; it\n does not test for equality with the current min (or max) element.\n Indeed, they are only used during the \"join\" operation which\n respects this precondition.\n *)\n\n let rec add_min_element x = function\n | Empty -> singleton x\n | Node {l; v; r} ->\n bal (add_min_element x l) v r\n\n let rec add_max_element x = function\n | Empty -> singleton x\n | Node {l; v; r} ->\n bal l v (add_max_element x r)\n\n (* Same as create and bal, but no assumptions are made on the\n relative heights of l and r. *)\n\n let rec join l v r =\n match (l, r) with\n (Empty, _) -> add_min_element v r\n | (_, Empty) -> add_max_element v l\n | (Node{l=ll; v=lv; r=lr; h=lh}, Node{l=rl; v=rv; r=rr; h=rh}) ->\n if lh > rh + 2 then bal ll lv (join lr v r) else\n if rh > lh + 2 then bal (join l v rl) rv rr else\n create l v r\n\n (* Smallest and greatest element of a set *)\n\n let rec min_elt = function\n Empty -> raise Not_found\n | Node{l=Empty; v} -> v\n | Node{l} -> min_elt l\n\n let rec min_elt_opt = function\n Empty -> None\n | Node{l=Empty; v} -> Some v\n | Node{l} -> min_elt_opt l\n\n let rec max_elt = function\n Empty -> raise Not_found\n | Node{v; r=Empty} -> v\n | Node{r} -> max_elt r\n\n let rec max_elt_opt = function\n Empty -> None\n | Node{v; r=Empty} -> Some v\n | Node{r} -> max_elt_opt r\n\n (* Remove the smallest element of the given set *)\n\n let rec remove_min_elt = function\n Empty -> invalid_arg \"Set.remove_min_elt\"\n | Node{l=Empty; r} -> r\n | Node{l; v; r} -> bal (remove_min_elt l) v r\n\n (* Merge two trees l and r into one.\n All elements of l must precede the elements of r.\n Assume | height l - height r | <= 2. *)\n\n let merge t1 t2 =\n match (t1, t2) with\n (Empty, t) -> t\n | (t, Empty) -> t\n | (_, _) -> bal t1 (min_elt t2) (remove_min_elt t2)\n\n (* Merge two trees l and r into one.\n All elements of l must precede the elements of r.\n No assumption on the heights of l and r. *)\n\n let concat t1 t2 =\n match (t1, t2) with\n (Empty, t) -> t\n | (t, Empty) -> t\n | (_, _) -> join t1 (min_elt t2) (remove_min_elt t2)\n\n (* Splitting. split x s returns a triple (l, present, r) where\n - l is the set of elements of s that are < x\n - r is the set of elements of s that are > x\n - present is false if s contains no element equal to x,\n or true if s contains an element equal to x. *)\n\n let rec split x = function\n Empty ->\n (Empty, false, Empty)\n | Node{l; v; r} ->\n let c = Ord.compare x v in\n if c = 0 then (l, true, r)\n else if c < 0 then\n let (ll, pres, rl) = split x l in (ll, pres, join rl v r)\n else\n let (lr, pres, rr) = split x r in (join l v lr, pres, rr)\n\n (* Implementation of the set operations *)\n\n let empty = Empty\n\n let is_empty = function Empty -> true | _ -> false\n\n let rec mem x = function\n Empty -> false\n | Node{l; v; r} ->\n let c = Ord.compare x v in\n c = 0 || mem x (if c < 0 then l else r)\n\n let rec remove x = function\n Empty -> Empty\n | (Node{l; v; r} as t) ->\n let c = Ord.compare x v in\n if c = 0 then merge l r\n else\n if c < 0 then\n let ll = remove x l in\n if l == ll then t\n else bal ll v r\n else\n let rr = remove x r in\n if r == rr then t\n else bal l v rr\n\n let rec union s1 s2 =\n match (s1, s2) with\n (Empty, t2) -> t2\n | (t1, Empty) -> t1\n | (Node{l=l1; v=v1; r=r1; h=h1}, Node{l=l2; v=v2; r=r2; h=h2}) ->\n if h1 >= h2 then\n if h2 = 1 then add v2 s1 else begin\n let (l2, _, r2) = split v1 s2 in\n join (union l1 l2) v1 (union r1 r2)\n end\n else\n if h1 = 1 then add v1 s2 else begin\n let (l1, _, r1) = split v2 s1 in\n join (union l1 l2) v2 (union r1 r2)\n end\n\n let rec inter s1 s2 =\n match (s1, s2) with\n (Empty, _) -> Empty\n | (_, Empty) -> Empty\n | (Node{l=l1; v=v1; r=r1}, t2) ->\n match split v1 t2 with\n (l2, false, r2) ->\n concat (inter l1 l2) (inter r1 r2)\n | (l2, true, r2) ->\n join (inter l1 l2) v1 (inter r1 r2)\n\n (* Same as split, but compute the left and right subtrees\n only if the pivot element is not in the set. The right subtree\n is computed on demand. *)\n\n type split_bis =\n | Found\n | NotFound of t * (unit -> t)\n\n let rec split_bis x = function\n Empty ->\n NotFound (Empty, (fun () -> Empty))\n | Node{l; v; r; _} ->\n let c = Ord.compare x v in\n if c = 0 then Found\n else if c < 0 then\n match split_bis x l with\n | Found -> Found\n | NotFound (ll, rl) -> NotFound (ll, (fun () -> join (rl ()) v r))\n else\n match split_bis x r with\n | Found -> Found\n | NotFound (lr, rr) -> NotFound (join l v lr, rr)\n\n let rec disjoint s1 s2 =\n match (s1, s2) with\n (Empty, _) | (_, Empty) -> true\n | (Node{l=l1; v=v1; r=r1}, t2) ->\n if s1 == s2 then false\n else match split_bis v1 t2 with\n NotFound(l2, r2) -> disjoint l1 l2 && disjoint r1 (r2 ())\n | Found -> false\n\n let rec diff s1 s2 =\n match (s1, s2) with\n (Empty, _) -> Empty\n | (t1, Empty) -> t1\n | (Node{l=l1; v=v1; r=r1}, t2) ->\n match split v1 t2 with\n (l2, false, r2) ->\n join (diff l1 l2) v1 (diff r1 r2)\n | (l2, true, r2) ->\n concat (diff l1 l2) (diff r1 r2)\n\n type enumeration = End | More of elt * t * enumeration\n\n let rec cons_enum s e =\n match s with\n Empty -> e\n | Node{l; v; r} -> cons_enum l (More(v, r, e))\n\n let rec compare_aux e1 e2 =\n match (e1, e2) with\n (End, End) -> 0\n | (End, _) -> -1\n | (_, End) -> 1\n | (More(v1, r1, e1), More(v2, r2, e2)) ->\n let c = Ord.compare v1 v2 in\n if c <> 0\n then c\n else compare_aux (cons_enum r1 e1) (cons_enum r2 e2)\n\n let compare s1 s2 =\n compare_aux (cons_enum s1 End) (cons_enum s2 End)\n\n let equal s1 s2 =\n compare s1 s2 = 0\n\n let rec subset s1 s2 =\n match (s1, s2) with\n Empty, _ ->\n true\n | _, Empty ->\n false\n | Node {l=l1; v=v1; r=r1}, (Node {l=l2; v=v2; r=r2} as t2) ->\n let c = Ord.compare v1 v2 in\n if c = 0 then\n subset l1 l2 && subset r1 r2\n else if c < 0 then\n subset (Node {l=l1; v=v1; r=Empty; h=0}) l2 && subset r1 t2\n else\n subset (Node {l=Empty; v=v1; r=r1; h=0}) r2 && subset l1 t2\n\n let rec iter f = function\n Empty -> ()\n | Node{l; v; r} -> iter f l; f v; iter f r\n\n let rec fold f s accu =\n match s with\n Empty -> accu\n | Node{l; v; r} -> fold f r (f v (fold f l accu))\n\n let rec for_all p = function\n Empty -> true\n | Node{l; v; r} -> p v && for_all p l && for_all p r\n\n let rec exists p = function\n Empty -> false\n | Node{l; v; r} -> p v || exists p l || exists p r\n\n let rec filter p = function\n Empty -> Empty\n | (Node{l; v; r}) as t ->\n (* call [p] in the expected left-to-right order *)\n let l' = filter p l in\n let pv = p v in\n let r' = filter p r in\n if pv then\n if l==l' && r==r' then t else join l' v r'\n else concat l' r'\n\n let rec partition p = function\n Empty -> (Empty, Empty)\n | Node{l; v; r} ->\n (* call [p] in the expected left-to-right order *)\n let (lt, lf) = partition p l in\n let pv = p v in\n let (rt, rf) = partition p r in\n if pv\n then (join lt v rt, concat lf rf)\n else (concat lt rt, join lf v rf)\n\n let rec cardinal = function\n Empty -> 0\n | Node{l; r} -> cardinal l + 1 + cardinal r\n\n let rec elements_aux accu = function\n Empty -> accu\n | Node{l; v; r} -> elements_aux (v :: elements_aux accu r) l\n\n let elements s =\n elements_aux [] s\n\n let choose = min_elt\n\n let choose_opt = min_elt_opt\n\n let rec find x = function\n Empty -> raise Not_found\n | Node{l; v; r} ->\n let c = Ord.compare x v in\n if c = 0 then v\n else find x (if c < 0 then l else r)\n\n let rec find_first_aux v0 f = function\n Empty ->\n v0\n | Node{l; v; r} ->\n if f v then\n find_first_aux v f l\n else\n find_first_aux v0 f r\n\n let rec find_first f = function\n Empty ->\n raise Not_found\n | Node{l; v; r} ->\n if f v then\n find_first_aux v f l\n else\n find_first f r\n\n let rec find_first_opt_aux v0 f = function\n Empty ->\n Some v0\n | Node{l; v; r} ->\n if f v then\n find_first_opt_aux v f l\n else\n find_first_opt_aux v0 f r\n\n let rec find_first_opt f = function\n Empty ->\n None\n | Node{l; v; r} ->\n if f v then\n find_first_opt_aux v f l\n else\n find_first_opt f r\n\n let rec find_last_aux v0 f = function\n Empty ->\n v0\n | Node{l; v; r} ->\n if f v then\n find_last_aux v f r\n else\n find_last_aux v0 f l\n\n let rec find_last f = function\n Empty ->\n raise Not_found\n | Node{l; v; r} ->\n if f v then\n find_last_aux v f r\n else\n find_last f l\n\n let rec find_last_opt_aux v0 f = function\n Empty ->\n Some v0\n | Node{l; v; r} ->\n if f v then\n find_last_opt_aux v f r\n else\n find_last_opt_aux v0 f l\n\n let rec find_last_opt f = function\n Empty ->\n None\n | Node{l; v; r} ->\n if f v then\n find_last_opt_aux v f r\n else\n find_last_opt f l\n\n let rec find_opt x = function\n Empty -> None\n | Node{l; v; r} ->\n let c = Ord.compare x v in\n if c = 0 then Some v\n else find_opt x (if c < 0 then l else r)\n\n let try_join l v r =\n (* [join l v r] can only be called when (elements of l < v <\n elements of r); use [try_join l v r] when this property may\n not hold, but you hope it does hold in the common case *)\n if (l = Empty || Ord.compare (max_elt l) v < 0)\n && (r = Empty || Ord.compare v (min_elt r) < 0)\n then join l v r\n else union l (add v r)\n\n let rec map f = function\n | Empty -> Empty\n | Node{l; v; r} as t ->\n (* enforce left-to-right evaluation order *)\n let l' = map f l in\n let v' = f v in\n let r' = map f r in\n if l == l' && v == v' && r == r' then t\n else try_join l' v' r'\n\n let try_concat t1 t2 =\n match (t1, t2) with\n (Empty, t) -> t\n | (t, Empty) -> t\n | (_, _) -> try_join t1 (min_elt t2) (remove_min_elt t2)\n\n let rec filter_map f = function\n | Empty -> Empty\n | Node{l; v; r} as t ->\n (* enforce left-to-right evaluation order *)\n let l' = filter_map f l in\n let v' = f v in\n let r' = filter_map f r in\n begin match v' with\n | Some v' ->\n if l == l' && v == v' && r == r' then t\n else try_join l' v' r'\n | None ->\n try_concat l' r'\n end\n\n let of_sorted_list l =\n let rec sub n l =\n match n, l with\n | 0, l -> Empty, l\n | 1, x0 :: l -> Node {l=Empty; v=x0; r=Empty; h=1}, l\n | 2, x0 :: x1 :: l ->\n Node{l=Node{l=Empty; v=x0; r=Empty; h=1}; v=x1; r=Empty; h=2}, l\n | 3, x0 :: x1 :: x2 :: l ->\n Node{l=Node{l=Empty; v=x0; r=Empty; h=1}; v=x1;\n r=Node{l=Empty; v=x2; r=Empty; h=1}; h=2}, l\n | n, l ->\n let nl = n / 2 in\n let left, l = sub nl l in\n match l with\n | [] -> assert false\n | mid :: l ->\n let right, l = sub (n - nl - 1) l in\n create left mid right, l\n in\n fst (sub (List.length l) l)\n\n let to_list = elements\n\n let of_list l =\n match l with\n | [] -> empty\n | [x0] -> singleton x0\n | [x0; x1] -> add x1 (singleton x0)\n | [x0; x1; x2] -> add x2 (add x1 (singleton x0))\n | [x0; x1; x2; x3] -> add x3 (add x2 (add x1 (singleton x0)))\n | [x0; x1; x2; x3; x4] -> add x4 (add x3 (add x2 (add x1 (singleton x0))))\n | _ -> of_sorted_list (List.sort_uniq Ord.compare l)\n\n let add_seq i m =\n Seq.fold_left (fun s x -> add x s) m i\n\n let of_seq i = add_seq i empty\n\n let rec seq_of_enum_ c () = match c with\n | End -> Seq.Nil\n | More (x, t, rest) -> Seq.Cons (x, seq_of_enum_ (cons_enum t rest))\n\n let to_seq c = seq_of_enum_ (cons_enum c End)\n\n let rec snoc_enum s e =\n match s with\n Empty -> e\n | Node{l; v; r} -> snoc_enum r (More(v, l, e))\n\n let rec rev_seq_of_enum_ c () = match c with\n | End -> Seq.Nil\n | More (x, t, rest) -> Seq.Cons (x, rev_seq_of_enum_ (snoc_enum t rest))\n\n let to_rev_seq c = rev_seq_of_enum_ (snoc_enum c End)\n\n let to_seq_from low s =\n let rec aux low s c = match s with\n | Empty -> c\n | Node {l; r; v; _} ->\n begin match Ord.compare v low with\n | 0 -> More (v, r, c)\n | n when n<0 -> aux low r c\n | _ -> aux low l (More (v, r, c))\n end\n in\n seq_of_enum_ (aux low s End)\n end\n","(* generated code *)"],"names":[],"mappings":"EA6mBkC,a,eAA5B,QAAa,UATS,mCAGa,IAHb,S,CAGJ,EAAZ,cAAY,KAAiB,C,CAAA,EAElB,YACF,M,CAAA,I,CAAA,gB,IAFA,M,CAAA,I,CAAA,OAKa,K,CAAA,I,EAZuB,a,EAAA,GAAjB,SAAiB,I,KAJrB,UACrB,KAC8D,IAD9D,YAC2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OAAe,OAAW,OAEC,C,KApB/D,UACgB,aACA,GACiB,OAAD,EAAZ,SAAY,OAAoB,C,QAvB7B,UACZ,sDACW,kBACC,KAAkB,SAAI,C,KAVzB,aACT,yBACW,IADX,OACW,eACT,OAAa,C,KARV,aACL,sCACW,UACT,OAAS,C,KARF,aACT,2BACW,IADX,OACW,UACI,C,KARV,aACL,wCACW,KACA,C,MAbtB,SACgB,iBACA,sBAEZ,cAFY,cAEZ,QAFY,qBAEkB,OAAa,IAC3C,0BAHY,kBAGY,IAHZ,OAGY,GAAa,QACrC,U,OAAY,C,KAfM,UAdN,0CAiBN,EAjBM,OAiBN,GAAqB,K,QART,UATN,8CAYV,EAZU,OAYV,GAAqB,QAAI,C,EAZf,sBAAgC,C,SAZtC,UACC,8CAGP,IADQ,EAFD,SADD,MAGN,YAAQ,KACR,IAAc,GACd,aAIW,SACT,yCAAgB,GAAO,WAJd,SACT,yCAAgB,GAAO,aAGU,C,YAzCvC,UAA+B,gB,EAC/B,UAA+B,gBAC/B,2BAAoB,SAEP,wDAES,KAAb,OAAS,iBACkB,IAAf,SAAe,IACzB,SAEQ,sDAEuB,SAAvB,SAAkB,Q,MAE5B,2BAAoB,SAEhB,wDAES,KAAb,OAAS,iBACH,SAAe,QACnB,SAEQ,sDAEqB,SAArB,SAAgB,Q,MAGa,UAA9C,mBAAkC,QAAY,mBAAQ,C,QArCxD,UAA+B,gB,EAEe,UAD9C,UAA+B,gBAC/B,mBAAkC,QAAY,iBAAQ,C,EAZ3C,UACA,gBACI,C,mBClFrB,oU,EAAA,mB,QAAA,4D,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":177812},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/map.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nmodule type OrderedType =\n sig\n type t\n val compare: t -> t -> int\n end\n\nmodule type S =\n sig\n type key\n type !+'a t\n val empty: 'a t\n val add: key -> 'a -> 'a t -> 'a t\n val add_to_list: key -> 'a -> 'a list t -> 'a list t\n val update: key -> ('a option -> 'a option) -> 'a t -> 'a t\n val singleton: key -> 'a -> 'a t\n val remove: key -> 'a t -> 'a t\n val merge:\n (key -> 'a option -> 'b option -> 'c option) ->\n 'a t -> 'b t -> 'c t\n val union: (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t\n val cardinal: 'a t -> int\n val bindings: 'a t -> (key * 'a) list\n val min_binding: 'a t -> (key * 'a)\n val min_binding_opt: 'a t -> (key * 'a) option\n val max_binding: 'a t -> (key * 'a)\n val max_binding_opt: 'a t -> (key * 'a) option\n val choose: 'a t -> (key * 'a)\n val choose_opt: 'a t -> (key * 'a) option\n val find: key -> 'a t -> 'a\n val find_opt: key -> 'a t -> 'a option\n val find_first: (key -> bool) -> 'a t -> key * 'a\n val find_first_opt: (key -> bool) -> 'a t -> (key * 'a) option\n val find_last: (key -> bool) -> 'a t -> key * 'a\n val find_last_opt: (key -> bool) -> 'a t -> (key * 'a) option\n val iter: (key -> 'a -> unit) -> 'a t -> unit\n val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b\n val map: ('a -> 'b) -> 'a t -> 'b t\n val mapi: (key -> 'a -> 'b) -> 'a t -> 'b t\n val filter: (key -> 'a -> bool) -> 'a t -> 'a t\n val filter_map: (key -> 'a -> 'b option) -> 'a t -> 'b t\n val partition: (key -> 'a -> bool) -> 'a t -> 'a t * 'a t\n val split: key -> 'a t -> 'a t * 'a option * 'a t\n val is_empty: 'a t -> bool\n val mem: key -> 'a t -> bool\n val equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool\n val compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int\n val for_all: (key -> 'a -> bool) -> 'a t -> bool\n val exists: (key -> 'a -> bool) -> 'a t -> bool\n val to_list : 'a t -> (key * 'a) list\n val of_list : (key * 'a) list -> 'a t\n val to_seq : 'a t -> (key * 'a) Seq.t\n val to_rev_seq : 'a t -> (key * 'a) Seq.t\n val to_seq_from : key -> 'a t -> (key * 'a) Seq.t\n val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t\n val of_seq : (key * 'a) Seq.t -> 'a t\n end\n\nmodule Make(Ord: OrderedType) = struct\n\n type key = Ord.t\n\n type 'a t =\n Empty\n | Node of {l:'a t; v:key; d:'a; r:'a t; h:int}\n\n let height = function\n Empty -> 0\n | Node {h} -> h\n\n let create l x d r =\n let hl = height l and hr = height r in\n Node{l; v=x; d; r; h=(if hl >= hr then hl + 1 else hr + 1)}\n\n let singleton x d = Node{l=Empty; v=x; d; r=Empty; h=1}\n\n let bal l x d r =\n let hl = match l with Empty -> 0 | Node {h} -> h in\n let hr = match r with Empty -> 0 | Node {h} -> h in\n if hl > hr + 2 then begin\n match l with\n Empty -> invalid_arg \"Map.bal\"\n | Node{l=ll; v=lv; d=ld; r=lr} ->\n if height ll >= height lr then\n create ll lv ld (create lr x d r)\n else begin\n match lr with\n Empty -> invalid_arg \"Map.bal\"\n | Node{l=lrl; v=lrv; d=lrd; r=lrr}->\n create (create ll lv ld lrl) lrv lrd (create lrr x d r)\n end\n end else if hr > hl + 2 then begin\n match r with\n Empty -> invalid_arg \"Map.bal\"\n | Node{l=rl; v=rv; d=rd; r=rr} ->\n if height rr >= height rl then\n create (create l x d rl) rv rd rr\n else begin\n match rl with\n Empty -> invalid_arg \"Map.bal\"\n | Node{l=rll; v=rlv; d=rld; r=rlr} ->\n create (create l x d rll) rlv rld (create rlr rv rd rr)\n end\n end else\n Node{l; v=x; d; r; h=(if hl >= hr then hl + 1 else hr + 1)}\n\n let empty = Empty\n\n let is_empty = function Empty -> true | _ -> false\n\n let rec add x data = function\n Empty ->\n Node{l=Empty; v=x; d=data; r=Empty; h=1}\n | Node {l; v; d; r; h} as m ->\n let c = Ord.compare x v in\n if c = 0 then\n if d == data then m else Node{l; v=x; d=data; r; h}\n else if c < 0 then\n let ll = add x data l in\n if l == ll then m else bal ll v d r\n else\n let rr = add x data r in\n if r == rr then m else bal l v d rr\n\n let rec find x = function\n Empty ->\n raise Not_found\n | Node {l; v; d; r} ->\n let c = Ord.compare x v in\n if c = 0 then d\n else find x (if c < 0 then l else r)\n\n let rec find_first_aux v0 d0 f = function\n Empty ->\n (v0, d0)\n | Node {l; v; d; r} ->\n if f v then\n find_first_aux v d f l\n else\n find_first_aux v0 d0 f r\n\n let rec find_first f = function\n Empty ->\n raise Not_found\n | Node {l; v; d; r} ->\n if f v then\n find_first_aux v d f l\n else\n find_first f r\n\n let rec find_first_opt_aux v0 d0 f = function\n Empty ->\n Some (v0, d0)\n | Node {l; v; d; r} ->\n if f v then\n find_first_opt_aux v d f l\n else\n find_first_opt_aux v0 d0 f r\n\n let rec find_first_opt f = function\n Empty ->\n None\n | Node {l; v; d; r} ->\n if f v then\n find_first_opt_aux v d f l\n else\n find_first_opt f r\n\n let rec find_last_aux v0 d0 f = function\n Empty ->\n (v0, d0)\n | Node {l; v; d; r} ->\n if f v then\n find_last_aux v d f r\n else\n find_last_aux v0 d0 f l\n\n let rec find_last f = function\n Empty ->\n raise Not_found\n | Node {l; v; d; r} ->\n if f v then\n find_last_aux v d f r\n else\n find_last f l\n\n let rec find_last_opt_aux v0 d0 f = function\n Empty ->\n Some (v0, d0)\n | Node {l; v; d; r} ->\n if f v then\n find_last_opt_aux v d f r\n else\n find_last_opt_aux v0 d0 f l\n\n let rec find_last_opt f = function\n Empty ->\n None\n | Node {l; v; d; r} ->\n if f v then\n find_last_opt_aux v d f r\n else\n find_last_opt f l\n\n let rec find_opt x = function\n Empty ->\n None\n | Node {l; v; d; r} ->\n let c = Ord.compare x v in\n if c = 0 then Some d\n else find_opt x (if c < 0 then l else r)\n\n let rec mem x = function\n Empty ->\n false\n | Node {l; v; r} ->\n let c = Ord.compare x v in\n c = 0 || mem x (if c < 0 then l else r)\n\n let rec min_binding = function\n Empty -> raise Not_found\n | Node {l=Empty; v; d} -> (v, d)\n | Node {l} -> min_binding l\n\n let rec min_binding_opt = function\n Empty -> None\n | Node {l=Empty; v; d} -> Some (v, d)\n | Node {l}-> min_binding_opt l\n\n let rec max_binding = function\n Empty -> raise Not_found\n | Node {v; d; r=Empty} -> (v, d)\n | Node {r} -> max_binding r\n\n let rec max_binding_opt = function\n Empty -> None\n | Node {v; d; r=Empty} -> Some (v, d)\n | Node {r} -> max_binding_opt r\n\n let rec remove_min_binding = function\n Empty -> invalid_arg \"Map.remove_min_elt\"\n | Node {l=Empty; r} -> r\n | Node {l; v; d; r} -> bal (remove_min_binding l) v d r\n\n let merge t1 t2 =\n match (t1, t2) with\n (Empty, t) -> t\n | (t, Empty) -> t\n | (_, _) ->\n let (x, d) = min_binding t2 in\n bal t1 x d (remove_min_binding t2)\n\n let rec remove x = function\n Empty ->\n Empty\n | (Node {l; v; d; r} as m) ->\n let c = Ord.compare x v in\n if c = 0 then merge l r\n else if c < 0 then\n let ll = remove x l in if l == ll then m else bal ll v d r\n else\n let rr = remove x r in if r == rr then m else bal l v d rr\n\n let rec update x f = function\n Empty ->\n begin match f None with\n | None -> Empty\n | Some data -> Node{l=Empty; v=x; d=data; r=Empty; h=1}\n end\n | Node {l; v; d; r; h} as m ->\n let c = Ord.compare x v in\n if c = 0 then begin\n match f (Some d) with\n | None -> merge l r\n | Some data ->\n if d == data then m else Node{l; v=x; d=data; r; h}\n end else if c < 0 then\n let ll = update x f l in\n if l == ll then m else bal ll v d r\n else\n let rr = update x f r in\n if r == rr then m else bal l v d rr\n\n let add_to_list x data m =\n let add = function None -> Some [data] | Some l -> Some (data :: l) in\n update x add m\n\n let rec iter f = function\n Empty -> ()\n | Node {l; v; d; r} ->\n iter f l; f v d; iter f r\n\n let rec map f = function\n Empty ->\n Empty\n | Node {l; v; d; r; h} ->\n let l' = map f l in\n let d' = f d in\n let r' = map f r in\n Node{l=l'; v; d=d'; r=r'; h}\n\n let rec mapi f = function\n Empty ->\n Empty\n | Node {l; v; d; r; h} ->\n let l' = mapi f l in\n let d' = f v d in\n let r' = mapi f r in\n Node{l=l'; v; d=d'; r=r'; h}\n\n let rec fold f m accu =\n match m with\n Empty -> accu\n | Node {l; v; d; r} ->\n fold f r (f v d (fold f l accu))\n\n let rec for_all p = function\n Empty -> true\n | Node {l; v; d; r} -> p v d && for_all p l && for_all p r\n\n let rec exists p = function\n Empty -> false\n | Node {l; v; d; r} -> p v d || exists p l || exists p r\n\n (* Beware: those two functions assume that the added k is *strictly*\n smaller (or bigger) than all the present keys in the tree; it\n does not test for equality with the current min (or max) key.\n\n Indeed, they are only used during the \"join\" operation which\n respects this precondition.\n *)\n\n let rec add_min_binding k x = function\n | Empty -> singleton k x\n | Node {l; v; d; r} ->\n bal (add_min_binding k x l) v d r\n\n let rec add_max_binding k x = function\n | Empty -> singleton k x\n | Node {l; v; d; r} ->\n bal l v d (add_max_binding k x r)\n\n (* Same as create and bal, but no assumptions are made on the\n relative heights of l and r. *)\n\n let rec join l v d r =\n match (l, r) with\n (Empty, _) -> add_min_binding v d r\n | (_, Empty) -> add_max_binding v d l\n | (Node{l=ll; v=lv; d=ld; r=lr; h=lh},\n Node{l=rl; v=rv; d=rd; r=rr; h=rh}) ->\n if lh > rh + 2 then bal ll lv ld (join lr v d r) else\n if rh > lh + 2 then bal (join l v d rl) rv rd rr else\n create l v d r\n\n (* Merge two trees l and r into one.\n All elements of l must precede the elements of r.\n No assumption on the heights of l and r. *)\n\n let concat t1 t2 =\n match (t1, t2) with\n (Empty, t) -> t\n | (t, Empty) -> t\n | (_, _) ->\n let (x, d) = min_binding t2 in\n join t1 x d (remove_min_binding t2)\n\n let concat_or_join t1 v d t2 =\n match d with\n | Some d -> join t1 v d t2\n | None -> concat t1 t2\n\n let rec split x = function\n Empty ->\n (Empty, None, Empty)\n | Node {l; v; d; r} ->\n let c = Ord.compare x v in\n if c = 0 then (l, Some d, r)\n else if c < 0 then\n let (ll, pres, rl) = split x l in (ll, pres, join rl v d r)\n else\n let (lr, pres, rr) = split x r in (join l v d lr, pres, rr)\n\n let rec merge f s1 s2 =\n match (s1, s2) with\n (Empty, Empty) -> Empty\n | (Node {l=l1; v=v1; d=d1; r=r1; h=h1}, _) when h1 >= height s2 ->\n let (l2, d2, r2) = split v1 s2 in\n concat_or_join (merge f l1 l2) v1 (f v1 (Some d1) d2) (merge f r1 r2)\n | (_, Node {l=l2; v=v2; d=d2; r=r2}) ->\n let (l1, d1, r1) = split v2 s1 in\n concat_or_join (merge f l1 l2) v2 (f v2 d1 (Some d2)) (merge f r1 r2)\n | _ ->\n assert false\n\n let rec union f s1 s2 =\n match (s1, s2) with\n | (Empty, s) | (s, Empty) -> s\n | (Node {l=l1; v=v1; d=d1; r=r1; h=h1},\n Node {l=l2; v=v2; d=d2; r=r2; h=h2}) ->\n if h1 >= h2 then\n let (l2, d2, r2) = split v1 s2 in\n let l = union f l1 l2 and r = union f r1 r2 in\n match d2 with\n | None -> join l v1 d1 r\n | Some d2 -> concat_or_join l v1 (f v1 d1 d2) r\n else\n let (l1, d1, r1) = split v2 s1 in\n let l = union f l1 l2 and r = union f r1 r2 in\n match d1 with\n | None -> join l v2 d2 r\n | Some d1 -> concat_or_join l v2 (f v2 d1 d2) r\n\n let rec filter p = function\n Empty -> Empty\n | Node {l; v; d; r} as m ->\n (* call [p] in the expected left-to-right order *)\n let l' = filter p l in\n let pvd = p v d in\n let r' = filter p r in\n if pvd then if l==l' && r==r' then m else join l' v d r'\n else concat l' r'\n\n let rec filter_map f = function\n Empty -> Empty\n | Node {l; v; d; r} ->\n (* call [f] in the expected left-to-right order *)\n let l' = filter_map f l in\n let fvd = f v d in\n let r' = filter_map f r in\n begin match fvd with\n | Some d' -> join l' v d' r'\n | None -> concat l' r'\n end\n\n let rec partition p = function\n Empty -> (Empty, Empty)\n | Node {l; v; d; r} ->\n (* call [p] in the expected left-to-right order *)\n let (lt, lf) = partition p l in\n let pvd = p v d in\n let (rt, rf) = partition p r in\n if pvd\n then (join lt v d rt, concat lf rf)\n else (concat lt rt, join lf v d rf)\n\n type 'a enumeration = End | More of key * 'a * 'a t * 'a enumeration\n\n let rec cons_enum m e =\n match m with\n Empty -> e\n | Node {l; v; d; r} -> cons_enum l (More(v, d, r, e))\n\n let compare cmp m1 m2 =\n let rec compare_aux e1 e2 =\n match (e1, e2) with\n (End, End) -> 0\n | (End, _) -> -1\n | (_, End) -> 1\n | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) ->\n let c = Ord.compare v1 v2 in\n if c <> 0 then c else\n let c = cmp d1 d2 in\n if c <> 0 then c else\n compare_aux (cons_enum r1 e1) (cons_enum r2 e2)\n in compare_aux (cons_enum m1 End) (cons_enum m2 End)\n\n let equal cmp m1 m2 =\n let rec equal_aux e1 e2 =\n match (e1, e2) with\n (End, End) -> true\n | (End, _) -> false\n | (_, End) -> false\n | (More(v1, d1, r1, e1), More(v2, d2, r2, e2)) ->\n Ord.compare v1 v2 = 0 && cmp d1 d2 &&\n equal_aux (cons_enum r1 e1) (cons_enum r2 e2)\n in equal_aux (cons_enum m1 End) (cons_enum m2 End)\n\n let rec cardinal = function\n Empty -> 0\n | Node {l; r} -> cardinal l + 1 + cardinal r\n\n let rec bindings_aux accu = function\n Empty -> accu\n | Node {l; v; d; r} -> bindings_aux ((v, d) :: bindings_aux accu r) l\n\n let bindings s =\n bindings_aux [] s\n\n let choose = min_binding\n\n let choose_opt = min_binding_opt\n\n let to_list = bindings\n let of_list bs = List.fold_left (fun m (k, v) -> add k v m) empty bs\n\n let add_seq i m =\n Seq.fold_left (fun m (k,v) -> add k v m) m i\n\n let of_seq i = add_seq i empty\n\n let rec seq_of_enum_ c () = match c with\n | End -> Seq.Nil\n | More (k,v,t,rest) -> Seq.Cons ((k,v), seq_of_enum_ (cons_enum t rest))\n\n let to_seq m =\n seq_of_enum_ (cons_enum m End)\n\n let rec snoc_enum s e =\n match s with\n Empty -> e\n | Node{l; v; d; r} -> snoc_enum r (More(v, d, l, e))\n\n let rec rev_seq_of_enum_ c () = match c with\n | End -> Seq.Nil\n | More (k,v,t,rest) ->\n Seq.Cons ((k,v), rev_seq_of_enum_ (snoc_enum t rest))\n\n let to_rev_seq c =\n rev_seq_of_enum_ (snoc_enum c End)\n\n let to_seq_from low m =\n let rec aux low m c = match m with\n | Empty -> c\n | Node {l; v; d; r; _} ->\n begin match Ord.compare v low with\n | 0 -> More (v, d, r, c)\n | n when n<0 -> aux low r c\n | _ -> aux low l (More (v, d, r, c))\n end\n in\n seq_of_enum_ (aux low m End)\nend\n","(* generated code *)"],"names":[],"mappings":"EAiiBkC,a,eAA5B,QAAa,UATS,4CAGa,IAHb,S,CAGJ,EAAZ,cAAY,KAAiB,C,CAAA,EAElB,YACF,M,CAAA,E,CAAA,I,CAAA,gB,IAFA,M,CAAA,E,CAAA,I,CAAA,OAKa,K,CAAA,I,EAZM,a,EAAA,GAAjB,SAAiB,I,KANJ,UACrB,KAE+C,QAF/C,mBAE+C,IAAnC,GAFZ,cAE6B,GAAjB,GAAmC,KAAC,C,KAPzD,aACW,GACW,IADX,0BACW,QADX,OACW,UAA8B,C,EALtB,GAAjB,SAAiB,I,KALJ,UACjB,KAC8D,QAD9D,mBAC8D,IAA/B,GAD/B,cAC4C,GAAb,GAA+B,KAAC,C,EAJ3D,oBAAe,C,KAFd,mBAAgB,EAAhB,MAAgB,QAAU,C,EAAxC,8CAA4C,C,EAH7B,gDAAmD,C,EAPlE,SAAiB,C,KALE,aACR,iBACuD,QADvD,cACuD,IAAnB,EADpC,OACoC,GAAmB,UAAG,C,OANpD,UACN,0BACuB,SAAjB,SAAU,uBAAiB,C,eAJzC,QAA6B,WAAnB,SAAkB,SAP3B,iBAEa,aACD,qEAEO,IAFP,cAEV,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D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":186372},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/stack.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype 'a t = { mutable c : 'a list; mutable len : int; }\n\nexception Empty\n\nlet create () = { c = []; len = 0; }\n\nlet clear s = s.c <- []; s.len <- 0\n\nlet copy s = { c = s.c; len = s.len; }\n\nlet push x s = s.c <- x :: s.c; s.len <- s.len + 1\n\nlet pop s =\n match s.c with\n | hd::tl -> s.c <- tl; s.len <- s.len - 1; hd\n | [] -> raise Empty\n\nlet pop_opt s =\n match s.c with\n | hd::tl -> s.c <- tl; s.len <- s.len - 1; Some hd\n | [] -> None\n\nlet drop s =\n match s.c with\n | _hd::tl -> s.c <- tl; s.len <- s.len - 1\n | [] -> raise Empty\n\nlet top s =\n match s.c with\n | hd::_ -> hd\n | [] -> raise Empty\n\nlet top_opt s =\n match s.c with\n | hd::_ -> Some hd\n | [] -> None\n\nlet is_empty s = (s.c = [])\n\nlet length s = s.len\n\nlet iter f s = List.iter f s.c\n\nlet fold f acc s = List.fold_left f acc s.c\n\n(** {1 Iterators} *)\n\nlet to_seq s = List.to_seq s.c\n\nlet add_seq q i = Seq.iter (fun x -> push x q) i\n\nlet of_seq g =\n let s = create() in\n add_seq s g;\n s\n","(* generated code *)"],"names":[],"mappings":"KAmBgB,I,EAAA,KAiDd,UAAW,EACV,C,EALkC,kBAAQ,C,EAA3B,+BAA8B,C,EAFjC,gCAAe,C,EAJX,mCAAwB,C,EAF5B,iCAAe,C,EAFf,UAAK,C,EAFH,iBAAU,C,EAJzB,oBAEW,KADA,IACA,UADA,KACI,C,EAPf,yBAEW,kBAAW,C,QAPtB,yBAEQ,OADK,SACL,UADK,GAAW,6BACL,C,KAPnB,oBAEY,mBADA,SACA,OADA,GAAW,wBAAoB,WAC3B,C,QAPhB,yBAEY,qBADA,SACA,OADA,GAAW,wBAAoB,GACpB,C,KALV,6BAAiB,4BAAkB,C,KAFrC,2BAAyB,C,KAFxB,gBAAW,eAAU,C,EAFnB,I,EAAA,GAAoB,C,KCnBpC,mG,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":187371},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/queue.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Francois Pottier, projet Cristal, INRIA Rocquencourt *)\n(* Jeremie Dimino, Jane Street Europe *)\n(* *)\n(* Copyright 2002 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nexception Empty\n\ntype 'a cell =\n | Nil\n | Cons of { content: 'a; mutable next: 'a cell }\n\ntype 'a t = {\n mutable length: int;\n mutable first: 'a cell;\n mutable last: 'a cell\n}\n\nlet create () = {\n length = 0;\n first = Nil;\n last = Nil\n}\n\nlet clear q =\n q.length <- 0;\n q.first <- Nil;\n q.last <- Nil\n\nlet add x q =\n let cell = Cons {\n content = x;\n next = Nil\n } in\n match q.last with\n | Nil ->\n q.length <- 1;\n q.first <- cell;\n q.last <- cell\n | Cons last ->\n q.length <- q.length + 1;\n last.next <- cell;\n q.last <- cell\n\nlet push =\n add\n\nlet peek q =\n match q.first with\n | Nil -> raise Empty\n | Cons { content } -> content\n\nlet peek_opt q =\n match q.first with\n | Nil -> None\n | Cons { content } -> Some content\n\nlet top =\n peek\n\nlet take q =\n match q.first with\n | Nil -> raise Empty\n | Cons { content; next = Nil } ->\n clear q;\n content\n | Cons { content; next } ->\n q.length <- q.length - 1;\n q.first <- next;\n content\n\nlet take_opt q =\n match q.first with\n | Nil -> None\n | Cons { content; next = Nil } ->\n clear q;\n Some content\n | Cons { content; next } ->\n q.length <- q.length - 1;\n q.first <- next;\n Some content\n\nlet pop =\n take\n\nlet copy =\n let rec copy q_res prev cell =\n match cell with\n | Nil -> q_res.last <- prev; q_res\n | Cons { content; next } ->\n let res = Cons { content; next = Nil } in\n begin match prev with\n | Nil -> q_res.first <- res\n | Cons p -> p.next <- res\n end;\n copy q_res res next\n in\n fun q -> copy { length = q.length; first = Nil; last = Nil } Nil q.first\n\nlet is_empty q =\n q.length = 0\n\nlet length q =\n q.length\n\nlet iter =\n let rec iter f cell =\n match cell with\n | Nil -> ()\n | Cons { content; next } ->\n f content;\n iter f next\n in\n fun f q -> iter f q.first\n\nlet fold =\n let rec fold f accu cell =\n match cell with\n | Nil -> accu\n | Cons { content; next } ->\n let accu = f accu content in\n fold f accu next\n in\n fun f accu q -> fold f accu q.first\n\nlet transfer q1 q2 =\n if q1.length > 0 then\n match q2.last with\n | Nil ->\n q2.length <- q1.length;\n q2.first <- q1.first;\n q2.last <- q1.last;\n clear q1\n | Cons last ->\n q2.length <- q2.length + q1.length;\n last.next <- q1.first;\n q2.last <- q1.last;\n clear q1\n\n(** {1 Iterators} *)\n\nlet to_seq q =\n let rec aux c () = match c with\n | Nil -> Seq.Nil\n | Cons { content=x; next; } -> Seq.Cons (x, aux next)\n in\n aux q.first\n\nlet add_seq q i = Seq.iter (fun x -> push x q) i\n\nlet of_seq g =\n let q = create() in\n add_seq q g;\n q\n","(* generated code *)"],"names":[],"mappings":"KA4BgB,I,EAAA,KAsId,UAAW,EACV,C,EALkC,kBAAQ,C,EAA3B,+BAA8B,C,EC9JhD,a,KDwJqB,UACR,KAC2C,IAD3C,YACmC,GADnC,OACmC,GAAQ,KAAC,C,EAEvD,gBAAW,C,QApBX,yBACE,qBAEE,cACA,cACA,cACA,UAEA,4CACA,iBACA,cACA,U,EAAA,KAAQ,C,KAdI,mBANd,UACS,iBAEI,EAFJ,OAEI,KACX,MAE+B,C,QAVxB,eANT,UACS,0BAEP,gBAAS,IAGY,C,EAVzB,UAAQ,C,EAHR,iBAAY,C,MAHH,gDAVP,UACS,SAAoB,iBAE3B,IAF2B,OAE3B,UACA,SACS,SAGT,OAFY,mB,GAIwD,C,SAzBxE,oBACS,kCAEP,UAAO,uBAGP,6BACA,SACA,YAAY,C,SAnBd,yBACS,oCAEP,UAAO,eAGP,6BACA,SACA,IAAO,C,EAhBT,oBACS,KACa,IADb,UACa,KAAY,C,EAPlC,yBACS,kBACoB,C,MApB7B,gBAIA,sBAEE,WACA,SACA,cAEA,2BACA,YACA,cAAc,C,KAjBhB,gBACA,WACA,eAAa,C,EATC,I,EAAA,GAIf,C,QChCD,4BDqIE,eCrIF,UDqIE,sD,QCrIF,4D,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":188979},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/buffer.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Pierre Weis and Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1999 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Extensible buffers *)\n\n(* The [inner_buffer] type ensures that the [length] and [buffer] fields are\n always synchronized, [length = Bytes.length buffer], even in presence\n of data races.\n*)\ntype inner_buffer = {\n buffer: bytes;\n length: int;\n}\n\ntype t =\n {mutable inner : inner_buffer;\n mutable position : int;\n initial_buffer : bytes}\n(* Invariants: all parts of the code preserve the invariants that:\n - [inner.length = Bytes.length inner.buffer]\n In absence of data races, we also have\n - [0 <= b.position <= b.inner.length]\n\n Note in particular that [b.position = b.inner.length] is legal,\n it means that the buffer is full and will have to be extended\n before any further addition. *)\n\nlet create n =\n let n = if n < 1 then 1 else n in\n let n = if n > Sys.max_string_length then Sys.max_string_length else n in\n let s = Bytes.create n in\n { inner = { buffer = s; length = n}; position = 0; initial_buffer = s}\n\nlet contents b = Bytes.sub_string b.inner.buffer 0 b.position\nlet to_bytes b = Bytes.sub b.inner.buffer 0 b.position\n\nlet sub b ofs len =\n if ofs < 0 || len < 0 || ofs > b.position - len\n then invalid_arg \"Buffer.sub\"\n else Bytes.sub_string b.inner.buffer ofs len\n\n\nlet blit src srcoff dst dstoff len =\n if len < 0 || srcoff < 0 || srcoff > src.position - len\n || dstoff < 0 || dstoff > (Bytes.length dst) - len\n then invalid_arg \"Buffer.blit\"\n else\n Bytes.blit src.inner.buffer srcoff dst dstoff len\n\n\nlet nth b ofs =\n let position = b.position in\n let {buffer;length} = b.inner in\n if ofs < 0 || ofs >= position || position > length then\n invalid_arg \"Buffer.nth\"\n else Bytes.unsafe_get buffer ofs\n\n\nlet length b = b.position\n\nlet clear b = b.position <- 0\n\nlet reset b =\n b.position <- 0;\n let inner =\n { buffer = b.initial_buffer; length = Bytes.length b.initial_buffer }\n in\n b.inner <- inner\n\n(* [resize b more] ensures that [b.position + more <= b.inner.length] holds\n by dynamically extending [b.inner] if necessary -- and thus\n increasing [b.inner.length].\n*)\nlet resize b more =\n let old_pos = b.position in\n let old_len = b.inner.length in\n let new_len = ref old_len in\n while old_pos + more > !new_len do new_len := 2 * !new_len done;\n if !new_len > Sys.max_string_length then begin\n if old_pos + more <= Sys.max_string_length\n then new_len := Sys.max_string_length\n else failwith \"Buffer.add: cannot grow buffer\"\n end;\n let new_buffer = Bytes.create !new_len in\n (* PR#6148: let's keep using [blit] rather than [unsafe_blit] in\n this tricky function that is slow anyway. *)\n Bytes.blit b.inner.buffer 0 new_buffer 0 b.position;\n b.inner <- { buffer = new_buffer; length = !new_len }\n\n(* Note:\n Some of the functions below have a fast path when the inner\n buffer doesn't need to be extended.\n In this case, it is possible to use unsafe accesses on the\n contents of the [inner] field since its fields are immutable.\n In presence of data races, we may access the wrong inner buffer, but we\n will use this buffer safely.\n As soon as we need to resize the buffer, we fall back to safe accesses.\n*)\n\nlet add_char b c =\n let pos = b.position in\n let {buffer;length} = b.inner in\n if pos >= length then (\n resize b 1;\n Bytes.set b.inner.buffer b.position c\n ) else\n Bytes.unsafe_set buffer pos c;\n b.position <- pos + 1\n\nlet uchar_utf_8_byte_length_max = 4\nlet uchar_utf_16_byte_length_max = 4\n\nlet rec add_utf_8_uchar b u =\n let pos = b.position in\n if pos >= b.inner.length then resize b uchar_utf_8_byte_length_max;\n let n = Bytes.set_utf_8_uchar b.inner.buffer pos u in\n if n = 0\n then (resize b uchar_utf_8_byte_length_max; add_utf_8_uchar b u)\n else (b.position <- pos + n)\n\nlet rec add_utf_16be_uchar b u =\n let pos = b.position in\n if pos >= b.inner.length then resize b uchar_utf_16_byte_length_max;\n let n = Bytes.set_utf_16be_uchar b.inner.buffer pos u in\n if n = 0\n then (resize b uchar_utf_16_byte_length_max; add_utf_16be_uchar b u)\n else (b.position <- pos + n)\n\nlet rec add_utf_16le_uchar b u =\n let pos = b.position in\n if pos >= b.inner.length then resize b uchar_utf_16_byte_length_max;\n let n = Bytes.set_utf_16le_uchar b.inner.buffer pos u in\n if n = 0\n then (resize b uchar_utf_16_byte_length_max; add_utf_16le_uchar b u)\n else (b.position <- pos + n)\n\nlet add_substring b s offset len =\n if offset < 0 || len < 0 || offset > String.length s - len\n then invalid_arg \"Buffer.add_substring/add_subbytes\";\n let position = b.position in\n let {buffer;length} = b.inner in\n let new_position = position + len in\n if new_position > length then (\n resize b len;\n Bytes.blit_string s offset b.inner.buffer b.position len\n ) else\n Bytes.unsafe_blit_string s offset buffer position len;\n b.position <- new_position\n\nlet add_subbytes b s offset len =\n add_substring b (Bytes.unsafe_to_string s) offset len\n\nlet add_string b s =\n let len = String.length s in\n let position = b.position in\n let {buffer; length} = b.inner in\n let new_position = position + len in\n if new_position > length then (\n resize b len;\n Bytes.blit_string s 0 b.inner.buffer b.position len;\n ) else\n Bytes.unsafe_blit_string s 0 buffer position len;\n b.position <- new_position\n\nlet add_bytes b s = add_string b (Bytes.unsafe_to_string s)\n\nlet add_buffer b bs =\n add_subbytes b bs.inner.buffer 0 bs.position\n\n(* this (private) function could move into the standard library *)\nlet really_input_up_to ic buf ofs len =\n let rec loop ic buf ~already_read ~ofs ~to_read =\n if to_read = 0 then already_read\n else begin\n let r = input ic buf ofs to_read in\n if r = 0 then already_read\n else begin\n let already_read = already_read + r in\n let ofs = ofs + r in\n let to_read = to_read - r in\n loop ic buf ~already_read ~ofs ~to_read\n end\n end\n in loop ic buf ~already_read:0 ~ofs ~to_read:len\n\n\nlet unsafe_add_channel_up_to b ic len =\n if b.position + len > b.inner.length then resize b len;\n let n = really_input_up_to ic b.inner.buffer b.position len in\n b.position <- b.position + n;\n n\n\nlet add_channel b ic len =\n if len < 0 || len > Sys.max_string_length then (* PR#5004 *)\n invalid_arg \"Buffer.add_channel\";\n let n = unsafe_add_channel_up_to b ic len in\n (* It is intentional that a consumer catching End_of_file\n will see the data written (see #6719, #7136). *)\n if n < len then raise End_of_file;\n ()\n\nlet output_buffer oc b =\n output oc b.inner.buffer 0 b.position\n\nlet closing = function\n | '(' -> ')'\n | '{' -> '}'\n | _ -> assert false\n\n(* opening and closing: open and close characters, typically ( and )\n k: balance of opening and closing chars\n s: the string where we are searching\n start: the index where we start the search. *)\nlet advance_to_closing opening closing k s start =\n let rec advance k i lim =\n if i >= lim then raise Not_found else\n if s.[i] = opening then advance (k + 1) (i + 1) lim else\n if s.[i] = closing then\n if k = 0 then i else advance (k - 1) (i + 1) lim\n else advance k (i + 1) lim in\n advance k start (String.length s)\n\nlet advance_to_non_alpha s start =\n let rec advance i lim =\n if i >= lim then lim else\n match s.[i] with\n | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' -> advance (i + 1) lim\n | _ -> i in\n advance start (String.length s)\n\n(* We are just at the beginning of an ident in s, starting at start. *)\nlet find_ident s start lim =\n if start >= lim then raise Not_found else\n match s.[start] with\n (* Parenthesized ident ? *)\n | '(' | '{' as c ->\n let new_start = start + 1 in\n let stop = advance_to_closing c (closing c) 0 s new_start in\n String.sub s new_start (stop - start - 1), stop + 1\n (* Regular ident *)\n | _ ->\n let stop = advance_to_non_alpha s start in\n if stop = start then raise Not_found else\n String.sub s start (stop - start), stop\n\n(* Substitute $ident, $(ident), or ${ident} in s,\n according to the function mapping f. *)\nlet add_substitute b f s =\n let lim = String.length s in\n let rec subst previous i =\n if i < lim then begin\n match s.[i] with\n | '$' as current when previous = '\\\\' ->\n add_char b current;\n subst ' ' (i + 1)\n | '$' ->\n let j = i + 1 in\n begin match find_ident s j lim with\n | ident, next_i ->\n add_string b (f ident);\n subst ' ' next_i\n | exception Not_found ->\n add_char b '$';\n subst ' ' j\n end\n | current ->\n if previous = '\\\\' then add_char b previous;\n if current <> '\\\\' then add_char b current;\n subst current (i + 1)\n end else\n if previous = '\\\\' then add_char b previous in\n subst ' ' 0\n\nlet truncate b len =\n if len < 0 || len > length b then\n invalid_arg \"Buffer.truncate\"\n else\n b.position <- len\n\n(** {1 Iterators} *)\n\nlet to_seq b =\n let rec aux i () =\n (* Note that b.position is not a constant and cannot be lifted out of aux *)\n if i >= b.position then Seq.Nil\n else\n let x = Bytes.get b.inner.buffer i in\n Seq.Cons (x, aux (i+1))\n in\n aux 0\n\nlet to_seqi b =\n let rec aux i () =\n (* Note that b.position is not a constant and cannot be lifted out of aux *)\n if i >= b.position then Seq.Nil\n else\n let x = Bytes.get b.inner.buffer i in\n Seq.Cons ((i,x), aux (i+1))\n in\n aux 0\n\nlet add_seq b seq = Seq.iter (add_char b) seq\n\nlet of_seq i =\n let b = create 32 in\n add_seq b i;\n b\n\n(** {6 Binary encoding of integers} *)\n\nexternal unsafe_set_int8 : bytes -> int -> int -> unit = \"%bytes_unsafe_set\"\nexternal unsafe_set_int16 : bytes -> int -> int -> unit = \"%caml_bytes_set16u\"\nexternal unsafe_set_int32 : bytes -> int -> int32 -> unit = \"%caml_bytes_set32u\"\nexternal unsafe_set_int64 : bytes -> int -> int64 -> unit = \"%caml_bytes_set64u\"\nexternal set_int8 : bytes -> int -> int -> unit = \"%bytes_safe_set\"\nexternal set_int16 : bytes -> int -> int -> unit = \"%caml_bytes_set16\"\nexternal set_int32 : bytes -> int -> int32 -> unit = \"%caml_bytes_set32\"\nexternal set_int64 : bytes -> int -> int64 -> unit = \"%caml_bytes_set64\"\n\nexternal swap16 : int -> int = \"%bswap16\"\nexternal swap32 : int32 -> int32 = \"%bswap_int32\"\nexternal swap64 : int64 -> int64 = \"%bswap_int64\"\n\n\nlet add_int8 b x =\n let position = b.position in\n let {length; buffer} = b.inner in\n let new_position = position + 1 in\n if new_position > length then (\n resize b 1;\n set_int8 b.inner.buffer b.position x\n ) else\n unsafe_set_int8 buffer position x;\n b.position <- new_position\n\nlet add_int16_ne b x =\n let position = b.position in\n let {length; buffer} = b.inner in\n let new_position = position + 2 in\n if new_position > length then (\n resize b 2;\n set_int16 b.inner.buffer b.position x\n ) else\n unsafe_set_int16 buffer position x;\n b.position <- new_position\n\nlet add_int32_ne b x =\n let position = b.position in\n let {length; buffer} = b.inner in\n let new_position = position + 4 in\n if new_position > length then (\n resize b 4;\n set_int32 b.inner.buffer b.position x\n ) else\n unsafe_set_int32 buffer position x;\n b.position <- new_position\n\nlet add_int64_ne b x =\n let position = b.position in\n let {length; buffer} = b.inner in\n let new_position = position + 8 in\n if new_position > length then (\n resize b 8;\n set_int64 b.inner.buffer b.position x\n ) else\n unsafe_set_int64 buffer position x;\n b.position <- new_position\n\nlet add_int16_le b x =\n add_int16_ne b (if Sys.big_endian then swap16 x else x)\n\nlet add_int16_be b x =\n add_int16_ne b (if Sys.big_endian then x else swap16 x)\n\nlet add_int32_le b x =\n add_int32_ne b (if Sys.big_endian then swap32 x else x)\n\nlet add_int32_be b x =\n add_int32_ne b (if Sys.big_endian then x else swap32 x)\n\nlet add_int64_le b x =\n add_int64_ne b (if Sys.big_endian then swap64 x else x)\n\nlet add_int64_be b x =\n add_int64_ne b (if Sys.big_endian then x else swap64 x)\n\nlet add_uint8 = add_int8\nlet add_uint16_ne = add_int16_ne\nlet add_uint16_le = add_int16_le\nlet add_uint16_be = add_int16_be\n","(* generated code *)"],"names":[],"mappings":"EA4YE,eAA8C,iBAAQ,cAAC,C,EAHvD,a,CAAA,EAAuC,iBAAQ,cAAQ,C,EAHvD,eAA8C,iBAAQ,cAAC,C,EAHvD,a,CAAA,EAAuC,iBAAQ,cAAQ,C,EAHvD,eAA8C,kBAAS,C,EAHvD,a,CAAA,EAAuC,kBAAgB,C,WAXvD,cAEA,UACA,MAFA,iBAEA,QACE,SAAU,sBACV,mBAJF,UAME,qBACF,kBAA0B,C,WAnB1B,cAEA,UACA,MAFA,iBAEA,QACE,SAAU,sBACV,mBAJF,UAME,qBACF,kBAA0B,C,WAnB1B,cAEA,UACA,MAFA,iBAEA,QACE,SAAU,sBACV,gBAJF,UAME,kBACF,kBAA0B,C,iBAnB1B,gBAEA,UACA,MAFA,iBAEA,QACE,SAAU,OACV,OADU,eACV,2BAJF,UAME,qBACF,uBAA0B,C,EA7BlB,aACR,UAAW,EACV,C,EAL0B,mB,EAAA,QAAY,uBAAI,C,ECzT7C,kB,MDqTuB,wB,UAHnB,gCAAwB,MAEd,IAAR,sBAAQ,Q,EACkB,UADlB,SACkB,MAAT,KAAjB,OAAiB,GAAS,UAAC,C,EAE/B,GAPA,KAOA,GAAK,C,ECvTP,kB,MD2SmB,wB,SAHf,gCAAwB,MAEd,IAAR,sBAAQ,Q,EACc,IADd,SACc,EAAT,KAAb,OAAa,GAAS,UAAC,C,EAE3B,GAPA,KAOA,G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yBADA,SACA,QAA8B,UAE9B,IADA,kBAAQ,IAAR,QAAQ,eACR,IACM,SAAqC,GACtC,iCAAuB,C,SAb5B,GACA,yBADA,SACA,QAA8B,UAE9B,IADA,kBAAQ,IAAR,QAAQ,eACR,IACM,SAAoC,GACrC,iCAAuB,C,eAlB5B,EACA,sBACA,KAFA,SAEA,QACE,SAAU,OACV,OADU,eACV,2BAHF,UAKE,qBACF,+BAAqB,C,UAjCrB,SACA,eAEA,8B,EAAA,KAAmC,eACnC,oBAAyC,qCAElC,WACA,0BAEU,MAGjB,sDAAmD,mBACE,C,KAxBrD,gBAIA,IAHA,6BAGA,OAAgB,C,EAPJ,kBAAe,C,EAFd,UAAU,C,SALvB,cADA,iCADA,OAEA,4BAEK,kBADJ,uBAC+B,C,YAZhC,wGAIE,iDAFG,uBAE8C,C,SAVnD,+DAEK,2CADA,uBACuC,C,KAL7B,oDAAqC,C,KADrC,oDAA4C,C,KAL5D,cAAsB,OAGtB,QAHsB,QACtB,aAA0C,YAClC,MACR,gBAAsE,C,GC3CvE,wI,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA,sD,EAAA,c,EAAA,c,EAAA,c,EAAA,c,iBAAA","ignoreList":[1]}},{"offset":{"line":0,"column":194663},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/mutex.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy and Pascal Cuoq, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1995 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t\nexternal create: unit -> t = \"caml_ml_mutex_new\"\nexternal lock: t -> unit = \"caml_ml_mutex_lock\"\nexternal try_lock: t -> bool = \"caml_ml_mutex_try_lock\"\nexternal unlock: t -> unit = \"caml_ml_mutex_unlock\"\n\n(* private re-export *)\nexternal reraise : exn -> 'a = \"%reraise\"\n\n(* cannot inline, otherwise flambda might move code around. *)\nlet[@inline never] protect m f =\n lock m;\n match f() with\n | x ->\n unlock m; x\n | exception e ->\n (* NOTE: [unlock] does not poll for asynchronous exceptions *)\n unlock m;\n reraise e\n"],"names":[],"mappings":"qCC0BE,MAAM,SACA,qBAAG,I,AAAA,I,AAAA,G,EAAA,KAKP,MAAQ,KAHR,MAAQ,EAIC,C","ignoreList":[0]}},{"offset":{"line":0,"column":194979},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/semaphore.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, Collège de France and INRIA Paris *)\n(* *)\n(* Copyright 2020 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(** Semaphores *)\n\ntype sem = {\n mut: Mutex.t; (* protects [v] *)\n mutable v: int; (* the current value *)\n nonzero: Condition.t (* signaled when [v > 0] *)\n}\n\nmodule Counting = struct\n\ntype t = sem\n\nlet make v =\n if v < 0 then invalid_arg \"Semaphore.Counting.init: wrong initial value\";\n { mut = Mutex.create(); v; nonzero = Condition.create() }\n\nlet release s =\n Mutex.lock s.mut;\n if s.v < max_int then begin\n s.v <- s.v + 1;\n Condition.signal s.nonzero;\n Mutex.unlock s.mut\n end else begin\n Mutex.unlock s.mut;\n raise (Sys_error \"Semaphore.Counting.release: overflow\")\n end\n\nlet acquire s =\n Mutex.lock s.mut;\n while s.v = 0 do Condition.wait s.nonzero s.mut done;\n s.v <- s.v - 1;\n Mutex.unlock s.mut\n\nlet try_acquire s =\n Mutex.lock s.mut;\n let ret = if s.v = 0 then false else (s.v <- s.v - 1; true) in\n Mutex.unlock s.mut;\n ret\n\nlet get_value s = s.v\n\nend\n\nmodule Binary = struct\n\ntype t = sem\n\nlet make b =\n { mut = Mutex.create();\n v = if b then 1 else 0;\n nonzero = Condition.create() }\n\nlet release s =\n Mutex.lock s.mut;\n s.v <- 1;\n Condition.signal s.nonzero;\n Mutex.unlock s.mut\n\nlet acquire s =\n Mutex.lock s.mut;\n while s.v = 0 do Condition.wait s.nonzero s.mut done;\n s.v <- 0;\n Mutex.unlock s.mut\n\nlet try_acquire s =\n Mutex.lock s.mut;\n let ret = if s.v = 0 then false else (s.v <- 0; true) in\n Mutex.unlock s.mut;\n ret\n\nend\n","(* generated code *)"],"names":[],"mappings":"OAgFE,kCAAgB,cACU,GAAW,cAAW,G,EAChD,gCAAkB,IACf,C,MATH,gCAAgB,qBACC,oCAA8B,GAC/C,cACA,6B,GAAkB,C,KATlB,kCAAgB,WAEhB,6BAA0B,4BACR,C,IANN,IAFZ,QAEY,eAAkB,QADd,EADM,IAAd,IACQ,QADR,aAAc,UAEU,C,EAXhB,UAAG,C,OALnB,kCAAgB,cACU,GAAW,2BAAiB,G,EACtD,gCAAkB,IACf,C,MATH,gCAAgB,qBACC,oCAA8B,GAC/C,2BACA,6B,GAAkB,C,MAdlB,kCAAgB,2BACM,wBAEpB,6BAA0B,6BAEnB,kBACP,cAAkB,qB,CAEjB,C,KAZH,YAAc,yBACuB,IAArC,QAAqC,eAAf,IAAd,IAA+C,QAA/C,aAAc,QAAmC,C,EC7B3D","ignoreList":[1]}},{"offset":{"line":0,"column":196097},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/domain.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* KC Sivaramakrishnan, Indian Institute of Technology, Madras *)\n(* Stephen Dolan, University of Cambridge *)\n(* Tom Kelly, OCaml Labs Consultancy *)\n(* *)\n(* Copyright 2019 Indian Institute of Technology, Madras *)\n(* Copyright 2014 University of Cambridge *)\n(* Copyright 2021 OCaml Labs Consultancy Ltd *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nmodule Raw = struct\n (* Low-level primitives provided by the runtime *)\n type t = private int\n\n (* The layouts of [state] and [term_sync] are hard-coded in\n [runtime/domain.c] *)\n\n type 'a state =\n | Running\n | Finished of ('a, exn) result [@warning \"-unused-constructor\"]\n\n type 'a term_sync = {\n (* protected by [mut] *)\n mutable state : 'a state [@warning \"-unused-field\"] ;\n mut : Mutex.t ;\n cond : Condition.t ;\n }\n\n external spawn : (unit -> 'a) -> 'a term_sync -> t\n = \"caml_domain_spawn\"\n external self : unit -> t\n = \"caml_ml_domain_id\" [@@noalloc]\n external cpu_relax : unit -> unit\n = \"caml_ml_domain_cpu_relax\"\n external get_recommended_domain_count: unit -> int\n = \"caml_recommended_domain_count\" [@@noalloc]\nend\n\nlet cpu_relax () = Raw.cpu_relax ()\n\ntype id = Raw.t\n\ntype 'a t = {\n domain : Raw.t;\n term_sync : 'a Raw.term_sync;\n}\n\nmodule DLS = struct\n\n module Obj_opt : sig\n type t\n val none : t\n val some : 'a -> t\n val is_some : t -> bool\n\n (** [unsafe_get obj] may only be called safely\n if [is_some] is true.\n\n [unsafe_get (some v)] is equivalent to\n [Obj.obj (Obj.repr v)]. *)\n val unsafe_get : t -> 'a\n end = struct\n type t = Obj.t\n let none = Obj.repr (ref 0)\n let some v = Obj.repr v\n let is_some obj = (obj != none)\n let unsafe_get obj = Obj.obj obj\n end\n\n type dls_state = Obj_opt.t array\n\n external get_dls_state : unit -> dls_state = \"%dls_get\"\n\n external set_dls_state : dls_state -> unit =\n \"caml_domain_dls_set\" [@@noalloc]\n\n external compare_and_set_dls_state : dls_state -> dls_state -> bool =\n \"caml_domain_dls_compare_and_set\" [@@noalloc]\n\n let create_dls () =\n let st = Array.make 8 Obj_opt.none in\n set_dls_state st\n\n let _ = create_dls ()\n\n type 'a key = int * (unit -> 'a)\n\n let key_counter = Atomic.make 0\n\n type key_initializer =\n KI: 'a key * ('a -> 'a) -> key_initializer\n\n let parent_keys = Atomic.make ([] : key_initializer list)\n\n let rec add_parent_key ki =\n let l = Atomic.get parent_keys in\n if not (Atomic.compare_and_set parent_keys l (ki :: l))\n then add_parent_key ki\n\n let new_key ?split_from_parent init_orphan =\n let idx = Atomic.fetch_and_add key_counter 1 in\n let k = (idx, init_orphan) in\n begin match split_from_parent with\n | None -> ()\n | Some split -> add_parent_key (KI(k, split))\n end;\n k\n\n (* If necessary, grow the current domain's local state array such that [idx]\n * is a valid index in the array. *)\n let rec maybe_grow idx =\n let st = get_dls_state () in\n let sz = Array.length st in\n if idx < sz then st\n else begin\n let rec compute_new_size s =\n if idx < s then s else compute_new_size (2 * s)\n in\n let new_sz = compute_new_size sz in\n let new_st = Array.make new_sz Obj_opt.none in\n Array.blit st 0 new_st 0 sz;\n (* We want a implementation that is safe with respect to\n single-domain multi-threading: retry if the DLS state has\n changed under our feet.\n Note that the number of retries will be very small in\n contended scenarios, as the array only grows, with\n exponential resizing. *)\n if compare_and_set_dls_state st new_st\n then new_st\n else maybe_grow idx\n end\n\n let set (type a) (idx, _init) (x : a) =\n let st = maybe_grow idx in\n (* [Sys.opaque_identity] ensures that flambda does not look at the type of\n * [x], which may be a [float] and conclude that the [st] is a float array.\n * We do not want OCaml's float array optimisation kicking in here. *)\n st.(idx) <- Obj_opt.some (Sys.opaque_identity x)\n\n\n let[@inline never] array_compare_and_set a i oldval newval =\n (* Note: we cannot use [@poll error] due to the\n allocations on a.(i) in the Double_array case. *)\n let curval = a.(i) in\n if curval == oldval then (\n Array.unsafe_set a i newval;\n true\n ) else false\n\n let get (type a) ((idx, init) : a key) : a =\n let st = maybe_grow idx in\n let obj = st.(idx) in\n if Obj_opt.is_some obj\n then (Obj_opt.unsafe_get obj : a)\n else begin\n let v : a = init () in\n let new_obj = Obj_opt.some (Sys.opaque_identity v) in\n (* At this point, [st] or [st.(idx)] may have been changed\n by another thread on the same domain.\n\n If [st] changed, it was resized into a larger value,\n we can just reuse the new value.\n\n If [st.(idx)] changed, we drop the current value to avoid\n letting other threads observe a 'revert' that forgets\n previous modifications. *)\n let st = get_dls_state () in\n if array_compare_and_set st idx obj new_obj\n then v\n else begin\n (* if st.(idx) changed, someone must have initialized\n the key in the meantime. *)\n let updated_obj = st.(idx) in\n if Obj_opt.is_some updated_obj\n then (Obj_opt.unsafe_get updated_obj : a)\n else assert false\n end\n end\n\n type key_value = KV : 'a key * 'a -> key_value\n\n let get_initial_keys () : key_value list =\n List.map\n (fun (KI (k, split)) -> KV (k, (split (get k))))\n (Atomic.get parent_keys)\n\n let set_initial_keys (l: key_value list) =\n List.iter (fun (KV (k, v)) -> set k v) l\nend\n\n(******** Identity **********)\n\nlet get_id { domain; _ } = domain\n\nlet self () = Raw.self ()\n\nlet is_main_domain () = (self () :> int) = 0\n\n(******** Callbacks **********)\n\n(* first spawn, domain startup and at exit functionality *)\nlet first_domain_spawned = Atomic.make false\n\nlet first_spawn_function = ref (fun () -> ())\n\nlet before_first_spawn f =\n if Atomic.get first_domain_spawned then\n raise (Invalid_argument \"first domain already spawned\")\n else begin\n let old_f = !first_spawn_function in\n let new_f () = old_f (); f () in\n first_spawn_function := new_f\n end\n\nlet do_before_first_spawn () =\n if not (Atomic.get first_domain_spawned) then begin\n Atomic.set first_domain_spawned true;\n !first_spawn_function();\n (* Release the old function *)\n first_spawn_function := (fun () -> ())\n end\n\nlet at_exit_key = DLS.new_key (fun () -> (fun () -> ()))\n\nlet at_exit f =\n let old_exit : unit -> unit = DLS.get at_exit_key in\n let new_exit () =\n f (); old_exit ()\n in\n DLS.set at_exit_key new_exit\n\nlet do_at_exit () =\n let f : unit -> unit = DLS.get at_exit_key in\n f ()\n\nlet _ = Stdlib.do_domain_local_at_exit := do_at_exit\n\n(******* Creation and Termination ********)\n\nlet spawn f =\n do_before_first_spawn ();\n let pk = DLS.get_initial_keys () in\n\n (* [term_sync] is used to synchronize with the joining domains *)\n let term_sync =\n Raw.{ state = Running ;\n mut = Mutex.create () ;\n cond = Condition.create () }\n in\n\n let body () =\n match\n DLS.create_dls ();\n DLS.set_initial_keys pk;\n let res = f () in\n res\n with\n (* Run the [at_exit] callbacks when the domain computation either\n terminates normally or exceptionally. *)\n | res ->\n (* If the domain computation terminated normally, but the\n [at_exit] callbacks raised an exception, then return the\n exception. *)\n do_at_exit ();\n res\n | exception exn ->\n (* If both the domain computation and the [at_exit] callbacks\n raise exceptions, then ignore the exception from the\n [at_exit] callbacks and return the original exception. *)\n (try do_at_exit () with _ -> ());\n raise exn\n in\n let domain = Raw.spawn body term_sync in\n { domain ; term_sync }\n\nlet join { term_sync ; _ } =\n let open Raw in\n let rec loop () =\n match term_sync.state with\n | Running ->\n Condition.wait term_sync.cond term_sync.mut;\n loop ()\n | Finished res ->\n res\n in\n match Mutex.protect term_sync.mut loop with\n | Ok x -> x\n | Error ex -> raise ex\n\nlet recommended_domain_count = Raw.get_recommended_domain_count\n"],"names":[],"mappings":"aC8RI,kCAEI,kDAA2C,eAGxC,C,KAE6B,IAV/B,UAUP,UATA,QASA,QAAM,eAAgC,sBAC5B,aACY,C,EApEe,IAAE,C,KAhC3B,yBAAoB,QAAQ,C,OAgEtC,iB,IACE,QAjEF,K,CAAA,W,CAAA,2BAmEY,M,CAAA,oBACV,I,AAAA,I,AAAA,G,EAAA,KDvQN,SCqRa,M,CAAA,SAAa,I,AAAA,I,AAAA,G,EAAA,KAClB,KAPA,M,CAAA,SAAa,EAOJ,C,WAvFX,cAA8C,IAA9C,SAAsC,EAAtC,MAAsC,QAAP,eAAe,IAAE,C,aAgCpD,QAAO,KAAP,QAAO,aAAiC,QACtC,WAD4C,QAC5C,cACA,IADoC,YACpC,cAAuB,gBAjCG,cAAxB,OAFF,QAEE,aAAwB,uBA+Db,IAHf,QAGe,eA0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ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Benoit Vaugon, ENSTA *)\n(* *)\n(* Copyright 2014 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nopen CamlinternalFormatBasics\n\n(******************************************************************************)\n (* Tools to manipulate scanning set of chars (see %[...]) *)\n\ntype mutable_char_set = bytes\n\n(* Create a fresh, empty, mutable char set. *)\nlet create_char_set () = Bytes.make 32 '\\000'\n\n(* Add a char in a mutable char set. *)\nlet add_in_char_set char_set c =\n let ind = int_of_char c in\n let str_ind = ind lsr 3 and mask = 1 lsl (ind land 0b111) in\n Bytes.set char_set str_ind\n (char_of_int (int_of_char (Bytes.get char_set str_ind) lor mask))\n\nlet freeze_char_set char_set =\n Bytes.to_string char_set\n\n(* Compute the complement of a char set. *)\nlet rev_char_set char_set =\n let char_set' = create_char_set () in\n for i = 0 to 31 do\n Bytes.set char_set' i\n (char_of_int (int_of_char (String.get char_set i) lxor 0xFF));\n done;\n Bytes.unsafe_to_string char_set'\n\n(* Return true if a `c' is in `char_set'. *)\nlet is_in_char_set char_set c =\n let ind = int_of_char c in\n let str_ind = ind lsr 3 and mask = 1 lsl (ind land 0b111) in\n (int_of_char (String.get char_set str_ind) land mask) <> 0\n\n\n(******************************************************************************)\n (* Ignored param conversion *)\n\n(* GADT used to abstract an existential type parameter. *)\n(* See param_format_of_ignored_format. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) param_format_ebb = Param_format_EBB :\n ('x -> 'a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('a, 'b, 'c, 'd, 'e, 'f) param_format_ebb\n\n(* Compute a padding associated to a pad_option (see \"%_42d\"). *)\nlet pad_of_pad_opt pad_opt = match pad_opt with\n | None -> No_padding\n | Some width -> Lit_padding (Right, width)\n\n(* Compute a precision associated to a prec_option (see \"%_.42f\"). *)\nlet prec_of_prec_opt prec_opt = match prec_opt with\n | None -> No_precision\n | Some ndec -> Lit_precision ndec\n\n(* Turn an ignored param into its equivalent not-ignored format node. *)\n(* Used for format pretty-printing and Scanf. *)\nlet param_format_of_ignored_format : type a b c d e f x y .\n (a, b, c, d, y, x) ignored -> (x, b, c, y, e, f) fmt ->\n (a, b, c, d, e, f) param_format_ebb =\nfun ign fmt -> match ign with\n | Ignored_char ->\n Param_format_EBB (Char fmt)\n | Ignored_caml_char ->\n Param_format_EBB (Caml_char fmt)\n | Ignored_string pad_opt ->\n Param_format_EBB (String (pad_of_pad_opt pad_opt, fmt))\n | Ignored_caml_string pad_opt ->\n Param_format_EBB (Caml_string (pad_of_pad_opt pad_opt, fmt))\n | Ignored_int (iconv, pad_opt) ->\n Param_format_EBB (Int (iconv, pad_of_pad_opt pad_opt, No_precision, fmt))\n | Ignored_int32 (iconv, pad_opt) ->\n Param_format_EBB\n (Int32 (iconv, pad_of_pad_opt pad_opt, No_precision, fmt))\n | Ignored_nativeint (iconv, pad_opt) ->\n Param_format_EBB\n (Nativeint (iconv, pad_of_pad_opt pad_opt, No_precision, fmt))\n | Ignored_int64 (iconv, pad_opt) ->\n Param_format_EBB\n (Int64 (iconv, pad_of_pad_opt pad_opt, No_precision, fmt))\n | Ignored_float (pad_opt, prec_opt) ->\n Param_format_EBB\n (Float ((Float_flag_, Float_f),\n pad_of_pad_opt pad_opt, prec_of_prec_opt prec_opt, fmt))\n | Ignored_bool pad_opt ->\n Param_format_EBB (Bool (pad_of_pad_opt pad_opt, fmt))\n | Ignored_format_arg (pad_opt, fmtty) ->\n Param_format_EBB (Format_arg (pad_opt, fmtty, fmt))\n | Ignored_format_subst (pad_opt, fmtty) ->\n Param_format_EBB\n (Format_subst (pad_opt, fmtty, fmt))\n | Ignored_reader ->\n Param_format_EBB (Reader fmt)\n | Ignored_scan_char_set (width_opt, char_set) ->\n Param_format_EBB (Scan_char_set (width_opt, char_set, fmt))\n | Ignored_scan_get_counter counter ->\n Param_format_EBB (Scan_get_counter (counter, fmt))\n | Ignored_scan_next_char ->\n Param_format_EBB (Scan_next_char fmt)\n\n\n(******************************************************************************)\n (* Types *)\n\ntype ('b, 'c) acc_formatting_gen =\n | Acc_open_tag of ('b, 'c) acc\n | Acc_open_box of ('b, 'c) acc\n\n(* Reversed list of printing atoms. *)\n(* Used to accumulate printf arguments. *)\nand ('b, 'c) acc =\n | Acc_formatting_lit of ('b, 'c) acc * formatting_lit\n (* Special fmtting (box) *)\n | Acc_formatting_gen of ('b, 'c) acc * ('b, 'c) acc_formatting_gen\n (* Special fmtting (box) *)\n | Acc_string_literal of ('b, 'c) acc * string (* Literal string *)\n | Acc_char_literal of ('b, 'c) acc * char (* Literal char *)\n | Acc_data_string of ('b, 'c) acc * string (* Generated string *)\n | Acc_data_char of ('b, 'c) acc * char (* Generated char *)\n | Acc_delay of ('b, 'c) acc * ('b -> 'c)\n (* Delayed printing (%a, %t) *)\n | Acc_flush of ('b, 'c) acc (* Flush *)\n | Acc_invalid_arg of ('b, 'c) acc * string\n (* Raise Invalid_argument msg *)\n | End_of_acc\n\n(* List of heterogeneous values. *)\n(* Used to accumulate scanf callback arguments. *)\ntype ('a, 'b) heter_list =\n | Cons : 'c * ('a, 'b) heter_list -> ('c -> 'a, 'b) heter_list\n | Nil : ('b, 'b) heter_list\n\n(* Existential Black Boxes. *)\n(* Used to abstract some existential type parameters. *)\n\n(* GADT type associating a padding and an fmtty. *)\n(* See the type_padding function. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) padding_fmtty_ebb = Padding_fmtty_EBB :\n ('x, 'y) padding * ('y, 'b, 'c, 'd, 'e, 'f) fmtty ->\n ('x, 'b, 'c, 'd, 'e, 'f) padding_fmtty_ebb\n\n(* GADT type associating a padding, a precision and an fmtty. *)\n(* See the type_padprec function. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) padprec_fmtty_ebb = Padprec_fmtty_EBB :\n ('x, 'y) padding * ('y, 'z) precision * ('z, 'b, 'c, 'd, 'e, 'f) fmtty ->\n ('x, 'b, 'c, 'd, 'e, 'f) padprec_fmtty_ebb\n\n(* GADT type associating a padding and an fmt. *)\n(* See make_padding_fmt_ebb and parse_format functions. *)\ntype ('a, 'b, 'c, 'e, 'f) padding_fmt_ebb = Padding_fmt_EBB :\n (_, 'x -> 'a) padding *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'e, 'f) padding_fmt_ebb\n\n(* GADT type associating a precision and an fmt. *)\n(* See make_precision_fmt_ebb and parse_format functions. *)\ntype ('a, 'b, 'c, 'e, 'f) precision_fmt_ebb = Precision_fmt_EBB :\n (_, 'x -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('x, 'b, 'c, 'e, 'f) precision_fmt_ebb\n\n(* GADT type associating a padding, a precision and an fmt. *)\n(* See make_padprec_fmt_ebb and parse_format functions. *)\ntype ('p, 'b, 'c, 'e, 'f) padprec_fmt_ebb = Padprec_fmt_EBB :\n ('x, 'y) padding * ('y, 'p -> 'a) precision *\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('p, 'b, 'c, 'e, 'f) padprec_fmt_ebb\n\n(* Abstract the 'a and 'd parameters of an fmt. *)\n(* Output type of the format parsing function. *)\ntype ('b, 'c, 'e, 'f) fmt_ebb = Fmt_EBB :\n ('a, 'b, 'c, 'd, 'e, 'f) fmt ->\n ('b, 'c, 'e, 'f) fmt_ebb\n\n(* GADT type associating an fmtty and an fmt. *)\n(* See the type_format_gen function. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) fmt_fmtty_ebb = Fmt_fmtty_EBB :\n ('a, 'b, 'c, 'd, 'y, 'x) fmt *\n ('x, 'b, 'c, 'y, 'e, 'f) fmtty ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmt_fmtty_ebb\n\n(* GADT type associating an fmtty and an fmt. *)\n(* See the type_ignored_format_substitution function. *)\ntype ('a, 'b, 'c, 'd, 'e, 'f) fmtty_fmt_ebb = Fmtty_fmt_EBB :\n ('a, 'b, 'c, 'd, 'y, 'x) fmtty *\n ('x, 'b, 'c, 'y, 'e, 'f) fmt_fmtty_ebb ->\n ('a, 'b, 'c, 'd, 'e, 'f) fmtty_fmt_ebb\n\n(* Abstract all fmtty type parameters. *)\n(* Used to compare format types. *)\ntype fmtty_ebb = Fmtty_EBB : ('a, 'b, 'c, 'd, 'e, 'f) fmtty -> fmtty_ebb\n\n(* Abstract all padding type parameters. *)\n(* Used to compare paddings. *)\ntype padding_ebb = Padding_EBB : ('a, 'b) padding -> padding_ebb\n\n(* Abstract all precision type parameters. *)\n(* Used to compare precisions. *)\ntype precision_ebb = Precision_EBB : ('a, 'b) precision -> precision_ebb\n\n(******************************************************************************)\n (* Constants *)\n\n(* Default precision for float printing. *)\nlet default_float_precision fconv =\n match snd fconv with\n | Float_f | Float_e | Float_E | Float_g | Float_G | Float_h | Float_H\n | Float_CF -> -6\n (* For %h %H and %#F formats, a negative precision means \"as many digits as\n necessary\". For the other FP formats, we take the absolute value\n of the precision, hence 6 digits by default. *)\n | Float_F -> 12\n (* Default precision for OCaml float printing (%F). *)\n\n(******************************************************************************)\n (* Externals *)\n\nexternal format_float: string -> float -> string\n = \"caml_format_float\"\nexternal format_int: string -> int -> string\n = \"caml_format_int\"\nexternal format_int32: string -> int32 -> string\n = \"caml_int32_format\"\nexternal format_nativeint: string -> nativeint -> string\n = \"caml_nativeint_format\"\nexternal format_int64: string -> int64 -> string\n = \"caml_int64_format\"\nexternal hexstring_of_float: float -> int -> char -> string\n = \"caml_hexstring_of_float\"\n\n(******************************************************************************)\n (* Tools to pretty-print formats *)\n\n(* Type of extensible character buffers. *)\ntype buffer = {\n mutable ind : int;\n mutable bytes : bytes;\n}\n\n(* Create a fresh buffer. *)\nlet buffer_create init_size = { ind = 0; bytes = Bytes.create init_size }\n\n(* Check size of the buffer and grow it if needed. *)\nlet buffer_check_size buf overhead =\n let len = Bytes.length buf.bytes in\n let min_len = buf.ind + overhead in\n if min_len > len then (\n let new_len = Int.max (len * 2) min_len in\n let new_str = Bytes.create new_len in\n Bytes.blit buf.bytes 0 new_str 0 len;\n buf.bytes <- new_str;\n )\n\n(* Add the character `c' to the buffer `buf'. *)\nlet buffer_add_char buf c =\n buffer_check_size buf 1;\n Bytes.set buf.bytes buf.ind c;\n buf.ind <- buf.ind + 1\n\n(* Add the string `s' to the buffer `buf'. *)\nlet buffer_add_string buf s =\n let str_len = String.length s in\n buffer_check_size buf str_len;\n String.blit s 0 buf.bytes buf.ind str_len;\n buf.ind <- buf.ind + str_len\n\n(* Get the content of the buffer. *)\nlet buffer_contents buf =\n Bytes.sub_string buf.bytes 0 buf.ind\n\n(***)\n\n(* Convert an integer conversion to char. *)\nlet char_of_iconv iconv = match iconv with\n | Int_d | Int_pd | Int_sd | Int_Cd -> 'd' | Int_i | Int_pi | Int_si\n | Int_Ci -> 'i' | Int_x | Int_Cx -> 'x' | Int_X | Int_CX -> 'X' | Int_o\n | Int_Co -> 'o' | Int_u | Int_Cu -> 'u'\n\n(* Convert a float conversion to char. *)\n(* `cF' will be 'F' for displaying format and 'g' to call libc printf *)\nlet char_of_fconv ?(cF='F') fconv = match snd fconv with\n | Float_f -> 'f' | Float_e -> 'e'\n | Float_E -> 'E' | Float_g -> 'g'\n | Float_G -> 'G' | Float_F -> cF\n | Float_h -> 'h' | Float_H -> 'H'\n | Float_CF -> 'F'\n\n\n(* Convert a scanning counter to char. *)\nlet char_of_counter counter = match counter with\n | Line_counter -> 'l'\n | Char_counter -> 'n'\n | Token_counter -> 'N'\n\n(***)\n\n(* Print a char_set in a buffer with the OCaml format lexical convention. *)\nlet bprint_char_set buf char_set =\n let rec print_start set =\n let is_alone c =\n let before, after = Char.(chr (code c - 1), chr (code c + 1)) in\n is_in_char_set set c\n && not (is_in_char_set set before && is_in_char_set set after) in\n if is_alone ']' then buffer_add_char buf ']';\n print_out set 1;\n if is_alone '-' then buffer_add_char buf '-';\n and print_out set i =\n if i < 256 then\n if is_in_char_set set (char_of_int i) then print_first set i\n else print_out set (i + 1)\n and print_first set i =\n match char_of_int i with\n | '\\255' -> print_char buf 255;\n | ']' | '-' -> print_out set (i + 1);\n | _ -> print_second set (i + 1);\n and print_second set i =\n if is_in_char_set set (char_of_int i) then\n match char_of_int i with\n | '\\255' ->\n print_char buf 254;\n print_char buf 255;\n | ']' | '-' when not (is_in_char_set set (char_of_int (i + 1))) ->\n print_char buf (i - 1);\n print_out set (i + 1);\n | _ when not (is_in_char_set set (char_of_int (i + 1))) ->\n print_char buf (i - 1);\n print_char buf i;\n print_out set (i + 2);\n | _ ->\n print_in set (i - 1) (i + 2);\n else (\n print_char buf (i - 1);\n print_out set (i + 1);\n )\n and print_in set i j =\n if j = 256 || not (is_in_char_set set (char_of_int j)) then (\n print_char buf i;\n print_char buf (int_of_char '-');\n print_char buf (j - 1);\n if j < 256 then print_out set (j + 1);\n ) else\n print_in set i (j + 1);\n and print_char buf i = match char_of_int i with\n | '%' -> buffer_add_char buf '%'; buffer_add_char buf '%';\n | '@' -> buffer_add_char buf '%'; buffer_add_char buf '@';\n | c -> buffer_add_char buf c;\n in\n buffer_add_char buf '[';\n print_start (\n if is_in_char_set char_set '\\000'\n then ( buffer_add_char buf '^'; rev_char_set char_set )\n else char_set\n );\n buffer_add_char buf ']'\n\n(***)\n\n(* Print a padty in a buffer with the format-like syntax. *)\nlet bprint_padty buf padty = match padty with\n | Left -> buffer_add_char buf '-'\n | Right -> ()\n | Zeros -> buffer_add_char buf '0'\n\n(* Print the '_' of an ignored flag if needed. *)\nlet bprint_ignored_flag buf ign_flag =\n if ign_flag then buffer_add_char buf '_'\n\n(***)\n\nlet bprint_pad_opt buf pad_opt = match pad_opt with\n | None -> ()\n | Some width -> buffer_add_string buf (Int.to_string width)\n\n(***)\n\n(* Print padding in a buffer with the format-like syntax. *)\nlet bprint_padding : type a b . buffer -> (a, b) padding -> unit =\nfun buf pad -> match pad with\n | No_padding -> ()\n | Lit_padding (padty, n) ->\n bprint_padty buf padty;\n buffer_add_string buf (Int.to_string n);\n | Arg_padding padty ->\n bprint_padty buf padty;\n buffer_add_char buf '*'\n\n(* Print precision in a buffer with the format-like syntax. *)\nlet bprint_precision : type a b . buffer -> (a, b) precision -> unit =\n fun buf prec -> match prec with\n | No_precision -> ()\n | Lit_precision n ->\n buffer_add_char buf '.';\n buffer_add_string buf (Int.to_string n);\n | Arg_precision ->\n buffer_add_string buf \".*\"\n\n(***)\n\n(* Print the optional '+', ' ' or '#' associated to an int conversion. *)\nlet bprint_iconv_flag buf iconv = match iconv with\n | Int_pd | Int_pi -> buffer_add_char buf '+'\n | Int_sd | Int_si -> buffer_add_char buf ' '\n | Int_Cx | Int_CX | Int_Co | Int_Cd | Int_Ci | Int_Cu ->\n buffer_add_char buf '#'\n | Int_d | Int_i | Int_x | Int_X | Int_o | Int_u -> ()\n\n(* Print an complete int format in a buffer (ex: \"%3.*d\"). *)\nlet bprint_int_fmt buf ign_flag iconv pad prec =\n buffer_add_char buf '%';\n bprint_ignored_flag buf ign_flag;\n bprint_iconv_flag buf iconv;\n bprint_padding buf pad;\n bprint_precision buf prec;\n buffer_add_char buf (char_of_iconv iconv)\n\n(* Print a complete int32, nativeint or int64 format in a buffer. *)\nlet bprint_altint_fmt buf ign_flag iconv pad prec c =\n buffer_add_char buf '%';\n bprint_ignored_flag buf ign_flag;\n bprint_iconv_flag buf iconv;\n bprint_padding buf pad;\n bprint_precision buf prec;\n buffer_add_char buf c;\n buffer_add_char buf (char_of_iconv iconv)\n\n(***)\n\n(* Print the optional '+', ' ' and/or '#' associated to a float conversion. *)\nlet bprint_fconv_flag buf fconv =\n begin match fst fconv with\n | Float_flag_p -> buffer_add_char buf '+'\n | Float_flag_s -> buffer_add_char buf ' '\n | Float_flag_ -> () end;\n match snd fconv with\n | Float_CF -> buffer_add_char buf '#'\n | Float_f | Float_e | Float_E | Float_g | Float_G\n | Float_F | Float_h | Float_H -> ()\n\n(* Print a complete float format in a buffer (ex: \"%+*.3f\"). *)\nlet bprint_float_fmt buf ign_flag fconv pad prec =\n buffer_add_char buf '%';\n bprint_ignored_flag buf ign_flag;\n bprint_fconv_flag buf fconv;\n bprint_padding buf pad;\n bprint_precision buf prec;\n buffer_add_char buf (char_of_fconv fconv)\n\n(* Compute the literal string representation of a Formatting_lit. *)\n(* Used by Printf and Scanf where formatting is not interpreted. *)\nlet string_of_formatting_lit formatting_lit = match formatting_lit with\n | Close_box -> \"@]\"\n | Close_tag -> \"@}\"\n | Break (str, _, _) -> str\n | FFlush -> \"@?\"\n | Force_newline -> \"@\\n\"\n | Flush_newline -> \"@.\"\n | Magic_size (str, _) -> str\n | Escaped_at -> \"@@\"\n | Escaped_percent -> \"@%\"\n | Scan_indic c -> \"@\" ^ (String.make 1 c)\n\n(***)\n\n(* Print a literal char in a buffer, escape '%' by \"%%\". *)\nlet bprint_char_literal buf chr = match chr with\n | '%' -> buffer_add_string buf \"%%\"\n | _ -> buffer_add_char buf chr\n\n(* Print a literal string in a buffer, escape all '%' by \"%%\". *)\nlet bprint_string_literal buf str =\n for i = 0 to String.length str - 1 do\n bprint_char_literal buf str.[i]\n done\n\n(******************************************************************************)\n (* Format pretty-printing *)\n\n(* Print a complete format type (an fmtty) in a buffer. *)\nlet rec bprint_fmtty : type a b c d e f g h i j k l .\n buffer -> (a, b, c, d, e, f, g, h, i, j, k, l) fmtty_rel -> unit =\nfun buf fmtty -> match fmtty with\n | Char_ty rest -> buffer_add_string buf \"%c\"; bprint_fmtty buf rest;\n | String_ty rest -> buffer_add_string buf \"%s\"; bprint_fmtty buf rest;\n | Int_ty rest -> buffer_add_string buf \"%i\"; bprint_fmtty buf rest;\n | Int32_ty rest -> buffer_add_string buf \"%li\"; bprint_fmtty buf rest;\n | Nativeint_ty rest -> buffer_add_string buf \"%ni\"; bprint_fmtty buf rest;\n | Int64_ty rest -> buffer_add_string buf \"%Li\"; bprint_fmtty buf rest;\n | Float_ty rest -> buffer_add_string buf \"%f\"; bprint_fmtty buf rest;\n | Bool_ty rest -> buffer_add_string buf \"%B\"; bprint_fmtty buf rest;\n | Alpha_ty rest -> buffer_add_string buf \"%a\"; bprint_fmtty buf rest;\n | Theta_ty rest -> buffer_add_string buf \"%t\"; bprint_fmtty buf rest;\n | Any_ty rest -> buffer_add_string buf \"%?\"; bprint_fmtty buf rest;\n | Reader_ty rest -> buffer_add_string buf \"%r\"; bprint_fmtty buf rest;\n\n | Ignored_reader_ty rest ->\n buffer_add_string buf \"%_r\";\n bprint_fmtty buf rest;\n\n | Format_arg_ty (sub_fmtty, rest) ->\n buffer_add_string buf \"%{\"; bprint_fmtty buf sub_fmtty;\n buffer_add_string buf \"%}\"; bprint_fmtty buf rest;\n | Format_subst_ty (sub_fmtty, _, rest) ->\n buffer_add_string buf \"%(\"; bprint_fmtty buf sub_fmtty;\n buffer_add_string buf \"%)\"; bprint_fmtty buf rest;\n\n | End_of_fmtty -> ()\n\n(***)\n\nlet rec int_of_custom_arity : type a b c .\n (a, b, c) custom_arity -> int =\n function\n | Custom_zero -> 0\n | Custom_succ x -> 1 + int_of_custom_arity x\n\n(* Print a complete format in a buffer. *)\nlet bprint_fmt buf fmt =\n let rec fmtiter : type a b c d e f .\n (a, b, c, d, e, f) fmt -> bool -> unit =\n fun fmt ign_flag -> match fmt with\n | String (pad, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_padding buf pad; buffer_add_char buf 's';\n fmtiter rest false;\n | Caml_string (pad, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_padding buf pad; buffer_add_char buf 'S';\n fmtiter rest false;\n\n | Int (iconv, pad, prec, rest) ->\n bprint_int_fmt buf ign_flag iconv pad prec;\n fmtiter rest false;\n | Int32 (iconv, pad, prec, rest) ->\n bprint_altint_fmt buf ign_flag iconv pad prec 'l';\n fmtiter rest false;\n | Nativeint (iconv, pad, prec, rest) ->\n bprint_altint_fmt buf ign_flag iconv pad prec 'n';\n fmtiter rest false;\n | Int64 (iconv, pad, prec, rest) ->\n bprint_altint_fmt buf ign_flag iconv pad prec 'L';\n fmtiter rest false;\n | Float (fconv, pad, prec, rest) ->\n bprint_float_fmt buf ign_flag fconv pad prec;\n fmtiter rest false;\n\n | Char rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf 'c'; fmtiter rest false;\n | Caml_char rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf 'C'; fmtiter rest false;\n | Bool (pad, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_padding buf pad; buffer_add_char buf 'B';\n fmtiter rest false;\n | Alpha rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf 'a'; fmtiter rest false;\n | Theta rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf 't'; fmtiter rest false;\n | Custom (arity, _, rest) ->\n for _i = 1 to int_of_custom_arity arity do\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf '?';\n done;\n fmtiter rest false;\n | Reader rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf 'r'; fmtiter rest false;\n | Flush rest ->\n buffer_add_string buf \"%!\";\n fmtiter rest ign_flag;\n\n | String_literal (str, rest) ->\n bprint_string_literal buf str;\n fmtiter rest ign_flag;\n | Char_literal (chr, rest) ->\n bprint_char_literal buf chr;\n fmtiter rest ign_flag;\n\n | Format_arg (pad_opt, fmtty, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_pad_opt buf pad_opt; buffer_add_char buf '{';\n bprint_fmtty buf fmtty; buffer_add_char buf '%'; buffer_add_char buf '}';\n fmtiter rest false;\n | Format_subst (pad_opt, fmtty, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_pad_opt buf pad_opt; buffer_add_char buf '(';\n bprint_fmtty buf fmtty; buffer_add_char buf '%'; buffer_add_char buf ')';\n fmtiter rest false;\n\n | Scan_char_set (width_opt, char_set, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_pad_opt buf width_opt; bprint_char_set buf char_set;\n fmtiter rest false;\n | Scan_get_counter (counter, rest) ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n buffer_add_char buf (char_of_counter counter);\n fmtiter rest false;\n | Scan_next_char rest ->\n buffer_add_char buf '%'; bprint_ignored_flag buf ign_flag;\n bprint_string_literal buf \"0c\"; fmtiter rest false;\n\n | Ignored_param (ign, rest) ->\n let Param_format_EBB fmt' = param_format_of_ignored_format ign rest in\n fmtiter fmt' true;\n\n | Formatting_lit (fmting_lit, rest) ->\n bprint_string_literal buf (string_of_formatting_lit fmting_lit);\n fmtiter rest ign_flag;\n | Formatting_gen (fmting_gen, rest) ->\n begin match fmting_gen with\n | Open_tag (Format (_, str)) ->\n buffer_add_string buf \"@{\"; buffer_add_string buf str\n | Open_box (Format (_, str)) ->\n buffer_add_string buf \"@[\"; buffer_add_string buf str\n end;\n fmtiter rest ign_flag;\n\n | End_of_format -> ()\n\n in fmtiter fmt false\n\n(***)\n\n(* Convert a format to string. *)\nlet string_of_fmt fmt =\n let buf = buffer_create 16 in\n bprint_fmt buf fmt;\n buffer_contents buf\n\n(******************************************************************************)\n (* Type extraction *)\n\ntype (_, _) eq = Refl : ('a, 'a) eq\n\n(* Invariant: this function is the identity on values.\n\n In particular, if (ty1, ty2) have equal values, then\n (trans (symm ty1) ty2) respects the 'trans' precondition. *)\nlet rec symm : type a1 b1 c1 d1 e1 f1 a2 b2 c2 d2 e2 f2 .\n (a1, b1, c1, d1, e1, f1,\n a2, b2, c2, d2, e2, f2) fmtty_rel\n-> (a2, b2, c2, d2, e2, f2,\n a1, b1, c1, d1, e1, f1) fmtty_rel\n= function\n | Char_ty rest -> Char_ty (symm rest)\n | Int_ty rest -> Int_ty (symm rest)\n | Int32_ty rest -> Int32_ty (symm rest)\n | Int64_ty rest -> Int64_ty (symm rest)\n | Nativeint_ty rest -> Nativeint_ty (symm rest)\n | Float_ty rest -> Float_ty (symm rest)\n | Bool_ty rest -> Bool_ty (symm rest)\n | String_ty rest -> String_ty (symm rest)\n | Theta_ty rest -> Theta_ty (symm rest)\n | Alpha_ty rest -> Alpha_ty (symm rest)\n | Any_ty rest -> Any_ty (symm rest)\n | Reader_ty rest -> Reader_ty (symm rest)\n | Ignored_reader_ty rest -> Ignored_reader_ty (symm rest)\n | Format_arg_ty (ty, rest) ->\n Format_arg_ty (ty, symm rest)\n | Format_subst_ty (ty1, ty2, rest) ->\n Format_subst_ty (ty2, ty1, symm rest)\n | End_of_fmtty -> End_of_fmtty\n\nlet rec fmtty_rel_det : type a1 b c d1 e1 f1 a2 d2 e2 f2 .\n (a1, b, c, d1, e1, f1,\n a2, b, c, d2, e2, f2) fmtty_rel ->\n ((f1, f2) eq -> (a1, a2) eq)\n * ((a1, a2) eq -> (f1, f2) eq)\n * ((e1, e2) eq -> (d1, d2) eq)\n * ((d1, d2) eq -> (e1, e2) eq)\n= function\n | End_of_fmtty ->\n (fun Refl -> Refl),\n (fun Refl -> Refl),\n (fun Refl -> Refl),\n (fun Refl -> Refl)\n | Char_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | String_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Int_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Int32_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Int64_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Nativeint_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Float_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Bool_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n\n | Theta_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Alpha_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Any_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Reader_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n (fun Refl -> let Refl = ed Refl in Refl),\n (fun Refl -> let Refl = de Refl in Refl)\n | Ignored_reader_ty rest ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n (fun Refl -> let Refl = ed Refl in Refl),\n (fun Refl -> let Refl = de Refl in Refl)\n | Format_arg_ty (_ty, rest) ->\n let fa, af, ed, de = fmtty_rel_det rest in\n (fun Refl -> let Refl = fa Refl in Refl),\n (fun Refl -> let Refl = af Refl in Refl),\n ed, de\n | Format_subst_ty (ty1, ty2, rest) ->\n let fa, af, ed, de = fmtty_rel_det rest in\n let ty = trans (symm ty1) ty2 in\n let ag, ga, dj, jd = fmtty_rel_det ty in\n (fun Refl -> let Refl = fa Refl in let Refl = ag Refl in Refl),\n (fun Refl -> let Refl = ga Refl in let Refl = af Refl in Refl),\n (fun Refl -> let Refl = ed Refl in let Refl = dj Refl in Refl),\n (fun Refl -> let Refl = jd Refl in let Refl = de Refl in Refl)\n\n(* Precondition: we assume that the two fmtty_rel arguments have equal\n values (at possibly distinct types); this invariant comes from the way\n fmtty_rel witnesses are produced by the type-checker\n\n The code below uses (assert false) when this assumption is broken. The\n code pattern is the following:\n\n | Foo x, Foo y ->\n (* case where indeed both values\n start with constructor Foo *)\n | Foo _, _\n | _, Foo _ ->\n (* different head constructors: broken precondition *)\n assert false\n*)\nand trans : type\n a1 b1 c1 d1 e1 f1\n a2 b2 c2 d2 e2 f2\n a3 b3 c3 d3 e3 f3\n.\n (a1, b1, c1, d1, e1, f1,\n a2, b2, c2, d2, e2, f2) fmtty_rel\n-> (a2, b2, c2, d2, e2, f2,\n a3, b3, c3, d3, e3, f3) fmtty_rel\n-> (a1, b1, c1, d1, e1, f1,\n a3, b3, c3, d3, e3, f3) fmtty_rel\n= fun ty1 ty2 -> match ty1, ty2 with\n | Char_ty rest1, Char_ty rest2 -> Char_ty (trans rest1 rest2)\n | String_ty rest1, String_ty rest2 -> String_ty (trans rest1 rest2)\n | Bool_ty rest1, Bool_ty rest2 -> Bool_ty (trans rest1 rest2)\n | Int_ty rest1, Int_ty rest2 -> Int_ty (trans rest1 rest2)\n | Int32_ty rest1, Int32_ty rest2 -> Int32_ty (trans rest1 rest2)\n | Int64_ty rest1, Int64_ty rest2 -> Int64_ty (trans rest1 rest2)\n | Nativeint_ty rest1, Nativeint_ty rest2 -> Nativeint_ty (trans rest1 rest2)\n | Float_ty rest1, Float_ty rest2 -> Float_ty (trans rest1 rest2)\n\n | Alpha_ty rest1, Alpha_ty rest2 -> Alpha_ty (trans rest1 rest2)\n | Alpha_ty _, _ -> assert false\n | _, Alpha_ty _ -> assert false\n\n | Theta_ty rest1, Theta_ty rest2 -> Theta_ty (trans rest1 rest2)\n | Theta_ty _, _ -> assert false\n | _, Theta_ty _ -> assert false\n\n | Any_ty rest1, Any_ty rest2 -> Any_ty (trans rest1 rest2)\n | Any_ty _, _ -> assert false\n | _, Any_ty _ -> assert false\n\n | Reader_ty rest1, Reader_ty rest2 -> Reader_ty (trans rest1 rest2)\n | Reader_ty _, _ -> assert false\n | _, Reader_ty _ -> assert false\n\n | Ignored_reader_ty rest1, Ignored_reader_ty rest2 ->\n Ignored_reader_ty (trans rest1 rest2)\n | Ignored_reader_ty _, _ -> assert false\n | _, Ignored_reader_ty _ -> assert false\n\n | Format_arg_ty (ty1, rest1), Format_arg_ty (ty2, rest2) ->\n Format_arg_ty (trans ty1 ty2, trans rest1 rest2)\n | Format_arg_ty _, _ -> assert false\n | _, Format_arg_ty _ -> assert false\n\n | Format_subst_ty (ty11, ty12, rest1),\n Format_subst_ty (ty21, ty22, rest2) ->\n let ty = trans (symm ty12) ty21 in\n let _, f2, _, f4 = fmtty_rel_det ty in\n let Refl = f2 Refl in\n let Refl = f4 Refl in\n Format_subst_ty (ty11, ty22, trans rest1 rest2)\n | Format_subst_ty _, _ -> assert false\n | _, Format_subst_ty _ -> assert false\n\n | End_of_fmtty, End_of_fmtty -> End_of_fmtty\n | End_of_fmtty, _ -> assert false\n | _, End_of_fmtty -> assert false\n\nlet rec fmtty_of_formatting_gen : type a b c d e f .\n (a, b, c, d, e, f) formatting_gen ->\n (a, b, c, d, e, f) fmtty =\nfun formatting_gen -> match formatting_gen with\n | Open_tag (Format (fmt, _)) -> fmtty_of_fmt fmt\n | Open_box (Format (fmt, _)) -> fmtty_of_fmt fmt\n\n(* Extract the type representation (an fmtty) of a format. *)\nand fmtty_of_fmt : type a b c d e f .\n (a, b, c, d, e, f) fmt -> (a, b, c, d, e, f) fmtty =\nfun fmtty -> match fmtty with\n | String (pad, rest) ->\n fmtty_of_padding_fmtty pad (String_ty (fmtty_of_fmt rest))\n | Caml_string (pad, rest) ->\n fmtty_of_padding_fmtty pad (String_ty (fmtty_of_fmt rest))\n\n | Int (_, pad, prec, rest) ->\n let ty_rest = fmtty_of_fmt rest in\n let prec_ty = fmtty_of_precision_fmtty prec (Int_ty ty_rest) in\n fmtty_of_padding_fmtty pad prec_ty\n | Int32 (_, pad, prec, rest) ->\n let ty_rest = fmtty_of_fmt rest in\n let prec_ty = fmtty_of_precision_fmtty prec (Int32_ty ty_rest) in\n fmtty_of_padding_fmtty pad prec_ty\n | Nativeint (_, pad, prec, rest) ->\n let ty_rest = fmtty_of_fmt rest in\n let prec_ty = fmtty_of_precision_fmtty prec (Nativeint_ty ty_rest) in\n fmtty_of_padding_fmtty pad prec_ty\n | Int64 (_, pad, prec, rest) ->\n let ty_rest = fmtty_of_fmt rest in\n let prec_ty = fmtty_of_precision_fmtty prec (Int64_ty ty_rest) in\n fmtty_of_padding_fmtty pad prec_ty\n | Float (_, pad, prec, rest) ->\n let ty_rest = fmtty_of_fmt rest in\n let prec_ty = fmtty_of_precision_fmtty prec (Float_ty ty_rest) in\n fmtty_of_padding_fmtty pad prec_ty\n\n | Char rest -> Char_ty (fmtty_of_fmt rest)\n | Caml_char rest -> Char_ty (fmtty_of_fmt rest)\n | Bool (pad, rest) ->\n fmtty_of_padding_fmtty pad (Bool_ty (fmtty_of_fmt rest))\n | Alpha rest -> Alpha_ty (fmtty_of_fmt rest)\n | Theta rest -> Theta_ty (fmtty_of_fmt rest)\n | Custom (arity, _, rest) -> fmtty_of_custom arity (fmtty_of_fmt rest)\n | Reader rest -> Reader_ty (fmtty_of_fmt rest)\n\n | Format_arg (_, ty, rest) ->\n Format_arg_ty (ty, fmtty_of_fmt rest)\n | Format_subst (_, ty, rest) ->\n Format_subst_ty (ty, ty, fmtty_of_fmt rest)\n\n | Flush rest -> fmtty_of_fmt rest\n | String_literal (_, rest) -> fmtty_of_fmt rest\n | Char_literal (_, rest) -> fmtty_of_fmt rest\n\n | Scan_char_set (_, _, rest) -> String_ty (fmtty_of_fmt rest)\n | Scan_get_counter (_, rest) -> Int_ty (fmtty_of_fmt rest)\n | Scan_next_char rest -> Char_ty (fmtty_of_fmt rest)\n | Ignored_param (ign, rest) -> fmtty_of_ignored_format ign rest\n | Formatting_lit (_, rest) -> fmtty_of_fmt rest\n | Formatting_gen (fmting_gen, rest) ->\n concat_fmtty (fmtty_of_formatting_gen fmting_gen) (fmtty_of_fmt rest)\n\n | End_of_format -> End_of_fmtty\n\nand fmtty_of_custom : type x y a b c d e f .\n (a, x, y) custom_arity -> (a, b, c, d, e, f) fmtty ->\n (y, b, c, d, e, f) fmtty =\nfun arity fmtty -> match arity with\n | Custom_zero -> fmtty\n | Custom_succ arity -> Any_ty (fmtty_of_custom arity fmtty)\n\n(* Extract the fmtty of an ignored parameter followed by the rest of\n the format. *)\nand fmtty_of_ignored_format : type x y a b c d e f .\n (a, b, c, d, y, x) ignored ->\n (x, b, c, y, e, f) fmt ->\n (a, b, c, d, e, f) fmtty =\nfun ign fmt -> match ign with\n | Ignored_char -> fmtty_of_fmt fmt\n | Ignored_caml_char -> fmtty_of_fmt fmt\n | Ignored_string _ -> fmtty_of_fmt fmt\n | Ignored_caml_string _ -> fmtty_of_fmt fmt\n | Ignored_int (_, _) -> fmtty_of_fmt fmt\n | Ignored_int32 (_, _) -> fmtty_of_fmt fmt\n | Ignored_nativeint (_, _) -> fmtty_of_fmt fmt\n | Ignored_int64 (_, _) -> fmtty_of_fmt fmt\n | Ignored_float (_, _) -> fmtty_of_fmt fmt\n | Ignored_bool _ -> fmtty_of_fmt fmt\n | Ignored_format_arg _ -> fmtty_of_fmt fmt\n | Ignored_format_subst (_, fmtty) -> concat_fmtty fmtty (fmtty_of_fmt fmt)\n | Ignored_reader -> Ignored_reader_ty (fmtty_of_fmt fmt)\n | Ignored_scan_char_set _ -> fmtty_of_fmt fmt\n | Ignored_scan_get_counter _ -> fmtty_of_fmt fmt\n | Ignored_scan_next_char -> fmtty_of_fmt fmt\n\n(* Add an Int_ty node if padding is taken as an extra argument (ex: \"%*s\"). *)\nand fmtty_of_padding_fmtty : type x a b c d e f .\n (x, a) padding -> (a, b, c, d, e, f) fmtty -> (x, b, c, d, e, f) fmtty =\n fun pad fmtty -> match pad with\n | No_padding -> fmtty\n | Lit_padding _ -> fmtty\n | Arg_padding _ -> Int_ty fmtty\n\n(* Add an Int_ty node if precision is taken as an extra argument (ex: \"%.*f\").*)\nand fmtty_of_precision_fmtty : type x a b c d e f .\n (x, a) precision -> (a, b, c, d, e, f) fmtty -> (x, b, c, d, e, f) fmtty =\n fun prec fmtty -> match prec with\n | No_precision -> fmtty\n | Lit_precision _ -> fmtty\n | Arg_precision -> Int_ty fmtty\n\n(******************************************************************************)\n (* Format typing *)\n\n(* Exception raised when a format does not match a given format type. *)\nexception Type_mismatch\n\n(* Type a padding. *)\n(* Take an Int_ty from the fmtty if the integer should be kept as argument. *)\n(* Raise Type_mismatch in case of type mismatch. *)\nlet type_padding : type a b c d e f x y .\n (x, y) padding -> (a, b, c, d, e, f) fmtty ->\n (a, b, c, d, e, f) padding_fmtty_ebb =\nfun pad fmtty -> match pad, fmtty with\n | No_padding, _ -> Padding_fmtty_EBB (No_padding, fmtty)\n | Lit_padding (padty, w), _ -> Padding_fmtty_EBB (Lit_padding (padty,w),fmtty)\n | Arg_padding padty, Int_ty rest -> Padding_fmtty_EBB (Arg_padding padty,rest)\n | _ -> raise Type_mismatch\n\n(* Convert a (upadding, uprecision) to a (padding, precision). *)\n(* Take one or two Int_ty from the fmtty if needed. *)\n(* Raise Type_mismatch in case of type mismatch. *)\nlet type_padprec : type a b c d e f x y z .\n (x, y) padding -> (y, z) precision -> (a, b, c, d, e, f) fmtty ->\n (a, b, c, d, e, f) padprec_fmtty_ebb =\nfun pad prec fmtty -> match prec, type_padding pad fmtty with\n | No_precision, Padding_fmtty_EBB (pad, rest) ->\n Padprec_fmtty_EBB (pad, No_precision, rest)\n | Lit_precision p, Padding_fmtty_EBB (pad, rest) ->\n Padprec_fmtty_EBB (pad, Lit_precision p, rest)\n | Arg_precision, Padding_fmtty_EBB (pad, Int_ty rest) ->\n Padprec_fmtty_EBB (pad, Arg_precision, rest)\n | _, Padding_fmtty_EBB (_, _) -> raise Type_mismatch\n\n(* Type a format according to an fmtty. *)\n(* If typing succeed, generate a copy of the format with the same\n type parameters as the fmtty. *)\n(* Raise [Failure] with an error message in case of type mismatch. *)\nlet rec type_format :\n type a1 b1 c1 d1 e1 f1\n a2 b2 c2 d2 e2 f2 .\n (a1, b1, c1, d1, e1, f1) fmt\n -> (a2, b2, c2, d2, e2, f2) fmtty\n -> (a2, b2, c2, d2, e2, f2) fmt\n= fun fmt fmtty -> match type_format_gen fmt fmtty with\n | Fmt_fmtty_EBB (fmt', End_of_fmtty) -> fmt'\n | _ -> raise Type_mismatch\n\nand type_format_gen :\n type a1 b1 c1 d1 e1 f1\n a2 b2 c2 d2 e2 f2 .\n (a1, b1, c1, d1, e1, f1) fmt\n -> (a2, b2, c2, d2, e2, f2) fmtty\n -> (a2, b2, c2, d2, e2, f2) fmt_fmtty_ebb\n= fun fmt fmtty -> match fmt, fmtty with\n | Char fmt_rest, Char_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Char fmt', fmtty')\n | Caml_char fmt_rest, Char_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Caml_char fmt', fmtty')\n | String (pad, fmt_rest), _ -> (\n match type_padding pad fmtty with\n | Padding_fmtty_EBB (pad, String_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (String (pad, fmt'), fmtty')\n | Padding_fmtty_EBB (_, _) -> raise Type_mismatch\n )\n | Caml_string (pad, fmt_rest), _ -> (\n match type_padding pad fmtty with\n | Padding_fmtty_EBB (pad, String_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Caml_string (pad, fmt'), fmtty')\n | Padding_fmtty_EBB (_, _) -> raise Type_mismatch\n )\n | Int (iconv, pad, prec, fmt_rest), _ -> (\n match type_padprec pad prec fmtty with\n | Padprec_fmtty_EBB (pad, prec, Int_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Int (iconv, pad, prec, fmt'), fmtty')\n | Padprec_fmtty_EBB (_, _, _) -> raise Type_mismatch\n )\n | Int32 (iconv, pad, prec, fmt_rest), _ -> (\n match type_padprec pad prec fmtty with\n | Padprec_fmtty_EBB (pad, prec, Int32_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Int32 (iconv, pad, prec, fmt'), fmtty')\n | Padprec_fmtty_EBB (_, _, _) -> raise Type_mismatch\n )\n | Nativeint (iconv, pad, prec, fmt_rest), _ -> (\n match type_padprec pad prec fmtty with\n | Padprec_fmtty_EBB (pad, prec, Nativeint_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Nativeint (iconv, pad, prec, fmt'), fmtty')\n | Padprec_fmtty_EBB (_, _, _) -> raise Type_mismatch\n )\n | Int64 (iconv, pad, prec, fmt_rest), _ -> (\n match type_padprec pad prec fmtty with\n | Padprec_fmtty_EBB (pad, prec, Int64_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Int64 (iconv, pad, prec, fmt'), fmtty')\n | Padprec_fmtty_EBB (_, _, _) -> raise Type_mismatch\n )\n | Float (fconv, pad, prec, fmt_rest), _ -> (\n match type_padprec pad prec fmtty with\n | Padprec_fmtty_EBB (pad, prec, Float_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Float (fconv, pad, prec, fmt'), fmtty')\n | Padprec_fmtty_EBB (_, _, _) -> raise Type_mismatch\n )\n | Bool (pad, fmt_rest), _ -> (\n match type_padding pad fmtty with\n | Padding_fmtty_EBB (pad, Bool_ty fmtty_rest) ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Bool (pad, fmt'), fmtty')\n | Padding_fmtty_EBB (_, _) -> raise Type_mismatch\n )\n | Flush fmt_rest, fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Flush fmt', fmtty')\n\n | String_literal (str, fmt_rest), fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (String_literal (str, fmt'), fmtty')\n | Char_literal (chr, fmt_rest), fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Char_literal (chr, fmt'), fmtty')\n\n | Format_arg (pad_opt, sub_fmtty, fmt_rest),\n Format_arg_ty (sub_fmtty', fmtty_rest) ->\n if Fmtty_EBB sub_fmtty <> Fmtty_EBB sub_fmtty' then raise Type_mismatch;\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Format_arg (pad_opt, sub_fmtty', fmt'), fmtty')\n | Format_subst (pad_opt, sub_fmtty, fmt_rest),\n Format_subst_ty (sub_fmtty1, _sub_fmtty2, fmtty_rest) ->\n if Fmtty_EBB (erase_rel sub_fmtty) <> Fmtty_EBB (erase_rel sub_fmtty1) then\n raise Type_mismatch;\n let Fmt_fmtty_EBB (fmt', fmtty') =\n type_format_gen fmt_rest (erase_rel fmtty_rest)\n in\n Fmt_fmtty_EBB (Format_subst (pad_opt, sub_fmtty1, fmt'), fmtty')\n (* Printf and Format specific constructors: *)\n | Alpha fmt_rest, Alpha_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Alpha fmt', fmtty')\n | Theta fmt_rest, Theta_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Theta fmt', fmtty')\n\n (* Format specific constructors: *)\n | Formatting_lit (formatting_lit, fmt_rest), fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Formatting_lit (formatting_lit, fmt'), fmtty')\n | Formatting_gen (formatting_gen, fmt_rest), fmtty_rest ->\n type_formatting_gen formatting_gen fmt_rest fmtty_rest\n\n (* Scanf specific constructors: *)\n | Reader fmt_rest, Reader_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Reader fmt', fmtty')\n | Scan_char_set (width_opt, char_set, fmt_rest), String_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Scan_char_set (width_opt, char_set, fmt'), fmtty')\n | Scan_get_counter (counter, fmt_rest), Int_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt_rest fmtty_rest in\n Fmt_fmtty_EBB (Scan_get_counter (counter, fmt'), fmtty')\n | Ignored_param (ign, rest), fmtty_rest ->\n type_ignored_param ign rest fmtty_rest\n\n | End_of_format, fmtty_rest -> Fmt_fmtty_EBB (End_of_format, fmtty_rest)\n\n | _ -> raise Type_mismatch\n\nand type_formatting_gen : type a1 a3 b1 b3 c1 c3 d1 d3 e1 e2 e3 f1 f2 f3 .\n (a1, b1, c1, d1, e1, f1) formatting_gen ->\n (f1, b1, c1, e1, e2, f2) fmt ->\n (a3, b3, c3, d3, e3, f3) fmtty ->\n (a3, b3, c3, d3, e3, f3) fmt_fmtty_ebb =\nfun formatting_gen fmt0 fmtty0 -> match formatting_gen with\n | Open_tag (Format (fmt1, str)) ->\n let Fmt_fmtty_EBB (fmt2, fmtty2) = type_format_gen fmt1 fmtty0 in\n let Fmt_fmtty_EBB (fmt3, fmtty3) = type_format_gen fmt0 fmtty2 in\n Fmt_fmtty_EBB (Formatting_gen (Open_tag (Format (fmt2, str)), fmt3), fmtty3)\n | Open_box (Format (fmt1, str)) ->\n let Fmt_fmtty_EBB (fmt2, fmtty2) = type_format_gen fmt1 fmtty0 in\n let Fmt_fmtty_EBB (fmt3, fmtty3) = type_format_gen fmt0 fmtty2 in\n Fmt_fmtty_EBB (Formatting_gen (Open_box (Format (fmt2, str)), fmt3), fmtty3)\n\n(* Type an Ignored_param node according to an fmtty. *)\nand type_ignored_param : type p q x y z t u v a b c d e f .\n (x, y, z, t, q, p) ignored ->\n (p, y, z, q, u, v) fmt ->\n (a, b, c, d, e, f) fmtty ->\n (a, b, c, d, e, f) fmt_fmtty_ebb =\nfun ign fmt fmtty -> match ign with\n | Ignored_char as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_caml_char as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_string _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_caml_string _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_int _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_int32 _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_nativeint _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_int64 _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_float _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_bool _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_scan_char_set _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_scan_get_counter _ as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_scan_next_char as ign' -> type_ignored_param_one ign' fmt fmtty\n | Ignored_format_arg (pad_opt, sub_fmtty) ->\n type_ignored_param_one (Ignored_format_arg (pad_opt, sub_fmtty)) fmt fmtty\n | Ignored_format_subst (pad_opt, sub_fmtty) ->\n let Fmtty_fmt_EBB (sub_fmtty', Fmt_fmtty_EBB (fmt', fmtty')) =\n type_ignored_format_substitution sub_fmtty fmt fmtty in\n Fmt_fmtty_EBB (Ignored_param (Ignored_format_subst (pad_opt, sub_fmtty'),\n fmt'),\n fmtty')\n | Ignored_reader -> (\n match fmtty with\n | Ignored_reader_ty fmtty_rest ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt fmtty_rest in\n Fmt_fmtty_EBB (Ignored_param (Ignored_reader, fmt'), fmtty')\n | _ -> raise Type_mismatch\n )\n\nand type_ignored_param_one : type a1 a2 b1 b2 c1 c2 d1 d2 e1 e2 f1 f2 .\n (a2, b2, c2, d2, d2, a2) ignored ->\n (a1, b1, c1, d1, e1, f1) fmt ->\n (a2, b2, c2, d2, e2, f2) fmtty ->\n (a2, b2, c2, d2, e2, f2) fmt_fmtty_ebb\n= fun ign fmt fmtty ->\n let Fmt_fmtty_EBB (fmt', fmtty') = type_format_gen fmt fmtty in\n Fmt_fmtty_EBB (Ignored_param (ign, fmt'), fmtty')\n\n(* Typing of the complex case: \"%_(...%)\". *)\nand type_ignored_format_substitution : type w x y z p s t u a b c d e f .\n (w, x, y, z, s, p) fmtty ->\n (p, x, y, s, t, u) fmt ->\n (a, b, c, d, e, f) fmtty -> (a, b, c, d, e, f) fmtty_fmt_ebb =\nfun sub_fmtty fmt fmtty -> match sub_fmtty, fmtty with\n | Char_ty sub_fmtty_rest, Char_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Char_ty sub_fmtty_rest', fmt')\n | String_ty sub_fmtty_rest, String_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (String_ty sub_fmtty_rest', fmt')\n | Int_ty sub_fmtty_rest, Int_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Int_ty sub_fmtty_rest', fmt')\n | Int32_ty sub_fmtty_rest, Int32_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Int32_ty sub_fmtty_rest', fmt')\n | Nativeint_ty sub_fmtty_rest, Nativeint_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Nativeint_ty sub_fmtty_rest', fmt')\n | Int64_ty sub_fmtty_rest, Int64_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Int64_ty sub_fmtty_rest', fmt')\n | Float_ty sub_fmtty_rest, Float_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Float_ty sub_fmtty_rest', fmt')\n | Bool_ty sub_fmtty_rest, Bool_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Bool_ty sub_fmtty_rest', fmt')\n | Alpha_ty sub_fmtty_rest, Alpha_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Alpha_ty sub_fmtty_rest', fmt')\n | Theta_ty sub_fmtty_rest, Theta_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Theta_ty sub_fmtty_rest', fmt')\n | Reader_ty sub_fmtty_rest, Reader_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Reader_ty sub_fmtty_rest', fmt')\n | Ignored_reader_ty sub_fmtty_rest, Ignored_reader_ty fmtty_rest ->\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Ignored_reader_ty sub_fmtty_rest', fmt')\n\n | Format_arg_ty (sub2_fmtty, sub_fmtty_rest),\n Format_arg_ty (sub2_fmtty', fmtty_rest) ->\n if Fmtty_EBB sub2_fmtty <> Fmtty_EBB sub2_fmtty' then raise Type_mismatch;\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution sub_fmtty_rest fmt fmtty_rest in\n Fmtty_fmt_EBB (Format_arg_ty (sub2_fmtty', sub_fmtty_rest'), fmt')\n | Format_subst_ty (sub1_fmtty, sub2_fmtty, sub_fmtty_rest),\n Format_subst_ty (sub1_fmtty', sub2_fmtty', fmtty_rest) ->\n (* TODO define Fmtty_rel_EBB to remove those erase_rel *)\n if Fmtty_EBB (erase_rel sub1_fmtty) <> Fmtty_EBB (erase_rel sub1_fmtty')\n then raise Type_mismatch;\n if Fmtty_EBB (erase_rel sub2_fmtty) <> Fmtty_EBB (erase_rel sub2_fmtty')\n then raise Type_mismatch;\n let sub_fmtty' = trans (symm sub1_fmtty') sub2_fmtty' in\n let _, f2, _, f4 = fmtty_rel_det sub_fmtty' in\n let Refl = f2 Refl in\n let Refl = f4 Refl in\n let Fmtty_fmt_EBB (sub_fmtty_rest', fmt') =\n type_ignored_format_substitution (erase_rel sub_fmtty_rest) fmt fmtty_rest\n in\n Fmtty_fmt_EBB (Format_subst_ty (sub1_fmtty', sub2_fmtty',\n symm sub_fmtty_rest'),\n fmt')\n | End_of_fmtty, fmtty ->\n Fmtty_fmt_EBB (End_of_fmtty, type_format_gen fmt fmtty)\n | _ -> raise Type_mismatch\n\n(* This implementation of `recast` is a bit disappointing. The\n invariant provided by the type are very strong: the input format's\n type is in relation to the output type's as witnessed by the\n fmtty_rel argument. One would at first expect this function to be\n total, and implementable by exhaustive pattern matching. Instead,\n we reuse the highly partial and much less well-defined function\n `type_format` that has lost all knowledge of the correspondence\n between the argument's types.\n\n Besides the fact that this function reuses a lot of the\n `type_format` logic (eg.: seeing Int_ty in the fmtty parameter does\n not let you match on Int only, as you may in fact have Float\n (Arg_padding, ...) (\"%.*d\") beginning with an Int_ty), it is also\n a partial function, because the typing information in a format is\n not quite enough to reconstruct it unambiguously. For example, the\n format types of \"%d%_r\" and \"%_r%d\" have the same format6\n parameters, but they are not at all exchangeable, and putting one\n in place of the other must result in a dynamic failure.\n\n Given that:\n - we'd have to duplicate a lot of non-trivial typing logic from type_format\n - this wouldn't even eliminate (all) the dynamic failures\n we decided to just reuse type_format directly for now.\n*)\nlet recast :\n type a1 b1 c1 d1 e1 f1\n a2 b2 c2 d2 e2 f2\n .\n (a1, b1, c1, d1, e1, f1) fmt\n -> (a1, b1, c1, d1, e1, f1,\n a2, b2, c2, d2, e2, f2) fmtty_rel\n -> (a2, b2, c2, d2, e2, f2) fmt\n= fun fmt fmtty ->\n type_format fmt (erase_rel (symm fmtty))\n\n(******************************************************************************)\n (* Printing tools *)\n\n(* Add padding spaces around a string. *)\nlet fix_padding padty width str =\n let len = String.length str in\n let width, padty =\n abs width,\n (* while literal padding widths are always non-negative,\n dynamically-set widths (Arg_padding, eg. %*d) may be negative;\n we interpret those as specifying a padding-to-the-left; this\n means that '0' may get dropped even if it was explicitly set,\n but:\n - this is what the legacy implementation does, and\n we preserve compatibility if possible\n - we could only signal this issue by failing at runtime,\n which is not very nice... *)\n if width < 0 then Left else padty in\n if width <= len then str else\n let res = Bytes.make width (if padty = Zeros then '0' else ' ') in\n begin match padty with\n | Left -> String.blit str 0 res 0 len\n | Right -> String.blit str 0 res (width - len) len\n | Zeros when len > 0 && (str.[0] = '+' || str.[0] = '-' || str.[0] = ' ') ->\n Bytes.set res 0 str.[0];\n String.blit str 1 res (width - len + 1) (len - 1)\n | Zeros when len > 1 && str.[0] = '0' && (str.[1] = 'x' || str.[1] = 'X') ->\n Bytes.set res 1 str.[1];\n String.blit str 2 res (width - len + 2) (len - 2)\n | Zeros ->\n String.blit str 0 res (width - len) len\n end;\n Bytes.unsafe_to_string res\n\n(* Add '0' padding to int, int32, nativeint or int64 string representation. *)\nlet fix_int_precision prec str =\n let prec = abs prec in\n let len = String.length str in\n match str.[0] with\n | ('+' | '-' | ' ') as c when prec + 1 > len ->\n let res = Bytes.make (prec + 1) '0' in\n Bytes.set res 0 c;\n String.blit str 1 res (prec - len + 2) (len - 1);\n Bytes.unsafe_to_string res\n | '0' when prec + 2 > len && len > 1 && (str.[1] = 'x' || str.[1] = 'X') ->\n let res = Bytes.make (prec + 2) '0' in\n Bytes.set res 1 str.[1];\n String.blit str 2 res (prec - len + 4) (len - 2);\n Bytes.unsafe_to_string res\n | '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' when prec > len ->\n let res = Bytes.make prec '0' in\n String.blit str 0 res (prec - len) len;\n Bytes.unsafe_to_string res\n | _ ->\n str\n\n(* Escape a string according to the OCaml lexing convention. *)\nlet string_to_caml_string str =\n let str = String.escaped str in\n let l = String.length str in\n let res = Bytes.make (l + 2) '\\\"' in\n String.unsafe_blit str 0 res 1 l;\n Bytes.unsafe_to_string res\n\n(* Generate the format_int/int32/nativeint/int64 first argument\n from an int_conv. *)\nlet format_of_iconv = function\n | Int_d | Int_Cd -> \"%d\" | Int_pd -> \"%+d\" | Int_sd -> \"% d\"\n | Int_i | Int_Ci -> \"%i\" | Int_pi -> \"%+i\" | Int_si -> \"% i\"\n | Int_x -> \"%x\" | Int_Cx -> \"%#x\"\n | Int_X -> \"%X\" | Int_CX -> \"%#X\"\n | Int_o -> \"%o\" | Int_Co -> \"%#o\"\n | Int_u | Int_Cu -> \"%u\"\n\nlet format_of_iconvL = function\n | Int_d | Int_Cd -> \"%Ld\" | Int_pd -> \"%+Ld\" | Int_sd -> \"% Ld\"\n | Int_i | Int_Ci -> \"%Li\" | Int_pi -> \"%+Li\" | Int_si -> \"% Li\"\n | Int_x -> \"%Lx\" | Int_Cx -> \"%#Lx\"\n | Int_X -> \"%LX\" | Int_CX -> \"%#LX\"\n | Int_o -> \"%Lo\" | Int_Co -> \"%#Lo\"\n | Int_u | Int_Cu -> \"%Lu\"\n\nlet format_of_iconvl = function\n | Int_d | Int_Cd -> \"%ld\" | Int_pd -> \"%+ld\" | Int_sd -> \"% ld\"\n | Int_i | Int_Ci -> \"%li\" | Int_pi -> \"%+li\" | Int_si -> \"% li\"\n | Int_x -> \"%lx\" | Int_Cx -> \"%#lx\"\n | Int_X -> \"%lX\" | Int_CX -> \"%#lX\"\n | Int_o -> \"%lo\" | Int_Co -> \"%#lo\"\n | Int_u | Int_Cu -> \"%lu\"\n\nlet format_of_iconvn = function\n | Int_d | Int_Cd -> \"%nd\" | Int_pd -> \"%+nd\" | Int_sd -> \"% nd\"\n | Int_i | Int_Ci -> \"%ni\" | Int_pi -> \"%+ni\" | Int_si -> \"% ni\"\n | Int_x -> \"%nx\" | Int_Cx -> \"%#nx\"\n | Int_X -> \"%nX\" | Int_CX -> \"%#nX\"\n | Int_o -> \"%no\" | Int_Co -> \"%#no\"\n | Int_u | Int_Cu -> \"%nu\"\n\n(* Generate the format_float first argument from a float_conv. *)\nlet format_of_fconv fconv prec =\n let prec = abs prec in\n let symb = char_of_fconv ~cF:'g' fconv in\n let buf = buffer_create 16 in\n buffer_add_char buf '%';\n bprint_fconv_flag buf fconv;\n buffer_add_char buf '.';\n buffer_add_string buf (Int.to_string prec);\n buffer_add_char buf symb;\n buffer_contents buf\n\nlet transform_int_alt iconv s =\n match iconv with\n | Int_Cd | Int_Ci | Int_Cu ->\n let digits =\n let n = ref 0 in\n for i = 0 to String.length s - 1 do\n match String.unsafe_get s i with\n | '0'..'9' -> incr n\n | _ -> ()\n done;\n !n\n in\n let buf = Bytes.create (String.length s + (digits - 1) / 3) in\n let pos = ref 0 in\n let put c = Bytes.set buf !pos c; incr pos in\n let left = ref ((digits - 1) mod 3 + 1) in\n for i = 0 to String.length s - 1 do\n match String.unsafe_get s i with\n | '0'..'9' as c ->\n if !left = 0 then (put '_'; left := 3); decr left; put c\n | c -> put c\n done;\n Bytes.unsafe_to_string buf\n | _ -> s\n\n(* Convert an integer to a string according to a conversion. *)\nlet convert_int iconv n =\n transform_int_alt iconv (format_int (format_of_iconv iconv) n)\nlet convert_int32 iconv n =\n transform_int_alt iconv (format_int32 (format_of_iconvl iconv) n)\nlet convert_nativeint iconv n =\n transform_int_alt iconv (format_nativeint (format_of_iconvn iconv) n)\nlet convert_int64 iconv n =\n transform_int_alt iconv (format_int64 (format_of_iconvL iconv) n)\n\n(* Convert a float to string. *)\n(* Fix special case of \"OCaml float format\". *)\nlet convert_float fconv prec x =\n let hex () =\n let sign =\n match fst fconv with\n | Float_flag_p -> '+'\n | Float_flag_s -> ' '\n | _ -> '-' in\n hexstring_of_float x prec sign in\n let add_dot_if_needed str =\n let len = String.length str in\n let rec is_valid i =\n if i = len then false else\n match str.[i] with\n | '.' | 'e' | 'E' -> true\n | _ -> is_valid (i + 1) in\n if is_valid 0 then str else str ^ \".\" in\n let caml_special_val str = match classify_float x with\n | FP_normal | FP_subnormal | FP_zero -> str\n | FP_infinite -> if x < 0.0 then \"neg_infinity\" else \"infinity\"\n | FP_nan -> \"nan\" in\n match snd fconv with\n | Float_h -> hex ()\n | Float_H -> String.uppercase_ascii (hex ())\n | Float_CF -> caml_special_val (hex ())\n | Float_F ->\n let str = format_float (format_of_fconv fconv prec) x in\n caml_special_val (add_dot_if_needed str)\n | Float_f | Float_e | Float_E | Float_g | Float_G ->\n format_float (format_of_fconv fconv prec) x\n\n(* Convert a char to a string according to the OCaml lexical convention. *)\nlet format_caml_char c =\n let str = Char.escaped c in\n let l = String.length str in\n let res = Bytes.make (l + 2) '\\'' in\n String.unsafe_blit str 0 res 1 l;\n Bytes.unsafe_to_string res\n\n(* Convert a format type to string *)\nlet string_of_fmtty fmtty =\n let buf = buffer_create 16 in\n bprint_fmtty buf fmtty;\n buffer_contents buf\n\n(******************************************************************************)\n (* Generic printing function *)\n\n(* Make a generic printing function. *)\n(* Used to generate Printf and Format printing functions. *)\n(* Parameters:\n k: a continuation finally applied to the output stream and the accumulator.\n o: the output stream (see k, %a and %t).\n acc: rev list of printing entities (string, char, flush, formatting, ...).\n fmt: the format. *)\nlet rec make_printf : type a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt -> a =\nfun k acc fmt -> match fmt with\n | Char rest ->\n fun c ->\n let new_acc = Acc_data_char (acc, c) in\n make_printf k new_acc rest\n | Caml_char rest ->\n fun c ->\n let new_acc = Acc_data_string (acc, format_caml_char c) in\n make_printf k new_acc rest\n | String (pad, rest) ->\n make_padding k acc rest pad (fun str -> str)\n | Caml_string (pad, rest) ->\n make_padding k acc rest pad string_to_caml_string\n | Int (iconv, pad, prec, rest) ->\n make_int_padding_precision k acc rest pad prec convert_int iconv\n | Int32 (iconv, pad, prec, rest) ->\n make_int_padding_precision k acc rest pad prec convert_int32 iconv\n | Nativeint (iconv, pad, prec, rest) ->\n make_int_padding_precision k acc rest pad prec convert_nativeint iconv\n | Int64 (iconv, pad, prec, rest) ->\n make_int_padding_precision k acc rest pad prec convert_int64 iconv\n | Float (fconv, pad, prec, rest) ->\n make_float_padding_precision k acc rest pad prec fconv\n | Bool (pad, rest) ->\n make_padding k acc rest pad string_of_bool\n | Alpha rest ->\n fun f x -> make_printf k (Acc_delay (acc, fun o -> f o x)) rest\n | Theta rest ->\n fun f -> make_printf k (Acc_delay (acc, f)) rest\n | Custom (arity, f, rest) ->\n make_custom k acc rest arity (f ())\n | Reader _ ->\n (* This case is impossible, by typing of formats. *)\n (* Indeed, since printf and co. take a format4 as argument, the 'd and 'e\n type parameters of fmt are obviously equals. The Reader is the\n only constructor which touch 'd and 'e type parameters of the format\n type, it adds an (->) to the 'd parameters. Consequently, a format4\n cannot contain a Reader node, except in the sub-format associated to\n an %{...%}. It's not a problem because make_printf do not call\n itself recursively on the sub-format associated to %{...%}. *)\n assert false\n | Flush rest ->\n make_printf k (Acc_flush acc) rest\n\n | String_literal (str, rest) ->\n make_printf k (Acc_string_literal (acc, str)) rest\n | Char_literal (chr, rest) ->\n make_printf k (Acc_char_literal (acc, chr)) rest\n\n | Format_arg (_, sub_fmtty, rest) ->\n let ty = string_of_fmtty sub_fmtty in\n (fun str ->\n ignore str;\n make_printf k (Acc_data_string (acc, ty)) rest)\n | Format_subst (_, fmtty, rest) ->\n fun (Format (fmt, _)) -> make_printf k acc\n (concat_fmt (recast fmt fmtty) rest)\n\n | Scan_char_set (_, _, rest) ->\n let new_acc = Acc_invalid_arg (acc, \"Printf: bad conversion %[\") in\n fun _ -> make_printf k new_acc rest\n | Scan_get_counter (_, rest) ->\n (* This case should be refused for Printf. *)\n (* Accepted for backward compatibility. *)\n (* Interpret %l, %n and %L as %u. *)\n fun n ->\n let new_acc = Acc_data_string (acc, format_int \"%u\" n) in\n make_printf k new_acc rest\n | Scan_next_char rest ->\n fun c ->\n let new_acc = Acc_data_char (acc, c) in\n make_printf k new_acc rest\n | Ignored_param (ign, rest) ->\n make_ignored_param k acc ign rest\n\n | Formatting_lit (fmting_lit, rest) ->\n make_printf k (Acc_formatting_lit (acc, fmting_lit)) rest\n | Formatting_gen (Open_tag (Format (fmt', _)), rest) ->\n let k' kacc =\n make_printf k (Acc_formatting_gen (acc, Acc_open_tag kacc)) rest in\n make_printf k' End_of_acc fmt'\n | Formatting_gen (Open_box (Format (fmt', _)), rest) ->\n let k' kacc =\n make_printf k (Acc_formatting_gen (acc, Acc_open_box kacc)) rest in\n make_printf k' End_of_acc fmt'\n\n | End_of_format ->\n k acc\n\n(* Delay the error (Invalid_argument \"Printf: bad conversion %_\"). *)\n(* Generate functions to take remaining arguments (after the \"%_\"). *)\nand make_ignored_param : type x y a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, y, x) ignored ->\n (x, b, c, y, e, f) fmt -> a =\nfun k acc ign fmt -> match ign with\n | Ignored_char -> make_invalid_arg k acc fmt\n | Ignored_caml_char -> make_invalid_arg k acc fmt\n | Ignored_string _ -> make_invalid_arg k acc fmt\n | Ignored_caml_string _ -> make_invalid_arg k acc fmt\n | Ignored_int (_, _) -> make_invalid_arg k acc fmt\n | Ignored_int32 (_, _) -> make_invalid_arg k acc fmt\n | Ignored_nativeint (_, _) -> make_invalid_arg k acc fmt\n | Ignored_int64 (_, _) -> make_invalid_arg k acc fmt\n | Ignored_float (_, _) -> make_invalid_arg k acc fmt\n | Ignored_bool _ -> make_invalid_arg k acc fmt\n | Ignored_format_arg _ -> make_invalid_arg k acc fmt\n | Ignored_format_subst (_, fmtty) -> make_from_fmtty k acc fmtty fmt\n | Ignored_reader -> assert false\n | Ignored_scan_char_set _ -> make_invalid_arg k acc fmt\n | Ignored_scan_get_counter _ -> make_invalid_arg k acc fmt\n | Ignored_scan_next_char -> make_invalid_arg k acc fmt\n\n\n(* Special case of printf \"%_(\". *)\nand make_from_fmtty : type x y a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, y, x) fmtty ->\n (x, b, c, y, e, f) fmt -> a =\nfun k acc fmtty fmt -> match fmtty with\n | Char_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | String_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Int_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Int32_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Nativeint_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Int64_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Float_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Bool_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Alpha_ty rest -> fun _ _ -> make_from_fmtty k acc rest fmt\n | Theta_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Any_ty rest -> fun _ -> make_from_fmtty k acc rest fmt\n | Reader_ty _ -> assert false\n | Ignored_reader_ty _ -> assert false\n | Format_arg_ty (_, rest) -> fun _ -> make_from_fmtty k acc rest fmt\n | End_of_fmtty -> make_invalid_arg k acc fmt\n | Format_subst_ty (ty1, ty2, rest) ->\n let ty = trans (symm ty1) ty2 in\n fun _ -> make_from_fmtty k acc (concat_fmtty ty rest) fmt\n\n(* Insert an Acc_invalid_arg in the accumulator and continue to generate\n closures to get the remaining arguments. *)\nand make_invalid_arg : type a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt -> a =\nfun k acc fmt ->\n make_printf k (Acc_invalid_arg (acc, \"Printf: bad conversion %_\")) fmt\n\n(* Fix padding, take it as an extra integer argument if needed. *)\nand make_padding : type x z a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt ->\n (x, z -> a) padding -> (z -> string) -> x =\n fun k acc fmt pad trans -> match pad with\n | No_padding ->\n fun x ->\n let new_acc = Acc_data_string (acc, trans x) in\n make_printf k new_acc fmt\n | Lit_padding (padty, width) ->\n fun x ->\n let new_acc = Acc_data_string (acc, fix_padding padty width (trans x)) in\n make_printf k new_acc fmt\n | Arg_padding padty ->\n fun w x ->\n let new_acc = Acc_data_string (acc, fix_padding padty w (trans x)) in\n make_printf k new_acc fmt\n\n(* Fix padding and precision for int, int32, nativeint or int64. *)\n(* Take one or two extra integer arguments if needed. *)\nand make_int_padding_precision : type x y z a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt ->\n (x, y) padding -> (y, z -> a) precision -> (int_conv -> z -> string) ->\n int_conv -> x =\n fun k acc fmt pad prec trans iconv -> match pad, prec with\n | No_padding, No_precision ->\n fun x ->\n let str = trans iconv x in\n make_printf k (Acc_data_string (acc, str)) fmt\n | No_padding, Lit_precision p ->\n fun x ->\n let str = fix_int_precision p (trans iconv x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | No_padding, Arg_precision ->\n fun p x ->\n let str = fix_int_precision p (trans iconv x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Lit_padding (padty, w), No_precision ->\n fun x ->\n let str = fix_padding padty w (trans iconv x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Lit_padding (padty, w), Lit_precision p ->\n fun x ->\n let str = fix_padding padty w (fix_int_precision p (trans iconv x)) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Lit_padding (padty, w), Arg_precision ->\n fun p x ->\n let str = fix_padding padty w (fix_int_precision p (trans iconv x)) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Arg_padding padty, No_precision ->\n fun w x ->\n let str = fix_padding padty w (trans iconv x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Arg_padding padty, Lit_precision p ->\n fun w x ->\n let str = fix_padding padty w (fix_int_precision p (trans iconv x)) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Arg_padding padty, Arg_precision ->\n fun w p x ->\n let str = fix_padding padty w (fix_int_precision p (trans iconv x)) in\n make_printf k (Acc_data_string (acc, str)) fmt\n\n(* Convert a float, fix padding and precision if needed. *)\n(* Take the float argument and one or two extra integer arguments if needed. *)\nand make_float_padding_precision : type x y a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt ->\n (x, y) padding -> (y, float -> a) precision -> float_conv -> x =\n fun k acc fmt pad prec fconv -> match pad, prec with\n | No_padding, No_precision ->\n fun x ->\n let str = convert_float fconv (default_float_precision fconv) x in\n make_printf k (Acc_data_string (acc, str)) fmt\n | No_padding, Lit_precision p ->\n fun x ->\n let str = convert_float fconv p x in\n make_printf k (Acc_data_string (acc, str)) fmt\n | No_padding, Arg_precision ->\n fun p x ->\n let str = convert_float fconv p x in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Lit_padding (padty, w), No_precision ->\n fun x ->\n let str = convert_float fconv (default_float_precision fconv) x in\n let str' = fix_padding padty w str in\n make_printf k (Acc_data_string (acc, str')) fmt\n | Lit_padding (padty, w), Lit_precision p ->\n fun x ->\n let str = fix_padding padty w (convert_float fconv p x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Lit_padding (padty, w), Arg_precision ->\n fun p x ->\n let str = fix_padding padty w (convert_float fconv p x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Arg_padding padty, No_precision ->\n fun w x ->\n let str = convert_float fconv (default_float_precision fconv) x in\n let str' = fix_padding padty w str in\n make_printf k (Acc_data_string (acc, str')) fmt\n | Arg_padding padty, Lit_precision p ->\n fun w x ->\n let str = fix_padding padty w (convert_float fconv p x) in\n make_printf k (Acc_data_string (acc, str)) fmt\n | Arg_padding padty, Arg_precision ->\n fun w p x ->\n let str = fix_padding padty w (convert_float fconv p x) in\n make_printf k (Acc_data_string (acc, str)) fmt\nand make_custom : type x y a b c d e f .\n ((b, c) acc -> f) -> (b, c) acc ->\n (a, b, c, d, e, f) fmt ->\n (a, x, y) custom_arity -> x -> y =\n fun k acc rest arity f -> match arity with\n | Custom_zero -> make_printf k (Acc_data_string (acc, f)) rest\n | Custom_succ arity ->\n fun x ->\n make_custom k acc rest arity (f x)\n\nlet const x _ = x\n\nlet rec make_iprintf : type a b c d e f state.\n (state -> f) -> state -> (a, b, c, d, e, f) fmt -> a =\n fun k o fmt -> match fmt with\n | Char rest ->\n const (make_iprintf k o rest)\n | Caml_char rest ->\n const (make_iprintf k o rest)\n | String (No_padding, rest) ->\n const (make_iprintf k o rest)\n | String (Lit_padding _, rest) ->\n const (make_iprintf k o rest)\n | String (Arg_padding _, rest) ->\n const (const (make_iprintf k o rest))\n | Caml_string (No_padding, rest) ->\n const (make_iprintf k o rest)\n | Caml_string (Lit_padding _, rest) ->\n const (make_iprintf k o rest)\n | Caml_string (Arg_padding _, rest) ->\n const (const (make_iprintf k o rest))\n | Int (_, pad, prec, rest) ->\n fn_of_padding_precision k o rest pad prec\n | Int32 (_, pad, prec, rest) ->\n fn_of_padding_precision k o rest pad prec\n | Nativeint (_, pad, prec, rest) ->\n fn_of_padding_precision k o rest pad prec\n | Int64 (_, pad, prec, rest) ->\n fn_of_padding_precision k o rest pad prec\n | Float (_, pad, prec, rest) ->\n fn_of_padding_precision k o rest pad prec\n | Bool (No_padding, rest) ->\n const (make_iprintf k o rest)\n | Bool (Lit_padding _, rest) ->\n const (make_iprintf k o rest)\n | Bool (Arg_padding _, rest) ->\n const (const (make_iprintf k o rest))\n | Alpha rest ->\n const (const (make_iprintf k o rest))\n | Theta rest ->\n const (make_iprintf k o rest)\n | Custom (arity, _, rest) ->\n fn_of_custom_arity k o rest arity\n | Reader _ ->\n (* This case is impossible, by typing of formats. See the\n note in the corresponding case for make_printf. *)\n assert false\n | Flush rest ->\n make_iprintf k o rest\n | String_literal (_, rest) ->\n make_iprintf k o rest\n | Char_literal (_, rest) ->\n make_iprintf k o rest\n | Format_arg (_, _, rest) ->\n const (make_iprintf k o rest)\n | Format_subst (_, fmtty, rest) ->\n fun (Format (fmt, _)) ->\n make_iprintf k o\n (concat_fmt (recast fmt fmtty) rest)\n | Scan_char_set (_, _, rest) ->\n const (make_iprintf k o rest)\n | Scan_get_counter (_, rest) ->\n const (make_iprintf k o rest)\n | Scan_next_char rest ->\n const (make_iprintf k o rest)\n | Ignored_param (ign, rest) ->\n make_ignored_param (fun _ -> k o) (End_of_acc) ign rest\n | Formatting_lit (_, rest) ->\n make_iprintf k o rest\n | Formatting_gen (Open_tag (Format (fmt', _)), rest) ->\n make_iprintf (fun koc -> make_iprintf k koc rest) o fmt'\n | Formatting_gen (Open_box (Format (fmt', _)), rest) ->\n make_iprintf (fun koc -> make_iprintf k koc rest) o fmt'\n | End_of_format ->\n k o\nand fn_of_padding_precision :\n type x y z a b c d e f state.\n (state -> f) -> state -> (a, b, c, d, e, f) fmt ->\n (x, y) padding -> (y, z -> a) precision -> x =\n fun k o fmt pad prec -> match pad, prec with\n | No_padding , No_precision ->\n const (make_iprintf k o fmt)\n | No_padding , Lit_precision _ ->\n const (make_iprintf k o fmt)\n | No_padding , Arg_precision ->\n const (const (make_iprintf k o fmt))\n | Lit_padding _, No_precision ->\n const (make_iprintf k o fmt)\n | Lit_padding _, Lit_precision _ ->\n const (make_iprintf k o fmt)\n | Lit_padding _, Arg_precision ->\n const (const (make_iprintf k o fmt))\n | Arg_padding _, No_precision ->\n const (const (make_iprintf k o fmt))\n | Arg_padding _, Lit_precision _ ->\n const (const (make_iprintf k o fmt))\n | Arg_padding _, Arg_precision ->\n const (const (const (make_iprintf k o fmt)))\nand fn_of_custom_arity : type x y a b c d e f state.\n (state -> f) ->\n state -> (a, b, c, d, e, f) fmt -> (a, x, y) custom_arity -> y =\n fun k o fmt -> function\n | Custom_zero ->\n make_iprintf k o fmt\n | Custom_succ arity ->\n const (fn_of_custom_arity k o fmt arity)\n\n(******************************************************************************)\n (* Continuations for make_printf *)\n\n(* Recursively output an \"accumulator\" containing a reversed list of\n printing entities (string, char, flus, ...) in an output_stream. *)\n(* Used as a continuation of make_printf. *)\nlet rec output_acc o acc = match acc with\n | Acc_formatting_lit (p, fmting_lit) ->\n let s = string_of_formatting_lit fmting_lit in\n output_acc o p; output_string o s;\n | Acc_formatting_gen (p, Acc_open_tag acc') ->\n output_acc o p; output_string o \"@{\"; output_acc o acc';\n | Acc_formatting_gen (p, Acc_open_box acc') ->\n output_acc o p; output_string o \"@[\"; output_acc o acc';\n | Acc_string_literal (p, s)\n | Acc_data_string (p, s) -> output_acc o p; output_string o s\n | Acc_char_literal (p, c)\n | Acc_data_char (p, c) -> output_acc o p; output_char o c\n | Acc_delay (p, f) -> output_acc o p; f o\n | Acc_flush p -> output_acc o p; flush o\n | Acc_invalid_arg (p, msg) -> output_acc o p; invalid_arg msg;\n | End_of_acc -> ()\n\n(* Recursively output an \"accumulator\" containing a reversed list of\n printing entities (string, char, flus, ...) in a buffer. *)\n(* Used as a continuation of make_printf. *)\nlet rec bufput_acc b acc = match acc with\n | Acc_formatting_lit (p, fmting_lit) ->\n let s = string_of_formatting_lit fmting_lit in\n bufput_acc b p; Buffer.add_string b s;\n | Acc_formatting_gen (p, Acc_open_tag acc') ->\n bufput_acc b p; Buffer.add_string b \"@{\"; bufput_acc b acc';\n | Acc_formatting_gen (p, Acc_open_box acc') ->\n bufput_acc b p; Buffer.add_string b \"@[\"; bufput_acc b acc';\n | Acc_string_literal (p, s)\n | Acc_data_string (p, s) -> bufput_acc b p; Buffer.add_string b s\n | Acc_char_literal (p, c)\n | Acc_data_char (p, c) -> bufput_acc b p; Buffer.add_char b c\n | Acc_delay (p, f) -> bufput_acc b p; f b\n | Acc_flush p -> bufput_acc b p;\n | Acc_invalid_arg (p, msg) -> bufput_acc b p; invalid_arg msg;\n | End_of_acc -> ()\n\n(* Recursively output an \"accumulator\" containing a reversed list of\n printing entities (string, char, flus, ...) in a buffer. *)\n(* Differ from bufput_acc by the interpretation of %a and %t. *)\n(* Used as a continuation of make_printf. *)\nlet rec strput_acc b acc = match acc with\n | Acc_formatting_lit (p, fmting_lit) ->\n let s = string_of_formatting_lit fmting_lit in\n strput_acc b p; Buffer.add_string b s;\n | Acc_formatting_gen (p, Acc_open_tag acc') ->\n strput_acc b p; Buffer.add_string b \"@{\"; strput_acc b acc';\n | Acc_formatting_gen (p, Acc_open_box acc') ->\n strput_acc b p; Buffer.add_string b \"@[\"; strput_acc b acc';\n | Acc_string_literal (p, s)\n | Acc_data_string (p, s) -> strput_acc b p; Buffer.add_string b s\n | Acc_char_literal (p, c)\n | Acc_data_char (p, c) -> strput_acc b p; Buffer.add_char b c\n | Acc_delay (p, f) -> strput_acc b p; Buffer.add_string b (f ())\n | Acc_flush p -> strput_acc b p;\n | Acc_invalid_arg (p, msg) -> strput_acc b p; invalid_arg msg;\n | End_of_acc -> ()\n\n(******************************************************************************)\n (* Error management *)\n\n(* Raise [Failure] with a pretty-printed error message. *)\nlet failwith_message (Format (fmt, _)) =\n let buf = Buffer.create 256 in\n let k acc = strput_acc buf acc; failwith (Buffer.contents buf) in\n make_printf k End_of_acc fmt\n\n(******************************************************************************)\n (* Formatting tools *)\n\n(* Convert a string to an open block description (indent, block_type) *)\nlet open_box_of_string str =\n if str = \"\" then (0, Pp_box) else\n let len = String.length str in\n let invalid_box () = failwith_message \"invalid box description %S\" str in\n let rec parse_spaces i =\n if i = len then i else\n match str.[i] with\n | ' ' | '\\t' -> parse_spaces (i + 1)\n | _ -> i\n and parse_lword i j =\n if j = len then j else\n match str.[j] with\n | 'a' .. 'z' -> parse_lword i (j + 1)\n | _ -> j\n and parse_int i j =\n if j = len then j else\n match str.[j] with\n | '0' .. '9' | '-' -> parse_int i (j + 1)\n | _ -> j in\n let wstart = parse_spaces 0 in\n let wend = parse_lword wstart wstart in\n let box_name = String.sub str wstart (wend - wstart) in\n let nstart = parse_spaces wend in\n let nend = parse_int nstart nstart in\n let indent =\n if nstart = nend then 0 else\n try int_of_string (String.sub str nstart (nend - nstart))\n with Failure _ -> invalid_box () in\n let exp_end = parse_spaces nend in\n if exp_end <> len then invalid_box ();\n let box_type = match box_name with\n | \"\" | \"b\" -> Pp_box\n | \"h\" -> Pp_hbox\n | \"v\" -> Pp_vbox\n | \"hv\" -> Pp_hvbox\n | \"hov\" -> Pp_hovbox\n | _ -> invalid_box () in\n (indent, box_type)\n\n(******************************************************************************)\n (* Parsing tools *)\n\n(* Create a padding_fmt_ebb from a padding and a format. *)\n(* Copy the padding to disjoin the type parameters of argument and result. *)\nlet make_padding_fmt_ebb : type x y .\n (x, y) padding -> (_, _, _, _, _, _) fmt ->\n (_, _, _, _, _) padding_fmt_ebb =\nfun pad fmt -> match pad with\n | No_padding -> Padding_fmt_EBB (No_padding, fmt)\n | Lit_padding (s, w) -> Padding_fmt_EBB (Lit_padding (s, w), fmt)\n | Arg_padding s -> Padding_fmt_EBB (Arg_padding s, fmt)\n\n(* Create a precision_fmt_ebb from a precision and a format. *)\n(* Copy the precision to disjoin the type parameters of argument and result. *)\nlet make_precision_fmt_ebb : type x y .\n (x, y) precision -> (_, _, _, _, _, _) fmt ->\n (_, _, _, _, _) precision_fmt_ebb =\nfun prec fmt -> match prec with\n | No_precision -> Precision_fmt_EBB (No_precision, fmt)\n | Lit_precision p -> Precision_fmt_EBB (Lit_precision p, fmt)\n | Arg_precision -> Precision_fmt_EBB (Arg_precision, fmt)\n\n(* Create a padprec_fmt_ebb from a padding, a precision and a format. *)\n(* Copy the padding and the precision to disjoin type parameters of arguments\n and result. *)\nlet make_padprec_fmt_ebb : type x y z t .\n (x, y) padding -> (z, t) precision ->\n (_, _, _, _, _, _) fmt ->\n (_, _, _, _, _) padprec_fmt_ebb =\nfun pad prec fmt ->\n let Precision_fmt_EBB (prec, fmt') = make_precision_fmt_ebb prec fmt in\n match pad with\n | No_padding -> Padprec_fmt_EBB (No_padding, prec, fmt')\n | Lit_padding (s, w) -> Padprec_fmt_EBB (Lit_padding (s, w), prec, fmt')\n | Arg_padding s -> Padprec_fmt_EBB (Arg_padding s, prec, fmt')\n\n(******************************************************************************)\n (* Format parsing *)\n\n(* Parse a string representing a format and create a fmt_ebb. *)\n(* Raise [Failure] in case of invalid format. *)\nlet fmt_ebb_of_string ?legacy_behavior str =\n (* Parameters naming convention: *)\n (* - lit_start: start of the literal sequence. *)\n (* - str_ind: current index in the string. *)\n (* - end_ind: end of the current (sub-)format. *)\n (* - pct_ind: index of the '%' in the current micro-format. *)\n (* - zero: is the '0' flag defined in the current micro-format. *)\n (* - minus: is the '-' flag defined in the current micro-format. *)\n (* - plus: is the '+' flag defined in the current micro-format. *)\n (* - hash: is the '#' flag defined in the current micro-format. *)\n (* - space: is the ' ' flag defined in the current micro-format. *)\n (* - ign: is the '_' flag defined in the current micro-format. *)\n (* - pad: padding of the current micro-format. *)\n (* - prec: precision of the current micro-format. *)\n (* - symb: char representing the conversion ('c', 's', 'd', ...). *)\n (* - char_set: set of characters as bitmap (see scanf %[...]). *)\n\n let legacy_behavior = match legacy_behavior with\n | Some flag -> flag\n | None -> true\n (* When this flag is enabled, the format parser tries to behave as\n the <4.02 implementations, in particular it ignores most benign\n nonsensical formats. When the flag is disabled, it will reject any\n format that is not accepted by the specification.\n\n A typical example would be \"%+ d\": specifying both '+' (if the\n number is positive, pad with a '+' to get the same width as\n negative numbers) and ' ' (if the number is positive, pad with\n a space) does not make sense, but the legacy (< 4.02)\n implementation was happy to just ignore the space.\n *)\n in\n\n (* Raise [Failure] with a friendly error message. *)\n let invalid_format_message str_ind msg =\n failwith_message\n \"invalid format %S: at character number %d, %s\"\n str str_ind msg\n in\n\n (* Used when the end of the format (or the current sub-format) was encountered\n unexpectedly. *)\n let unexpected_end_of_format end_ind =\n invalid_format_message end_ind\n \"unexpected end of format\"\n in\n\n (* Used for %0c: no other widths are implemented *)\n let invalid_nonnull_char_width str_ind =\n invalid_format_message str_ind\n \"non-zero widths are unsupported for %c conversions\"\n in\n (* Raise [Failure] with a friendly error message about an option dependency\n problem. *)\n let invalid_format_without str_ind c s =\n failwith_message\n \"invalid format %S: at character number %d, '%c' without %s\"\n str str_ind c s\n in\n\n (* Raise [Failure] with a friendly error message about an unexpected\n character. *)\n let expected_character str_ind expected read =\n failwith_message\n \"invalid format %S: at character number %d, %s expected, read %C\"\n str str_ind expected read\n in\n\n (* Parse the string from beg_ind (included) to end_ind (excluded). *)\n let rec parse : type e f . int -> int -> (_, _, e, f) fmt_ebb =\n fun beg_ind end_ind -> parse_literal beg_ind beg_ind end_ind\n\n (* Read literal characters up to '%' or '@' special characters. *)\n and parse_literal : type e f . int -> int -> int -> (_, _, e, f) fmt_ebb =\n fun lit_start str_ind end_ind ->\n if str_ind = end_ind then add_literal lit_start str_ind End_of_format else\n match str.[str_ind] with\n | '%' ->\n let Fmt_EBB fmt_rest = parse_format str_ind end_ind in\n add_literal lit_start str_ind fmt_rest\n | '@' ->\n let Fmt_EBB fmt_rest = parse_after_at (str_ind + 1) end_ind in\n add_literal lit_start str_ind fmt_rest\n | _ ->\n parse_literal lit_start (str_ind + 1) end_ind\n\n (* Parse a format after '%' *)\n and parse_format : type e f . int -> int -> (_, _, e, f) fmt_ebb =\n fun pct_ind end_ind -> parse_ign pct_ind (pct_ind + 1) end_ind\n\n and parse_ign : type e f . int -> int -> int -> (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind ->\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | '_' -> parse_flags pct_ind (str_ind+1) end_ind true\n | _ -> parse_flags pct_ind str_ind end_ind false\n\n and parse_flags : type e f . int -> int -> int -> bool -> (_, _, e, f) fmt_ebb\n =\n fun pct_ind str_ind end_ind ign ->\n let zero = ref false and minus = ref false\n and plus = ref false and space = ref false\n and hash = ref false in\n let set_flag str_ind flag =\n (* in legacy mode, duplicate flags are accepted *)\n if !flag && not legacy_behavior then\n failwith_message\n \"invalid format %S: at character number %d, duplicate flag %C\"\n str str_ind str.[str_ind];\n flag := true;\n in\n let rec read_flags str_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n begin match str.[str_ind] with\n | '0' -> set_flag str_ind zero; read_flags (str_ind + 1)\n | '-' -> set_flag str_ind minus; read_flags (str_ind + 1)\n | '+' -> set_flag str_ind plus; read_flags (str_ind + 1)\n | '#' -> set_flag str_ind hash; read_flags (str_ind + 1)\n | ' ' -> set_flag str_ind space; read_flags (str_ind + 1)\n | _ ->\n parse_padding pct_ind str_ind end_ind\n !zero !minus !plus !hash !space ign\n end\n in\n read_flags str_ind\n\n (* Try to read a digital or a '*' padding. *)\n and parse_padding : type e f .\n int -> int -> int -> bool -> bool -> bool -> bool -> bool -> bool ->\n (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind zero minus plus hash space ign ->\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n let padty = match zero, minus with\n | false, false -> Right\n | false, true -> Left\n | true, false -> Zeros\n | true, true ->\n if legacy_behavior then Left\n else incompatible_flag pct_ind str_ind '-' \"0\" in\n match str.[str_ind] with\n | '0' .. '9' ->\n let new_ind, width = parse_positive str_ind end_ind 0 in\n parse_after_padding pct_ind new_ind end_ind minus plus hash space ign\n (Lit_padding (padty, width))\n | '*' ->\n parse_after_padding pct_ind (str_ind + 1) end_ind minus plus hash space\n ign (Arg_padding padty)\n | _ ->\n begin match padty with\n | Left ->\n if not legacy_behavior then\n invalid_format_without (str_ind - 1) '-' \"padding\";\n parse_after_padding pct_ind str_ind end_ind minus plus hash space ign\n No_padding\n | Zeros ->\n (* a '0' padding indication not followed by anything should\n be interpreted as a Right padding of width 0. This is used\n by scanning conversions %0s and %0c *)\n parse_after_padding pct_ind str_ind end_ind minus plus hash space ign\n (Lit_padding (Right, 0))\n | Right ->\n parse_after_padding pct_ind str_ind end_ind minus plus hash space ign\n No_padding\n end\n\n (* Is precision defined? *)\n and parse_after_padding : type x e f .\n int -> int -> int -> bool -> bool -> bool -> bool -> bool ->\n (x, _) padding -> (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind minus plus hash space ign pad ->\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | '.' ->\n parse_precision pct_ind (str_ind + 1) end_ind minus plus hash space ign\n pad\n | symb ->\n parse_conversion pct_ind (str_ind + 1) end_ind plus hash space ign pad\n No_precision pad symb\n\n (* Read the digital or '*' precision. *)\n and parse_precision : type x e f .\n int -> int -> int -> bool -> bool -> bool -> bool -> bool ->\n (x, _) padding -> (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind minus plus hash space ign pad ->\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n let parse_literal minus str_ind =\n let new_ind, prec = parse_positive str_ind end_ind 0 in\n parse_after_precision pct_ind new_ind end_ind minus plus hash space ign\n pad (Lit_precision prec) in\n match str.[str_ind] with\n | '0' .. '9' -> parse_literal minus str_ind\n | ('+' | '-') as symb when legacy_behavior ->\n (* Legacy mode would accept and ignore '+' or '-' before the\n integer describing the desired precision; note that this\n cannot happen for padding width, as '+' and '-' already have\n a semantics there.\n\n That said, the idea (supported by this tweak) that width and\n precision literals are \"integer literals\" in the OCaml sense is\n still blatantly wrong, as 123_456 or 0xFF are rejected. *)\n parse_literal (minus || symb = '-') (str_ind + 1)\n | '*' ->\n parse_after_precision pct_ind (str_ind + 1) end_ind minus plus hash space\n ign pad Arg_precision\n | _ ->\n if legacy_behavior then\n (* note that legacy implementation did not ignore '.' without\n a number (as it does for padding indications), but\n interprets it as '.0' *)\n parse_after_precision pct_ind str_ind end_ind minus plus hash space ign\n pad (Lit_precision 0)\n else\n invalid_format_without (str_ind - 1) '.' \"precision\"\n\n (* Try to read the conversion. *)\n and parse_after_precision : type x y z t e f .\n int -> int -> int -> bool -> bool -> bool -> bool -> bool ->\n (x, y) padding -> (z, t) precision -> (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind minus plus hash space ign pad prec ->\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n let parse_conv (type u) (type v) (padprec : (u, v) padding) =\n parse_conversion pct_ind (str_ind + 1) end_ind plus hash space ign pad\n prec padprec str.[str_ind] in\n (* in legacy mode, some formats (%s and %S) accept a weird mix of\n padding and precision, which is merged as a single padding\n information. For example, in %.10s the precision is implicitly\n understood as padding %10s, but the left-padding component may\n be specified either as a left padding or a negative precision:\n %-.3s and %.-3s are equivalent to %-3s *)\n match pad with\n | No_padding -> (\n match minus, prec with\n | _, No_precision -> parse_conv No_padding\n | false, Lit_precision n -> parse_conv (Lit_padding (Right, n))\n | true, Lit_precision n -> parse_conv (Lit_padding (Left, n))\n | false, Arg_precision -> parse_conv (Arg_padding Right)\n | true, Arg_precision -> parse_conv (Arg_padding Left)\n )\n | pad -> parse_conv pad\n\n (* Case analysis on conversion. *)\n and parse_conversion : type x y z t u v e f .\n int -> int -> int -> bool -> bool -> bool -> bool -> (x, y) padding ->\n (z, t) precision -> (u, v) padding -> char -> (_, _, e, f) fmt_ebb =\n fun pct_ind str_ind end_ind plus hash space ign pad prec padprec symb ->\n (* Flags used to check option usages/compatibilities. *)\n let plus_used = ref false and hash_used = ref false\n and space_used = ref false and ign_used = ref false\n and pad_used = ref false and prec_used = ref false in\n\n (* Access to options, update flags. *)\n let get_plus () = plus_used := true; plus\n and get_hash () = hash_used := true; hash\n and get_space () = space_used := true; space\n and get_ign () = ign_used := true; ign\n and get_pad () = pad_used := true; pad\n and get_prec () = prec_used := true; prec\n and get_padprec () = pad_used := true; padprec in\n\n let get_int_pad () : (x,y) padding =\n (* %5.3d is accepted and meaningful: pad to length 5 with\n spaces, but first pad with zeros upto length 3 (0-padding\n is the interpretation of \"precision\" for integer formats).\n\n %05.3d is redundant: pad to length 5 *with zeros*, but\n first pad with zeros... To add insult to the injury, the\n legacy implementation ignores the 0-padding indication and\n does the 5 padding with spaces instead. We reuse this\n interpretation for compatibility, but statically reject this\n format when the legacy mode is disabled, to protect strict\n users from this corner case. *)\n match get_pad (), get_prec () with\n | pad, No_precision -> pad\n | No_padding, _ -> No_padding\n | Lit_padding (Zeros, n), _ ->\n if legacy_behavior then Lit_padding (Right, n)\n else incompatible_flag pct_ind str_ind '0' \"precision\"\n | Arg_padding Zeros, _ ->\n if legacy_behavior then Arg_padding Right\n else incompatible_flag pct_ind str_ind '0' \"precision\"\n | Lit_padding _ as pad, _ -> pad\n | Arg_padding _ as pad, _ -> pad in\n\n (* Check that padty <> Zeros. *)\n let check_no_0 symb (type a b) (pad : (a, b) padding) : (a,b) padding =\n match pad with\n | No_padding -> pad\n | Lit_padding ((Left | Right), _) -> pad\n | Arg_padding (Left | Right) -> pad\n | Lit_padding (Zeros, width) ->\n if legacy_behavior then Lit_padding (Right, width)\n else incompatible_flag pct_ind str_ind symb \"0\"\n | Arg_padding Zeros ->\n if legacy_behavior then Arg_padding Right\n else incompatible_flag pct_ind str_ind symb \"0\"\n in\n\n (* Get padding as a pad_option (see \"%_\", \"%{\", \"%(\" and \"%[\").\n (no need for legacy mode tweaking, those were rejected by the\n legacy parser as well) *)\n let opt_of_pad c (type a) (type b) (pad : (a, b) padding) = match pad with\n | No_padding -> None\n | Lit_padding (Right, width) -> Some width\n | Lit_padding (Zeros, width) ->\n if legacy_behavior then Some width\n else incompatible_flag pct_ind str_ind c \"'0'\"\n | Lit_padding (Left, width) ->\n if legacy_behavior then Some width\n else incompatible_flag pct_ind str_ind c \"'-'\"\n | Arg_padding _ -> incompatible_flag pct_ind str_ind c \"'*'\"\n in\n let get_pad_opt c = opt_of_pad c (get_pad ()) in\n let get_padprec_opt c = opt_of_pad c (get_padprec ()) in\n\n (* Get precision as a prec_option (see \"%_f\").\n (no need for legacy mode tweaking, those were rejected by the\n legacy parser as well) *)\n let get_prec_opt () = match get_prec () with\n | No_precision -> None\n | Lit_precision ndec -> Some ndec\n | Arg_precision -> incompatible_flag pct_ind str_ind '_' \"'*'\"\n in\n\n let fmt_result = match symb with\n | ',' ->\n parse str_ind end_ind\n | 'c' ->\n let char_format fmt_rest = (* %c *)\n if get_ign ()\n then Fmt_EBB (Ignored_param (Ignored_char, fmt_rest))\n else Fmt_EBB (Char fmt_rest)\n in\n let scan_format fmt_rest = (* %0c *)\n if get_ign ()\n then Fmt_EBB (Ignored_param (Ignored_scan_next_char, fmt_rest))\n else Fmt_EBB (Scan_next_char fmt_rest)\n in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n begin match get_pad_opt 'c' with\n | None -> char_format fmt_rest\n | Some 0 -> scan_format fmt_rest\n | Some _n ->\n if not legacy_behavior\n then invalid_nonnull_char_width str_ind\n else (* legacy ignores %c widths *) char_format fmt_rest\n end\n | 'C' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then Fmt_EBB (Ignored_param (Ignored_caml_char,fmt_rest))\n else Fmt_EBB (Caml_char fmt_rest)\n | 's' ->\n let pad = check_no_0 symb (get_padprec ()) in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then\n let ignored = Ignored_string (get_padprec_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padding_fmt_EBB (pad', fmt_rest') =\n make_padding_fmt_ebb pad fmt_rest in\n Fmt_EBB (String (pad', fmt_rest'))\n | 'S' ->\n let pad = check_no_0 symb (get_padprec ()) in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then\n let ignored = Ignored_caml_string (get_padprec_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padding_fmt_EBB (pad', fmt_rest') =\n make_padding_fmt_ebb pad fmt_rest in\n Fmt_EBB (Caml_string (pad', fmt_rest'))\n | 'd' | 'i' | 'x' | 'X' | 'o' | 'u' ->\n let iconv = compute_int_conv pct_ind str_ind (get_plus ()) (get_hash ())\n (get_space ()) symb in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then\n let ignored = Ignored_int (iconv, get_pad_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padprec_fmt_EBB (pad', prec', fmt_rest') =\n make_padprec_fmt_ebb (get_int_pad ()) (get_prec ()) fmt_rest in\n Fmt_EBB (Int (iconv, pad', prec', fmt_rest'))\n | 'N' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n let counter = Token_counter in\n if get_ign () then\n let ignored = Ignored_scan_get_counter counter in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n Fmt_EBB (Scan_get_counter (counter, fmt_rest))\n | 'l' | 'n' | 'L' when str_ind=end_ind || not (is_int_base str.[str_ind]) ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n let counter = counter_of_char symb in\n if get_ign () then\n let ignored = Ignored_scan_get_counter counter in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n Fmt_EBB (Scan_get_counter (counter, fmt_rest))\n | 'l' ->\n let iconv =\n compute_int_conv pct_ind (str_ind + 1) (get_plus ()) (get_hash ())\n (get_space ()) str.[str_ind] in\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n if get_ign () then\n let ignored = Ignored_int32 (iconv, get_pad_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padprec_fmt_EBB (pad', prec', fmt_rest') =\n make_padprec_fmt_ebb (get_int_pad ()) (get_prec ()) fmt_rest in\n Fmt_EBB (Int32 (iconv, pad', prec', fmt_rest'))\n | 'n' ->\n let iconv =\n compute_int_conv pct_ind (str_ind + 1) (get_plus ())\n (get_hash ()) (get_space ()) str.[str_ind] in\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n if get_ign () then\n let ignored = Ignored_nativeint (iconv, get_pad_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padprec_fmt_EBB (pad', prec', fmt_rest') =\n make_padprec_fmt_ebb (get_int_pad ()) (get_prec ()) fmt_rest in\n Fmt_EBB (Nativeint (iconv, pad', prec', fmt_rest'))\n | 'L' ->\n let iconv =\n compute_int_conv pct_ind (str_ind + 1) (get_plus ()) (get_hash ())\n (get_space ()) str.[str_ind] in\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n if get_ign () then\n let ignored = Ignored_int64 (iconv, get_pad_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padprec_fmt_EBB (pad', prec', fmt_rest') =\n make_padprec_fmt_ebb (get_int_pad ()) (get_prec ()) fmt_rest in\n Fmt_EBB (Int64 (iconv, pad', prec', fmt_rest'))\n | 'f' | 'e' | 'E' | 'g' | 'G' | 'F' | 'h' | 'H' ->\n let fconv =\n compute_float_conv pct_ind str_ind\n (get_plus ()) (get_hash ()) (get_space ()) symb in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then\n let ignored = Ignored_float (get_pad_opt '_', get_prec_opt ()) in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padprec_fmt_EBB (pad', prec', fmt_rest') =\n make_padprec_fmt_ebb (get_pad ()) (get_prec ()) fmt_rest in\n Fmt_EBB (Float (fconv, pad', prec', fmt_rest'))\n | 'b' | 'B' ->\n let pad = check_no_0 symb (get_padprec ()) in\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then\n let ignored = Ignored_bool (get_padprec_opt '_') in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n let Padding_fmt_EBB (pad', fmt_rest') =\n make_padding_fmt_ebb pad fmt_rest in\n Fmt_EBB (Bool (pad', fmt_rest'))\n | 'a' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Alpha fmt_rest)\n | 't' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Theta fmt_rest)\n | 'r' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n if get_ign () then Fmt_EBB (Ignored_param (Ignored_reader, fmt_rest))\n else Fmt_EBB (Reader fmt_rest)\n | '!' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Flush fmt_rest)\n | ('%' | '@') as c ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Char_literal (c, fmt_rest))\n | '{' ->\n let sub_end = search_subformat_end str_ind end_ind '}' in\n let Fmt_EBB sub_fmt = parse str_ind sub_end in\n let Fmt_EBB fmt_rest = parse (sub_end + 2) end_ind in\n let sub_fmtty = fmtty_of_fmt sub_fmt in\n if get_ign () then\n let ignored = Ignored_format_arg (get_pad_opt '_', sub_fmtty) in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n Fmt_EBB (Format_arg (get_pad_opt '{', sub_fmtty, fmt_rest))\n | '(' ->\n let sub_end = search_subformat_end str_ind end_ind ')' in\n let Fmt_EBB fmt_rest = parse (sub_end + 2) end_ind in\n let Fmt_EBB sub_fmt = parse str_ind sub_end in\n let sub_fmtty = fmtty_of_fmt sub_fmt in\n if get_ign () then\n let ignored = Ignored_format_subst (get_pad_opt '_', sub_fmtty) in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n Fmt_EBB (Format_subst (get_pad_opt '(', sub_fmtty, fmt_rest))\n | '[' ->\n let next_ind, char_set = parse_char_set str_ind end_ind in\n let Fmt_EBB fmt_rest = parse next_ind end_ind in\n if get_ign () then\n let ignored = Ignored_scan_char_set (get_pad_opt '_', char_set) in\n Fmt_EBB (Ignored_param (ignored, fmt_rest))\n else\n Fmt_EBB (Scan_char_set (get_pad_opt '[', char_set, fmt_rest))\n | '-' | '+' | '#' | ' ' | '_' ->\n failwith_message\n \"invalid format %S: at character number %d, \\\n flag %C is only allowed after the '%%', before padding and precision\"\n str pct_ind symb\n | _ ->\n failwith_message\n \"invalid format %S: at character number %d, \\\n invalid conversion \\\"%%%c\\\"\" str (str_ind - 1) symb\n in\n (* Check for unused options, and reject them as incompatible.\n\n Such checks need to be disabled in legacy mode, as the legacy\n parser silently ignored incompatible flags. *)\n if not legacy_behavior then begin\n if not !plus_used && plus then\n incompatible_flag pct_ind str_ind symb \"'+'\";\n if not !hash_used && hash then\n incompatible_flag pct_ind str_ind symb \"'#'\";\n if not !space_used && space then\n incompatible_flag pct_ind str_ind symb \"' '\";\n if not !pad_used && Padding_EBB pad <> Padding_EBB No_padding then\n incompatible_flag pct_ind str_ind symb \"`padding'\";\n if not !prec_used && Precision_EBB prec <> Precision_EBB No_precision then\n incompatible_flag pct_ind str_ind (if ign then '_' else symb)\n \"`precision'\";\n if ign && plus then incompatible_flag pct_ind str_ind '_' \"'+'\";\n end;\n (* this last test must not be disabled in legacy mode,\n as ignoring it would typically result in a different typing\n than what the legacy parser used *)\n if not !ign_used && ign then\n begin match symb with\n (* argument-less formats can safely be ignored in legacy mode *)\n | ('@' | '%' | '!' | ',') when legacy_behavior -> ()\n | _ ->\n incompatible_flag pct_ind str_ind symb \"'_'\"\n end;\n fmt_result\n\n (* Parse formatting information (after '@'). *)\n and parse_after_at : type e f . int -> int -> (_, _, e, f) fmt_ebb =\n fun str_ind end_ind ->\n if str_ind = end_ind then Fmt_EBB (Char_literal ('@', End_of_format))\n else\n match str.[str_ind] with\n | '[' ->\n parse_tag false (str_ind + 1) end_ind\n | ']' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Close_box, fmt_rest))\n | '{' ->\n parse_tag true (str_ind + 1) end_ind\n | '}' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Close_tag, fmt_rest))\n | ',' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Break (\"@,\", 0, 0), fmt_rest))\n | ' ' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Break (\"@ \", 1, 0), fmt_rest))\n | ';' ->\n parse_good_break (str_ind + 1) end_ind\n | '?' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (FFlush, fmt_rest))\n | '\\n' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Force_newline, fmt_rest))\n | '.' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Flush_newline, fmt_rest))\n | '<' ->\n parse_magic_size (str_ind + 1) end_ind\n | '@' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Escaped_at, fmt_rest))\n | '%' when str_ind + 1 < end_ind && str.[str_ind + 1] = '%' ->\n let Fmt_EBB fmt_rest = parse (str_ind + 2) end_ind in\n Fmt_EBB (Formatting_lit (Escaped_percent, fmt_rest))\n | '%' ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Char_literal ('@', fmt_rest))\n | c ->\n let Fmt_EBB fmt_rest = parse (str_ind + 1) end_ind in\n Fmt_EBB (Formatting_lit (Scan_indic c, fmt_rest))\n\n (* Try to read the optional <name> after \"@{\" or \"@[\". *)\n and parse_tag : type e f . bool -> int -> int -> (_, _, e, f) fmt_ebb =\n fun is_open_tag str_ind end_ind ->\n try\n if str_ind = end_ind then raise Not_found;\n match str.[str_ind] with\n | '<' ->\n let ind = String.index_from str (str_ind + 1) '>' in\n if ind >= end_ind then raise Not_found;\n let sub_str = String.sub str str_ind (ind - str_ind + 1) in\n let Fmt_EBB fmt_rest = parse (ind + 1) end_ind in\n let Fmt_EBB sub_fmt = parse str_ind (ind + 1) in\n let sub_format = Format (sub_fmt, sub_str) in\n let formatting =\n if is_open_tag then Open_tag sub_format else Open_box sub_format in\n Fmt_EBB (Formatting_gen (formatting, fmt_rest))\n | _ ->\n raise Not_found\n with Not_found ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n let sub_format = Format (End_of_format, \"\") in\n let formatting =\n if is_open_tag then Open_tag sub_format else Open_box sub_format in\n Fmt_EBB (Formatting_gen (formatting, fmt_rest))\n\n (* Try to read the optional <width offset> after \"@;\". *)\n and parse_good_break : type e f . int -> int -> (_, _, e, f) fmt_ebb =\n fun str_ind end_ind ->\n let next_ind, formatting_lit =\n try\n if str_ind = end_ind || str.[str_ind] <> '<' then raise Not_found;\n let str_ind_1 = parse_spaces (str_ind + 1) end_ind in\n match str.[str_ind_1] with\n | '0' .. '9' | '-' -> (\n let str_ind_2, width = parse_integer str_ind_1 end_ind in\n let str_ind_3 = parse_spaces str_ind_2 end_ind in\n match str.[str_ind_3] with\n | '>' ->\n let s = String.sub str (str_ind-2) (str_ind_3-str_ind+3) in\n str_ind_3 + 1, Break (s, width, 0)\n | '0' .. '9' | '-' ->\n let str_ind_4, offset = parse_integer str_ind_3 end_ind in\n let str_ind_5 = parse_spaces str_ind_4 end_ind in\n if str.[str_ind_5] <> '>' then raise Not_found;\n let s = String.sub str (str_ind-2) (str_ind_5-str_ind+3) in\n str_ind_5 + 1, Break (s, width, offset)\n | _ -> raise Not_found\n )\n | _ -> raise Not_found\n with Not_found | Failure _ ->\n str_ind, Break (\"@;\", 1, 0)\n in\n let Fmt_EBB fmt_rest = parse next_ind end_ind in\n Fmt_EBB (Formatting_lit (formatting_lit, fmt_rest))\n\n (* Parse the size in a <n>. *)\n and parse_magic_size : type e f . int -> int -> (_, _, e, f) fmt_ebb =\n fun str_ind end_ind ->\n match\n try\n let str_ind_1 = parse_spaces str_ind end_ind in\n match str.[str_ind_1] with\n | '0' .. '9' | '-' ->\n let str_ind_2, size = parse_integer str_ind_1 end_ind in\n let str_ind_3 = parse_spaces str_ind_2 end_ind in\n if str.[str_ind_3] <> '>' then raise Not_found;\n let s = String.sub str (str_ind - 2) (str_ind_3 - str_ind + 3) in\n Some (str_ind_3 + 1, Magic_size (s, size))\n | _ -> None\n with Not_found | Failure _ ->\n None\n with\n | Some (next_ind, formatting_lit) ->\n let Fmt_EBB fmt_rest = parse next_ind end_ind in\n Fmt_EBB (Formatting_lit (formatting_lit, fmt_rest))\n | None ->\n let Fmt_EBB fmt_rest = parse str_ind end_ind in\n Fmt_EBB (Formatting_lit (Scan_indic '<', fmt_rest))\n\n (* Parse and construct a char set. *)\n and parse_char_set str_ind end_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n\n let char_set = create_char_set () in\n let add_char c =\n add_in_char_set char_set c;\n in\n let add_range c c' =\n for i = int_of_char c to int_of_char c' do\n add_in_char_set char_set (char_of_int i);\n done;\n in\n\n let fail_single_percent str_ind =\n failwith_message\n \"invalid format %S: '%%' alone is not accepted in character sets, \\\n use %%%% instead at position %d.\" str str_ind\n in\n\n (* Parse the first character of a char set. *)\n let rec parse_char_set_start str_ind end_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n let c = str.[str_ind] in\n parse_char_set_after_char (str_ind + 1) end_ind c\n\n (* Parse the content of a char set until the first ']'. *)\n and parse_char_set_content str_ind end_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | ']' ->\n str_ind + 1\n | '-' ->\n add_char '-';\n parse_char_set_content (str_ind + 1) end_ind\n | c ->\n parse_char_set_after_char (str_ind + 1) end_ind c\n\n (* Test for range in char set. *)\n and parse_char_set_after_char str_ind end_ind c =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | ']' ->\n add_char c;\n str_ind + 1\n | '-' ->\n parse_char_set_after_minus (str_ind + 1) end_ind c\n | ('%' | '@') as c' when c = '%' ->\n add_char c';\n parse_char_set_content (str_ind + 1) end_ind\n | c' ->\n if c = '%' then fail_single_percent str_ind;\n (* note that '@' alone is accepted, as done by the legacy\n implementation; the documentation specifically requires %@\n so we could warn on that *)\n add_char c;\n parse_char_set_after_char (str_ind + 1) end_ind c'\n\n (* Manage range in char set (except if the '-' the last char before ']') *)\n and parse_char_set_after_minus str_ind end_ind c =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | ']' ->\n add_char c;\n add_char '-';\n str_ind + 1\n | '%' ->\n if str_ind + 1 = end_ind then unexpected_end_of_format end_ind;\n begin match str.[str_ind + 1] with\n | ('%' | '@') as c' ->\n add_range c c';\n parse_char_set_content (str_ind + 2) end_ind\n | _ -> fail_single_percent str_ind\n end\n | c' ->\n add_range c c';\n parse_char_set_content (str_ind + 1) end_ind\n in\n let str_ind, reverse =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | '^' -> str_ind + 1, true\n | _ -> str_ind, false in\n let next_ind = parse_char_set_start str_ind end_ind in\n let char_set = freeze_char_set char_set in\n next_ind, (if reverse then rev_char_set char_set else char_set)\n\n (* Consume all next spaces, raise an Failure if end_ind is reached. *)\n and parse_spaces str_ind end_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n if str.[str_ind] = ' ' then parse_spaces (str_ind + 1) end_ind else str_ind\n\n (* Read a positive integer from the string, raise a Failure if end_ind is\n reached. *)\n and parse_positive str_ind end_ind acc =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | '0' .. '9' as c ->\n let new_acc = acc * 10 + (int_of_char c - int_of_char '0') in\n if new_acc > Sys.max_string_length then\n failwith_message\n \"invalid format %S: integer %d is greater than the limit %d\"\n str new_acc Sys.max_string_length\n else\n parse_positive (str_ind + 1) end_ind new_acc\n | _ -> str_ind, acc\n\n (* Read a positive or negative integer from the string, raise a Failure\n if end_ind is reached. *)\n and parse_integer str_ind end_ind =\n if str_ind = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind] with\n | '0' .. '9' -> parse_positive str_ind end_ind 0\n | '-' -> (\n if str_ind + 1 = end_ind then unexpected_end_of_format end_ind;\n match str.[str_ind + 1] with\n | '0' .. '9' ->\n let next_ind, n = parse_positive (str_ind + 1) end_ind 0 in\n next_ind, -n\n | c ->\n expected_character (str_ind + 1) \"digit\" c\n )\n | _ -> assert false\n\n (* Add a literal to a format from a literal character sub-sequence. *)\n and add_literal : type a d e f .\n int -> int -> (a, _, _, d, e, f) fmt ->\n (_, _, e, f) fmt_ebb =\n fun lit_start str_ind fmt -> match str_ind - lit_start with\n | 0 -> Fmt_EBB fmt\n | 1 -> Fmt_EBB (Char_literal (str.[lit_start], fmt))\n | size -> Fmt_EBB (String_literal (String.sub str lit_start size, fmt))\n\n (* Search the end of the current sub-format\n (i.e. the corresponding \"%}\" or \"%)\") *)\n and search_subformat_end str_ind end_ind c =\n if str_ind = end_ind then\n failwith_message\n \"invalid format %S: unclosed sub-format, \\\n expected \\\"%%%c\\\" at character number %d\" str c end_ind;\n match str.[str_ind] with\n | '%' ->\n if str_ind + 1 = end_ind then unexpected_end_of_format end_ind;\n if str.[str_ind + 1] = c then (* End of format found *) str_ind else\n begin match str.[str_ind + 1] with\n | '_' ->\n (* Search for \"%_(\" or \"%_{\". *)\n if str_ind + 2 = end_ind then unexpected_end_of_format end_ind;\n begin match str.[str_ind + 2] with\n | '{' ->\n let sub_end = search_subformat_end (str_ind + 3) end_ind '}' in\n search_subformat_end (sub_end + 2) end_ind c\n | '(' ->\n let sub_end = search_subformat_end (str_ind + 3) end_ind ')' in\n search_subformat_end (sub_end + 2) end_ind c\n | _ -> search_subformat_end (str_ind + 3) end_ind c\n end\n | '{' ->\n (* %{...%} sub-format found. *)\n let sub_end = search_subformat_end (str_ind + 2) end_ind '}' in\n search_subformat_end (sub_end + 2) end_ind c\n | '(' ->\n (* %(...%) sub-format found. *)\n let sub_end = search_subformat_end (str_ind + 2) end_ind ')' in\n search_subformat_end (sub_end + 2) end_ind c\n | '}' ->\n (* Error: %(...%}. *)\n expected_character (str_ind + 1) \"character ')'\" '}'\n | ')' ->\n (* Error: %{...%). *)\n expected_character (str_ind + 1) \"character '}'\" ')'\n | _ ->\n search_subformat_end (str_ind + 2) end_ind c\n end\n | _ -> search_subformat_end (str_ind + 1) end_ind c\n\n (* Check if symb is a valid int conversion after \"%l\", \"%n\" or \"%L\" *)\n and is_int_base symb = match symb with\n | 'd' | 'i' | 'x' | 'X' | 'o' | 'u' -> true\n | _ -> false\n\n (* Convert a char (l, n or L) to its associated counter. *)\n and counter_of_char symb = match symb with\n | 'l' -> Line_counter | 'n' -> Char_counter\n | 'L' -> Token_counter | _ -> assert false\n\n (* Convert (plus, symb) to its associated int_conv. *)\n and compute_int_conv pct_ind str_ind plus hash space symb =\n match plus, hash, space, symb with\n | false, false, false, 'd' -> Int_d | false, false, false, 'i' -> Int_i\n | false, false, true, 'd' -> Int_sd | false, false, true, 'i' -> Int_si\n | true, false, false, 'd' -> Int_pd | true, false, false, 'i' -> Int_pi\n | false, false, false, 'x' -> Int_x | false, false, false, 'X' -> Int_X\n | false, true, false, 'x' -> Int_Cx | false, true, false, 'X' -> Int_CX\n | false, false, false, 'o' -> Int_o\n | false, true, false, 'o' -> Int_Co\n | false, false, false, 'u' -> Int_u\n | false, true, false, 'd' -> Int_Cd\n | false, true, false, 'i' -> Int_Ci\n | false, true, false, 'u' -> Int_Cu\n | _, true, _, 'x' when legacy_behavior -> Int_Cx\n | _, true, _, 'X' when legacy_behavior -> Int_CX\n | _, true, _, 'o' when legacy_behavior -> Int_Co\n | _, true, _, ('d' | 'i' | 'u') ->\n if legacy_behavior then (* ignore *)\n compute_int_conv pct_ind str_ind plus false space symb\n else incompatible_flag pct_ind str_ind symb \"'#'\"\n | true, _, true, _ ->\n if legacy_behavior then\n (* plus and space: legacy implementation prefers plus *)\n compute_int_conv pct_ind str_ind plus hash false symb\n else incompatible_flag pct_ind str_ind ' ' \"'+'\"\n | false, _, true, _ ->\n if legacy_behavior then (* ignore *)\n compute_int_conv pct_ind str_ind plus hash false symb\n else incompatible_flag pct_ind str_ind symb \"' '\"\n | true, _, false, _ ->\n if legacy_behavior then (* ignore *)\n compute_int_conv pct_ind str_ind false hash space symb\n else incompatible_flag pct_ind str_ind symb \"'+'\"\n | false, _, false, _ -> assert false\n\n (* Convert (plus, space, symb) to its associated float_conv. *)\n and compute_float_conv pct_ind str_ind plus hash space symb =\n let flag = match plus, space with\n | false, false -> Float_flag_\n | false, true -> Float_flag_s\n | true, false -> Float_flag_p\n | true, true ->\n (* plus and space: legacy implementation prefers plus *)\n if legacy_behavior then Float_flag_p\n else incompatible_flag pct_ind str_ind ' ' \"'+'\" in\n let kind = match hash, symb with\n | _, 'f' -> Float_f\n | _, 'e' -> Float_e\n | _, 'E' -> Float_E\n | _, 'g' -> Float_g\n | _, 'G' -> Float_G\n | _, 'h' -> Float_h\n | _, 'H' -> Float_H\n | false, 'F' -> Float_F\n | true, 'F' -> Float_CF\n | _ -> assert false in\n flag, kind\n\n (* Raise [Failure] with a friendly error message about incompatible options.*)\n and incompatible_flag : type a . int -> int -> char -> string -> a =\n fun pct_ind str_ind symb option ->\n let subfmt = String.sub str pct_ind (str_ind - pct_ind) in\n failwith_message\n \"invalid format %S: at character number %d, \\\n %s is incompatible with '%c' in sub-format %S\"\n str pct_ind option symb subfmt\n\n in parse 0 (String.length str)\n\n(******************************************************************************)\n (* Guarded string to format conversions *)\n\n(* Convert a string to a format according to an fmtty. *)\n(* Raise [Failure] with an error message in case of type mismatch. *)\nlet format_of_string_fmtty str fmtty =\n let Fmt_EBB fmt = fmt_ebb_of_string str in\n try Format (type_format fmt fmtty, str)\n with Type_mismatch ->\n failwith_message\n \"bad input: format type mismatch between %S and %S\"\n str (string_of_fmtty fmtty)\n\n(* Convert a string to a format compatible with an other format. *)\n(* Raise [Failure] with an error message in case of type mismatch. *)\nlet format_of_string_format str (Format (fmt', str')) =\n let Fmt_EBB fmt = fmt_ebb_of_string str in\n try Format (type_format fmt (fmtty_of_fmt fmt'), str)\n with Type_mismatch ->\n failwith_message\n \"bad input: format type mismatch between %S and %S\" str str'\n","(* generated code *)"],"names":[],"mappings":"aAy6F4B,uBACR,MADQ,QACR,QAAqB,UACvC,OAA+C,IAAnC,EAAgB,KAAhB,UAAmC,S,AAAA,I,AAAA,G,EAAA,KC36FjD,UD66FI,0B,CAC8D,C,OAd9C,MAAlB,QAAkB,QAAqB,UACvC,OAAiC,IAArB,cAAqB,S,AAAA,I,AAAA,G,EAAA,KCj6FnC,UDq6FiC,EAAvB,SAAuB,sB,CAAA,C,WA/1BR,qBAKrB,sCAA0B,mBAClB,O,CAAA,6B,CAAA,OAAa,aAMjB,I,CADA,E,CAAA,KAAuB,cAAoC,QAC3D,WAEA,E,CAAA,e,IAIiB,E,CAAA,UAIrB,OAjDA,iBAkDM,uBAdF,I,CAcE,qBAAa,OACR,E,CAAA,wBACF,E,CA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,QAEA,mBAFA,YAF8C,QAE9C,UAFwB,GAAsB,wBAlClB,QACpB,KACK,IADL,UACK,K,EA8BmB,WAEc,UAFpC,GAAsB,cAJO,QAIP,mBAJf,GAAsB,gBAHI,QAGJ,mBAHlB,GAAsB,gBAHJ,QAGI,mBAH1B,GAAsB,gBAHa,QAGb,mBAHT,GAAsB,gBAFC,QAED,UAFrB,GAAsB,YAFL,QAEK,UAF3B,GAAsB,WAgCX,C,EApDZ,UACjB,KACM,QADN,UACM,KAA0B,C,UAhB1C,qBACa,UADb,YACa,OAA6B,WAAgB,C,WAX1C,aAChB,EADA,EAG8B,iCAAuB,IAAjD,EAAiD,OAAjD,eADF,wCAC+D,oBAEjE,wB,GAAA,GAAgC,C,EAThC,uBAAwB,C,UALxB,uBAE4B,YAF5B,UAE4B,OAA4B,CAAtD,EAAsD,OAAtD,eADF,uBACmE,U,EAP5C,6BAAoB,C,8ICvB7C,mc,QAAA,4D,QAAA,6E,QAAA,8F,QAAA,+G,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":244179},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/printf.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy and Pierre Weis, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nopen CamlinternalFormatBasics\nopen CamlinternalFormat\n\nlet kfprintf k o (Format (fmt, _)) =\n make_printf (fun acc -> output_acc o acc; k o) End_of_acc fmt\nlet kbprintf k b (Format (fmt, _)) =\n make_printf (fun acc -> bufput_acc b acc; k b) End_of_acc fmt\nlet ikfprintf k oc (Format (fmt, _)) =\n make_iprintf k oc fmt\nlet ikbprintf = ikfprintf\n\nlet fprintf oc fmt = kfprintf ignore oc fmt\nlet bprintf b fmt = kbprintf ignore b fmt\nlet ifprintf oc fmt = ikfprintf ignore oc fmt\nlet ibprintf b fmt = ikbprintf ignore b fmt\nlet printf fmt = fprintf stdout fmt\nlet eprintf fmt = fprintf stderr fmt\n\nlet ksprintf k (Format (fmt, _)) =\n let k' acc =\n let buf = Buffer.create 64 in\n strput_acc buf acc;\n k (Buffer.contents buf) in\n make_printf k' End_of_acc fmt\n\nlet sprintf fmt = ksprintf (fun s -> s) fmt\n\nlet kprintf = ksprintf\n","(* generated code *)"],"names":[],"mappings":"EAwCqC,EAAC,C,EAApB,YAAyB,C,KALvC,OAAU,KAAV,QAAU,eACV,wBACE,EADgB,QAChB,aAAqB,oB,EAHzB,QAIA,IALW,UAKX,qBAA6B,C,EAPb,gBAAkB,C,EADnB,gBAAkB,C,EC9BnC,K,ED6BqB,cAAsB,C,EADrB,cAAuB,C,EADzB,cAAqB,C,EADpB,cAAsB,C,EAHzC,IADY,UACZ,qBAAqB,C,KAFG,mCAAgB,yBAAK,C,EAA7C,cADW,UACX,qBAA6D,C,KAFrC,mCAAgB,yBAAK,C,EAA7C,cADW,UACX,qBAA6D,C,ECnB/D,uD,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":244927},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/dynarray.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Gabriel Scherer, projet Partout, INRIA Paris-Saclay *)\n(* *)\n(* Copyright 2022 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype 'a t = {\n mutable length : int;\n mutable arr : 'a slot array;\n}\n(* {2 The type ['a t]}\n\n A dynamic array is represented using a backing array [arr] and\n a [length]. It behaves as an array of size [length] -- the indices\n from [0] to [length - 1] included contain user-provided values and\n can be [get] and [set] -- but the length may also change in the\n future by adding or removing elements at the end.\n\n We use the following concepts;\n - capacity: the length of the backing array:\n [Array.length arr]\n - live space: the portion of the backing array with\n indices from [0] to [length - 1] included.\n - empty space: the portion of the backing array\n from [length] to the end of the backing array.\n\n {2 The type ['a slot]}\n\n We should not keep a user-provided value in the empty space, as\n this could extend its lifetime and may result in memory leaks of\n arbitrary size. Functions that remove elements from the dynamic\n array, such as [pop_last] or [truncate], must really erase the\n element from the backing array.\n\n This constraint makes it difficult to represent an dynamic array of\n elements of type ['a] with a backing array of type ['a array]: what\n valid value of type ['a] would we use in the empty space? Typical\n choices include:\n - accepting scenarios where we actually leak user-provided values\n (but this can blowup memory usage in some cases, and is hard to debug)\n - requiring a \"dummy\" value at creation of the dynamic array\n or in the parts of the API that grow the empty space\n (but users find this very inconvenient)\n - using arcane Obj.magic tricks\n (but experts don't agree on which tricks are safe to use and/or\n should be used here)\n - using a backing array of ['a option] values, using [None]\n in the empty space\n (but this gives a noticeably less efficient memory representation)\n\n In the present implementation, we use the ['a option] approach,\n with a twist. With ['a option], calling [set a i x] must reallocate\n a new [Some x] block:\n{[\n let set a i x =\n if i < 0 || i >= a.length then error \"out of bounds\";\n a.arr.(i) <- Some x\n]}\n Instead we use the type ['a slot] below,\n which behaves as an option whose [Some] constructor\n (called [Elem] here) has a _mutable_ argument.\n*)\nand 'a slot =\n| Empty\n| Elem of { mutable v: 'a }\n(*\n This gives an allocation-free implementation of [set] that calls\n [Array.get] (instead of [Array.set]) on the backing array and then\n mutates the [v] parameter. In pseudo-code:\n{[\n let set a i x =\n if i < 0 || i >= a.length then error \"out of bounds\";\n match a.arr.(i) with\n | Empty -> error \"invalid state: missing element\"\n | Elem s -> s.v <- x\n]}\n With this approach, accessing an element still pays the cost of an\n extra indirection (compared to approaches that do not box elements\n in the backing array), but only operations that add new elements at\n the end of the array pay extra allocations.\n\n There are some situations where ['a option] is better: it makes\n [pop_last_opt] more efficient as the underlying option can be\n returned directly, and it also lets us use [Array.blit] to\n implement [append]. We believe that optimizing [get] and [set] is\n more important for dynamic arrays.\n\n {2 Invariants and valid states}\n\n We enforce the invariant that [length >= 0] at all times.\n we rely on this invariant for optimization.\n\n The following conditions define what we call a \"valid\" dynarray:\n - valid length: [length <= Array.length arr]\n - no missing element in the live space:\n forall i, [0 <= i < length] implies [arr.(i) <> Empty]\n - no element in the empty space:\n forall i, [length <= i < Array.length arr] implies [arr.(i) = Empty]\n\n Unfortunately, we cannot easily enforce validity as an invariant in\n presence of concurrent updates. We can thus observe dynarrays in\n \"invalid states\". Our implementation may raise exceptions or return\n incorrect results on observing invalid states, but of course it\n must preserve memory safety.\n*)\n\nmodule Error = struct\n let[@inline never] index_out_of_bounds f ~i ~length =\n if length = 0 then\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: index %d out of bounds (empty dynarray)\"\n f i\n else\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: index %d out of bounds (0..%d)\"\n f i (length - 1)\n\n let[@inline never] negative_length_requested f n =\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: negative length %d requested\"\n f n\n\n let[@inline never] negative_capacity_requested f n =\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: negative capacity %d requested\"\n f n\n\n let[@inline never] requested_length_out_of_bounds f requested_length =\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: cannot grow to requested length %d (max_array_length is %d)\"\n f requested_length Sys.max_array_length\n\n (* When observing an invalid state ([missing_element],\n [invalid_length]), we do not give the name of the calling function\n in the error message, as the error is related to invalid operations\n performed earlier, and not to the callsite of the function\n itself. *)\n\n let invalid_state_description =\n \"Invalid dynarray (unsynchronized concurrent length change)\"\n\n let[@inline never] missing_element ~i ~length =\n Printf.ksprintf invalid_arg\n \"%s: missing element at position %d < length %d\"\n invalid_state_description\n i length\n\n let[@inline never] invalid_length ~length ~capacity =\n Printf.ksprintf invalid_arg\n \"%s: length %d > capacity %d\"\n invalid_state_description\n length capacity\n\n let[@inline never] length_change_during_iteration f ~expected ~observed =\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: a length change from %d to %d occurred during iteration\"\n f expected observed\n\n (* When an [Empty] element is observed unexpectedly at index [i],\n it may be either an out-of-bounds access or an invalid-state situation\n depending on whether [i <= length]. *)\n let[@inline never] unexpected_empty_element f ~i ~length =\n if i < length then\n missing_element ~i ~length\n else\n index_out_of_bounds f ~i ~length\n\n let[@inline never] empty_dynarray f =\n Printf.ksprintf invalid_arg\n \"Dynarray.%s: empty array\" f\nend\n\n(* Detecting iterator invalidation.\n\n See {!iter} below for a detailed usage example.\n*)\nlet check_same_length f a ~length =\n let length_a = a.length in\n if length <> length_a then\n Error.length_change_during_iteration f\n ~expected:length ~observed:length_a\n\n(** Careful unsafe access. *)\n\n(* Postcondition on non-exceptional return:\n [length <= Array.length arr] *)\nlet[@inline always] check_valid_length length arr =\n let capacity = Array.length arr in\n if length > capacity then\n Error.invalid_length ~length ~capacity\n\n(* Precondition: [0 <= i < length <= Array.length arr]\n\n This precondition is typically guaranteed by knowing\n [0 <= i < length] and calling [check_valid_length length arr].*)\nlet[@inline always] unsafe_get arr ~i ~length =\n match Array.unsafe_get arr i with\n | Empty -> Error.missing_element ~i ~length\n | Elem {v} -> v\n\n\n(** {1:dynarrays Dynamic arrays} *)\n\nlet create () = {\n length = 0;\n arr = [| |];\n}\n\nlet make n x =\n if n < 0 then Error.negative_length_requested \"make\" n;\n {\n length = n;\n arr = Array.init n (fun _ -> Elem {v = x});\n }\n\nlet init n f =\n if n < 0 then Error.negative_length_requested \"init\" n;\n {\n length = n;\n arr = Array.init n (fun i -> Elem {v = f i});\n }\n\nlet get a i =\n (* This implementation will propagate an [Invalid_argument] exception\n from array lookup if the index is out of the backing array,\n instead of using our own [Error.index_out_of_bounds]. This is\n allowed by our specification, and more efficient -- no need to\n check that [length a <= capacity a] in the fast path. *)\n match a.arr.(i) with\n | Elem s -> s.v\n | Empty ->\n Error.unexpected_empty_element \"get\" ~i ~length:a.length\n\nlet set a i x =\n (* See {!get} comment on the use of checked array\n access without our own bound checking. *)\n match a.arr.(i) with\n | Elem s -> s.v <- x\n | Empty ->\n Error.unexpected_empty_element \"set\" ~i ~length:a.length\n\nlet length a = a.length\n\nlet is_empty a = (a.length = 0)\n\nlet copy {length; arr} =\n check_valid_length length arr;\n (* use [length] as the new capacity to make\n this an O(length) operation. *)\n {\n length;\n arr = Array.init length (fun i ->\n let v = unsafe_get arr ~i ~length in\n Elem {v}\n );\n }\n\nlet get_last a =\n let {arr; length} = a in\n check_valid_length length arr;\n (* We know [length <= capacity a]. *)\n if length = 0 then Error.empty_dynarray \"get_last\";\n (* We know [length > 0]. *)\n unsafe_get arr ~i:(length - 1) ~length\n\nlet find_last a =\n let {arr; length} = a in\n check_valid_length length arr;\n (* We know [length <= capacity a]. *)\n if length = 0 then None\n else\n (* We know [length > 0]. *)\n Some (unsafe_get arr ~i:(length - 1) ~length)\n\n(** {1:removing Removing elements} *)\n\nlet pop_last a =\n let {arr; length} = a in\n check_valid_length length arr;\n (* We know [length <= capacity a]. *)\n if length = 0 then raise Not_found;\n let last = length - 1 in\n (* We know [length > 0] so [last >= 0]. *)\n match Array.unsafe_get arr last with\n | Empty ->\n Error.missing_element ~i:last ~length\n | Elem s ->\n Array.unsafe_set arr last Empty;\n a.length <- last;\n s.v\n\nlet pop_last_opt a =\n match pop_last a with\n | exception Not_found -> None\n | x -> Some x\n\nlet remove_last a =\n let last = length a - 1 in\n if last >= 0 then begin\n a.length <- last;\n a.arr.(last) <- Empty;\n end\n\nlet truncate a n =\n if n < 0 then Error.negative_length_requested \"truncate\" n;\n let {arr; length} = a in\n if length <= n then ()\n else begin\n a.length <- n;\n Array.fill arr n (length - n) Empty;\n end\n\nlet clear a = truncate a 0\n\n\n(** {1:capacity Backing array and capacity} *)\n\nlet capacity a = Array.length a.arr\n\nlet next_capacity n =\n let n' =\n (* For large values of n, we use 1.5 as our growth factor.\n\n For smaller values of n, we grow more aggressively to avoid\n reallocating too much when accumulating elements into an empty\n array.\n\n The constants \"512 words\" and \"8 words\" below are taken from\n https://github.com/facebook/folly/blob/\n c06c0f41d91daf1a6a5f3fc1cd465302ac260459/folly/FBVector.h#L1128-L1157\n *)\n if n <= 512 then n * 2\n else n + n / 2\n in\n (* jump directly from 0 to 8 *)\n min (max 8 n') Sys.max_array_length\n\nlet ensure_capacity a capacity_request =\n let arr = a.arr in\n let cur_capacity = Array.length arr in\n if capacity_request < 0 then\n Error.negative_capacity_requested \"ensure_capacity\" capacity_request\n else if cur_capacity >= capacity_request then\n (* This is the fast path, the code up to here must do as little as\n possible. (This is why we don't use [let {arr; length} = a] as\n usual, the length is not needed in the fast path.)*)\n ()\n else begin\n if capacity_request > Sys.max_array_length then\n Error.requested_length_out_of_bounds \"ensure_capacity\" capacity_request;\n let new_capacity =\n (* We use either the next exponential-growth strategy,\n or the requested strategy, whichever is bigger.\n\n Compared to only using the exponential-growth strategy, this\n lets us use less memory by avoiding any overshoot whenever\n the capacity request is noticeably larger than the current\n capacity.\n\n Compared to only using the requested capacity, this avoids\n losing the amortized guarantee: we allocated \"exponentially\n or more\", so the amortization holds. In particular, notice\n that repeated calls to [ensure_capacity a (length a + 1)]\n will have amortized-linear rather than quadratic complexity.\n *)\n max (next_capacity cur_capacity) capacity_request in\n let new_arr = Array.make new_capacity Empty in\n Array.blit arr 0 new_arr 0 a.length;\n a.arr <- new_arr;\n (* postcondition: *)\n assert (0 <= capacity_request);\n assert (capacity_request <= Array.length new_arr);\n end\n\nlet ensure_extra_capacity a extra_capacity_request =\n ensure_capacity a (length a + extra_capacity_request)\n\nlet fit_capacity a =\n if capacity a = a.length\n then ()\n else a.arr <- Array.sub a.arr 0 a.length\n\nlet set_capacity a n =\n if n < 0 then\n Error.negative_capacity_requested \"set_capacity\" n;\n let arr = a.arr in\n let cur_capacity = Array.length arr in\n if n < cur_capacity then begin\n a.length <- min a.length n;\n a.arr <- Array.sub arr 0 n;\n end\n else if n > cur_capacity then begin\n let new_arr = Array.make n Empty in\n Array.blit arr 0 new_arr 0 a.length;\n a.arr <- new_arr;\n end\n\nlet reset a =\n a.length <- 0;\n a.arr <- [||]\n\n(** {1:adding Adding elements} *)\n\n(* We chose an implementation of [add_last a x] that behaves correctly\n in presence of asynchronous / re-entrant code execution around\n allocations and poll points: if another thread or a callback gets\n executed on allocation, we add the element at the new end of the\n dynamic array.\n\n (We do not give the same guarantees in presence of concurrent\n parallel updates, which are much more expensive to protect\n against.)\n*)\n\n(* [add_last_if_room a elem] only writes the slot if there is room, and\n returns [false] otherwise. *)\nlet[@inline] add_last_if_room a elem =\n let {arr; length} = a in\n (* we know [0 <= length] *)\n if length >= Array.length arr then false\n else begin\n (* we know [0 <= length < Array.length arr] *)\n a.length <- length + 1;\n Array.unsafe_set arr length elem;\n true\n end\n\nlet add_last a x =\n let elem = Elem {v = x} in\n if add_last_if_room a elem then ()\n else begin\n (* slow path *)\n let rec grow_and_add a elem =\n ensure_extra_capacity a 1;\n if not (add_last_if_room a elem)\n then grow_and_add a elem\n in grow_and_add a elem\n end\n\nlet rec append_list a li =\n match li with\n | [] -> ()\n | x :: xs -> add_last a x; append_list a xs\n\nlet append_iter a iter b =\n iter (fun x -> add_last a x) b\n\nlet append_seq a seq =\n Seq.iter (fun x -> add_last a x) seq\n\n(* append_array: same [..._if_room] and loop logic as [add_last]. *)\n\nlet append_array_if_room a b =\n let {arr; length = length_a} = a in\n let length_b = Array.length b in\n if length_a + length_b > Array.length arr then false\n else begin\n a.length <- length_a + length_b;\n (* Note: we intentionally update the length *before* filling the\n elements. This \"reserve before fill\" approach provides better\n behavior than \"fill then notify\" in presence of reentrant\n modifications (which may occur below, on a poll point in the loop or\n the [Elem] allocation):\n\n - If some code asynchronously adds new elements after this\n length update, they will go after the space we just reserved,\n and in particular no addition will be lost. If instead we\n updated the length after the loop, any asynchronous addition\n during the loop could be erased or erase one of our additions,\n silently, without warning the user.\n\n - If some code asynchronously iterates on the dynarray, or\n removes elements, or otherwise tries to access the\n reserved-but-not-yet-filled space, it will get a clean \"missing\n element\" error. This is worse than with the fill-then-notify\n approach where the new elements would only become visible\n (to iterators, for removal, etc.) alltogether at the end of\n loop.\n\n To summarise, \"reserve before fill\" is better on add-add races,\n and \"fill then notify\" is better on add-remove or add-iterate\n races. But the key difference is the failure mode:\n reserve-before fails on add-remove or add-iterate races with\n a clean error, while notify-after fails on add-add races with\n silently disappearing data. *)\n for i = 0 to length_b - 1 do\n let x = Array.unsafe_get b i in\n Array.unsafe_set arr (length_a + i) (Elem {v = x})\n done;\n true\n end\n\nlet append_array a b =\n if append_array_if_room a b then ()\n else begin\n (* slow path *)\n let rec grow_and_append a b =\n ensure_extra_capacity a (Array.length b);\n if not (append_array_if_room a b)\n then grow_and_append a b\n in grow_and_append a b end\n\n(* append: same [..._if_room] and loop logic as [add_last],\n same reserve-before-fill logic as [append_array]. *)\n\n(* It is a programming error to mutate the length of [b] during a call\n to [append a b]. To detect this mistake we keep track of the length\n of [b] throughout the computation and check it that does not\n change.\n*)\nlet append_if_room a b ~length_b =\n let {arr = arr_a; length = length_a} = a in\n if length_a + length_b > Array.length arr_a then false\n else begin\n a.length <- length_a + length_b;\n let arr_b = b.arr in\n check_valid_length length_b arr_b;\n for i = 0 to length_b - 1 do\n let x = unsafe_get arr_b ~i ~length:length_b in\n Array.unsafe_set arr_a (length_a + i) (Elem {v = x})\n done;\n check_same_length \"append\" b ~length:length_b;\n true\n end\n\nlet append a b =\n let length_b = length b in\n if append_if_room a b ~length_b then ()\n else begin\n (* slow path *)\n let rec grow_and_append a b ~length_b =\n ensure_extra_capacity a length_b;\n (* Eliding the [check_same_length] call below would be wrong in\n the case where [a] and [b] are aliases of each other, we\n would get into an infinite loop instead of failing.\n\n We could push the call to [append_if_room] itself, but we\n prefer to keep it in the slow path. *)\n check_same_length \"append\" b ~length:length_b;\n if not (append_if_room a b ~length_b)\n then grow_and_append a b ~length_b\n in grow_and_append a b ~length_b\n end\n\n\n\n(** {1:iteration Iteration} *)\n\n(* The implementation choice that we made for iterators is the one\n that maximizes efficiency by avoiding repeated bound checking: we\n check the length of the dynamic array once at the beginning, and\n then only operate on that portion of the dynarray, ignoring\n elements added in the meantime.\n\n The specification states that it is a programming error to mutate\n the length of the array during iteration. We check for this and\n raise an error on size change.\n Note that we may still miss some transient state changes that cancel\n each other and leave the length unchanged at the next check.\n*)\n\nlet iter_ f k a =\n let {arr; length} = a in\n (* [check_valid_length length arr] is used for memory safety, it\n guarantees that the backing array has capacity at least [length],\n allowing unsafe array access.\n\n [check_same_length] is used for correctness, it lets the function\n fail more often if we discover the programming error of mutating\n the length during iteration.\n\n We could, naively, call [check_same_length] at each iteration of\n the loop (before or after, or both). However, notice that this is\n not necessary to detect the removal of elements from [a]: if\n elements have been removed by the time the [for] loop reaches\n them, then [unsafe_get] will itself fail with an [Invalid_argument]\n exception. We only need to detect the addition of new elements to\n [a] during iteration, and for this it is enough to call\n [check_same_length] once at the end.\n\n Calling [check_same_length] more often could catch more\n programming errors, but the only errors that we miss with this\n optimization are those that keep the array size constant --\n additions and deletions that cancel each other. We consider this\n an acceptable tradeoff.\n *)\n check_valid_length length arr;\n for i = 0 to length - 1 do\n k (unsafe_get arr ~i ~length);\n done;\n check_same_length f a ~length\n\nlet iter k a =\n iter_ \"iter\" k a\n\nlet iteri k a =\n let {arr; length} = a in\n check_valid_length length arr;\n for i = 0 to length - 1 do\n k i (unsafe_get arr ~i ~length);\n done;\n check_same_length \"iteri\" a ~length\n\nlet map f a =\n let {arr; length} = a in\n check_valid_length length arr;\n let res = {\n length;\n arr = Array.init length (fun i ->\n Elem {v = f (unsafe_get arr ~i ~length)});\n } in\n check_same_length \"map\" a ~length;\n res\n\n\nlet mapi f a =\n let {arr; length} = a in\n check_valid_length length arr;\n let res = {\n length;\n arr = Array.init length (fun i ->\n Elem {v = f i (unsafe_get arr ~i ~length)});\n } in\n check_same_length \"mapi\" a ~length;\n res\n\nlet fold_left f acc a =\n let {arr; length} = a in\n check_valid_length length arr;\n let r = ref acc in\n for i = 0 to length - 1 do\n let v = unsafe_get arr ~i ~length in\n r := f !r v;\n done;\n check_same_length \"fold_left\" a ~length;\n !r\n\nlet fold_right f a acc =\n let {arr; length} = a in\n check_valid_length length arr;\n let r = ref acc in\n for i = length - 1 downto 0 do\n let v = unsafe_get arr ~i ~length in\n r := f v !r;\n done;\n check_same_length \"fold_right\" a ~length;\n !r\n\nlet exists p a =\n let {arr; length} = a in\n check_valid_length length arr;\n let rec loop p arr i length =\n if i = length then false\n else\n p (unsafe_get arr ~i ~length)\n || loop p arr (i + 1) length\n in\n let res = loop p arr 0 length in\n check_same_length \"exists\" a ~length;\n res\n\nlet for_all p a =\n let {arr; length} = a in\n check_valid_length length arr;\n let rec loop p arr i length =\n if i = length then true\n else\n p (unsafe_get arr ~i ~length)\n && loop p arr (i + 1) length\n in\n let res = loop p arr 0 length in\n check_same_length \"for_all\" a ~length;\n res\n\nlet filter f a =\n let b = create () in\n iter_ \"filter\" (fun x -> if f x then add_last b x) a;\n b\n\nlet filter_map f a =\n let b = create () in\n iter_ \"filter_map\" (fun x ->\n match f x with\n | None -> ()\n | Some y -> add_last b y\n ) a;\n b\n\n\n(** {1:conversions Conversions to other data structures} *)\n\n(* The eager [to_*] conversion functions behave similarly to iterators\n in presence of updates during computation. The [*_reentrant]\n functions obey their more permissive specification, which tolerates\n any concurrent update. *)\n\nlet of_array a =\n let length = Array.length a in\n {\n length;\n arr = Array.init length (fun i -> Elem {v = Array.unsafe_get a i});\n }\n\nlet to_array a =\n let {arr; length} = a in\n check_valid_length length arr;\n let res = Array.init length (fun i ->\n unsafe_get arr ~i ~length)\n in\n check_same_length \"to_array\" a ~length;\n res\n\nlet of_list li =\n let a = create () in\n List.iter (fun x -> add_last a x) li;\n a\n\nlet to_list a =\n let {arr; length} = a in\n check_valid_length length arr;\n let l = ref [] in\n for i = length - 1 downto 0 do\n l := unsafe_get arr ~i ~length :: !l\n done;\n check_same_length \"to_list\" a ~length;\n !l\n\nlet of_seq seq =\n let init = create() in\n append_seq init seq;\n init\n\nlet to_seq a =\n let {arr; length} = a in\n check_valid_length length arr;\n let rec aux i = fun () ->\n check_same_length \"to_seq\" a ~length;\n if i >= length then Seq.Nil\n else begin\n let v = unsafe_get arr ~i ~length in\n Seq.Cons (v, aux (i + 1))\n end\n in\n aux 0\n\nlet to_seq_reentrant a =\n let rec aux i = fun () ->\n if i >= length a then Seq.Nil\n else begin\n let v = get a i in\n Seq.Cons (v, aux (i + 1))\n end\n in\n aux 0\n\nlet to_seq_rev a =\n let {arr; length} = a in\n check_valid_length length arr;\n let rec aux i = fun () ->\n check_same_length \"to_seq_rev\" a ~length;\n if i < 0 then Seq.Nil\n else begin\n let v = unsafe_get arr ~i ~length in\n Seq.Cons (v, aux (i - 1))\n end\n in\n aux (length - 1)\n\nlet to_seq_rev_reentrant a =\n let rec aux i = fun () ->\n if i < 0 then Seq.Nil\n else if i >= length a then\n (* If some elements have been removed in the meantime, we skip\n those elements and continue with the new end of the array. *)\n aux (length a - 1) ()\n else begin\n let v = get a i in\n Seq.Cons (v, aux (i - 1))\n end\n in\n aux (length a - 1)\n","(* generated code *)"],"names":[],"mappings":"MA2wBI,sBAjhBW,cAkhBU,oBAGN,IArhBJ,cAqhBI,uBAGW,IADhB,mBACR,cAAa,WAAW,MAPZ,KAQX,C,MATW,sBASX,C,KAzhBQ,YA2hBA,UAXb,KAWa,GAAK,C,MArBhB,2BAAwC,kBAId,IADhB,wBACR,eAAa,YAAW,KAHZ,KAIX,C,MANW,sCAMX,C,QARL,uBACA,IASA,cAT6B,UAS7B,GAAgB,C,KA7gBH,mBA0fK,oBAAM,KAGI,IADhB,mBACR,cAAa,WAAW,KACvB,C,MALW,sBAKX,C,EAEL,IAPA,KAOA,GAAK,C,MAjBH,2BAAoC,4BAChB,KAGM,IADhB,wBACR,eAAa,YAAW,KACvB,C,MANW,sC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b,uBACA,IAA6B,UAEV,UAGnB,KAFA,cAEA,sBAEI,UAEA,uBACA,cACA,YAAG,C,QAvBP,uBACA,IAA6B,UAEV,KAG4B,IAAxC,EAAL,YAAK,OAAwC,M,WAd/C,uBACA,IAA6B,SA3F3B,iDA+FF,qBAAsC,C,KAVlC,IADQ,sBACR,IAAQ,C,KARL,uBACP,IAQG,MAHK,EALqB,kBAKrB,aAGL,IACF,C,EAZc,iBAAc,C,EAFhB,UAAQ,C,QALrB,YAAM,oBAAN,EAAM,cAAS,OAGX,gBAFQ,kB,EAAA,GAEgD,C,QAX5D,YAAM,oBAAN,EAAM,cAAS,OAGX,gBAFQ,Y,EAAA,GAEgD,C,EAZhB,IAAH,wBAAG,IAAC,C,KAH7C,cAAc,UAGgC,MAAtC,EAFR,gBAEQ,aAAsC,IAC7C,C,EAR8B,iBAAY,C,KAH3C,cAAc,UAG8B,MAApC,EAFR,gBAEQ,aAAoC,IAC3C,C,EAVa,oBAGf,C,KAVC,8BACW,mBACI,C,OAXf,gCACA,eAxCE,iDAyCsC,C,WAZxC,UACA,4CAxBE,8CA0BqC,C,aAlBrC,gBACE,QAvDF,SACE,uCAIA,gD,GAoDgC,C,EAvBlC,G,EAAA,oCAGU,C,OAtBV,oCAEK,C,OAPL,oCAEK,C,qCCjIT,0J,QAAA,4D,UAAA,G,EAAA,E,CAAA,8B,CAAA,e,EAAA,W,EAAA,Y,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":251912},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/arg.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype key = string\ntype doc = string\ntype usage_msg = string\ntype anon_fun = (string -> unit)\n\ntype spec =\n | Unit of (unit -> unit) (* Call the function with unit argument *)\n | Bool of (bool -> unit) (* Call the function with a bool argument *)\n | Set of bool ref (* Set the reference to true *)\n | Clear of bool ref (* Set the reference to false *)\n | String of (string -> unit) (* Call the function with a string argument *)\n | Set_string of string ref (* Set the reference to the string argument *)\n | Int of (int -> unit) (* Call the function with an int argument *)\n | Set_int of int ref (* Set the reference to the int argument *)\n | Float of (float -> unit) (* Call the function with a float argument *)\n | Set_float of float ref (* Set the reference to the float argument *)\n | Tuple of spec list (* Take several arguments according to the\n spec list *)\n | Symbol of string list * (string -> unit)\n (* Take one of the symbols as argument and\n call the function with the symbol. *)\n | Rest of (string -> unit) (* Stop interpreting keywords and call the\n function with each remaining argument *)\n | Rest_all of (string list -> unit)\n (* Stop interpreting keywords and call the\n function with all remaining arguments. *)\n | Expand of (string -> string array) (* If the remaining arguments to process\n are of the form\n [[\"-foo\"; \"arg\"] @ rest] where \"foo\"\n is registered as [Expand f], then the\n arguments [f \"arg\" @ rest] are\n processed. Only allowed in\n [parse_and_expand_argv_dynamic]. *)\n\nexception Bad of string\nexception Help of string\n\ntype error =\n | Unknown of string\n | Wrong of string * string * string (* option, actual, expected *)\n | Missing of string\n | Message of string\n\nexception Stop of error (* used internally *)\n\nopen Printf\n\nlet rec assoc3 x l =\n match l with\n | [] -> raise Not_found\n | (y1, y2, _) :: _ when y1 = x -> y2\n | _ :: t -> assoc3 x t\n\n\nlet split s =\n let i = String.index s '=' in\n let len = String.length s in\n String.sub s 0 i, String.sub s (i+1) (len-(i+1))\n\n\nlet make_symlist prefix sep suffix l =\n match l with\n | [] -> \"<none>\"\n | h::t -> (List.fold_left (fun x y -> x ^ sep ^ y) (prefix ^ h) t) ^ suffix\n\n\nlet print_spec buf (key, spec, doc) =\n if String.length doc > 0 then\n match spec with\n | Symbol (l, _) ->\n bprintf buf \" %s %s%s\\n\" key (make_symlist \"{\" \"|\" \"}\" l) doc\n | _ ->\n bprintf buf \" %s %s\\n\" key doc\n\n\nlet help_action () = raise (Stop (Unknown \"-help\"))\n\nlet add_help speclist =\n let add1 =\n try ignore (assoc3 \"-help\" speclist); []\n with Not_found ->\n [\"-help\", Unit help_action, \" Display this list of options\"]\n and add2 =\n try ignore (assoc3 \"--help\" speclist); []\n with Not_found ->\n [\"--help\", Unit help_action, \" Display this list of options\"]\n in\n speclist @ (add1 @ add2)\n\n\nlet usage_b buf speclist errmsg =\n bprintf buf \"%s\\n\" errmsg;\n List.iter (print_spec buf) (add_help speclist)\n\n\nlet usage_string speclist errmsg =\n let b = Buffer.create 200 in\n usage_b b speclist errmsg;\n Buffer.contents b\n\n\nlet usage speclist errmsg =\n eprintf \"%s\" (usage_string speclist errmsg)\n\n\nlet current = ref 0\n\nlet bool_of_string_opt x =\n try Some (bool_of_string x)\n with Invalid_argument _ -> None\n\nlet int_of_string_opt x =\n try Some (int_of_string x)\n with Failure _ -> None\n\nlet float_of_string_opt x =\n try Some (float_of_string x)\n with Failure _ -> None\n\nlet parse_and_expand_argv_dynamic_aux allow_expand current argv speclist anonfun\n errmsg =\n let initpos = !current in\n let convert_error error =\n (* convert an internal error to a Bad/Help exception\n *or* add the program name as a prefix and the usage message as a suffix\n to an user-raised Bad exception.\n *)\n let b = Buffer.create 200 in\n let progname =\n if initpos < (Array.length !argv) then !argv.(initpos) else \"(?)\" in\n begin match error with\n | Unknown \"-help\" -> ()\n | Unknown \"--help\" -> ()\n | Unknown s ->\n bprintf b \"%s: unknown option '%s'.\\n\" progname s\n | Missing s ->\n bprintf b \"%s: option '%s' needs an argument.\\n\" progname s\n | Wrong (opt, arg, expected) ->\n bprintf b \"%s: wrong argument '%s'; option '%s' expects %s.\\n\"\n progname arg opt expected\n | Message s -> (* user error message *)\n bprintf b \"%s: %s.\\n\" progname s\n end;\n usage_b b !speclist errmsg;\n if error = Unknown \"-help\" || error = Unknown \"--help\"\n then Help (Buffer.contents b)\n else Bad (Buffer.contents b)\n in\n incr current;\n while !current < (Array.length !argv) do\n begin try\n let s = !argv.(!current) in\n if String.starts_with ~prefix:\"-\" s then begin\n let action, follow =\n try assoc3 s !speclist, None\n with Not_found ->\n try\n let keyword, arg = split s in\n assoc3 keyword !speclist, Some arg\n with Not_found -> raise (Stop (Unknown s))\n in\n let no_arg () =\n match follow with\n | None -> ()\n | Some arg -> raise (Stop (Wrong (s, arg, \"no argument\"))) in\n let get_arg () =\n match follow with\n | None ->\n if !current + 1 < (Array.length !argv) then !argv.(!current + 1)\n else raise (Stop (Missing s))\n | Some arg -> arg\n in\n let consume_arg () =\n match follow with\n | None -> incr current\n | Some _ -> ()\n in\n let rec treat_action = function\n | Unit f -> no_arg (); f ();\n | Bool f ->\n let arg = get_arg () in\n begin match bool_of_string_opt arg with\n | None -> raise (Stop (Wrong (s, arg, \"a boolean\")))\n | Some s -> f s\n end;\n consume_arg ();\n | Set r -> no_arg (); r := true;\n | Clear r -> no_arg (); r := false;\n | String f ->\n let arg = get_arg () in\n f arg;\n consume_arg ();\n | Symbol (symb, f) ->\n let arg = get_arg () in\n if List.mem arg symb then begin\n f arg;\n consume_arg ();\n end else begin\n raise (Stop (Wrong (s, arg, \"one of: \"\n ^ (make_symlist \"\" \" \" \"\" symb))))\n end\n | Set_string r ->\n r := get_arg ();\n consume_arg ();\n | Int f ->\n let arg = get_arg () in\n begin match int_of_string_opt arg with\n | None -> raise (Stop (Wrong (s, arg, \"an integer\")))\n | Some x -> f x\n end;\n consume_arg ();\n | Set_int r ->\n let arg = get_arg () in\n begin match int_of_string_opt arg with\n | None -> raise (Stop (Wrong (s, arg, \"an integer\")))\n | Some x -> r := x\n end;\n consume_arg ();\n | Float f ->\n let arg = get_arg () in\n begin match float_of_string_opt arg with\n | None -> raise (Stop (Wrong (s, arg, \"a float\")))\n | Some x -> f x\n end;\n consume_arg ();\n | Set_float r ->\n let arg = get_arg () in\n begin match float_of_string_opt arg with\n | None -> raise (Stop (Wrong (s, arg, \"a float\")))\n | Some x -> r := x\n end;\n consume_arg ();\n | Tuple specs ->\n no_arg ();\n List.iter treat_action specs;\n | Rest f ->\n no_arg ();\n while !current < (Array.length !argv) - 1 do\n f !argv.(!current + 1);\n consume_arg ();\n done;\n | Rest_all f ->\n no_arg ();\n let acc = ref [] in\n while !current < Array.length !argv - 1 do\n acc := !argv.(!current + 1) :: !acc;\n consume_arg ();\n done;\n f (List.rev !acc)\n | Expand f ->\n if not allow_expand then\n raise (Invalid_argument \"Arg.Expand is is only allowed with \\\n Arg.parse_and_expand_argv_dynamic\");\n let arg = get_arg () in\n let newarg = f arg in\n consume_arg ();\n let before = Array.sub !argv 0 (!current + 1)\n and after =\n Array.sub !argv (!current + 1)\n ((Array.length !argv) - !current - 1) in\n argv:= Array.concat [before;newarg;after];\n in\n treat_action action end\n else anonfun s\n with | Bad m -> raise (convert_error (Message m));\n | Stop e -> raise (convert_error e);\n end;\n incr current\n done\n\nlet parse_and_expand_argv_dynamic current argv speclist anonfun errmsg =\n parse_and_expand_argv_dynamic_aux true current argv speclist anonfun errmsg\n\nlet parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =\n parse_and_expand_argv_dynamic_aux false current (ref argv) speclist anonfun\n errmsg\n\n\nlet parse_argv ?(current=current) argv speclist anonfun errmsg =\n parse_argv_dynamic ~current:current argv (ref speclist) anonfun errmsg\n\n\nlet parse l f msg =\n try\n parse_argv Sys.argv l f msg\n with\n | Bad msg -> eprintf \"%s\" msg; exit 2\n | Help msg -> printf \"%s\" msg; exit 0\n\n\nlet parse_dynamic l f msg =\n try\n parse_argv_dynamic Sys.argv l f msg\n with\n | Bad msg -> eprintf \"%s\" msg; exit 2\n | Help msg -> printf \"%s\" msg; exit 0\n\nlet parse_expand l f msg =\n try\n let argv = ref Sys.argv in\n let spec = ref l in\n let current = ref (!current) in\n parse_and_expand_argv_dynamic current argv spec f msg\n with\n | Bad msg -> eprintf \"%s\" msg; exit 2\n | Help msg -> printf \"%s\" msg; exit 0\n\n\nlet second_word s =\n let len = String.length s in\n let rec loop n =\n if n >= len then len\n else if s.[n] = ' ' then loop (n+1)\n else n\n in\n match String.index s '\\t' with\n | n -> loop (n+1)\n | exception Not_found ->\n begin match String.index s ' ' with\n | n -> loop (n+1)\n | exception Not_found -> len\n end\n\n\nlet max_arg_len cur (kwd, spec, doc) =\n match spec with\n | Symbol _ -> Int.max cur (String.length kwd)\n | _ -> Int.max cur (String.length kwd + second_word doc)\n\n\nlet replace_leading_tab s =\n let seen = ref false in\n String.map (function '\\t' when not !seen -> seen := true; ' ' | c -> c) s\n\nlet add_padding len ksd =\n match ksd with\n | (_, _, \"\") ->\n (* Do not pad undocumented options, so that they still don't show up when\n * run through [usage] or [parse]. *)\n ksd\n | (kwd, (Symbol _ as spec), msg) ->\n let cutcol = second_word msg in\n let spaces = String.make ((Int.max 0 (len - cutcol)) + 3) ' ' in\n (kwd, spec, \"\\n\" ^ spaces ^ replace_leading_tab msg)\n | (kwd, spec, msg) ->\n let cutcol = second_word msg in\n let kwd_len = String.length kwd in\n let diff = len - kwd_len - cutcol in\n if diff <= 0 then\n (kwd, spec, replace_leading_tab msg)\n else\n let spaces = String.make diff ' ' in\n let prefix = String.sub (replace_leading_tab msg) 0 cutcol in\n let suffix = String.sub msg cutcol (String.length msg - cutcol) in\n (kwd, spec, prefix ^ spaces ^ suffix)\n\n\nlet align ?(limit=max_int) speclist =\n let completed = add_help speclist in\n let len = List.fold_left max_arg_len 0 completed in\n let len = Int.min len limit in\n List.map (add_padding len) completed\n\nlet trim_cr s =\n let len = String.length s in\n if len > 0 && String.get s (len - 1) = '\\r' then\n String.sub s 0 (len - 1)\n else\n s\n\nlet read_aux trim sep file =\n let ic = open_in_bin file in\n let buf = Buffer.create 200 in\n let words = ref [] in\n let stash () =\n let word = Buffer.contents buf in\n let word = if trim then trim_cr word else word in\n words := word :: !words;\n Buffer.clear buf\n in\n begin\n try while true do\n let c = input_char ic in\n if c = sep then stash () else Buffer.add_char buf c\n done\n with End_of_file -> ()\n end;\n if Buffer.length buf > 0 then stash ();\n close_in ic;\n Array.of_list (List.rev !words)\n\nlet read_arg = read_aux true '\\n'\n\nlet read_arg0 = read_aux false '\\x00'\n\nlet write_aux sep file args =\n let oc = open_out_bin file in\n Array.iter (fun s -> fprintf oc \"%s%c\" s sep) args;\n close_out oc\n\nlet write_arg = write_aux '\\n'\n\nlet write_arg0 = write_aux '\\x00'\n","(* generated code *)"],"names":[],"mappings":"EAiaiB,Y,EAFD,Y,KAHO,8CAAuB,C,KAA5C,G,EADS,EAAT,OAAS,eACT,2BAAkD,uBACtC,C,EALE,c,EAFD,c,WAhBX,EAAW,KAAX,QAAW,eAAX,EACA,Y,CAAA,EAZF,WACA,YAAc,0BAAsB,KAClC,uCAWA,kCACA,gCAAgB,C,iBAPT,EAAT,QAAS,eAGT,EAFU,KAAV,QAAU,eACV,I,EAAA,KACA,MAMA,SAEc,EAAR,QAAQ,aACR,sCAAgB,MAAQ,GAAM,0BAAqB,G,KAAA,I,AAAA,G,EAAA,GC9Y3D,iDDkZK,EAAH,QAAG,aAAiB,UAAU,OAC9B,wBAAW,eACG,aAAiB,2B,CAAA,C,oBAtD/B,kDAII,mCAEa,KAEsC,QAAvC,GADc,IAA1B,mBAA0B,EAA1B,QAA0B,aAA0B,QAAvC,MAAuC,QAAvC,aACe,KAAuB,OAAhC,aAAgC,OAAvC,aAAuC,4BAEtC,KAEb,WADA,SACA,aACA,SAGe,QAAb,QAAa,eAGuB,QAFZ,KAAX,MAAoC,QAApC,aAEQ,EADR,SAAb,SAAa,EAAb,QAAa,aACb,OAAqB,aAAe,OAAxB,aAAwB,KALD,QAAvB,KAAuB,Q,GAQjC,UAAQ,mB,EAIP,GAFC,OADM,EADR,MACQ,UAChB,QAAU,aACA,EAAV,QAAU,aACD,GAAiB,uBAAU,C,KA7BzB,gBAAoB,gBAAa,eAAc,OAAW,EAAE,C,EAAvE,GADA,I,EAAA,GACA,0BAA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"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/printexc.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nopen Printf\n\ntype t = exn = ..\n\nlet printers = Atomic.make []\n\nlet locfmt = format_of_string \"File \\\"%s\\\", line %d, characters %d-%d: %s\"\n\nlet field x i =\n let f = Obj.field x i in\n if not (Obj.is_block f) then\n sprintf \"%d\" (Obj.magic f : int) (* can also be a char *)\n else if Obj.tag f = Obj.string_tag then\n sprintf \"%S\" (Obj.magic f : string)\n else if Obj.tag f = Obj.double_tag then\n string_of_float (Obj.magic f : float)\n else\n \"_\"\n\nlet rec other_fields x i =\n if i >= Obj.size x then \"\"\n else sprintf \", %s%s\" (field x i) (other_fields x (i+1))\n\nlet fields x =\n match Obj.size x with\n | 0 -> \"\"\n | 1 -> \"\"\n | 2 -> sprintf \"(%s)\" (field x 1)\n | _ -> sprintf \"(%s%s)\" (field x 1) (other_fields x 2)\n\nlet use_printers x =\n let rec conv = function\n | hd :: tl ->\n (match hd x with\n | None | exception _ -> conv tl\n | Some s -> Some s)\n | [] -> None in\n conv (Atomic.get printers)\n\nlet destruct_ext_constructor x =\n if Obj.tag x <> 0 then\n ((Obj.magic (Obj.field x 0) : string), None)\n else\n let constructor =\n (Obj.magic (Obj.field (Obj.field x 0) 0) : string) in\n (constructor, Some (fields x))\n\nlet string_of_extension_constructor t =\n let constructor, fields_opt = destruct_ext_constructor t in\n match fields_opt with\n | None -> constructor\n | Some f -> constructor ^ f\n\nlet to_string_default = function\n | Out_of_memory -> \"Out of memory\"\n | Stack_overflow -> \"Stack overflow\"\n | Match_failure(file, line, char) ->\n sprintf locfmt file line char (char+5) \"Pattern matching failed\"\n | Assert_failure(file, line, char) ->\n sprintf locfmt file line char (char+6) \"Assertion failed\"\n | Undefined_recursive_module(file, line, char) ->\n sprintf locfmt file line char (char+6) \"Undefined recursive module\"\n | x ->\n string_of_extension_constructor (Obj.repr x)\n\nlet to_string e =\n match use_printers e with\n | Some s -> s\n | None -> to_string_default e\n\nlet print fct arg =\n try\n fct arg\n with x ->\n eprintf \"Uncaught exception: %s\\n\" (to_string x);\n flush stderr;\n raise x\n\nlet catch fct arg =\n try\n fct arg\n with x ->\n flush stdout;\n eprintf \"Uncaught exception: %s\\n\" (to_string x);\n exit 2\n\ntype raw_backtrace_slot\ntype raw_backtrace_entry = private int\ntype raw_backtrace = raw_backtrace_entry array\n\nlet raw_backtrace_entries bt = bt\n\nexternal get_raw_backtrace:\n unit -> raw_backtrace = \"caml_get_exception_raw_backtrace\"\n\nexternal raise_with_backtrace: exn -> raw_backtrace -> 'a\n = \"%raise_with_backtrace\"\n\n(* Disable warning 37: values are constructed in the runtime *)\ntype[@warning \"-37\"] backtrace_slot =\n | Known_location of {\n is_raise : bool;\n filename : string;\n start_lnum : int;\n start_char : int;\n end_offset : int; (* Relative to beginning of start_lnum *)\n end_lnum : int;\n end_char : int; (* Relative to beginning of end_lnum line *)\n is_inline : bool;\n defname : string;\n }\n | Unknown_location of {\n is_raise : bool\n }\n\nexternal convert_raw_backtrace_slot:\n raw_backtrace_slot -> backtrace_slot = \"caml_convert_raw_backtrace_slot\"\n\nexternal convert_raw_backtrace:\n raw_backtrace -> backtrace_slot array = \"caml_convert_raw_backtrace\"\n\nlet convert_raw_backtrace bt =\n try Some (convert_raw_backtrace bt)\n with Failure _ -> None\n\nlet format_backtrace_slot pos slot =\n let info is_raise =\n if is_raise then\n if pos = 0 then \"Raised at\" else \"Re-raised at\"\n else\n if pos = 0 then \"Raised by primitive operation at\" else \"Called from\"\n in\n match slot with\n | Unknown_location l ->\n if l.is_raise then\n (* compiler-inserted re-raise, skipped *) None\n else\n Some (sprintf \"%s unknown location\" (info false))\n | Known_location l ->\n let lines =\n if l.start_lnum = l.end_lnum then\n Printf.sprintf \" %d\" l.start_lnum\n else\n Printf.sprintf \"s %d-%d\" l.start_lnum l.end_lnum\n in\n Some (sprintf \"%s %s in file \\\"%s\\\"%s, line%s, characters %d-%d\"\n (info l.is_raise) l.defname l.filename\n (if l.is_inline then \" (inlined)\" else \"\")\n lines l.start_char l.end_char)\n\nlet print_exception_backtrace outchan backtrace =\n match backtrace with\n | None ->\n fprintf outchan\n \"(Program not linked with -g, cannot print stack backtrace)\\n\"\n | Some a ->\n for i = 0 to Array.length a - 1 do\n match format_backtrace_slot i a.(i) with\n | None -> ()\n | Some str -> fprintf outchan \"%s\\n\" str\n done\n\nlet print_raw_backtrace outchan raw_backtrace =\n print_exception_backtrace outchan (convert_raw_backtrace raw_backtrace)\n\n(* confusingly named: prints the global current backtrace *)\nlet print_backtrace outchan =\n print_raw_backtrace outchan (get_raw_backtrace ())\n\nlet backtrace_to_string backtrace =\n match backtrace with\n | None ->\n \"(Program not linked with -g, cannot print stack backtrace)\\n\"\n | Some a ->\n let b = Buffer.create 1024 in\n for i = 0 to Array.length a - 1 do\n match format_backtrace_slot i a.(i) with\n | None -> ()\n | Some str -> bprintf b \"%s\\n\" str\n done;\n Buffer.contents b\n\nlet raw_backtrace_to_string raw_backtrace =\n backtrace_to_string (convert_raw_backtrace raw_backtrace)\n\nlet backtrace_slot_is_raise = function\n | Known_location l -> l.is_raise\n | Unknown_location l -> l.is_raise\n\nlet backtrace_slot_is_inline = function\n | Known_location l -> l.is_inline\n | Unknown_location _ -> false\n\ntype location = {\n filename : string;\n line_number : int;\n start_char : int;\n end_char : int;\n end_line : int;\n end_col : int;\n}\n\nlet backtrace_slot_location = function\n | Unknown_location _ -> None\n | Known_location l ->\n Some {\n filename = l.filename;\n line_number = l.start_lnum;\n start_char = l.start_char;\n end_char = l.end_offset;\n end_line = l.end_lnum;\n end_col = l.end_char;\n }\n\nlet backtrace_slot_defname = function\n | Unknown_location _\n | Known_location { defname = \"\" } -> None\n | Known_location l -> Some l.defname\n\nlet backtrace_slots raw_backtrace =\n (* The documentation of this function guarantees that Some is\n returned only if a part of the trace is usable. This gives us\n a bit more work than just convert_raw_backtrace, but it makes the\n API more user-friendly -- otherwise most users would have to\n reimplement the \"Program not linked with -g, sorry\" logic\n themselves. *)\n match convert_raw_backtrace raw_backtrace with\n | None -> None\n | Some backtrace ->\n let usable_slot = function\n | Unknown_location _ -> false\n | Known_location _ -> true in\n let rec exists_usable = function\n | (-1) -> false\n | i -> usable_slot backtrace.(i) || exists_usable (i - 1) in\n if exists_usable (Array.length backtrace - 1)\n then Some backtrace\n else None\n\nlet backtrace_slots_of_raw_entry entry =\n backtrace_slots [| entry |]\n\nmodule Slot = struct\n type t = backtrace_slot\n let format = format_backtrace_slot\n let is_raise = backtrace_slot_is_raise\n let is_inline = backtrace_slot_is_inline\n let location = backtrace_slot_location\n let name = backtrace_slot_defname\nend\n\nlet raw_backtrace_length bt = Array.length bt\n\nexternal get_raw_backtrace_slot :\n raw_backtrace -> int -> raw_backtrace_slot = \"caml_raw_backtrace_slot\"\n\nexternal get_raw_backtrace_next_slot :\n raw_backtrace_slot -> raw_backtrace_slot option\n = \"caml_raw_backtrace_next_slot\"\n\n(* confusingly named:\n returns the *string* corresponding to the global current backtrace *)\nlet get_backtrace () = raw_backtrace_to_string (get_raw_backtrace ())\n\nexternal record_backtrace: bool -> unit = \"caml_record_backtrace\"\nexternal backtrace_status: unit -> bool = \"caml_backtrace_status\"\n\nlet rec register_printer fn =\n let old_printers = Atomic.get printers in\n let new_printers = fn :: old_printers in\n let success = Atomic.compare_and_set printers old_printers new_printers in\n if not success then register_printer fn\n\nexternal get_callstack: int -> raw_backtrace = \"caml_get_current_callstack\"\n\nlet exn_slot x =\n let x = Obj.repr x in\n if Obj.tag x = 0 then Obj.field x 0 else x\n\nlet exn_slot_id x =\n let slot = exn_slot x in\n (Obj.obj (Obj.field slot 1) : int)\n\nlet exn_slot_name x =\n let slot = exn_slot x in\n (Obj.obj (Obj.field slot 0) : string)\n\nexternal get_debug_info_status : unit -> int = \"caml_ml_debug_info_status\"\n\n(* Descriptions for errors in startup.h. See also backtrace.c *)\nlet errors = [| \"\";\n (* FILE_NOT_FOUND *)\n \"(Cannot print locations:\\n \\\n bytecode executable program file not found)\";\n (* BAD_BYTECODE *)\n \"(Cannot print locations:\\n \\\n bytecode executable program file appears to be corrupt)\";\n (* WRONG_MAGIC *)\n \"(Cannot print locations:\\n \\\n bytecode executable program file has wrong magic number)\";\n (* NO_FDS *)\n \"(Cannot print locations:\\n \\\n bytecode executable program file cannot be opened;\\n \\\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)\"\n|]\n\nlet default_uncaught_exception_handler exn raw_backtrace =\n eprintf \"Fatal error: exception %s\\n\" (to_string exn);\n print_raw_backtrace stderr raw_backtrace;\n let status = get_debug_info_status () in\n if status < 0 then\n prerr_endline errors.(abs status);\n flush stderr\n\nlet uncaught_exception_handler = ref default_uncaught_exception_handler\n\nlet set_uncaught_exception_handler fn = uncaught_exception_handler := fn\n\nlet empty_backtrace : raw_backtrace = [| |]\n\nlet try_get_raw_backtrace () =\n try\n get_raw_backtrace ()\n with _ (* Out_of_memory? *) ->\n empty_backtrace\n\nlet handle_uncaught_exception' exn debugger_in_use =\n try\n (* Get the backtrace now, in case one of the [at_exit] function\n destroys it. *)\n let raw_backtrace =\n if debugger_in_use (* Same test as in [runtime/printexc.c] *) then\n empty_backtrace\n else\n try_get_raw_backtrace ()\n in\n (try Stdlib.do_at_exit () with _ -> ());\n try\n !uncaught_exception_handler exn raw_backtrace\n with exn' ->\n let raw_backtrace' = try_get_raw_backtrace () in\n eprintf \"Fatal error: exception %s\\n\" (to_string exn);\n print_raw_backtrace stderr raw_backtrace;\n eprintf \"Fatal error in uncaught exception handler: exception %s\\n\"\n (to_string exn');\n print_raw_backtrace stderr raw_backtrace';\n flush stderr\n with\n | Out_of_memory ->\n prerr_endline\n \"Fatal error: out of memory in uncaught exception handler\"\n\n(* This function is called by [caml_fatal_uncaught_exception] in\n [runtime/printexc.c] which expects no exception is raised. *)\nlet handle_uncaught_exception exn debugger_in_use =\n try\n handle_uncaught_exception' exn debugger_in_use\n with _ ->\n (* There is not much we can do at this point *)\n ()\n\nexternal register_named_value : string -> 'a -> unit\n = \"caml_register_named_value\"\n\nlet () =\n register_named_value \"Printexc.handle_uncaught_exception\"\n handle_uncaught_exception\n"],"names":[],"mappings":"4DCkXE,eA5BA,oBALE,QAY4B,Q,EAE5B,SAAK,IAAL,QAAK,cAAoB,I,AAAA,I,AAAA,G,EAAA,KACzB,UACE,IADF,YACE,GAA6C,I,AAAA,I,AAAA,G,EAAA,KAhB/C,SAmBwC,YAAtC,GAAqD,QAArD,2BAAqD,OACrD,UAEE,YADF,GACkB,QADlB,2BACkB,OAClB,UAAyC,cACzC,cAAY,I,AAAA,I,AAAA,G,EAAA,GDzWlB,WC4WQ,ED5WR,oC,CC4WQ,E,CAAA,wBAO0C,G,AAAA,I,AAAA,G,EAAA,IAG9C,IAAE,C,EA3CkC,oBAAgC,C,UAThC,kBAAtC,GAAqD,QAArD,2BAAqD,OACrD,UADsC,EAEzB,OACb,YACwB,EAAtB,OAAsB,eAAR,+CAAmB,OAAjC,eACF,+BAAY,C,IA3BH,MADE,KACF,E,CAAA,6BAA4B,C,IAJ5B,MADE,KACF,E,CAAA,6BAAyB,C,EAJtB,IAAT,IAAS,IAAU,sCAAmB,GAAC,C,OAT1C,UAEc,MAFK,MAAnB,QAAmB,eACnB,YACA,QAAc,aACd,eAAuC,C,EATM,OAAsB,Q,IAXvC,S,CAAA,yBAAe,C,EAX3C,iBAA2B,C,UAdrB,OAAmC,OAC7B,M,EAQR,KARQ,YAQR,E,CAAA,0BAAG,IAHqB,UACZ,KACS,uBALH,IAKG,gBALH,SACQ,E,CAIQ,cACW,IACxC,M,CAAA,MACA,M,GAAA,GAAI,C,K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SAAO,EAGH,OAHG,E,CAAA,aAAI,I,AAAA,I,AAAA,G,EAAA,IDhDnB,YCkDqB,IDlDrB,UCkDqB,MAEO,C,SAjB1B,yCAAwB,IACU,EAA7B,UAA6B,OAAZ,OAAW,8BAAuB,C,QAZhD,gDACR,QAAO,aAAgB,QACrB,wCACG,UAAG,IAAS,uCACf,wCACG,UAAG,IAAS,uCACf,uBAEA,MAAG,C,8FAbsB,YAAd,IDnBf,QCmBe,eAAc,8EAyW3B,GAzW2B,sBAyW3B,GAC2B,2G","ignoreList":[0]}},{"offset":{"line":0,"column":266104},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/fun.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* The OCaml programmers *)\n(* *)\n(* Copyright 2018 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nexternal id : 'a -> 'a = \"%identity\"\nlet const c _ = c\nlet compose f g x = f (g x)\nlet flip f x y = f y x\nlet negate p v = not (p v)\n\nexception Finally_raised of exn\n\nlet () = Printexc.register_printer @@ function\n| Finally_raised exn -> Some (\"Fun.Finally_raised: \" ^ Printexc.to_string exn)\n| _ -> None\n\nlet protect ~(finally : unit -> unit) work =\n let finally_no_exn () =\n try finally () with e ->\n let bt = Printexc.get_raw_backtrace () in\n Printexc.raise_with_backtrace (Finally_raised e) bt\n in\n match work () with\n | result -> finally_no_exn () ; result\n | exception work_exn ->\n let work_bt = Printexc.get_raw_backtrace () in\n finally_no_exn () ;\n Printexc.raise_with_backtrace work_exn work_bt\n","(* generated code *)"],"names":[],"mappings":"QA6BI,OAAI,IAAJ,EAAI,mBAAU,G,AAAA,I,AAAA,G,EAAA,KACH,IAAT,QAAS,eACT,6BAAmD,C,SAHvD,kBAKA,SAAM,qBAAO,I,AAAA,I,AAAA,G,EAAA,KAGK,IAAd,QAAc,eACd,KAAiB,aAHT,KAAiB,EAIqB,C,KAfd,yBACwC,IAAjD,GADS,OACd,QAA+B,aAAsB,OAAhD,aAAiD,KACvE,KAAI,C,KANU,iBAAK,S,EADT,SAAK,C,KADA,iBAAK,gB,EADX,EAAC,C,QChBjB,kCDuBS,cAEE,yC,QCzBX,4D,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":266832},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/gc.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* Jacques-Henri Jourdan, projet Gallium, INRIA Paris *)\n(* *)\n(* Copyright 1996-2016 Institut National de Recherche en Informatique *)\n(* et en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype stat = {\n minor_words : float;\n promoted_words : float;\n major_words : float;\n minor_collections : int;\n major_collections : int;\n heap_words : int;\n heap_chunks : int;\n live_words : int;\n live_blocks : int;\n free_words : int;\n free_blocks : int;\n largest_free : int;\n fragments : int;\n compactions : int;\n top_heap_words : int;\n stack_size : int;\n forced_major_collections: int;\n}\n\ntype control = {\n minor_heap_size : int;\n major_heap_increment : int;\n space_overhead : int;\n verbose : int;\n max_overhead : int;\n stack_limit : int;\n allocation_policy : int;\n window_size : int;\n custom_major_ratio : int;\n custom_minor_ratio : int;\n custom_minor_max_size : int;\n}\n\nexternal stat : unit -> stat = \"caml_gc_stat\"\nexternal quick_stat : unit -> stat = \"caml_gc_quick_stat\"\nexternal counters : unit -> (float * float * float) = \"caml_gc_counters\"\nexternal minor_words : unit -> (float [@unboxed])\n = \"caml_gc_minor_words\" \"caml_gc_minor_words_unboxed\"\nexternal get : unit -> control = \"caml_gc_get\"\nexternal set : control -> unit = \"caml_gc_set\"\nexternal minor : unit -> unit = \"caml_gc_minor\"\nexternal major_slice : int -> int = \"caml_gc_major_slice\"\nexternal major : unit -> unit = \"caml_gc_major\"\nexternal full_major : unit -> unit = \"caml_gc_full_major\"\nexternal compact : unit -> unit = \"caml_gc_compaction\"\nexternal get_minor_free : unit -> int = \"caml_get_minor_free\"\n\nlet eventlog_pause () = ()\nlet eventlog_resume () = ()\n\nopen Printf\n\nlet print_stat c =\n let st = stat () in\n fprintf c \"minor_collections: %d\\n\" st.minor_collections;\n fprintf c \"major_collections: %d\\n\" st.major_collections;\n fprintf c \"compactions: %d\\n\" st.compactions;\n fprintf c \"forced_major_collections: %d\\n\" st.forced_major_collections;\n fprintf c \"\\n\";\n let l1 = String.length (sprintf \"%.0f\" st.minor_words) in\n fprintf c \"minor_words: %*.0f\\n\" l1 st.minor_words;\n fprintf c \"promoted_words: %*.0f\\n\" l1 st.promoted_words;\n fprintf c \"major_words: %*.0f\\n\" l1 st.major_words;\n fprintf c \"\\n\";\n let l2 = String.length (sprintf \"%d\" st.top_heap_words) in\n fprintf c \"top_heap_words: %*d\\n\" l2 st.top_heap_words;\n fprintf c \"heap_words: %*d\\n\" l2 st.heap_words;\n fprintf c \"live_words: %*d\\n\" l2 st.live_words;\n fprintf c \"free_words: %*d\\n\" l2 st.free_words;\n fprintf c \"largest_free: %*d\\n\" l2 st.largest_free;\n fprintf c \"fragments: %*d\\n\" l2 st.fragments;\n fprintf c \"\\n\";\n fprintf c \"live_blocks: %d\\n\" st.live_blocks;\n fprintf c \"free_blocks: %d\\n\" st.free_blocks;\n fprintf c \"heap_chunks: %d\\n\" st.heap_chunks\n\n\nlet allocated_bytes () =\n let (mi, pro, ma) = counters () in\n (mi +. ma -. pro) *. float_of_int (Sys.word_size / 8)\n\n\nexternal finalise : ('a -> unit) -> 'a -> unit = \"caml_final_register\"\nexternal finalise_last : (unit -> unit) -> 'a -> unit =\n \"caml_final_register_called_without_value\"\nexternal finalise_release : unit -> unit = \"caml_final_release\"\n\n\ntype alarm = bool Atomic.t\ntype alarm_rec = {active : alarm; f : unit -> unit}\n\nlet rec call_alarm arec =\n if Atomic.get arec.active then begin\n let finally () = finalise call_alarm arec in\n Fun.protect ~finally arec.f\n end\n\nlet delete_alarm a = Atomic.set a false\n\nlet create_alarm f =\n let arec = { active = Atomic.make true; f = f } in\n Domain.at_exit (fun () -> delete_alarm arec.active);\n finalise call_alarm arec;\n arec.active\n\n\nmodule Memprof =\n struct\n type t\n type allocation_source = Normal | Marshal | Custom\n type allocation =\n { n_samples : int;\n size : int;\n source : allocation_source;\n callstack : Printexc.raw_backtrace }\n\n type ('minor, 'major) tracker = {\n alloc_minor: allocation -> 'minor option;\n alloc_major: allocation -> 'major option;\n promote: 'minor -> 'major option;\n dealloc_minor: 'minor -> unit;\n dealloc_major: 'major -> unit;\n }\n\n let null_tracker = {\n alloc_minor = (fun _ -> None);\n alloc_major = (fun _ -> None);\n promote = (fun _ -> None);\n dealloc_minor = (fun _ -> ());\n dealloc_major = (fun _ -> ());\n }\n\n external c_start :\n float -> int -> ('minor, 'major) tracker -> t\n = \"caml_memprof_start\"\n\n let start\n ~sampling_rate\n ?(callstack_size = max_int)\n tracker =\n c_start sampling_rate callstack_size tracker\n\n external stop : unit -> unit = \"caml_memprof_stop\"\n\n external discard : t -> unit = \"caml_memprof_discard\"\n end\n"],"names":[],"mappings":"8CC6JM,EAHA,UACmB,mBAEnB,KAA4C,C,EAfpB,IAAI,C,EAxBN,gBAAwB,C,EAAlD,GADsB,IAAtB,QAAsB,eACtB,yBACwB,EACb,C,EANQ,2BAAkB,C,KAnBjB,OAAW,UAC9B,OAD8B,OAC9B,QAD8B,OAC/B,wBAAqB,CAArB,IAAqD,C,QA1B5C,OACT,kDAA6D,OAC7D,KAD6D,QAC7D,2BAA6D,OAC7D,KAD6D,QAC7D,2BAAuD,OACvD,KADuD,QACvD,2BACA,KADsE,QACtE,cAAc,OACS,GADT,QACS,0BAA+B,OACtD,uCACA,IADqD,OACrD,KADqD,QACrD,iBACA,IADwD,OACxD,KADwD,QACxD,iBACA,KADqD,QACrD,cAAc,OACS,GADT,QACS,0BAAgC,OACvD,uCACA,IADsD,OACtD,KADsD,QACtD,iBACA,IADkD,OAClD,KADkD,QAClD,iBACA,IADkD,OAClD,KADkD,QAClD,iBACA,IADkD,OAClD,KADkD,QAClD,iBACA,IADoD,OACpD,KADoD,QACpD,iBACA,KADiD,QACjD,cAAc,OACd,KADc,QACd,2BAA4C,OAC5C,KAD4C,QAC5C,2BAA4C,8CACA,C","ignoreList":[0]}},{"offset":{"line":0,"column":268305},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/in_channel.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2021 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t = in_channel\n\ntype open_flag = Stdlib.open_flag =\n | Open_rdonly\n | Open_wronly\n | Open_append\n | Open_creat\n | Open_trunc\n | Open_excl\n | Open_binary\n | Open_text\n | Open_nonblock\n\nlet stdin = Stdlib.stdin\nlet open_bin = Stdlib.open_in_bin\nlet open_text = Stdlib.open_in\nlet open_gen = Stdlib.open_in_gen\n\nlet with_open openfun s f =\n let ic = openfun s in\n Fun.protect ~finally:(fun () -> Stdlib.close_in_noerr ic)\n (fun () -> f ic)\n\nlet with_open_bin s f =\n with_open Stdlib.open_in_bin s f\n\nlet with_open_text s f =\n with_open Stdlib.open_in s f\n\nlet with_open_gen flags perm s f =\n with_open (Stdlib.open_in_gen flags perm) s f\n\nlet seek = Stdlib.LargeFile.seek_in\nlet pos = Stdlib.LargeFile.pos_in\nlet length = Stdlib.LargeFile.in_channel_length\nlet close = Stdlib.close_in\nlet close_noerr = Stdlib.close_in_noerr\n\nlet input_char ic =\n match Stdlib.input_char ic with\n | c -> Some c\n | exception End_of_file -> None\n\nlet input_byte ic =\n match Stdlib.input_byte ic with\n | n -> Some n\n | exception End_of_file -> None\n\nlet input_line ic =\n match Stdlib.input_line ic with\n | s -> Some s\n | exception End_of_file -> None\n\nlet input = Stdlib.input\n\nexternal unsafe_input_bigarray :\n t -> _ Bigarray.Array1.t -> int -> int -> int\n = \"caml_ml_input_bigarray\"\n\nlet input_bigarray ic buf ofs len =\n if ofs < 0 || len < 0 || ofs > Bigarray.Array1.dim buf - len\n then invalid_arg \"input_bigarray\"\n else unsafe_input_bigarray ic buf ofs len\n\nlet really_input ic buf pos len =\n match Stdlib.really_input ic buf pos len with\n | () -> Some ()\n | exception End_of_file -> None\n\nlet rec unsafe_really_input_bigarray ic buf ofs len =\n if len <= 0 then Some () else begin\n let r = unsafe_input_bigarray ic buf ofs len in\n if r = 0\n then None\n else unsafe_really_input_bigarray ic buf (ofs + r) (len - r)\n end\n\nlet really_input_bigarray ic buf ofs len =\n if ofs < 0 || len < 0 || ofs > Bigarray.Array1.dim buf - len\n then invalid_arg \"really_input_bigarray\"\n else unsafe_really_input_bigarray ic buf ofs len\n\nlet really_input_string ic len =\n match Stdlib.really_input_string ic len with\n | s -> Some s\n | exception End_of_file -> None\n\n(* Read up to [len] bytes into [buf], starting at [ofs]. Return total bytes\n read. *)\nlet read_upto ic buf ofs len =\n let rec loop ofs len =\n if len = 0 then ofs\n else begin\n let r = Stdlib.input ic buf ofs len in\n if r = 0 then\n ofs\n else\n loop (ofs + r) (len - r)\n end\n in\n loop ofs len - ofs\n\n(* Best effort attempt to return a buffer with >= (ofs + n) bytes of storage,\n and such that it coincides with [buf] at indices < [ofs].\n\n The returned buffer is equal to [buf] itself if it already has sufficient\n free space.\n\n The returned buffer may have *fewer* than [ofs + n] bytes of storage if this\n number is > [Sys.max_string_length]. However the returned buffer will\n *always* have > [ofs] bytes of storage. In the limiting case when [ofs = len\n = Sys.max_string_length] (so that it is not possible to resize the buffer at\n all), an exception is raised. *)\n\nlet ensure buf ofs n =\n let len = Bytes.length buf in\n if len >= ofs + n then buf\n else begin\n let new_len = ref len in\n while !new_len < ofs + n do\n new_len := 2 * !new_len + 1\n done;\n let new_len = !new_len in\n let new_len =\n if new_len <= Sys.max_string_length then\n new_len\n else if ofs < Sys.max_string_length then\n Sys.max_string_length\n else\n failwith \"In_channel.input_all: channel content \\\n is larger than maximum string length\"\n in\n let new_buf = Bytes.create new_len in\n Bytes.blit buf 0 new_buf 0 ofs;\n new_buf\n end\n\nlet input_all ic =\n let chunk_size = 65536 in (* IO_BUFFER_SIZE *)\n let initial_size =\n try\n Stdlib.in_channel_length ic - Stdlib.pos_in ic\n with Sys_error _ ->\n -1\n in\n let initial_size = if initial_size < 0 then chunk_size else initial_size in\n let initial_size =\n if initial_size <= Sys.max_string_length then\n initial_size\n else\n Sys.max_string_length\n in\n let buf = Bytes.create initial_size in\n let nread = read_upto ic buf 0 initial_size in\n if nread < initial_size then (* EOF reached, buffer partially filled *)\n Bytes.sub_string buf 0 nread\n else begin (* nread = initial_size, maybe EOF reached *)\n match Stdlib.input_char ic with\n | exception End_of_file ->\n (* EOF reached, buffer is completely filled *)\n Bytes.unsafe_to_string buf\n | c ->\n (* EOF not reached *)\n let rec loop buf ofs =\n let buf = ensure buf ofs chunk_size in\n let rem = Bytes.length buf - ofs in\n (* [rem] can be < [chunk_size] if buffer size close to\n [Sys.max_string_length] *)\n let r = read_upto ic buf ofs rem in\n if r < rem then (* EOF reached *)\n Bytes.sub_string buf 0 (ofs + r)\n else (* r = rem *)\n loop buf (ofs + rem)\n in\n let buf = ensure buf nread (chunk_size + 1) in\n Bytes.set buf nread c;\n loop buf (nread + 1)\n end\n\nlet [@tail_mod_cons] rec input_lines ic =\n match Stdlib.input_line ic with\n | line -> line :: input_lines ic\n | exception End_of_file -> []\n\nlet rec fold_lines f accu ic =\n match Stdlib.input_line ic with\n | line -> fold_lines f (f accu line) ic\n | exception End_of_file -> accu\n\nlet set_binary_mode = Stdlib.set_binary_mode_in\n\nexternal is_binary_mode : in_channel -> bool = \"caml_ml_is_binary_mode\"\n\nexternal isatty : t -> bool = \"caml_sys_isatty\"\n"],"names":[],"mappings":"mBCwME,WAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GDxM5B,iDC0M6B,S,EADJ,SAAa,K,CACL,C,QAP/B,SAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GDnM5B,iDCqM6B,W,EADjB,kBAAQ,QADlB,SAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GDnM5B,iDCqM6B,cADK,S,EAAtB,+B,CACmB,C,WA7BjB,EARZ,IANA,SAEkC,EAFlC,QAEkC,eAA9B,EAA8C,QAA9C,aAA2B,iB,AAAA,I,AAAA,G,EAAA,KD5JjC,yDC8JM,SAJJ,EAMA,WACA,MADA,QACA,cAII,SAEM,MACE,WACZ,gBACE,gC,EAAA,SAEM,EAFN,QAEM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GD5K9B,iDC+KQ,6B,EAeA,QADU,eACV,8BAAqB,aAXT,iBACV,YAGQ,iBACR,WACE,mCAEA,U,KAAA,GAKP,C,cA7DH,I,IAAA,E,EAAA,MADA,WACA,MAAuB,6BAInB,eAaF,MAVA,QADA,QACA,cAGO,qBACH,SAEA,yBAGU,IACd,4BAA8B,EAE7B,C,QAnCH,MATE,O,CAAA,EAGE,IADQ,QADL,QACK,eACR,C,CAAA,EAGE,sCAGM,UAAM,C,EAjBlB,SAAM,IAAN,QAAM,eAAiC,I,AAAA,I,AAAA,G,EAAA,GDlGzC,iDCoG6B,W,EADpB,UACwB,C,MAP/B,4BAA+B,KAAuB,yBARtD,SAEE,IADQ,aACR,GACK,MACA,kC,EAJU,K,MASZ,uBAC2C,C,EAfhD,OAAM,QAAN,QAAM,cACE,M,AAAA,I,AAAA,G,EAAA,GDjFV,kDCkF6B,UAAI,C,KAP/B,4BAA+B,KAAuB,uBAEjD,WAAoC,IADpC,uBACoC,C,EAbzC,SAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GDhE5B,iDCkE6B,W,EADpB,UACwB,C,EAP/B,SAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GD3D5B,iDC6D6B,W,EADpB,UACwB,C,EAP/B,SAAM,EAAN,QAAM,eAAoB,I,AAAA,I,AAAA,G,EAAA,GDtD5B,iDCwD6B,W,EADpB,UACwB,C,KAXrB,uC,EAAA,OAAV,QAAU,GAA+B,OAAI,C,EAH7C,eAA4B,C,EAH5B,eAAgC,C,EAJA,8BAAwB,C,KAC3C,8BAAI,C,KADjB,GADS,mBACT,kCACkB,C","ignoreList":[0]}},{"offset":{"line":0,"column":271320},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/out_channel.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2021 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype t = out_channel\n\ntype open_flag = Stdlib.open_flag =\n | Open_rdonly\n | Open_wronly\n | Open_append\n | Open_creat\n | Open_trunc\n | Open_excl\n | Open_binary\n | Open_text\n | Open_nonblock\n\nlet stdout = Stdlib.stdout\nlet stderr = Stdlib.stderr\nlet open_bin = Stdlib.open_out_bin\nlet open_text = Stdlib.open_out\nlet open_gen = Stdlib.open_out_gen\n\nlet with_open openfun s f =\n let oc = openfun s in\n Fun.protect ~finally:(fun () -> Stdlib.close_out_noerr oc)\n (fun () -> f oc)\n\nlet with_open_bin s f =\n with_open Stdlib.open_out_bin s f\n\nlet with_open_text s f =\n with_open Stdlib.open_out s f\n\nlet with_open_gen flags perm s f =\n with_open (Stdlib.open_out_gen flags perm) s f\n\nexternal unsafe_output_bigarray :\n t -> _ Bigarray.Array1.t -> int -> int -> unit\n = \"caml_ml_output_bigarray\"\n\nlet seek = Stdlib.LargeFile.seek_out\nlet pos = Stdlib.LargeFile.pos_out\nlet length = Stdlib.LargeFile.out_channel_length\nlet close = Stdlib.close_out\nlet close_noerr = Stdlib.close_out_noerr\nlet flush = Stdlib.flush\nlet flush_all = Stdlib.flush_all\nlet output_char = Stdlib.output_char\nlet output_byte = Stdlib.output_byte\nlet output_string = Stdlib.output_string\nlet output_bytes = Stdlib.output_bytes\nlet output = Stdlib.output\nlet output_substring = Stdlib.output_substring\nlet output_bigarray oc buf ofs len =\n if ofs < 0 || len < 0 || ofs > Bigarray.Array1.dim buf - len\n then invalid_arg \"output_bigarray\"\n else unsafe_output_bigarray oc buf ofs len\n\nlet set_binary_mode = Stdlib.set_binary_mode_out\n\nexternal is_binary_mode : out_channel -> bool = \"caml_ml_is_binary_mode\"\n\nexternal set_buffered : t -> bool -> unit = \"caml_ml_set_buffered\"\n\nexternal is_buffered : t -> bool = \"caml_ml_is_buffered\"\n\nexternal isatty : t -> bool = \"caml_sys_isatty\"\n"],"names":[],"mappings":"uCCkEE,4BAA+B,KAAuB,uBAEjD,WAAqC,IADrC,uBACqC,C,KAtBhC,uC,EAAA,OAAV,OAAU,GAAgC,OAAI,C,EAH9C,cAA6B,C,EAH7B,cAAiC,C,EAJD,8BAAyB,C,KAC5C,8BAAI,C,KADjB,GADS,mBACT,kCACkB,C","ignoreList":[0]}},{"offset":{"line":0,"column":272073},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/digest.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Utility functions *)\n\nlet hex_of_string d =\n let char_hex n =\n Char.chr (if n < 10 then Char.code '0' + n\n else Char.code 'a' + n - 10) in\n let len = String.length d in\n let result = Bytes.create (len * 2) in\n for i = 0 to len - 1 do\n let x = Char.code d.[i] in\n Bytes.unsafe_set result (i*2) (char_hex (x lsr 4));\n Bytes.unsafe_set result (i*2+1) (char_hex (x land 0x0f));\n done;\n Bytes.unsafe_to_string result\n\nlet string_of_hex s =\n let digit c =\n match c with\n | '0'..'9' -> Char.code c - Char.code '0'\n | 'A'..'F' -> Char.code c - Char.code 'A' + 10\n | 'a'..'f' -> Char.code c - Char.code 'a' + 10\n | _ -> invalid_arg \"Digest.of_hex\" in\n let byte i = digit s.[i] lsl 4 + digit s.[i+1] in\n String.init (String.length s / 2) (fun i -> Char.chr (byte (2 * i)))\n\n(* Generic interface *)\n\nmodule type S = sig\n type t = string\n val hash_length : int\n val compare : t -> t -> int\n val equal : t -> t -> bool\n val string : string -> t\n val bytes : bytes -> t\n val substring : string -> int -> int -> t\n val subbytes : bytes -> int -> int -> t\n val channel : in_channel -> int -> t\n val file : string -> t\n val output : out_channel -> t -> unit\n val input : in_channel -> t\n val to_hex : t -> string\n val of_hex : string -> t\nend\n\n(* BLAKE2 hashing, parameterized by hash size *)\n\nmodule BLAKE2 (X: sig val hash_length : int end) : S = struct\n\n type t = string\n\n let hash_length =\n if X.hash_length < 1 || X.hash_length > 64\n then invalid_arg \"Digest.BLAKE2: wrong hash size\";\n X.hash_length\n\n let compare = String.compare\n let equal = String.equal\n\n type state\n\n external create_gen: int -> string -> state = \"caml_blake2_create\"\n external update: state -> string -> int -> int -> unit = \"caml_blake2_update\"\n external final: state -> int -> t = \"caml_blake2_final\"\n external unsafe_string: int -> string -> string -> int -> int -> t\n = \"caml_blake2_string\"\n\n let create () = create_gen hash_length \"\"\n\n let string str =\n unsafe_string hash_length \"\" str 0 (String.length str)\n\n let bytes b =\n string (Bytes.unsafe_to_string b)\n\n let substring str ofs len =\n if ofs < 0 || len < 0 || ofs > String.length str - len\n then invalid_arg \"Digest.substring\";\n unsafe_string hash_length \"\" str ofs len\n\n let subbytes b ofs len =\n substring (Bytes.unsafe_to_string b) ofs len\n\n let channel ic toread =\n let buf_size = 4096 in\n let buf = Bytes.create buf_size in\n let ctx = create () in\n if toread < 0 then begin\n let rec do_read () =\n let n = In_channel.input ic buf 0 buf_size in\n if n = 0\n then final ctx hash_length\n else (update ctx (Bytes.unsafe_to_string buf) 0 n; do_read ())\n in do_read ()\n end else begin\n let rec do_read toread =\n if toread = 0 then final ctx hash_length else begin\n let n = In_channel.input ic buf 0 (Int.min buf_size toread) in\n if n = 0\n then raise End_of_file\n else begin\n update ctx (Bytes.unsafe_to_string buf) 0 n;\n do_read (toread - n)\n end\n end\n in do_read toread\n end\n\n let file filename =\n In_channel.with_open_bin filename (fun ic -> channel ic (-1))\n\n let output chan digest = output_string chan digest\n\n let input chan = really_input_string chan hash_length\n\n let to_hex d =\n if String.length d <> hash_length then invalid_arg \"Digest.to_hex\";\n hex_of_string d\n\n let of_hex s =\n if String.length s <> hash_length * 2 then invalid_arg \"Digest.of_hex\";\n string_of_hex s\n\nend\n\nmodule BLAKE128 = BLAKE2(struct let hash_length = 16 end)\nmodule BLAKE256 = BLAKE2(struct let hash_length = 32 end)\nmodule BLAKE512 = BLAKE2(struct let hash_length = 64 end)\n\n(* MD5 hashing *)\n\nmodule MD5 = struct\n\n type t = string\n\n let hash_length = 16\n\n let compare = String.compare\n let equal = String.equal\n\n external unsafe_string: string -> int -> int -> t = \"caml_md5_string\"\n external channel: in_channel -> int -> t = \"caml_md5_chan\"\n\n let string str =\n unsafe_string str 0 (String.length str)\n\n let bytes b = string (Bytes.unsafe_to_string b)\n\n let substring str ofs len =\n if ofs < 0 || len < 0 || ofs > String.length str - len\n then invalid_arg \"Digest.substring\"\n else unsafe_string str ofs len\n\n let subbytes b ofs len = substring (Bytes.unsafe_to_string b) ofs len\n\n let file filename =\n In_channel.with_open_bin filename (fun ic -> channel ic (-1))\n\n let output chan digest = output_string chan digest\n\n let input chan = really_input_string chan 16\n\n let to_hex d =\n if String.length d <> 16 then invalid_arg \"Digest.to_hex\";\n hex_of_string d\n\n let of_hex s =\n if String.length s <> 32 then invalid_arg \"Digest.from_hex\";\n string_of_hex s\n\nend\n\n(* Default exported implementation is MD5 *)\n\ninclude MD5\n\nlet from_hex = of_hex\n"],"names":[],"mappings":"YCqLI,YAA8B,yBAC9B,KAAe,C,EALf,YAA8B,yBAC9B,KAAe,C,EAJA,2BAA2B,C,EAFnB,yBAAyB,C,EAFH,SAAe,C,EAA5D,0BAA6D,C,EAH5B,EAAV,QAAU,aAA0B,WAAQ,C,QAJnE,uDAEK,SAAyB,IADzB,uBACyB,C,EALX,EAAP,QAAO,aAA0B,Q,KAF7C,oBAAuC,C,EAxBvC,8BAA2C,yBAC3C,KAAe,C,EALf,sBAAuC,yBACvC,KAAe,C,EAJA,gCAAoC,C,EAJN,oBAAe,C,EAA5D,yCAA6D,C,aAzB7D,QACU,SAlBI,cAoBd,kBASI,UAAmB,YAEjB,IADQ,QAA0B,OADU,QACV,aAAyB,QAAnD,eACR,GACK,UAEH,EAAW,EADR,QACQ,aAAX,UAA2C,mB,IAAA,GAX/C,IADQ,aAAR,QAAQ,eACR,IACK,YACC,EAAW,EAAZ,QAAY,aAAX,UAA2C,KAclD,C,MAzBH,QAAU,EAAV,QAAU,aAA0B,cAAQ,C,OAL5C,Y,CAAA,c,CAAA,uCACK,yBADL,MAEA,gBAAwC,C,KALxC,OAAO,EAAP,QAAO,aAA0B,U,KAHjC,gCAAsD,C,qEAjBjD,yBACL,mI,QA9B0C,cAD/B,KAA0B,MACK,OADL,gCAAN,OAAd,0CAAN,KAAW,oBAC2C,4B,KANjE,8BAGc,I,GAAA,gBADA,I,EAAA,sBADA,YAGP,uBAA2B,C,KAEpC,2CAAoE,C,KAlBzC,I,GAAA,CADA,OAAzB,QAAyB,uBACuB,C,WAClD,SACA,GAAa,MAJb,EAKA,qBACoB,mCAClB,UAA8B,OAAoB,yBACM,gBAAxD,KAAgC,KAAwB,iCAE1D,2BAA6B,C","ignoreList":[0]}},{"offset":{"line":0,"column":274419},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/bigarray.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Manuel Serrano et Xavier Leroy, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2000 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Module [Bigarray]: large, multi-dimensional, numerical arrays *)\n\n(* These types in must be kept in sync with the tables in\n ../typing/typeopt.ml *)\n\ntype float16_elt = Float16_elt\ntype float32_elt = Float32_elt\ntype float64_elt = Float64_elt\ntype int8_signed_elt = Int8_signed_elt\ntype int8_unsigned_elt = Int8_unsigned_elt\ntype int16_signed_elt = Int16_signed_elt\ntype int16_unsigned_elt = Int16_unsigned_elt\ntype int32_elt = Int32_elt\ntype int64_elt = Int64_elt\ntype int_elt = Int_elt\ntype nativeint_elt = Nativeint_elt\ntype complex32_elt = Complex32_elt\ntype complex64_elt = Complex64_elt\n\n(* Keep the order of these constructors in sync with the caml_ba_kind\n enumeration in bigarray.h *)\n\ntype ('a, 'b) kind =\n | Float32 : (float, float32_elt) kind\n | Float64 : (float, float64_elt) kind\n | Int8_signed : (int, int8_signed_elt) kind\n | Int8_unsigned : (int, int8_unsigned_elt) kind\n | Int16_signed : (int, int16_signed_elt) kind\n | Int16_unsigned : (int, int16_unsigned_elt) kind\n | Int32 : (int32, int32_elt) kind\n | Int64 : (int64, int64_elt) kind\n | Int : (int, int_elt) kind\n | Nativeint : (nativeint, nativeint_elt) kind\n | Complex32 : (Complex.t, complex32_elt) kind\n | Complex64 : (Complex.t, complex64_elt) kind\n | Char : (char, int8_unsigned_elt) kind\n | Float16 : (float, float16_elt) kind\n\ntype c_layout = C_layout_typ\ntype fortran_layout = Fortran_layout_typ (**)\n\ntype 'a layout =\n C_layout: c_layout layout\n | Fortran_layout: fortran_layout layout\n\nlet float16 = Float16\nlet float32 = Float32\nlet float64 = Float64\nlet int8_signed = Int8_signed\nlet int8_unsigned = Int8_unsigned\nlet int16_signed = Int16_signed\nlet int16_unsigned = Int16_unsigned\nlet int32 = Int32\nlet int64 = Int64\nlet int = Int\nlet nativeint = Nativeint\nlet complex32 = Complex32\nlet complex64 = Complex64\nlet char = Char\n\nlet kind_size_in_bytes : type a b. (a, b) kind -> int = function\n | Float16 -> 2\n | Float32 -> 4\n | Float64 -> 8\n | Int8_signed -> 1\n | Int8_unsigned -> 1\n | Int16_signed -> 2\n | Int16_unsigned -> 2\n | Int32 -> 4\n | Int64 -> 8\n | Int -> Sys.word_size / 8\n | Nativeint -> Sys.word_size / 8\n | Complex32 -> 8\n | Complex64 -> 16\n | Char -> 1\n\n(* Keep those constants in sync with the caml_ba_layout enumeration\n in bigarray.h *)\n\nlet c_layout = C_layout\nlet fortran_layout = Fortran_layout\n\nmodule Genarray = struct\n type (!'a, !'b, !'c) t\n external create: ('a, 'b) kind -> 'c layout -> int array -> ('a, 'b, 'c) t\n = \"caml_ba_create\"\n external get: ('a, 'b, 'c) t -> int array -> 'a\n = \"caml_ba_get_generic\"\n external set: ('a, 'b, 'c) t -> int array -> 'a -> unit\n = \"caml_ba_set_generic\"\n\n let rec cloop arr idx f col max =\n if col = Array.length idx then set arr idx (f idx)\n else for j = 0 to pred max.(col) do\n idx.(col) <- j;\n cloop arr idx f (succ col) max\n done\n let rec floop arr idx f col max =\n if col < 0 then set arr idx (f idx)\n else for j = 1 to max.(col) do\n idx.(col) <- j;\n floop arr idx f (pred col) max\n done\n let init (type t) kind (layout : t layout) dims f =\n let arr = create kind layout dims in\n let dlen = Array.length dims in\n match layout with\n | C_layout -> cloop arr (Array.make dlen 0) f 0 dims; arr\n | Fortran_layout -> floop arr (Array.make dlen 1) f (pred dlen) dims; arr\n\n external num_dims: ('a, 'b, 'c) t -> int = \"caml_ba_num_dims\"\n external nth_dim: ('a, 'b, 'c) t -> int -> int = \"caml_ba_dim\"\n let dims a =\n let n = num_dims a in\n let d = Array.make n 0 in\n for i = 0 to n-1 do d.(i) <- nth_dim a i done;\n d\n\n external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = \"caml_ba_kind\"\n external layout: ('a, 'b, 'c) t -> 'c layout = \"caml_ba_layout\"\n external change_layout: ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) t\n = \"caml_ba_change_layout\"\n\n let size_in_bytes arr =\n (kind_size_in_bytes (kind arr)) * (Array.fold_left ( * ) 1 (dims arr))\n\n external sub_left: ('a, 'b, c_layout) t -> int -> int -> ('a, 'b, c_layout) t\n = \"caml_ba_sub\"\n external sub_right: ('a, 'b, fortran_layout) t -> int -> int ->\n ('a, 'b, fortran_layout) t\n = \"caml_ba_sub\"\n external slice_left: ('a, 'b, c_layout) t -> int array ->\n ('a, 'b, c_layout) t\n = \"caml_ba_slice\"\n external slice_right: ('a, 'b, fortran_layout) t -> int array ->\n ('a, 'b, fortran_layout) t\n = \"caml_ba_slice\"\n external blit: ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit\n = \"caml_ba_blit\"\n external fill: ('a, 'b, 'c) t -> 'a -> unit = \"caml_ba_fill\"\nend\n\nmodule Array0 = struct\n type (!'a, !'b, !'c) t = ('a, 'b, 'c) Genarray.t\n let create kind layout =\n Genarray.create kind layout [||]\n let get arr = Genarray.get arr [||]\n let set arr = Genarray.set arr [||]\n external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = \"caml_ba_kind\"\n external layout: ('a, 'b, 'c) t -> 'c layout = \"caml_ba_layout\"\n\n external change_layout: ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) t\n = \"caml_ba_change_layout\"\n\n let size_in_bytes arr = kind_size_in_bytes (kind arr)\n\n external blit: ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit = \"caml_ba_blit\"\n external fill: ('a, 'b, 'c) t -> 'a -> unit = \"caml_ba_fill\"\n\n let of_value kind layout v =\n let a = create kind layout in\n set a v;\n a\n let init = of_value\nend\n\nmodule Array1 = struct\n type (!'a, !'b, !'c) t = ('a, 'b, 'c) Genarray.t\n let create kind layout dim =\n Genarray.create kind layout [|dim|]\n external get: ('a, 'b, 'c) t -> int -> 'a = \"%caml_ba_ref_1\"\n external set: ('a, 'b, 'c) t -> int -> 'a -> unit = \"%caml_ba_set_1\"\n external unsafe_get: ('a, 'b, 'c) t -> int -> 'a = \"%caml_ba_unsafe_ref_1\"\n external unsafe_set: ('a, 'b, 'c) t -> int -> 'a -> unit\n = \"%caml_ba_unsafe_set_1\"\n external dim: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_1\"\n external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = \"caml_ba_kind\"\n external layout: ('a, 'b, 'c) t -> 'c layout = \"caml_ba_layout\"\n\n external change_layout: ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) t\n = \"caml_ba_change_layout\"\n\n let size_in_bytes arr =\n (kind_size_in_bytes (kind arr)) * (dim arr)\n\n external sub: ('a, 'b, 'c) t -> int -> int -> ('a, 'b, 'c) t = \"caml_ba_sub\"\n let slice (type t) (a : (_, _, t) Genarray.t) n =\n match layout a with\n | C_layout -> (Genarray.slice_left a [|n|] : (_, _, t) Genarray.t)\n | Fortran_layout -> (Genarray.slice_right a [|n|]: (_, _, t) Genarray.t)\n external blit: ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit = \"caml_ba_blit\"\n external fill: ('a, 'b, 'c) t -> 'a -> unit = \"caml_ba_fill\"\n let c_init arr dim f =\n for i = 0 to pred dim do unsafe_set arr i (f i) done\n let fortran_init arr dim f =\n for i = 1 to dim do unsafe_set arr i (f i) done\n let init (type t) kind (layout : t layout) dim f =\n let arr = create kind layout dim in\n match layout with\n | C_layout -> c_init arr dim f; arr\n | Fortran_layout -> fortran_init arr dim f; arr\n let of_array (type t) kind (layout: t layout) data =\n let ba = create kind layout (Array.length data) in\n let ofs =\n match layout with\n C_layout -> 0\n | Fortran_layout -> 1\n in\n for i = 0 to Array.length data - 1 do unsafe_set ba (i + ofs) data.(i) done;\n ba\nend\n\nmodule Array2 = struct\n type (!'a, !'b, !'c) t = ('a, 'b, 'c) Genarray.t\n let create kind layout dim1 dim2 =\n Genarray.create kind layout [|dim1; dim2|]\n external get: ('a, 'b, 'c) t -> int -> int -> 'a = \"%caml_ba_ref_2\"\n external set: ('a, 'b, 'c) t -> int -> int -> 'a -> unit = \"%caml_ba_set_2\"\n external unsafe_get: ('a, 'b, 'c) t -> int -> int -> 'a\n = \"%caml_ba_unsafe_ref_2\"\n external unsafe_set: ('a, 'b, 'c) t -> int -> int -> 'a -> unit\n = \"%caml_ba_unsafe_set_2\"\n external dim1: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_1\"\n external dim2: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_2\"\n external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = \"caml_ba_kind\"\n external layout: ('a, 'b, 'c) t -> 'c layout = \"caml_ba_layout\"\n\n external change_layout: ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) t\n = \"caml_ba_change_layout\"\n\n let size_in_bytes arr =\n (kind_size_in_bytes (kind arr)) * (dim1 arr) * (dim2 arr)\n\n external sub_left: ('a, 'b, c_layout) t -> int -> int -> ('a, 'b, c_layout) t\n = \"caml_ba_sub\"\n external sub_right:\n ('a, 'b, fortran_layout) t -> int -> int -> ('a, 'b, fortran_layout) t\n = \"caml_ba_sub\"\n let slice_left a n = Genarray.slice_left a [|n|]\n let slice_right a n = Genarray.slice_right a [|n|]\n external blit: ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit = \"caml_ba_blit\"\n external fill: ('a, 'b, 'c) t -> 'a -> unit = \"caml_ba_fill\"\n let c_init arr dim1 dim2 f =\n for i = 0 to pred dim1 do\n for j = 0 to pred dim2 do\n unsafe_set arr i j (f i j)\n done\n done\n let fortran_init arr dim1 dim2 f =\n for j = 1 to dim2 do\n for i = 1 to dim1 do\n unsafe_set arr i j (f i j)\n done\n done\n let init (type t) kind (layout : t layout) dim1 dim2 f =\n let arr = create kind layout dim1 dim2 in\n match layout with\n | C_layout -> c_init arr dim1 dim2 f; arr\n | Fortran_layout -> fortran_init arr dim1 dim2 f; arr\n let of_array (type t) kind (layout: t layout) data =\n let dim1 = Array.length data in\n let dim2 = if dim1 = 0 then 0 else Array.length data.(0) in\n let ba = create kind layout dim1 dim2 in\n let ofs =\n match layout with\n C_layout -> 0\n | Fortran_layout -> 1\n in\n for i = 0 to dim1 - 1 do\n let row = data.(i) in\n if Array.length row <> dim2 then\n invalid_arg(\"Bigarray.Array2.of_array: non-rectangular data\");\n for j = 0 to dim2 - 1 do\n unsafe_set ba (i + ofs) (j + ofs) row.(j)\n done\n done;\n ba\nend\n\nmodule Array3 = struct\n type (!'a, !'b, !'c) t = ('a, 'b, 'c) Genarray.t\n let create kind layout dim1 dim2 dim3 =\n Genarray.create kind layout [|dim1; dim2; dim3|]\n external get: ('a, 'b, 'c) t -> int -> int -> int -> 'a = \"%caml_ba_ref_3\"\n external set: ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit\n = \"%caml_ba_set_3\"\n external unsafe_get: ('a, 'b, 'c) t -> int -> int -> int -> 'a\n = \"%caml_ba_unsafe_ref_3\"\n external unsafe_set: ('a, 'b, 'c) t -> int -> int -> int -> 'a -> unit\n = \"%caml_ba_unsafe_set_3\"\n external dim1: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_1\"\n external dim2: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_2\"\n external dim3: ('a, 'b, 'c) t -> int = \"%caml_ba_dim_3\"\n external kind: ('a, 'b, 'c) t -> ('a, 'b) kind = \"caml_ba_kind\"\n external layout: ('a, 'b, 'c) t -> 'c layout = \"caml_ba_layout\"\n\n external change_layout: ('a, 'b, 'c) t -> 'd layout -> ('a, 'b, 'd) t\n = \"caml_ba_change_layout\"\n\n let size_in_bytes arr =\n (kind_size_in_bytes (kind arr)) * (dim1 arr) * (dim2 arr) * (dim3 arr)\n\n external sub_left: ('a, 'b, c_layout) t -> int -> int -> ('a, 'b, c_layout) t\n = \"caml_ba_sub\"\n external sub_right:\n ('a, 'b, fortran_layout) t -> int -> int -> ('a, 'b, fortran_layout) t\n = \"caml_ba_sub\"\n let slice_left_1 a n m = Genarray.slice_left a [|n; m|]\n let slice_right_1 a n m = Genarray.slice_right a [|n; m|]\n let slice_left_2 a n = Genarray.slice_left a [|n|]\n let slice_right_2 a n = Genarray.slice_right a [|n|]\n external blit: ('a, 'b, 'c) t -> ('a, 'b, 'c) t -> unit = \"caml_ba_blit\"\n external fill: ('a, 'b, 'c) t -> 'a -> unit = \"caml_ba_fill\"\n let c_init arr dim1 dim2 dim3 f =\n for i = 0 to pred dim1 do\n for j = 0 to pred dim2 do\n for k = 0 to pred dim3 do\n unsafe_set arr i j k (f i j k)\n done\n done\n done\n let fortran_init arr dim1 dim2 dim3 f =\n for k = 1 to dim3 do\n for j = 1 to dim2 do\n for i = 1 to dim1 do\n unsafe_set arr i j k (f i j k)\n done\n done\n done\n let init (type t) kind (layout : t layout) dim1 dim2 dim3 f =\n let arr = create kind layout dim1 dim2 dim3 in\n match layout with\n | C_layout -> c_init arr dim1 dim2 dim3 f; arr\n | Fortran_layout -> fortran_init arr dim1 dim2 dim3 f; arr\n let of_array (type t) kind (layout: t layout) data =\n let dim1 = Array.length data in\n let dim2 = if dim1 = 0 then 0 else Array.length data.(0) in\n let dim3 = if dim2 = 0 then 0 else Array.length data.(0).(0) in\n let ba = create kind layout dim1 dim2 dim3 in\n let ofs =\n match layout with\n C_layout -> 0\n | Fortran_layout -> 1\n in\n for i = 0 to dim1 - 1 do\n let row = data.(i) in\n if Array.length row <> dim2 then\n invalid_arg(\"Bigarray.Array3.of_array: non-cubic data\");\n for j = 0 to dim2 - 1 do\n let col = row.(j) in\n if Array.length col <> dim3 then\n invalid_arg(\"Bigarray.Array3.of_array: non-cubic data\");\n for k = 0 to dim3 - 1 do\n unsafe_set ba (i + ofs) (j + ofs) (k + ofs) col.(k)\n done\n done\n done;\n ba\nend\n\nexternal genarray_of_array0: ('a, 'b, 'c) Array0.t -> ('a, 'b, 'c) Genarray.t\n = \"%identity\"\nexternal genarray_of_array1: ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Genarray.t\n = \"%identity\"\nexternal genarray_of_array2: ('a, 'b, 'c) Array2.t -> ('a, 'b, 'c) Genarray.t\n = \"%identity\"\nexternal genarray_of_array3: ('a, 'b, 'c) Array3.t -> ('a, 'b, 'c) Genarray.t\n = \"%identity\"\nlet array0_of_genarray a =\n if Genarray.num_dims a = 0 then a\n else invalid_arg \"Bigarray.array0_of_genarray\"\nlet array1_of_genarray a =\n if Genarray.num_dims a = 1 then a\n else invalid_arg \"Bigarray.array1_of_genarray\"\nlet array2_of_genarray a =\n if Genarray.num_dims a = 2 then a\n else invalid_arg \"Bigarray.array2_of_genarray\"\nlet array3_of_genarray a =\n if Genarray.num_dims a = 3 then a\n else invalid_arg \"Bigarray.array3_of_genarray\"\n\nexternal reshape:\n ('a, 'b, 'c) Genarray.t -> int array -> ('a, 'b, 'c) Genarray.t\n = \"caml_ba_reshape\"\nlet reshape_0 a = reshape a [||]\nlet reshape_1 a dim1 = reshape a [|dim1|]\nlet reshape_2 a dim1 dim2 = reshape a [|dim1;dim2|]\nlet reshape_3 a dim1 dim2 dim3 = reshape a [|dim1;dim2;dim3|]\n\n(* Force caml_ba_get_{1,2,3,N} to be linked in, since we don't refer\n to those primitives directly in this file *)\n\nlet _ =\n let _ = Genarray.get in\n let _ = Array1.get in\n let _ = Array2.get in\n let _ = Array3.get in\n ()\n\n[@@@ocaml.warning \"-32\"]\nexternal get1: unit -> unit = \"caml_ba_get_1\"\nexternal get2: unit -> unit = \"caml_ba_get_2\"\nexternal get3: unit -> unit = \"caml_ba_get_3\"\nexternal set1: unit -> unit = \"caml_ba_set_1\"\nexternal set2: unit -> unit = \"caml_ba_set_2\"\nexternal set3: unit -> unit = \"caml_ba_set_3\"\n"],"names":[],"mappings":"sBCkZiC,mBAA4B,C,EADjC,iBAAuB,C,EAD5B,eAAkB,C,EADvB,aAAc,C,EANR,IAAnB,KAAmB,IAAU,GAC3B,wBAAyC,C,EAJxB,IAAnB,KAAmB,IAAU,GAC3B,wBAAyC,C,EAJxB,IAAnB,KAAmB,IAAU,GAC3B,wBAAyC,C,EAJxB,IAAnB,KAAmB,IAAU,GAC3B,wBAAyC,C,UAnC5C,W,CAAA,yBACA,EAAgD,cAAQ,KAAR,OAAQ,E,CAAA,wBAA5B,GAC5B,IAAgD,iCAAY,KAAZ,OAAY,E,CAAA,wBAAhC,G,EACnB,yBAMT,eALA,QAGsB,EAEtB,MACY,uBACV,KADU,kBACV,E,CAAA,4BACE,yBACF,qBACY,uBACV,KADU,kBACV,E,CAAA,4BACE,yBACF,qBAC8C,O,CAAA,kCAA5C,EAAmD,KAAnD,EAAmD,KAAnD,EAAmD,KAAnD,EAA4C,kB,CAAA,gCAA5C,IAAmD,2EAIzD,OAAE,C,KA3BQ,mBACV,UAjBA,sBACE,0BACE,0BACE,cAAqB,iBAArB,IAA8B,2EAeK,GAVzC,kBACE,kBACE,kBACE,cAAqB,iBAArB,IAA8B,kEAQiB,GAAK,C,EAvBpC,eAA4B,C,EAF1B,iBAA+B,C,OARK,OAAb,OAAb,OAAd,KAApB,OAA+B,mCAAuC,C,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ACzB,mCACA,MADc,OACd,OAA8B,+BAC5B,C,EApCT,oCAaa,gDACJ,C,GAmUX,sP","ignoreList":[0]}},{"offset":{"line":0,"column":279209},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/random.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* Xavier Leroy, projet Cambium, College de France and Inria *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Pseudo-random number generator *)\n\nexternal random_seed: unit -> int array = \"caml_sys_random_seed\"\n\nmodule State = struct\n\n open Bigarray\n\n type t = (int64, int64_elt, c_layout) Array1.t\n\n external next: t -> (int64[@unboxed])\n = \"caml_lxm_next\" \"caml_lxm_next_unboxed\" [@@noalloc]\n\n let create () : t =\n Array1.create Int64 C_layout 4\n\n let set s i1 i2 i3 i4 =\n Array1.unsafe_set s 0 (Int64.logor i1 1L); (* must be odd *)\n Array1.unsafe_set s 1 i2;\n Array1.unsafe_set s 2 (if i3 <> 0L then i3 else 1L); (* must not be 0 *)\n Array1.unsafe_set s 3 (if i4 <> 0L then i4 else 2L) (* must not be 0 *)\n\n let mk i1 i2 i3 i4 =\n let s = create () in\n set s i1 i2 i3 i4; s\n\n let serialization_prefix =\n \"lxm1:\"\n (* \"lxm\" denotes the algorithm currently in use, and '1' is\n a version number. We should update this prefix if we change\n the Random algorithm or the serialization format, so that users\n get a clean error instead of believing that they faithfully\n reproduce their previous state and in fact get a different\n stream.\n\n Note that there is no constraint to keep the same\n \"<name><ver>:<data>\" format or message size in future versions,\n we could change the format completely if we wanted as long\n as there is no confusion possible with the previous formats. *)\n\n let serialization_prefix_len =\n String.length serialization_prefix\n\n let to_binary_string s =\n let prefix = serialization_prefix in\n let preflen = serialization_prefix_len in\n let buf = Bytes.create (preflen + 4 * 8) in\n Bytes.blit_string prefix 0 buf 0 preflen;\n for i = 0 to 3 do\n Bytes.set_int64_le buf (preflen + i * 8) (Array1.get s i)\n done;\n Bytes.unsafe_to_string buf\n\n let of_binary_string buf =\n let prefix = serialization_prefix in\n let preflen = serialization_prefix_len in\n if String.length buf <> preflen + 4 * 8\n || not (String.starts_with ~prefix buf)\n then\n failwith\n (\"Random.State.of_binary_string: expected a format \\\n compatible with OCaml \" ^ Sys.ocaml_version);\n let i1 = String.get_int64_le buf (preflen + 0 * 8) in\n let i2 = String.get_int64_le buf (preflen + 1 * 8) in\n let i3 = String.get_int64_le buf (preflen + 2 * 8) in\n let i4 = String.get_int64_le buf (preflen + 3 * 8) in\n mk i1 i2 i3 i4\n\n let assign (dst: t) (src: t) =\n Array1.blit src dst\n\n let copy s =\n let s' = create() in assign s' s; s'\n\n (* The seed is an array of integers. It can be just one integer,\n but it can also be 12 or more bytes. To hide the difference,\n we serialize the array as a sequence of bytes, then hash the\n sequence with MD5 (Digest.bytes). MD5 gives only 128 bits while\n we need 256 bits, so we hash twice with different suffixes. *)\n let reinit s seed =\n let n = Array.length seed in\n let b = Bytes.create (n * 8 + 1) in\n for i = 0 to n-1 do\n Bytes.set_int64_le b (i * 8) (Int64.of_int seed.(i))\n done;\n Bytes.set b (n * 8) '\\x01';\n let d1 = Digest.bytes b in\n Bytes.set b (n * 8) '\\x02';\n let d2 = Digest.bytes b in\n set s (String.get_int64_le d1 0)\n (String.get_int64_le d1 8)\n (String.get_int64_le d2 0)\n (String.get_int64_le d2 8)\n\n let make seed =\n let s = create() in reinit s seed; s\n\n let make_self_init () =\n make (random_seed ())\n\n let min_int31 = -0x4000_0000\n (* = -2{^30}, which is [min_int] for 31-bit integers *)\n let max_int31 = 0x3FFF_FFFF\n (* = 2{^30}-1, which is [max_int] for 31-bit integers *)\n (* avoid integer literals for these, 32-bit OCaml would reject them: *)\n let min_int32 = -(1 lsl 31)\n (* = -0x8000_0000 on platforms where [Sys.int_size >= 32] *)\n let max_int32 = (1 lsl 31) - 1\n (* = 0x7FFF_FFFF on platforms where [Sys.int_size >= 32] *)\n\n (* Return 30 random bits as an integer 0 <= x < 2^30 *)\n let bits s =\n Int64.to_int (next s) land max_int31\n\n (* Return an integer between 0 (included) and [n] (excluded).\n [bound] may be any positive [int]. [mask] must be of the form [2{^i}-1]\n and greater or equal to [n]. Larger values of [mask] make the function\n run faster (fewer samples are rejected). Smaller values of [mask]\n are usable on a wider range of OCaml implementations. *)\n let rec int_aux s n mask =\n (* We start by drawing a non-negative integer in the [ [0, mask] ] range *)\n let r = Int64.to_int (next s) land mask in\n let v = r mod n in\n (* For uniform distribution of the result between 0 included and [n]\n * excluded, the random number [r] must have been drawn uniformly in\n * an interval whose length is a multiple of [n]. To achieve this,\n * we use rejection sampling on the greatest interval [ [0, k*n-1] ]\n * that fits in [ [0, mask] ]. That is, we reject the\n * sample if it falls outside of this interval, and draw again.\n * This is what the test below does, while carefuly avoiding\n * overflows and sparing a division [mask / n]. *)\n if r - v > mask - n + 1 then int_aux s n mask else v\n\n (* Return an integer between 0 (included) and [bound] (excluded).\n The bound must fit in 31-bit signed integers.\n This function yields the same output regardless of the integer size. *)\n let int s bound =\n if bound > max_int31 || bound <= 0\n then invalid_arg \"Random.int\"\n else int_aux s bound max_int31\n\n (* Return an integer between 0 (included) and [bound] (excluded).\n [bound] may be any positive [int]. *)\n let full_int s bound =\n if bound <= 0 then\n invalid_arg \"Random.full_int\"\n (* When the bound fits in 31-bit signed integers, we use the same mask\n as in function [int] so as to yield the same output on all platforms\n supported by OCaml (32-bit OCaml, 64-bit OCaml, and JavaScript).\n When the bound fits in 32-bit signed integers, we use [max_int32]\n as the mask so as to yield the same output on all platforms where\n [Sys.int_size >= 32] (i.e. JavaScript and 64-bit OCaml). *)\n else\n int_aux s bound\n (if bound <= max_int31 then max_int31\n else if bound <= max_int32 then max_int32\n else max_int)\n\n (* Return an integer between [min] (included) and [max] (included).\n The [nbits] parameter is the size in bits of the signed integers\n we draw from [s].\n We must have [-2{^nbits - 1} <= min <= max < 2{^nbits - 1}].\n Moreover, for the iteration to converge quickly, the interval\n [[min, max]] should have width at least [2{^nbits - 1}].\n As the width approaches this lower limit, the average number of\n draws approaches 2, with a quite high standard deviation (2 + epsilon). *)\n let rec int_in_large_range s ~min ~max ~nbits =\n let drop = Sys.int_size - nbits in\n (* The bitshifts replicate the [nbits]-th bit (sign bit) to higher bits: *)\n let r = ((Int64.to_int (next s)) lsl drop) asr drop in\n if r < min || r > max then int_in_large_range s ~min ~max ~nbits else r\n\n (* Return an integer between [min] (included) and [max] (included).\n [mask] is as described for [int_aux].\n [nbits] is as described for [int_in_large_range]. *)\n let int_in_range_aux s ~min ~max ~mask ~nbits =\n let span = max - min + 1 in\n if span <= mask (* [span] is small enough *)\n && span > 0 (* no overflow occurred when computing [span] *)\n then\n (* Just draw a number in [[0, span)] and shift it by [min]. *)\n min + int_aux s span mask\n else\n (* Span too large, use the alternative drawing method. *)\n int_in_large_range s ~min ~max ~nbits\n\n (* Return an integer between [min] (included) and [max] (included).\n We must have [min <= max]. *)\n let int_in_range s ~min ~max =\n if min > max then\n invalid_arg \"Random.int_in_range\";\n (* When both bounds fit in 31-bit signed integers, we use parameters\n [mask] and [nbits] appropriate for 31-bit integers, so as to\n yield the same output on all platforms supported by OCaml.\n When both bounds fit in 32-bit signed integers, we use parameters\n [mask] and [nbits] appropriate for 32-bit integers, so as to\n yield the same output on JavaScript and on 64-bit OCaml. *)\n if min >= min_int31 && max <= max_int31 then\n int_in_range_aux s ~min ~max ~mask:max_int31 ~nbits:31\n else if min >= min_int32 && max <= max_int32 then\n int_in_range_aux s ~min ~max ~mask:max_int32 ~nbits:32\n else\n int_in_range_aux s ~min ~max ~mask:max_int ~nbits:Sys.int_size\n\n (* Return 32 random bits as an [int32] *)\n let bits32 s =\n Int64.to_int32 (next s)\n\n (* Return an [int32] between 0 (included) and [bound] (excluded). *)\n let rec int32aux s n =\n let r = Int32.shift_right_logical (bits32 s) 1 in\n let v = Int32.rem r n in\n (* Explanation of this test: see comment in [int_aux]. *)\n if Int32.(sub r v > add (sub max_int n) 1l)\n then int32aux s n\n else v\n\n let int32 s bound =\n if bound <= 0l\n then invalid_arg \"Random.int32\"\n else int32aux s bound\n\n (* Return an [int32] between [min] (included) and [max] (included).\n We must have [min <= max]. *)\n let rec int32_in_range_aux s ~min ~max =\n let r = Int64.to_int32 (next s) in\n if r < min || r > max then int32_in_range_aux s ~min ~max else r\n\n let int32_in_range s ~min ~max =\n if min > max then\n invalid_arg \"Random.int32_in_range\"\n else\n let span = Int32.succ (Int32.sub max min) in\n (* Explanation of this test: see comment in [int_in_range_aux]. *)\n if span <= Int32.zero then\n int32_in_range_aux s ~min ~max\n else\n Int32.add min (int32aux s span)\n\n (* Return 64 random bits as an [int64] *)\n let bits64 s =\n next s\n\n (* Return an [int64] between 0 (included) and [bound] (excluded). *)\n let rec int64aux s n =\n let r = Int64.shift_right_logical (bits64 s) 1 in\n let v = Int64.rem r n in\n (* Explanation of this test: see comment in [int_aux]. *)\n if Int64.(sub r v > add (sub max_int n) 1L)\n then int64aux s n\n else v\n\n let int64 s bound =\n if bound <= 0L\n then invalid_arg \"Random.int64\"\n else int64aux s bound\n\n (* Return an [int64] between [min] (included) and [max] (included).\n We must have [min <= max]. *)\n let rec int64_in_range_aux s ~min ~max =\n let r = next s in\n if r < min || r > max then int64_in_range_aux s ~min ~max else r\n\n let int64_in_range s ~min ~max =\n if min > max then\n invalid_arg \"Random.int64_in_range\"\n else\n let span = Int64.succ (Int64.sub max min) in\n (* Explanation of this test: see comment in [int_in_range_aux]. *)\n if span <= Int64.zero then\n int64_in_range_aux s ~min ~max\n else\n Int64.add min (int64aux s span)\n\n (* Return 32 or 64 random bits as a [nativeint] *)\n let nativebits =\n if Nativeint.size = 32\n then fun s -> Nativeint.of_int32 (bits32 s)\n else fun s -> Int64.to_nativeint (bits64 s)\n\n (* Return a [nativeint] between 0 (included) and [bound] (excluded). *)\n let nativeint =\n if Nativeint.size = 32\n then fun s bound -> Nativeint.of_int32 (int32 s (Nativeint.to_int32 bound))\n else fun s bound -> Int64.to_nativeint (int64 s (Int64.of_nativeint bound))\n\n (* Return a [nativeint] between [min] (included) and [max] (included). *)\n let nativeint_in_range =\n if Nativeint.size = 32\n then fun s ~min ~max ->\n Nativeint.of_int32 (int32_in_range s\n ~min:(Nativeint.to_int32 min) ~max:(Nativeint.to_int32 max))\n else fun s ~min ~max ->\n Int64.to_nativeint (int64_in_range s\n ~min:(Int64.of_nativeint min) ~max:(Int64.of_nativeint max))\n\n (* Return a float 0 < x < 1 uniformly distributed among the\n multiples of 2^-53 *)\n let rec rawfloat s =\n let b = next s in\n let n = Int64.shift_right_logical b 11 in\n if n <> 0L then Int64.to_float n *. 0x1.p-53 else rawfloat s\n\n (* Return a float between 0 and [bound] *)\n let float s bound = rawfloat s *. bound\n\n (* Return a random Boolean *)\n let bool s = next s < 0L\n\n (* Split a new PRNG off the given PRNG *)\n let split s =\n let i1 = bits64 s in let i2 = bits64 s in\n let i3 = bits64 s in let i4 = bits64 s in\n mk i1 i2 i3 i4\nend\n\nlet mk_default () =\n (* This is the state obtained with [State.make [| 314159265 |]]. *)\n State.mk (-6196874289567705097L)\n 586573249833713189L\n (-8591268803865043407L)\n 6388613595849772044L\n\nlet random_key =\n Domain.DLS.new_key ~split_from_parent:State.split mk_default\n\nlet bits () = State.bits (Domain.DLS.get random_key)\nlet int bound = State.int (Domain.DLS.get random_key) bound\nlet full_int bound = State.full_int (Domain.DLS.get random_key) bound\nlet int_in_range ~min ~max =\n State.int_in_range (Domain.DLS.get random_key) ~min ~max\nlet int32 bound = State.int32 (Domain.DLS.get random_key) bound\nlet int32_in_range ~min ~max =\n State.int32_in_range (Domain.DLS.get random_key) ~min ~max\nlet nativeint bound = State.nativeint (Domain.DLS.get random_key) bound\nlet nativeint_in_range ~min ~max =\n State.nativeint_in_range (Domain.DLS.get random_key) ~min ~max\nlet int64 bound = State.int64 (Domain.DLS.get random_key) bound\nlet int64_in_range ~min ~max =\n State.int64_in_range (Domain.DLS.get random_key) ~min ~max\nlet float scale = State.float (Domain.DLS.get random_key) scale\nlet bool () = State.bool (Domain.DLS.get random_key)\nlet bits32 () = State.bits32 (Domain.DLS.get random_key)\nlet bits64 () = State.bits64 (Domain.DLS.get random_key)\nlet nativebits () = State.nativebits (Domain.DLS.get random_key)\n\nlet full_init seed = State.reinit (Domain.DLS.get random_key) seed\nlet init seed = full_init [| seed |]\nlet self_init () = full_init (random_seed())\n\n(* Splitting *)\n\nlet split () = State.split (Domain.DLS.get random_key)\n\n(* Manipulating the current state. *)\n\nlet get_state () = State.copy (Domain.DLS.get random_key)\nlet set_state s = State.assign (Domain.DLS.get random_key) s\n","(* generated code *)"],"names":[],"mappings":"OAwRO,OAAS,IACV,wBAEsB,0BAAmB,QAA9B,eAA8B,QAEtC,EAAkB,QATf,YACL,IAAO,EAAI,OAAO,EAA0C,IAW3D,EAAc,eAAd,gBAA+B,C,EAnBhC,OAAW,EACT,wBACA,Q,CAAgB,C,QAVrB,IAJA,KAIQ,KACA,iBAER,QAAwB,eAAJ,GAAV,EAFF,O,GAAA,EAEE,MAAgC,EAErC,QAAC,C,EATN,UAAM,C,OAZH,OAAS,IACV,wBAEsB,0BAAmB,QAA9B,eAA8B,QAEtC,EAAkB,QATf,EAAe,KAAf,MACL,IAAO,EAAI,OAAO,EAA0C,IAW3D,EAAc,eAAd,gBAA+B,C,EAnBhC,OAAW,EACT,wBACA,Q,CAAgB,C,QAVrB,IAAkC,SAA1B,aACA,iBAER,QAAwB,eAAJ,GAAV,EAFF,O,GAAA,EAEE,MAAgC,EAErC,QAAC,C,EATN,EAAe,KAAf,IAAuB,C,MAjBvB,iBACE,yBAOF,oCACE,0BACG,0BACH,sBAEA,0BAA8D,C,QA1BhE,iBACA,wB,CAAA,EAIQ,WAAmB,SAd3B,uBAEuB,KAAQ,eAC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{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/hashtbl.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Hash tables *)\n\n(* We do dynamic hashing, and resize the table and rehash the elements\n when the load factor becomes too high. *)\n\ntype ('a, 'b) t =\n { mutable size: int; (* number of entries *)\n mutable data: ('a, 'b) bucketlist array; (* the buckets *)\n seed: int; (* for randomization *)\n mutable initial_size: int; (* initial array size *)\n }\n\nand ('a, 'b) bucketlist =\n Empty\n | Cons of { mutable key: 'a;\n mutable data: 'b;\n mutable next: ('a, 'b) bucketlist }\n\n(* The sign of initial_size encodes the fact that a traversal is\n ongoing or not.\n\n This disables the efficient in place implementation of resizing.\n*)\n\nlet ongoing_traversal h =\n Obj.size (Obj.repr h) < 4 (* compatibility with old hash tables *)\n || h.initial_size < 0\n\nlet flip_ongoing_traversal h =\n h.initial_size <- - h.initial_size\n\n(* To pick random seeds if requested *)\n\nlet randomized_default =\n let params =\n try Sys.getenv \"OCAMLRUNPARAM\" with Not_found ->\n try Sys.getenv \"CAMLRUNPARAM\" with Not_found -> \"\" in\n String.contains params 'R'\n\nlet randomized = Atomic.make randomized_default\n\nlet randomize () = Atomic.set randomized true\nlet is_randomized () = Atomic.get randomized\n\nlet prng_key = Domain.DLS.new_key Random.State.make_self_init\n\n(* Functions which appear before the functorial interface must either be\n independent of the hash function or take it as a parameter (see #2202 and\n code below the functor definitions. *)\n\n(* Creating a fresh, empty table *)\n\nlet rec power_2_above x n =\n if x >= n then x\n else if x * 2 > Sys.max_array_length then x\n else power_2_above (x * 2) n\n\nlet create ?(random = Atomic.get randomized) initial_size =\n let s = power_2_above 16 initial_size in\n let seed =\n if random then Random.State.bits (Domain.DLS.get prng_key) else 0\n in\n { initial_size = s; size = 0; seed = seed; data = Array.make s Empty }\n\nlet clear h =\n if h.size > 0 then begin\n h.size <- 0;\n Array.fill h.data 0 (Array.length h.data) Empty\n end\n\nlet reset h =\n let len = Array.length h.data in\n if Obj.size (Obj.repr h) < 4 (* compatibility with old hash tables *)\n || len = abs h.initial_size then\n clear h\n else begin\n h.size <- 0;\n h.data <- Array.make (abs h.initial_size) Empty\n end\n\nlet copy_bucketlist = function\n | Empty -> Empty\n | Cons {key; data; next} ->\n let rec loop prec = function\n | Empty -> ()\n | Cons {key; data; next} ->\n let r = Cons {key; data; next} in\n begin match prec with\n | Empty -> assert false\n | Cons prec -> prec.next <- r\n end;\n loop r next\n in\n let r = Cons {key; data; next} in\n loop r next;\n r\n\nlet copy h = { h with data = Array.map copy_bucketlist h.data }\n\nlet length h = h.size\n\nlet insert_all_buckets indexfun inplace odata ndata =\n let nsize = Array.length ndata in\n let ndata_tail = Array.make nsize Empty in\n let rec insert_bucket = function\n | Empty -> ()\n | Cons {key; data; next} as cell ->\n let cell =\n if inplace then cell\n else Cons {key; data; next = Empty}\n in\n let nidx = indexfun key in\n begin match ndata_tail.(nidx) with\n | Empty -> ndata.(nidx) <- cell;\n | Cons tail -> tail.next <- cell;\n end;\n ndata_tail.(nidx) <- cell;\n insert_bucket next\n in\n for i = 0 to Array.length odata - 1 do\n insert_bucket odata.(i)\n done;\n if inplace then\n for i = 0 to nsize - 1 do\n match ndata_tail.(i) with\n | Empty -> ()\n | Cons tail -> tail.next <- Empty\n done\n\nlet resize indexfun h =\n let odata = h.data in\n let osize = Array.length odata in\n let nsize = osize * 2 in\n if nsize < Sys.max_array_length then begin\n let ndata = Array.make nsize Empty in\n let inplace = not (ongoing_traversal h) in\n h.data <- ndata; (* so that indexfun sees the new bucket count *)\n insert_all_buckets (indexfun h) inplace odata ndata\n end\n\nlet iter f h =\n let rec do_bucket = function\n | Empty ->\n ()\n | Cons{key; data; next} ->\n f key data; do_bucket next in\n let old_trav = ongoing_traversal h in\n if not old_trav then flip_ongoing_traversal h;\n try\n let d = h.data in\n for i = 0 to Array.length d - 1 do\n do_bucket d.(i)\n done;\n if not old_trav then flip_ongoing_traversal h;\n with exn when not old_trav ->\n flip_ongoing_traversal h;\n raise exn\n\nlet rec filter_map_inplace_bucket f h i prec = function\n | Empty ->\n begin match prec with\n | Empty -> h.data.(i) <- Empty\n | Cons c -> c.next <- Empty\n end\n | (Cons ({key; data; next} as c)) as slot ->\n begin match f key data with\n | None ->\n h.size <- h.size - 1;\n filter_map_inplace_bucket f h i prec next\n | Some data ->\n begin match prec with\n | Empty -> h.data.(i) <- slot\n | Cons c -> c.next <- slot\n end;\n c.data <- data;\n filter_map_inplace_bucket f h i slot next\n end\n\nlet filter_map_inplace f h =\n let d = h.data in\n let old_trav = ongoing_traversal h in\n if not old_trav then flip_ongoing_traversal h;\n try\n for i = 0 to Array.length d - 1 do\n filter_map_inplace_bucket f h i Empty h.data.(i)\n done;\n if not old_trav then flip_ongoing_traversal h\n with exn when not old_trav ->\n flip_ongoing_traversal h;\n raise exn\n\nlet fold f h init =\n let rec do_bucket b accu =\n match b with\n Empty ->\n accu\n | Cons{key; data; next} ->\n do_bucket next (f key data accu) in\n let old_trav = ongoing_traversal h in\n if not old_trav then flip_ongoing_traversal h;\n try\n let d = h.data in\n let accu = ref init in\n for i = 0 to Array.length d - 1 do\n accu := do_bucket d.(i) !accu\n done;\n if not old_trav then flip_ongoing_traversal h;\n !accu\n with exn when not old_trav ->\n flip_ongoing_traversal h;\n raise exn\n\ntype statistics = {\n num_bindings: int;\n num_buckets: int;\n max_bucket_length: int;\n bucket_histogram: int array\n}\n\nlet rec bucket_length accu = function\n | Empty -> accu\n | Cons{next} -> bucket_length (accu + 1) next\n\nlet stats h =\n let mbl =\n Array.fold_left (fun m b -> Int.max m (bucket_length 0 b)) 0 h.data in\n let histo = Array.make (mbl + 1) 0 in\n Array.iter\n (fun b ->\n let l = bucket_length 0 b in\n histo.(l) <- histo.(l) + 1)\n h.data;\n { num_bindings = h.size;\n num_buckets = Array.length h.data;\n max_bucket_length = mbl;\n bucket_histogram = histo }\n\n(** {1 Iterators} *)\n\nlet to_seq tbl =\n (* capture current array, so that even if the table is resized we\n keep iterating on the same array *)\n let tbl_data = tbl.data in\n (* state: index * next bucket to traverse *)\n let rec aux i buck () = match buck with\n | Empty ->\n if i = Array.length tbl_data\n then Seq.Nil\n else aux(i+1) tbl_data.(i) ()\n | Cons {key; data; next} ->\n Seq.Cons ((key, data), aux i next)\n in\n aux 0 Empty\n\nlet to_seq_keys m = Seq.map fst (to_seq m)\n\nlet to_seq_values m = Seq.map snd (to_seq m)\n\n(* Functorial interface *)\n\nmodule type HashedType =\n sig\n type t\n val equal: t -> t -> bool\n val hash: t -> int\n end\n\nmodule type SeededHashedType =\n sig\n type t\n val equal: t -> t -> bool\n val seeded_hash: int -> t -> int\n end\n\nmodule type S =\n sig\n type key\n type !'a t\n val create: int -> 'a t\n val clear : 'a t -> unit\n val reset : 'a t -> unit\n val copy: 'a t -> 'a t\n val add: 'a t -> key -> 'a -> unit\n val remove: 'a t -> key -> unit\n val find: 'a t -> key -> 'a\n val find_opt: 'a t -> key -> 'a option\n val find_all: 'a t -> key -> 'a list\n val replace : 'a t -> key -> 'a -> unit\n val mem : 'a t -> key -> bool\n val iter: (key -> 'a -> unit) -> 'a t -> unit\n val filter_map_inplace: (key -> 'a -> 'a option) -> 'a t -> unit\n val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b\n val length: 'a t -> int\n val stats: 'a t -> statistics\n val to_seq : 'a t -> (key * 'a) Seq.t\n val to_seq_keys : _ t -> key Seq.t\n val to_seq_values : 'a t -> 'a Seq.t\n val add_seq : 'a t -> (key * 'a) Seq.t -> unit\n val replace_seq : 'a t -> (key * 'a) Seq.t -> unit\n val of_seq : (key * 'a) Seq.t -> 'a t\n end\n\nmodule type SeededS =\n sig\n type key\n type !'a t\n val create : ?random:bool -> int -> 'a t\n val clear : 'a t -> unit\n val reset : 'a t -> unit\n val copy : 'a t -> 'a t\n val add : 'a t -> key -> 'a -> unit\n val remove : 'a t -> key -> unit\n val find : 'a t -> key -> 'a\n val find_opt: 'a t -> key -> 'a option\n val find_all : 'a t -> key -> 'a list\n val replace : 'a t -> key -> 'a -> unit\n val mem : 'a t -> key -> bool\n val iter : (key -> 'a -> unit) -> 'a t -> unit\n val filter_map_inplace: (key -> 'a -> 'a option) -> 'a t -> unit\n val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b\n val length : 'a t -> int\n val stats: 'a t -> statistics\n val to_seq : 'a t -> (key * 'a) Seq.t\n val to_seq_keys : _ t -> key Seq.t\n val to_seq_values : 'a t -> 'a Seq.t\n val add_seq : 'a t -> (key * 'a) Seq.t -> unit\n val replace_seq : 'a t -> (key * 'a) Seq.t -> unit\n val of_seq : (key * 'a) Seq.t -> 'a t\n end\n\nmodule MakeSeeded(H: SeededHashedType): (SeededS with type key = H.t) =\n struct\n type key = H.t\n type 'a hashtbl = (key, 'a) t\n type 'a t = 'a hashtbl\n let create = create\n let clear = clear\n let reset = reset\n let copy = copy\n\n let key_index h key =\n (H.seeded_hash h.seed key) land (Array.length h.data - 1)\n\n let add h key data =\n let i = key_index h key in\n let bucket = Cons{key; data; next=h.data.(i)} in\n h.data.(i) <- bucket;\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize key_index h\n\n let rec remove_bucket h i key prec = function\n | Empty ->\n ()\n | (Cons {key=k; next}) as c ->\n if H.equal k key\n then begin\n h.size <- h.size - 1;\n match prec with\n | Empty -> h.data.(i) <- next\n | Cons c -> c.next <- next\n end\n else remove_bucket h i key c next\n\n let remove h key =\n let i = key_index h key in\n remove_bucket h i key Empty h.data.(i)\n\n let rec find_rec key = function\n | Empty ->\n raise Not_found\n | Cons{key=k; data; next} ->\n if H.equal key k then data else find_rec key next\n\n let find h key =\n match h.data.(key_index h key) with\n | Empty -> raise Not_found\n | Cons{key=k1; data=d1; next=next1} ->\n if H.equal key k1 then d1 else\n match next1 with\n | Empty -> raise Not_found\n | Cons{key=k2; data=d2; next=next2} ->\n if H.equal key k2 then d2 else\n match next2 with\n | Empty -> raise Not_found\n | Cons{key=k3; data=d3; next=next3} ->\n if H.equal key k3 then d3 else find_rec key next3\n\n let rec find_rec_opt key = function\n | Empty ->\n None\n | Cons{key=k; data; next} ->\n if H.equal key k then Some data else find_rec_opt key next\n\n let find_opt h key =\n match h.data.(key_index h key) with\n | Empty -> None\n | Cons{key=k1; data=d1; next=next1} ->\n if H.equal key k1 then Some d1 else\n match next1 with\n | Empty -> None\n | Cons{key=k2; data=d2; next=next2} ->\n if H.equal key k2 then Some d2 else\n match next2 with\n | Empty -> None\n | Cons{key=k3; data=d3; next=next3} ->\n if H.equal key k3 then Some d3 else find_rec_opt key next3\n\n let find_all h key =\n let[@tail_mod_cons] rec find_in_bucket = function\n | Empty ->\n []\n | Cons{key=k; data=d; next} ->\n if H.equal k key\n then d :: find_in_bucket next\n else find_in_bucket next in\n find_in_bucket h.data.(key_index h key)\n\n let rec replace_bucket key data = function\n | Empty ->\n true\n | Cons ({key=k; next} as slot) ->\n if H.equal k key\n then (slot.key <- key; slot.data <- data; false)\n else replace_bucket key data next\n\n let replace h key data =\n let i = key_index h key in\n let l = h.data.(i) in\n if replace_bucket key data l then begin\n h.data.(i) <- Cons{key; data; next=l};\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize key_index h\n end\n\n let rec mem_in_bucket key = function\n | Empty ->\n false\n | Cons{key=k; next} ->\n H.equal k key || mem_in_bucket key next\n\n let mem h key =\n mem_in_bucket key h.data.(key_index h key)\n\n let add_seq tbl i =\n Seq.iter (fun (k,v) -> add tbl k v) i\n\n let replace_seq tbl i =\n Seq.iter (fun (k,v) -> replace tbl k v) i\n\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n\n let iter = iter\n let filter_map_inplace = filter_map_inplace\n let fold = fold\n let length = length\n let stats = stats\n let to_seq = to_seq\n let to_seq_keys = to_seq_keys\n let to_seq_values = to_seq_values\n end\n\nmodule Make(H: HashedType): (S with type key = H.t) =\n struct\n include MakeSeeded(struct\n type t = H.t\n let equal = H.equal\n let seeded_hash (_seed: int) x = H.hash x\n end)\n let create sz = create ~random:false sz\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n end\n\n(* Polymorphic hash function-based tables *)\n(* Code included below the functorial interface to guard against accidental\n use - see #2202 *)\n\nexternal seeded_hash_param :\n int -> int -> int -> 'a -> int = \"caml_hash\" [@@noalloc]\n\nlet hash x = seeded_hash_param 10 100 0 x\nlet hash_param n1 n2 x = seeded_hash_param n1 n2 0 x\nlet seeded_hash seed x = seeded_hash_param 10 100 seed x\n\nlet key_index h key =\n if Obj.size (Obj.repr h) >= 4\n then (seeded_hash_param 10 100 h.seed key) land (Array.length h.data - 1)\n else invalid_arg \"Hashtbl: unsupported hash table format\"\n\nlet add h key data =\n let i = key_index h key in\n let bucket = Cons{key; data; next=h.data.(i)} in\n h.data.(i) <- bucket;\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize key_index h\n\nlet rec remove_bucket h i key prec = function\n | Empty ->\n ()\n | (Cons {key=k; next}) as c ->\n if compare k key = 0\n then begin\n h.size <- h.size - 1;\n match prec with\n | Empty -> h.data.(i) <- next\n | Cons c -> c.next <- next\n end\n else remove_bucket h i key c next\n\nlet remove h key =\n let i = key_index h key in\n remove_bucket h i key Empty h.data.(i)\n\nlet rec find_rec key = function\n | Empty ->\n raise Not_found\n | Cons{key=k; data; next} ->\n if compare key k = 0 then data else find_rec key next\n\nlet find h key =\n match h.data.(key_index h key) with\n | Empty -> raise Not_found\n | Cons{key=k1; data=d1; next=next1} ->\n if compare key k1 = 0 then d1 else\n match next1 with\n | Empty -> raise Not_found\n | Cons{key=k2; data=d2; next=next2} ->\n if compare key k2 = 0 then d2 else\n match next2 with\n | Empty -> raise Not_found\n | Cons{key=k3; data=d3; next=next3} ->\n if compare key k3 = 0 then d3 else find_rec key next3\n\nlet rec find_rec_opt key = function\n | Empty ->\n None\n | Cons{key=k; data; next} ->\n if compare key k = 0 then Some data else find_rec_opt key next\n\nlet find_opt h key =\n match h.data.(key_index h key) with\n | Empty -> None\n | Cons{key=k1; data=d1; next=next1} ->\n if compare key k1 = 0 then Some d1 else\n match next1 with\n | Empty -> None\n | Cons{key=k2; data=d2; next=next2} ->\n if compare key k2 = 0 then Some d2 else\n match next2 with\n | Empty -> None\n | Cons{key=k3; data=d3; next=next3} ->\n if compare key k3 = 0 then Some d3 else find_rec_opt key next3\n\nlet find_all h key =\n let[@tail_mod_cons] rec find_in_bucket = function\n | Empty ->\n []\n | Cons{key=k; data; next} ->\n if compare k key = 0\n then data :: find_in_bucket next\n else find_in_bucket next in\n find_in_bucket h.data.(key_index h key)\n\nlet rec replace_bucket key data = function\n | Empty ->\n true\n | Cons ({key=k; next} as slot) ->\n if compare k key = 0\n then (slot.key <- key; slot.data <- data; false)\n else replace_bucket key data next\n\nlet replace h key data =\n let i = key_index h key in\n let l = h.data.(i) in\n if replace_bucket key data l then begin\n h.data.(i) <- Cons{key; data; next=l};\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize key_index h\n end\n\nlet rec mem_in_bucket key = function\n | Empty ->\n false\n | Cons{key=k; next} ->\n compare k key = 0 || mem_in_bucket key next\n\nlet mem h key =\n mem_in_bucket key h.data.(key_index h key)\n\nlet add_seq tbl i =\n Seq.iter (fun (k,v) -> add tbl k v) i\n\nlet replace_seq tbl i =\n Seq.iter (fun (k,v) -> replace tbl k v) i\n\nlet of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n\nlet rebuild ?(random = Atomic.get randomized) h =\n let s = power_2_above 16 (Array.length h.data) in\n let seed =\n if random then Random.State.bits (Domain.DLS.get prng_key)\n else if Obj.size (Obj.repr h) >= 4 then h.seed\n else 0 in\n let h' = {\n size = h.size;\n data = Array.make s Empty;\n seed = seed;\n initial_size = if Obj.size (Obj.repr h) >= 4 then h.initial_size else s\n } in\n insert_all_buckets (key_index h') false h.data h'.data;\n h'\n","(* generated code *)"],"names":[],"mappings":"KA4CE,+BAAkC,C,IAJlC,qC,GAAA,mBACqB,C,ECzCvB,W,EDwnBqB,mB,YAZT,kBAAW,4BAAqB,W,EAClC,IAAR,iB,CAAA,uBAAQ,OACR,UAEO,S,CAAA,6BAAmC,WACnC,MAF4B,MAAlB,gBAAkB,aAAyB,gBAA3C,c,EAGjB,S,CAAA,6BAIoD,c,EAF3C,UAIU,GAJQ,oB,CAAA,QAIR,GAAnB,sBAAsD,EACpD,C,EAjBQ,QAAV,MAAU,UACV,UAAiB,EACd,C,KALM,KAAc,IAAd,mBAAc,OAAgB,C,EAAvC,+BAAyC,C,KAHhC,KAAc,IAAd,mBAAc,OAAY,C,EAAnC,+BAAqC,C,WAHX,aAAe,UAAvB,oBAAQ,EAAR,YAAwB,IAPtB,SAEhB,2BAEA,IAAa,G,CAAA,Q,IAAA,GAGyB,C,gBAflC,eACR,UAAQ,oCACL,IAXkB,SAEjB,wBAEG,IACuC,EAArC,SAAkB,SAAmB,GAMlB,IAAM,YAChC,6BADgC,cAChC,GAAqC,wBAErC,c,CAAA,iDAA2C,uBAC1C,C,WAjBoB,aAAe,UAAvB,oBAAQ,EAAR,YAAwB,IAPE,SAErC,oCAEG,IAAa,IACX,kBAAQ,QALwB,SAErC,cAGgC,kCAD7B,IACE,iC,IAAA,GAE8B,C,SArBzB,aAAe,UAAvB,oBAAQ,EAAR,cAAwB,OACnB,6BAEJ,EAFI,OAEJ,EAAc,EACjB,SACW,6BAEJ,EAFI,OAEJ,EAAc,EACjB,SACW,6BAEJ,EAFI,OAEJ,EAAc,EAAU,EAlBpB,SAEf,6BAEG,EAFH,OAEG,EAAuB,c,IAcS,Y,IAJJ,Y,IAJJ,Y,IAND,GAc4C,C,SA/B5D,aAAe,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B,WAEjB,yB,CAAA,wDACC,C,OAXM,kBAAW,4BAAqB,W,EACjC,WACR,UACkE,KAA/B,MAAlB,gBAAkB,aAAyB,gBAA3C,c,EAEmD,QAAlB,QAAkB,QAAE,C,EATtE,kBAAe,GACV,2BAAqC,GACrC,gBAAuB,C,EAbP,8BAAqB,C,EADzB,kCAA0B,C,mBAFE,GCtD/C,UDkDQ,KAA0B,I,AAAA,I,AAAA,G,EAAA,GClDlC,a,CAAA,kB,CAAA,6BDmDQ,KAAyB,I,AAAA,I,AAAA,G,EAAA,GCnDjC,a,CAAA,kB,CAAA,yB,CAAA,O,CAAA,IDoDE,e,CAAA,WAA0B,QAEX,E,CAAA,a,CAA8B,U,CAAA,KAKc,W,CAA9C,IALgC,gCAKhC,KAA8C,uE,CAAA,mE,QC3D7D,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}},{"offset":{"line":0,"column":293946},"map":{"version":3,"sources":["/builtin/blackbox.ml","/root/.opam/5.2.0/lib/ocaml/weak.ml"],"sourcesContent":["(* generated code *)","(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1997 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(** Weak array operations *)\n\ntype !'a t\n\nexternal create : int -> 'a t = \"caml_weak_create\"\n\n(** number of additional values in a weak pointer\n * - Link\n * - Data *)\nlet additional_values = 2 (* CAML_EPHE_FIRST_KEY in weak.h *)\n\nlet create l =\n if not (0 <= l && l <= Obj.Ephemeron.max_ephe_length) then\n invalid_arg(\"Weak.create\");\n create l\n\n\nlet length x = Obj.size(Obj.repr x) - additional_values\n\nlet raise_if_invalid_offset e o msg =\n if not (0 <= o && o < length e) then\n invalid_arg(msg)\n\nexternal set' : 'a t -> int -> 'a -> unit = \"caml_ephe_set_key\"\nexternal unset : 'a t -> int -> unit = \"caml_ephe_unset_key\"\nlet set e o x =\n raise_if_invalid_offset e o \"Weak.set\";\n match x with\n | None -> unset e o\n | Some x -> set' e o x\n\nexternal get : 'a t -> int -> 'a option = \"caml_weak_get\"\nlet get e o =\n raise_if_invalid_offset e o \"Weak.get\";\n get e o\n\nexternal get_copy : 'a t -> int -> 'a option = \"caml_weak_get_copy\"\nlet get_copy e o =\n raise_if_invalid_offset e o \"Weak.get_copy\";\n get_copy e o\n\nexternal check : 'a t -> int -> bool = \"caml_weak_check\"\nlet check e o =\n raise_if_invalid_offset e o \"Weak.check\";\n check e o\n\nexternal blit : 'a t -> int -> 'a t -> int -> int -> unit = \"caml_weak_blit\"\n\n(* blit: src srcoff dst dstoff len *)\nlet blit e1 o1 e2 o2 l =\n if l < 0 || o1 < 0 || o1 > length e1 - l\n || o2 < 0 || o2 > length e2 - l\n then invalid_arg \"Weak.blit\"\n else if l <> 0 then blit e1 o1 e2 o2 l\n\nlet fill ar ofs len x =\n if ofs < 0 || len < 0 || ofs > length ar - len\n then raise (Invalid_argument \"Weak.fill\")\n else begin\n for i = ofs to (ofs + len - 1) do\n set ar i x\n done\n end\n\n\n(** Weak hash tables *)\n\nmodule type S = sig\n type data\n type t\n val create : int -> t\n val clear : t -> unit\n val merge : t -> data -> data\n val add : t -> data -> unit\n val remove : t -> data -> unit\n val find : t -> data -> data\n val find_opt : t -> data -> data option\n val find_all : t -> data -> data list\n val mem : t -> data -> bool\n val iter : (data -> unit) -> t -> unit\n val fold : (data -> 'acc -> 'acc) -> t -> 'acc -> 'acc\n val count : t -> int\n val stats : t -> int * int * int * int * int * int\nend\n\nmodule Make (H : Hashtbl.HashedType) : (S with type data = H.t) = struct\n\n type 'a weak_t = 'a t\n let weak_create = create\n let emptybucket = weak_create 0\n\n type data = H.t\n\n type t = {\n mutable table : data weak_t array;\n mutable hashes : int array array;\n mutable limit : int; (* bucket size limit *)\n mutable oversize : int; (* number of oversize buckets *)\n mutable rover : int; (* for internal bookkeeping *)\n }\n\n let get_index t h = (h land max_int) mod (Array.length t.table)\n\n let limit = 7\n let over_limit = 2\n\n let create sz =\n let sz = if sz < 7 then 7 else sz in\n let sz = if sz > Sys.max_array_length then Sys.max_array_length else sz in\n {\n table = Array.make sz emptybucket;\n hashes = Array.make sz [| |];\n limit = limit;\n oversize = 0;\n rover = 0;\n }\n\n let clear t =\n for i = 0 to Array.length t.table - 1 do\n t.table.(i) <- emptybucket;\n t.hashes.(i) <- [| |];\n done;\n t.limit <- limit;\n t.oversize <- 0\n\n\n let fold f t init =\n let rec fold_bucket i b accu =\n if i >= length b then accu else\n match get b i with\n | Some v -> fold_bucket (i+1) b (f v accu)\n | None -> fold_bucket (i+1) b accu\n in\n Array.fold_right (fold_bucket 0) t.table init\n\n\n let iter f t =\n let rec iter_bucket i b =\n if i >= length b then () else\n match get b i with\n | Some v -> f v; iter_bucket (i+1) b\n | None -> iter_bucket (i+1) b\n in\n Array.iter (iter_bucket 0) t.table\n\n\n let iter_weak f t =\n let rec iter_bucket i j b =\n if i >= length b then () else\n match check b i with\n | true -> f b t.hashes.(j) i; iter_bucket (i+1) j b\n | false -> iter_bucket (i+1) j b\n in\n Array.iteri (iter_bucket 0) t.table\n\n\n let rec count_bucket i b accu =\n if i >= length b then accu else\n count_bucket (i+1) b (accu + (if check b i then 1 else 0))\n\n\n let count t =\n Array.fold_right (count_bucket 0) t.table 0\n\n\n let next_sz n = Int.min (3 * n / 2 + 3) Sys.max_array_length\n let prev_sz n = ((n - 3) * 2 + 2) / 3\n\n let test_shrink_bucket t =\n let bucket = t.table.(t.rover) in\n let hbucket = t.hashes.(t.rover) in\n let len = length bucket in\n let prev_len = prev_sz len in\n let live = count_bucket 0 bucket 0 in\n if live <= prev_len then begin\n let rec loop i j =\n if j >= prev_len then begin\n if check bucket i then loop (i + 1) j\n else if check bucket j then begin\n blit bucket j bucket i 1;\n hbucket.(i) <- hbucket.(j);\n loop (i + 1) (j - 1);\n end else loop i (j - 1);\n end;\n in\n loop 0 (length bucket - 1);\n if prev_len = 0 then begin\n t.table.(t.rover) <- emptybucket;\n t.hashes.(t.rover) <- [| |];\n end else begin\n let newbucket = weak_create prev_len in\n blit bucket 0 newbucket 0 prev_len;\n t.table.(t.rover) <- newbucket;\n t.hashes.(t.rover) <- Array.sub hbucket 0 prev_len\n end;\n if len > t.limit && prev_len <= t.limit then t.oversize <- t.oversize - 1;\n end;\n t.rover <- (t.rover + 1) mod (Array.length t.table)\n\n\n let rec resize t =\n let oldlen = Array.length t.table in\n let newlen = next_sz oldlen in\n if newlen > oldlen then begin\n let newt = create newlen in\n let add_weak ob oh oi =\n let setter nb ni _ = blit ob oi nb ni 1 in\n let h = oh.(oi) in\n add_aux newt setter None h (get_index newt h);\n in\n iter_weak add_weak t;\n t.table <- newt.table;\n t.hashes <- newt.hashes;\n t.limit <- newt.limit;\n t.oversize <- newt.oversize;\n t.rover <- t.rover mod Array.length newt.table;\n end else begin\n t.limit <- max_int; (* maximum size already reached *)\n t.oversize <- 0;\n end\n\n and add_aux t setter d h index =\n let bucket = t.table.(index) in\n let hashes = t.hashes.(index) in\n let sz = length bucket in\n let rec loop i =\n if i >= sz then begin\n let newsz =\n Int.min (3 * sz / 2 + 3) (Sys.max_array_length - additional_values)\n in\n if newsz <= sz then failwith \"Weak.Make: hash bucket cannot grow more\";\n let newbucket = weak_create newsz in\n let newhashes = Array.make newsz 0 in\n blit bucket 0 newbucket 0 sz;\n Array.blit hashes 0 newhashes 0 sz;\n setter newbucket sz d;\n newhashes.(sz) <- h;\n t.table.(index) <- newbucket;\n t.hashes.(index) <- newhashes;\n if sz <= t.limit && newsz > t.limit then begin\n t.oversize <- t.oversize + 1;\n for _i = 0 to over_limit do test_shrink_bucket t done;\n end;\n if t.oversize > Array.length t.table / over_limit then resize t;\n end else if check bucket i then begin\n loop (i + 1)\n end else begin\n setter bucket i d;\n hashes.(i) <- h;\n end;\n in\n loop 0\n\n\n let add t d =\n let h = H.hash d in\n add_aux t set (Some d) h (get_index t h)\n\n (* General auxiliary function for searching for a particular value\n * in a hash-set, and acting according to whether or not it's found *)\n\n let find_aux t d found notfound =\n let h = H.hash d in\n let index = get_index t h in\n let bucket = t.table.(index) in\n let hashes = t.hashes.(index) in\n let sz = length bucket in\n let rec loop i =\n if i >= sz then notfound h index\n else if h = hashes.(i) then begin\n match get bucket i with\n | Some v as opt when H.equal v d -> found bucket i opt v\n | _ -> loop (i + 1)\n end else loop (i + 1)\n in\n loop 0\n\n let find_opt t d = find_aux t d (fun _b _i o _v -> o)\n (fun _h _i -> None)\n\n let merge t d = find_aux t d (fun _b _i _o v -> v)\n (fun h i ->\n add_aux t set (Some d) h i; d)\n\n let find t d = find_aux t d (fun _b _i _o v -> v)\n (fun _h _i -> raise Not_found)\n\n let remove t d = find_aux t d (fun b i _o _v -> set b i None)\n (fun _h _i -> ())\n\n let mem t d = find_aux t d (fun _b _i _o _v -> true)\n (fun _h _i -> false)\n\n let find_all t d =\n let h = H.hash d in\n let index = get_index t h in\n let bucket = t.table.(index) in\n let hashes = t.hashes.(index) in\n let sz = length bucket in\n let rec loop i accu =\n if i >= sz then accu\n else if h = hashes.(i) then begin\n match get bucket i with\n | Some v when H.equal v d -> loop (i + 1) (v :: accu)\n | _ -> loop (i + 1) accu\n end else loop (i + 1) accu\n in\n loop 0 []\n\n let stats t =\n let len = Array.length t.table in\n let lens = Array.map length t.table in\n Array.sort compare lens;\n let totlen = Array.fold_left ( + ) 0 lens in\n (len, count t, totlen, lens.(0), lens.(len/2), lens.(len-1))\n\n\nend\n"],"names":[],"mappings":"sECqUI,iB,CAAA,yBAEA,GADW,GAAX,oBAAW,eACX,sBACa,SADU,QACV,eAHb,EAI+C,YAA/C,OAA+C,SAAY,OAA1B,UAAV,SAAwB,kBAAd,YAAV,SAAV,QAAP,SAAO,iBAA+C,C,iBA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WACA,OAAO,C,EARP,WAAsC,UAE5B,OACE,IADO,UACP,GAAU,C,OATtB,gBAA8B,IAAR,SAAQ,O,GAAA,MAC5B,4BAAgB,C,IAJL,S,CAAA,4BAAwC,C,OALrD,kDACE,yBACF,KAAQ,C","ignoreList":[0]}},{"offset":{"line":0,"column":300340},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/format.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* A pretty-printing facility and definition of formatters for 'parallel'\n (i.e. unrelated or independent) pretty-printing on multiple out channels. *)\n\n(*\n The pretty-printing engine internal data structures.\n*)\n\nlet id x = x\n\n(* A devoted type for sizes to avoid confusion\n between sizes and mere integers. *)\nmodule Size : sig\n type t\n\n val to_int : t -> int\n val of_int : int -> t\n val zero : t\n val unknown : t\n val is_known : t -> bool\nend = struct\n type t = int\n\n let to_int = id\n let of_int = id\n let zero = 0\n let unknown = -1\n let is_known n = n >= 0\nend\n\n\n\n(* The pretty-printing boxes definition:\n a pretty-printing box is either\n - hbox: horizontal box (no line splitting)\n - vbox: vertical box (every break hint splits the line)\n - hvbox: horizontal/vertical box\n (the box behaves as an horizontal box if it fits on\n the current line, otherwise the box behaves as a vertical box)\n - hovbox: horizontal or vertical compacting box\n (the box is compacting material, printing as much material as possible\n on every lines)\n - box: horizontal or vertical compacting box with enhanced box structure\n (the box behaves as an horizontal or vertical box but break hints split\n the line if splitting would move to the left)\n*)\ntype box_type = CamlinternalFormatBasics.block_type =\n | Pp_hbox | Pp_vbox | Pp_hvbox | Pp_hovbox | Pp_box | Pp_fits\n\n\n(* The pretty-printing tokens definition:\n are either text to print or pretty printing\n elements that drive indentation and line splitting. *)\ntype pp_token =\n | Pp_text of string (* normal text *)\n | Pp_break of { (* complete break *)\n fits: string * int * string; (* line is not split *)\n breaks: string * int * string; (* line is split *)\n }\n | Pp_tbreak of int * int (* go to next tabulation *)\n | Pp_stab (* set a tabulation *)\n | Pp_begin of int * box_type (* beginning of a box *)\n | Pp_end (* end of a box *)\n | Pp_tbegin of tbox (* beginning of a tabulation box *)\n | Pp_tend (* end of a tabulation box *)\n | Pp_newline (* to force a newline inside a box *)\n | Pp_if_newline (* to do something only if this very\n line has been broken *)\n | Pp_open_tag of stag (* opening a tag name *)\n | Pp_close_tag (* closing the most recently open tag *)\n\nand stag = ..\n\nand tbox = Pp_tbox of int list ref (* Tabulation box *)\n\ntype tag = string\ntype stag += String_tag of tag\n\n\n(* The pretty-printer queue:\n pretty-printing material is not written in the output as soon as emitted;\n instead, the material is simply recorded in the pretty-printer queue,\n until the enclosing box has a known computed size and proper splitting\n decisions can be made.\n\n The pretty-printer queue contains formatting elements to be printed.\n Each formatting element is a tuple (size, token, length), where\n - length is the declared length of the token,\n - size is effective size of the token when it is printed\n (size is set when the size of the box is known, so that size of break\n hints are definitive). *)\ntype pp_queue_elem = {\n mutable size : Size.t;\n token : pp_token;\n length : int;\n}\n\n\n(* The pretty-printer queue definition. *)\ntype pp_queue = pp_queue_elem Queue.t\n\n(* The pretty-printer scanning stack. *)\n\n(* The pretty-printer scanning stack: scanning element definition. *)\ntype pp_scan_elem = {\n left_total : int; (* Value of pp_left_total when the element was enqueued. *)\n queue_elem : pp_queue_elem\n}\n\n(* The pretty-printer formatting stack:\n the formatting stack contains the description of all the currently active\n boxes; the pretty-printer formatting stack is used to split the lines\n while printing tokens. *)\n\n(* The pretty-printer formatting stack: formatting stack element definition.\n Each stack element describes a pretty-printing box. *)\ntype pp_format_elem = { box_type : box_type; width : int }\n\n(* The formatter definition.\n Each formatter value is a pretty-printer instance with all its\n machinery. *)\ntype formatter = {\n (* The pretty-printer scanning stack. *)\n pp_scan_stack : pp_scan_elem Stack.t;\n (* The pretty-printer formatting stack. *)\n pp_format_stack : pp_format_elem Stack.t;\n pp_tbox_stack : tbox Stack.t;\n (* The pretty-printer semantics tag stack. *)\n pp_tag_stack : stag Stack.t;\n pp_mark_stack : stag Stack.t;\n (* Value of right margin. *)\n mutable pp_margin : int;\n (* Minimal space left before margin, when opening a box. *)\n mutable pp_min_space_left : int;\n (* Maximum value of indentation:\n no box can be opened further. *)\n mutable pp_max_indent : int;\n (* Space remaining on the current line. *)\n mutable pp_space_left : int;\n (* Current value of indentation. *)\n mutable pp_current_indent : int;\n (* True when the line has been broken by the pretty-printer. *)\n mutable pp_is_new_line : bool;\n (* Total width of tokens already printed. *)\n mutable pp_left_total : int;\n (* Total width of tokens ever put in queue. *)\n mutable pp_right_total : int;\n (* Current number of open boxes. *)\n mutable pp_curr_depth : int;\n (* Maximum number of boxes which can be simultaneously open. *)\n mutable pp_max_boxes : int;\n (* Ellipsis string. *)\n mutable pp_ellipsis : string;\n (* Output function. *)\n mutable pp_out_string : string -> int -> int -> unit;\n (* Flushing function. *)\n mutable pp_out_flush : unit -> unit;\n (* Output of new lines. *)\n mutable pp_out_newline : unit -> unit;\n (* Output of break hints spaces. *)\n mutable pp_out_spaces : int -> unit;\n (* Output of indentation of new lines. *)\n mutable pp_out_indent : int -> unit;\n (* Are tags printed ? *)\n mutable pp_print_tags : bool;\n (* Are tags marked ? *)\n mutable pp_mark_tags : bool;\n (* Find opening and closing markers of tags. *)\n mutable pp_mark_open_tag : stag -> string;\n mutable pp_mark_close_tag : stag -> string;\n mutable pp_print_open_tag : stag -> unit;\n mutable pp_print_close_tag : stag -> unit;\n (* The pretty-printer queue. *)\n pp_queue : pp_queue;\n}\n\n\n(* The formatter specific tag handling functions. *)\ntype formatter_stag_functions = {\n mark_open_stag : stag -> string;\n mark_close_stag : stag -> string;\n print_open_stag : stag -> unit;\n print_close_stag : stag -> unit;\n}\n\n\n(* The formatter functions to output material. *)\ntype formatter_out_functions = {\n out_string : string -> int -> int -> unit;\n out_flush : unit -> unit;\n out_newline : unit -> unit;\n out_spaces : int -> unit;\n out_indent : int -> unit;\n}\n\n\n(*\n\n Auxiliaries and basic functions.\n\n*)\n\n(* Enter a token in the pretty-printer queue. *)\nlet pp_enqueue state token =\n state.pp_right_total <- state.pp_right_total + token.length;\n Queue.add token state.pp_queue\n\n\nlet pp_clear_queue state =\n state.pp_left_total <- 1; state.pp_right_total <- 1;\n Queue.clear state.pp_queue\n\n\n(* Pp_infinity: large value for default tokens size.\n\n Pp_infinity is documented as being greater than 1e10; to avoid\n confusion about the word 'greater', we choose pp_infinity greater\n than 1e10 + 1; for correct handling of tests in the algorithm,\n pp_infinity must be even one more than 1e10 + 1; let's stand on the\n safe side by choosing 1.e10+10.\n\n Pp_infinity could probably be 1073741823 that is 2^30 - 1, that is\n the minimal upper bound for integers; now that max_int is defined,\n this limit could also be defined as max_int - 1.\n\n However, before setting pp_infinity to something around max_int, we\n must carefully double-check all the integer arithmetic operations\n that involve pp_infinity, since any overflow would wreck havoc the\n pretty-printing algorithm's invariants. Given that this arithmetic\n correctness check is difficult and error prone and given that 1e10\n + 1 is in practice large enough, there is no need to attempt to set\n pp_infinity to the theoretically maximum limit. It is not worth the\n burden ! *)\nlet pp_infinity = 1000000010\n\n(* Output functions for the formatter. *)\nlet pp_output_string state s = state.pp_out_string s 0 (String.length s)\nand pp_output_newline state = state.pp_out_newline ()\nand pp_output_spaces state n = state.pp_out_spaces n\nand pp_output_indent state n = state.pp_out_indent n\n\n(* Format a textual token *)\nlet format_pp_text state size text =\n state.pp_space_left <- state.pp_space_left - size;\n pp_output_string state text;\n state.pp_is_new_line <- false\n\n(* Format a string by its length, if not empty *)\nlet format_string state s =\n if s <> \"\" then format_pp_text state (String.length s) s\n\n(* To format a break, indenting a new line. *)\nlet break_new_line state (before, offset, after) width =\n format_string state before;\n pp_output_newline state;\n state.pp_is_new_line <- true;\n let indent = state.pp_margin - width + offset in\n (* Don't indent more than pp_max_indent. *)\n let real_indent = Int.min state.pp_max_indent indent in\n state.pp_current_indent <- real_indent;\n state.pp_space_left <- state.pp_margin - state.pp_current_indent;\n pp_output_indent state state.pp_current_indent;\n format_string state after\n\n\n(* To force a line break inside a box: no offset is added. *)\nlet break_line state width = break_new_line state (\"\", 0, \"\") width\n\n(* To format a break that fits on the current line. *)\nlet break_same_line state (before, width, after) =\n format_string state before;\n state.pp_space_left <- state.pp_space_left - width;\n pp_output_spaces state width;\n format_string state after\n\n\n(* To indent no more than pp_max_indent, if one tries to open a box\n beyond pp_max_indent, then the box is rejected on the left\n by simulating a break. *)\nlet pp_force_break_line state =\n match Stack.top_opt state.pp_format_stack with\n | None -> pp_output_newline state\n | Some { box_type; width } ->\n if width > state.pp_space_left then\n match box_type with\n | Pp_fits | Pp_hbox -> ()\n | Pp_vbox | Pp_hvbox | Pp_hovbox | Pp_box -> break_line state width\n\n\n(* To skip a token, if the previous line has been broken. *)\nlet pp_skip_token state =\n match Queue.take_opt state.pp_queue with\n | None -> () (* print_if_newline must have been the last printing command *)\n | Some { size; length; _ } ->\n state.pp_left_total <- state.pp_left_total - length;\n state.pp_space_left <- state.pp_space_left + Size.to_int size\n\n\n(*\n\n The main pretty printing functions.\n\n*)\n\n(* Formatting a token with a given size. *)\nlet format_pp_token state size = function\n\n | Pp_text s ->\n format_pp_text state size s\n\n | Pp_begin (off, ty) ->\n let insertion_point = state.pp_margin - state.pp_space_left in\n if insertion_point > state.pp_max_indent then\n (* can not open a box right there. *)\n begin pp_force_break_line state end;\n let width = state.pp_space_left - off in\n let box_type =\n match ty with\n | Pp_vbox -> Pp_vbox\n | Pp_hbox | Pp_hvbox | Pp_hovbox | Pp_box | Pp_fits ->\n if size > state.pp_space_left then ty else Pp_fits in\n Stack.push { box_type; width } state.pp_format_stack\n\n | Pp_end ->\n Stack.pop_opt state.pp_format_stack |> ignore\n\n | Pp_tbegin (Pp_tbox _ as tbox) ->\n Stack.push tbox state.pp_tbox_stack\n\n | Pp_tend ->\n Stack.pop_opt state.pp_tbox_stack |> ignore\n\n | Pp_stab ->\n begin match Stack.top_opt state.pp_tbox_stack with\n | None -> () (* No open tabulation box. *)\n | Some (Pp_tbox tabs) ->\n let rec add_tab n = function\n | [] -> [n]\n | x :: l as ls -> if n < x then n :: ls else x :: add_tab n l in\n tabs := add_tab (state.pp_margin - state.pp_space_left) !tabs\n end\n\n | Pp_tbreak (n, off) ->\n let insertion_point = state.pp_margin - state.pp_space_left in\n begin match Stack.top_opt state.pp_tbox_stack with\n | None -> () (* No open tabulation box. *)\n | Some (Pp_tbox tabs) ->\n let tab =\n match !tabs with\n | [] -> insertion_point\n | first :: _ ->\n let rec find = function\n | head :: tail ->\n if head >= insertion_point then head else find tail\n | [] -> first in\n find !tabs in\n let offset = tab - insertion_point in\n if offset >= 0\n then break_same_line state (\"\", offset + n, \"\")\n else break_new_line state (\"\", tab + off, \"\") state.pp_margin\n end\n\n | Pp_newline ->\n begin match Stack.top_opt state.pp_format_stack with\n | None -> pp_output_newline state (* No open box. *)\n | Some { width; _} -> break_line state width\n end\n\n | Pp_if_newline ->\n if state.pp_current_indent != state.pp_margin - state.pp_space_left\n then pp_skip_token state\n\n | Pp_break { fits; breaks } ->\n let before, off, _ = breaks in\n begin match Stack.top_opt state.pp_format_stack with\n | None -> () (* No open box. *)\n | Some { box_type; width } ->\n begin match box_type with\n | Pp_hovbox ->\n if size + String.length before > state.pp_space_left\n then break_new_line state breaks width\n else break_same_line state fits\n | Pp_box ->\n (* Have the line just been broken here ? *)\n if state.pp_is_new_line then break_same_line state fits else\n if size + String.length before > state.pp_space_left\n then break_new_line state breaks width else\n (* break the line here leads to new indentation ? *)\n if state.pp_current_indent > state.pp_margin - width + off\n then break_new_line state breaks width\n else break_same_line state fits\n | Pp_hvbox -> break_new_line state breaks width\n | Pp_fits -> break_same_line state fits\n | Pp_vbox -> break_new_line state breaks width\n | Pp_hbox -> break_same_line state fits\n end\n end\n\n | Pp_open_tag tag_name ->\n let marker = state.pp_mark_open_tag tag_name in\n pp_output_string state marker;\n Stack.push tag_name state.pp_mark_stack\n\n | Pp_close_tag ->\n begin match Stack.pop_opt state.pp_mark_stack with\n | None -> () (* No more tag to close. *)\n | Some tag_name ->\n let marker = state.pp_mark_close_tag tag_name in\n pp_output_string state marker\n end\n\n\n(* Print if token size is known else printing is delayed.\n Printing is delayed when the text waiting in the queue requires\n more room to format than exists on the current line. *)\nlet rec advance_left state =\n match Queue.peek_opt state.pp_queue with\n | None -> () (* No tokens to print *)\n | Some { size; token; length } ->\n let pending_count = state.pp_right_total - state.pp_left_total in\n if Size.is_known size || pending_count >= state.pp_space_left then begin\n Queue.take state.pp_queue |> ignore; (* Not empty: we peek into it *)\n let size = if Size.is_known size then Size.to_int size else pp_infinity in\n format_pp_token state size token;\n state.pp_left_total <- length + state.pp_left_total;\n (advance_left [@tailcall]) state\n end\n\n\n(* To enqueue a token : try to advance. *)\nlet enqueue_advance state tok = pp_enqueue state tok; advance_left state\n\n\n(* To enqueue strings. *)\nlet enqueue_string_as state size s =\n enqueue_advance state { size; token = Pp_text s; length = Size.to_int size }\n\n\nlet enqueue_string state s =\n enqueue_string_as state (Size.of_int (String.length s)) s\n\n\n(* Routines for scan stack\n determine size of boxes. *)\n\n(* The scan_stack is never empty. *)\nlet initialize_scan_stack stack =\n Stack.clear stack;\n let queue_elem = { size = Size.unknown; token = Pp_text \"\"; length = 0 } in\n Stack.push { left_total = -1; queue_elem } stack\n\n(* Setting the size of boxes on scan stack:\n if ty = true then size of break is set else size of box is set;\n in each case pp_scan_stack is popped.\n\n Note:\n Pattern matching on scan stack is exhaustive, since scan_stack is never\n empty.\n Pattern matching on token in scan stack is also exhaustive,\n since scan_push is used on breaks and opening of boxes. *)\nlet set_size state ty =\n match Stack.top_opt state.pp_scan_stack with\n | None -> () (* scan_stack is never empty. *)\n | Some { left_total; queue_elem } ->\n let size = Size.to_int queue_elem.size in\n (* test if scan stack contains any data that is not obsolete. *)\n if left_total < state.pp_left_total then\n initialize_scan_stack state.pp_scan_stack\n else\n match queue_elem.token with\n | Pp_break _ | Pp_tbreak (_, _) ->\n if ty then begin\n queue_elem.size <- Size.of_int (state.pp_right_total + size);\n Stack.pop_opt state.pp_scan_stack |> ignore\n end\n | Pp_begin (_, _) ->\n if not ty then begin\n queue_elem.size <- Size.of_int (state.pp_right_total + size);\n Stack.pop_opt state.pp_scan_stack |> ignore\n end\n | Pp_text _ | Pp_stab | Pp_tbegin _ | Pp_tend | Pp_end\n | Pp_newline | Pp_if_newline | Pp_open_tag _ | Pp_close_tag ->\n () (* scan_push is only used for breaks and boxes. *)\n\n\n(* Push a token on pretty-printer scanning stack.\n If b is true set_size is called. *)\nlet scan_push state b token =\n pp_enqueue state token;\n if b then set_size state true;\n let elem = { left_total = state.pp_right_total; queue_elem = token } in\n Stack.push elem state.pp_scan_stack\n\n\n(* To open a new box :\n the user may set the depth bound pp_max_boxes\n any text nested deeper is printed as the ellipsis string. *)\nlet pp_open_box_gen state indent br_ty =\n state.pp_curr_depth <- state.pp_curr_depth + 1;\n if state.pp_curr_depth < state.pp_max_boxes then\n let size = Size.of_int (- state.pp_right_total) in\n let elem = { size; token = Pp_begin (indent, br_ty); length = 0 } in\n scan_push state false elem else\n if state.pp_curr_depth = state.pp_max_boxes\n then enqueue_string state state.pp_ellipsis\n\n\n(* The box which is always open. *)\nlet pp_open_sys_box state = pp_open_box_gen state 0 Pp_hovbox\n\n(* Close a box, setting sizes of its sub boxes. *)\nlet pp_close_box state () =\n if state.pp_curr_depth > 1 then\n begin\n if state.pp_curr_depth < state.pp_max_boxes then\n begin\n pp_enqueue state { size = Size.zero; token = Pp_end; length = 0 };\n set_size state true; set_size state false\n end;\n state.pp_curr_depth <- state.pp_curr_depth - 1;\n end\n\n\n(* Open a tag, pushing it on the tag stack. *)\nlet pp_open_stag state tag_name =\n if state.pp_print_tags then\n begin\n Stack.push tag_name state.pp_tag_stack;\n state.pp_print_open_tag tag_name\n end;\n if state.pp_mark_tags then\n let token = Pp_open_tag tag_name in\n pp_enqueue state { size = Size.zero; token; length = 0 }\n\n\n(* Close a tag, popping it from the tag stack. *)\nlet pp_close_stag state () =\n if state.pp_mark_tags then\n pp_enqueue state { size = Size.zero; token = Pp_close_tag; length = 0 };\n if state.pp_print_tags then\n match Stack.pop_opt state.pp_tag_stack with\n | None -> () (* No more tag to close. *)\n | Some tag_name ->\n state.pp_print_close_tag tag_name\n\nlet pp_set_print_tags state b = state.pp_print_tags <- b\nlet pp_set_mark_tags state b = state.pp_mark_tags <- b\nlet pp_get_print_tags state () = state.pp_print_tags\nlet pp_get_mark_tags state () = state.pp_mark_tags\nlet pp_set_tags state b =\n pp_set_print_tags state b; pp_set_mark_tags state b\n\n\n(* Handling tag handling functions: get/set functions. *)\nlet pp_get_formatter_stag_functions state () = {\n mark_open_stag = state.pp_mark_open_tag;\n mark_close_stag = state.pp_mark_close_tag;\n print_open_stag = state.pp_print_open_tag;\n print_close_stag = state.pp_print_close_tag;\n}\n\n\nlet pp_set_formatter_stag_functions state {\n mark_open_stag = mot;\n mark_close_stag = mct;\n print_open_stag = pot;\n print_close_stag = pct;\n } =\n state.pp_mark_open_tag <- mot;\n state.pp_mark_close_tag <- mct;\n state.pp_print_open_tag <- pot;\n state.pp_print_close_tag <- pct\n\n\n(* Initialize pretty-printer. *)\nlet pp_rinit state =\n pp_clear_queue state;\n initialize_scan_stack state.pp_scan_stack;\n Stack.clear state.pp_format_stack;\n Stack.clear state.pp_tbox_stack;\n Stack.clear state.pp_tag_stack;\n Stack.clear state.pp_mark_stack;\n state.pp_current_indent <- 0;\n state.pp_curr_depth <- 0;\n state.pp_space_left <- state.pp_margin;\n pp_open_sys_box state\n\nlet clear_tag_stack state =\n Stack.iter (fun _ -> pp_close_stag state ()) state.pp_tag_stack\n\n\n(* Flushing pretty-printer queue. *)\nlet pp_flush_queue state ~end_with_newline =\n clear_tag_stack state;\n while state.pp_curr_depth > 1 do\n pp_close_box state ()\n done;\n state.pp_right_total <- pp_infinity;\n advance_left state;\n if end_with_newline then pp_output_newline state;\n pp_rinit state\n\n(*\n\n Procedures to format values and use boxes.\n\n*)\n\n(* To format a string. *)\nlet pp_print_as_size state size s =\n if state.pp_curr_depth < state.pp_max_boxes\n then enqueue_string_as state size s\n\n\nlet pp_print_as state isize s =\n pp_print_as_size state (Size.of_int isize) s\n\n\nlet pp_print_string state s =\n pp_print_as state (String.length s) s\n\nlet pp_print_bytes state s =\n pp_print_as state (Bytes.length s) (Bytes.to_string s)\n\n(* To format an integer. *)\nlet pp_print_int state i = pp_print_string state (Int.to_string i)\n\n(* To format a float. *)\nlet pp_print_float state f = pp_print_string state (string_of_float f)\n\n(* To format a boolean. *)\nlet pp_print_bool state b = pp_print_string state (string_of_bool b)\n\n(* To format a char. *)\nlet pp_print_char state c =\n pp_print_as state 1 (String.make 1 c)\n\nlet pp_print_nothing _state () = ()\n\n\n(* Opening boxes. *)\nlet pp_open_hbox state () = pp_open_box_gen state 0 Pp_hbox\nand pp_open_vbox state indent = pp_open_box_gen state indent Pp_vbox\n\nand pp_open_hvbox state indent = pp_open_box_gen state indent Pp_hvbox\nand pp_open_hovbox state indent = pp_open_box_gen state indent Pp_hovbox\nand pp_open_box state indent = pp_open_box_gen state indent Pp_box\n\n\n(* Printing queued text.\n\n [pp_print_flush] prints all pending items in the pretty-printer queue and\n then flushes the low level output device of the formatter to actually\n display printing material.\n\n [pp_print_newline] behaves as [pp_print_flush] after printing an additional\n new line. *)\nlet pp_print_newline state () =\n pp_flush_queue state ~end_with_newline:true; state.pp_out_flush ()\nand pp_print_flush state () =\n pp_flush_queue state ~end_with_newline:false; state.pp_out_flush ()\n\n\n(* To get a newline when one does not want to close the current box. *)\nlet pp_force_newline state () =\n if state.pp_curr_depth < state.pp_max_boxes then\n enqueue_advance state { size = Size.zero; token = Pp_newline; length = 0 }\n\n\n(* To format something, only in case the line has just been broken. *)\nlet pp_print_if_newline state () =\n if state.pp_curr_depth < state.pp_max_boxes then\n enqueue_advance state\n { size = Size.zero; token = Pp_if_newline; length = 0 }\n\n\n(* Generalized break hint that allows printing strings before/after\n same-line offset (width) or new-line offset *)\nlet pp_print_custom_break state ~fits ~breaks =\n let before, width, after = fits in\n if state.pp_curr_depth < state.pp_max_boxes then\n let size = Size.of_int (- state.pp_right_total) in\n let token = Pp_break { fits; breaks } in\n let length = String.length before + width + String.length after in\n let elem = { size; token; length } in\n scan_push state true elem\n\n(* Printing break hints:\n A break hint indicates where a box may be broken.\n If line is broken then offset is added to the indentation of the current\n box else (the value of) width blanks are printed. *)\nlet pp_print_break state width offset =\n pp_print_custom_break state\n ~fits:(\"\", width, \"\") ~breaks:(\"\", offset, \"\")\n\n\n(* Print a space :\n a space is a break hint that prints a single space if the break does not\n split the line;\n a cut is a break hint that prints nothing if the break does not split the\n line. *)\nlet pp_print_space state () = pp_print_break state 1 0\nand pp_print_cut state () = pp_print_break state 0 0\n\n\n(* Tabulation boxes. *)\nlet pp_open_tbox state () =\n state.pp_curr_depth <- state.pp_curr_depth + 1;\n if state.pp_curr_depth < state.pp_max_boxes then\n let size = Size.zero in\n let elem = { size; token = Pp_tbegin (Pp_tbox (ref [])); length = 0 } in\n enqueue_advance state elem\n\n\n(* Close a tabulation box. *)\nlet pp_close_tbox state () =\n if state.pp_curr_depth > 1 then\n begin\n if state.pp_curr_depth < state.pp_max_boxes then\n let elem = { size = Size.zero; token = Pp_tend; length = 0 } in\n enqueue_advance state elem;\n state.pp_curr_depth <- state.pp_curr_depth - 1\n end\n\n\n(* Print a tabulation break. *)\nlet pp_print_tbreak state width offset =\n if state.pp_curr_depth < state.pp_max_boxes then\n let size = Size.of_int (- state.pp_right_total) in\n let elem = { size; token = Pp_tbreak (width, offset); length = width } in\n scan_push state true elem\n\n\nlet pp_print_tab state () = pp_print_tbreak state 0 0\n\nlet pp_set_tab state () =\n if state.pp_curr_depth < state.pp_max_boxes then\n let elem = { size = Size.zero; token = Pp_stab; length = 0 } in\n enqueue_advance state elem\n\n\n(*\n\n Procedures to control the pretty-printers\n\n*)\n\n(* Set_max_boxes. *)\nlet pp_set_max_boxes state n = if n > 1 then state.pp_max_boxes <- n\n\n(* To know the current maximum number of boxes allowed. *)\nlet pp_get_max_boxes state () = state.pp_max_boxes\n\nlet pp_over_max_boxes state () = state.pp_curr_depth = state.pp_max_boxes\n\n(* Ellipsis. *)\nlet pp_set_ellipsis_text state s = state.pp_ellipsis <- s\nand pp_get_ellipsis_text state () = state.pp_ellipsis\n\n\n(* To set the margin of pretty-printer. *)\nlet pp_limit n =\n if n < pp_infinity then n else pred pp_infinity\n\n\n(* Internal pretty-printer functions. *)\nlet pp_set_min_space_left state n =\n if n >= 1 then\n let n = pp_limit n in\n state.pp_min_space_left <- n;\n state.pp_max_indent <- state.pp_margin - state.pp_min_space_left;\n pp_rinit state\n\n\n(* Initially, we have :\n pp_max_indent = pp_margin - pp_min_space_left, and\n pp_space_left = pp_margin. *)\nlet pp_set_max_indent state n =\n if n > 1 then\n pp_set_min_space_left state (state.pp_margin - n)\n\n\nlet pp_get_max_indent state () = state.pp_max_indent\n\nlet pp_set_margin state n =\n if n >= 1 then\n let n = pp_limit n in\n state.pp_margin <- n;\n let new_max_indent =\n (* Try to maintain max_indent to its actual value. *)\n if state.pp_max_indent <= state.pp_margin\n then state.pp_max_indent else\n (* If possible maintain pp_min_space_left to its actual value,\n if this leads to a too small max_indent, take half of the\n new margin, if it is greater than 1. *)\n Int.max (Int.max (state.pp_margin - state.pp_min_space_left)\n (state.pp_margin / 2)) 1 in\n (* Rebuild invariants. *)\n pp_set_max_indent state new_max_indent\n\n\n(** Geometry functions and types *)\ntype geometry = { max_indent:int; margin: int}\n\nlet validate_geometry {margin; max_indent} =\n if max_indent < 2 then\n Error \"max_indent < 2\"\n else if margin <= max_indent then\n Error \"margin <= max_indent\"\n else if margin >= pp_infinity then\n Error \"margin >= pp_infinity\"\n else Ok ()\n\nlet check_geometry geometry =\n match validate_geometry geometry with\n | Ok () -> true\n | Error _ -> false\n\nlet pp_get_margin state () = state.pp_margin\n\nlet pp_set_full_geometry state {margin; max_indent} =\n pp_set_margin state margin;\n pp_set_max_indent state max_indent;\n ()\n\nlet pp_set_geometry state ~max_indent ~margin =\n let geometry = { max_indent; margin } in\n match validate_geometry geometry with\n | Error msg ->\n raise (Invalid_argument (\"Format.pp_set_geometry: \" ^ msg))\n | Ok () ->\n pp_set_full_geometry state geometry\n\nlet pp_safe_set_geometry state ~max_indent ~margin =\n let geometry = { max_indent; margin } in\n match validate_geometry geometry with\n | Error _msg ->\n ()\n | Ok () ->\n pp_set_full_geometry state geometry\n\nlet pp_get_geometry state () =\n { margin = pp_get_margin state (); max_indent = pp_get_max_indent state () }\n\nlet pp_update_geometry state update =\n let geometry = pp_get_geometry state () in\n pp_set_full_geometry state (update geometry)\n\n(* Setting a formatter basic output functions. *)\nlet pp_set_formatter_out_functions state {\n out_string = f;\n out_flush = g;\n out_newline = h;\n out_spaces = i;\n out_indent = j;\n } =\n state.pp_out_string <- f;\n state.pp_out_flush <- g;\n state.pp_out_newline <- h;\n state.pp_out_spaces <- i;\n state.pp_out_indent <- j\n\nlet pp_get_formatter_out_functions state () = {\n out_string = state.pp_out_string;\n out_flush = state.pp_out_flush;\n out_newline = state.pp_out_newline;\n out_spaces = state.pp_out_spaces;\n out_indent = state.pp_out_indent;\n}\n\n\n(* Setting a formatter basic string output and flush functions. *)\nlet pp_set_formatter_output_functions state f g =\n state.pp_out_string <- f; state.pp_out_flush <- g\n\nlet pp_get_formatter_output_functions state () =\n (state.pp_out_string, state.pp_out_flush)\n\n\n(* The default function to output new lines. *)\nlet display_newline state () = state.pp_out_string \"\\n\" 0 1\n\n(* The default function to output spaces. *)\nlet blank_line = String.make 80 ' '\nlet rec display_blanks state n =\n if n > 0 then\n if n <= 80 then state.pp_out_string blank_line 0 n else\n begin\n state.pp_out_string blank_line 0 80;\n display_blanks state (n - 80)\n end\n\n\n(* The default function to output indentation of new lines. *)\nlet display_indent = display_blanks\n\n(* Setting a formatter basic output functions as printing to a given\n [Stdlib.out_channel] value. *)\nlet pp_set_formatter_out_channel state oc =\n state.pp_out_string <- output_substring oc;\n state.pp_out_flush <- (fun () -> flush oc);\n state.pp_out_newline <- display_newline state;\n state.pp_out_spaces <- display_blanks state;\n state.pp_out_indent <- display_indent state\n\n(*\n\n Defining specific formatters\n\n*)\n\nlet default_pp_mark_open_tag = function\n | String_tag s -> \"<\" ^ s ^ \">\"\n | _ -> \"\"\nlet default_pp_mark_close_tag = function\n | String_tag s -> \"</\" ^ s ^ \">\"\n | _ -> \"\"\n\nlet default_pp_print_open_tag = ignore\nlet default_pp_print_close_tag = ignore\n\n(* Building a formatter given its basic output functions.\n Other fields get reasonable default values. *)\nlet pp_make_formatter f g h i j =\n (* The initial state of the formatter contains a dummy box. *)\n let pp_queue = Queue.create () in\n let sys_tok =\n { size = Size.unknown; token = Pp_begin (0, Pp_hovbox); length = 0 } in\n Queue.add sys_tok pp_queue;\n let scan_stack = Stack.create () in\n initialize_scan_stack scan_stack;\n Stack.push { left_total = 1; queue_elem = sys_tok } scan_stack;\n let pp_margin = 78\n and pp_min_space_left = 10 in\n {\n pp_scan_stack = scan_stack;\n pp_format_stack = Stack.create ();\n pp_tbox_stack = Stack.create ();\n pp_tag_stack = Stack.create ();\n pp_mark_stack = Stack.create ();\n pp_margin = pp_margin;\n pp_min_space_left = pp_min_space_left;\n pp_max_indent = pp_margin - pp_min_space_left;\n pp_space_left = pp_margin;\n pp_current_indent = 0;\n pp_is_new_line = true;\n pp_left_total = 1;\n pp_right_total = 1;\n pp_curr_depth = 1;\n pp_max_boxes = max_int;\n pp_ellipsis = \".\";\n pp_out_string = f;\n pp_out_flush = g;\n pp_out_newline = h;\n pp_out_spaces = i;\n pp_out_indent = j;\n pp_print_tags = false;\n pp_mark_tags = false;\n pp_mark_open_tag = default_pp_mark_open_tag;\n pp_mark_close_tag = default_pp_mark_close_tag;\n pp_print_open_tag = default_pp_print_open_tag;\n pp_print_close_tag = default_pp_print_close_tag;\n pp_queue = pp_queue;\n }\n\n\n(* Build a formatter out of its out functions. *)\nlet formatter_of_out_functions out_funs =\n pp_make_formatter\n out_funs.out_string\n out_funs.out_flush\n out_funs.out_newline\n out_funs.out_spaces\n out_funs.out_indent\n\n\n(* Make a formatter with default functions to output spaces,\n indentation, and new lines. *)\nlet make_formatter output flush =\n let ppf = pp_make_formatter output flush ignore ignore ignore in\n ppf.pp_out_newline <- display_newline ppf;\n ppf.pp_out_spaces <- display_blanks ppf;\n ppf.pp_out_indent <- display_indent ppf;\n ppf\n\n\n(* Make a formatter writing to a given [Stdlib.out_channel] value. *)\nlet formatter_of_out_channel oc =\n make_formatter (output_substring oc) (fun () -> flush oc)\n\n\n(* Make a formatter writing to a given [Buffer.t] value. *)\nlet formatter_of_buffer b =\n make_formatter (Buffer.add_substring b) ignore\n\n\n(* Allocating buffer for pretty-printing purposes.\n Default buffer size is pp_buffer_size or 512.\n*)\nlet pp_buffer_size = 512\nlet pp_make_buffer () = Buffer.create pp_buffer_size\n\n(* The standard (shared) buffer. *)\nlet stdbuf = pp_make_buffer ()\n\n(* Predefined formatters standard formatter to print\n to [Stdlib.stdout], [Stdlib.stderr], and {!stdbuf}. *)\nlet std_formatter = formatter_of_out_channel Stdlib.stdout\nand err_formatter = formatter_of_out_channel Stdlib.stderr\nand str_formatter = formatter_of_buffer stdbuf\n\n(* Initialise domain local state *)\nmodule DLS = Domain.DLS\n\nlet stdbuf_key = DLS.new_key pp_make_buffer\nlet _ = DLS.set stdbuf_key stdbuf\n\nlet str_formatter_key = DLS.new_key (fun () ->\n formatter_of_buffer (DLS.get stdbuf_key))\nlet _ = DLS.set str_formatter_key str_formatter\n\nlet buffered_out_string key str ofs len =\n Buffer.add_substring (Domain.DLS.get key) str ofs len\n\nlet buffered_out_flush oc key () =\n let buf = Domain.DLS.get key in\n let len = Buffer.length buf in\n let str = Buffer.contents buf in\n output_substring oc str 0 len ;\n Stdlib.flush oc;\n Buffer.clear buf\n\nlet std_buf_key = Domain.DLS.new_key (fun () -> Buffer.create pp_buffer_size)\nlet err_buf_key = Domain.DLS.new_key (fun () -> Buffer.create pp_buffer_size)\n\nlet std_formatter_key = DLS.new_key (fun () ->\n let ppf =\n pp_make_formatter (buffered_out_string std_buf_key)\n (buffered_out_flush Stdlib.stdout std_buf_key) ignore ignore ignore\n in\n ppf.pp_out_newline <- display_newline ppf;\n ppf.pp_out_spaces <- display_blanks ppf;\n ppf.pp_out_indent <- display_indent ppf;\n Domain.at_exit (pp_print_flush ppf);\n ppf)\nlet _ = DLS.set std_formatter_key std_formatter\n\nlet err_formatter_key = DLS.new_key (fun () ->\n let ppf =\n pp_make_formatter (buffered_out_string err_buf_key)\n (buffered_out_flush Stdlib.stderr err_buf_key) ignore ignore ignore\n in\n ppf.pp_out_newline <- display_newline ppf;\n ppf.pp_out_spaces <- display_blanks ppf;\n ppf.pp_out_indent <- display_indent ppf;\n Domain.at_exit (pp_print_flush ppf);\n ppf)\nlet _ = DLS.set err_formatter_key err_formatter\n\nlet get_std_formatter () = DLS.get std_formatter_key\nlet get_err_formatter () = DLS.get err_formatter_key\nlet get_str_formatter () = DLS.get str_formatter_key\nlet get_stdbuf () = DLS.get stdbuf_key\n\n(* [flush_buffer_formatter buf ppf] flushes formatter [ppf],\n then returns the contents of buffer [buf] that is reset.\n Formatter [ppf] is supposed to print to buffer [buf], otherwise this\n function is not really useful. *)\nlet flush_buffer_formatter buf ppf =\n pp_flush_queue ppf ~end_with_newline:false;\n let s = Buffer.contents buf in\n Buffer.reset buf;\n s\n\n(* Flush [str_formatter] and get the contents of [stdbuf]. *)\nlet flush_str_formatter () =\n let stdbuf = DLS.get stdbuf_key in\n let str_formatter = DLS.get str_formatter_key in\n flush_buffer_formatter stdbuf str_formatter\n\nlet make_synchronized_formatter output flush =\n DLS.new_key (fun () ->\n let buf = Buffer.create pp_buffer_size in\n let output' = Buffer.add_substring buf in\n let flush' () =\n output (Buffer.contents buf) 0 (Buffer.length buf);\n Buffer.clear buf;\n flush ()\n in\n make_formatter output' flush')\n\nlet synchronized_formatter_of_out_channel oc =\n make_synchronized_formatter (output_substring oc) (fun () -> flush oc)\n\n(*\n Symbolic pretty-printing\n*)\n\n(*\n Symbolic pretty-printing is pretty-printing with no low level output.\n\n When using a symbolic formatter, all regular pretty-printing activities\n occur but output material is symbolic and stored in a buffer of output\n items. At the end of pretty-printing, flushing the output buffer allows\n post-processing of symbolic output before low level output operations.\n*)\n\ntype symbolic_output_item =\n | Output_flush\n | Output_newline\n | Output_string of string\n | Output_spaces of int\n | Output_indent of int\n\ntype symbolic_output_buffer = {\n mutable symbolic_output_contents : symbolic_output_item list;\n}\n\nlet make_symbolic_output_buffer () =\n { symbolic_output_contents = [] }\n\nlet clear_symbolic_output_buffer sob =\n sob.symbolic_output_contents <- []\n\nlet get_symbolic_output_buffer sob =\n List.rev sob.symbolic_output_contents\n\nlet flush_symbolic_output_buffer sob =\n let items = get_symbolic_output_buffer sob in\n clear_symbolic_output_buffer sob;\n items\n\nlet add_symbolic_output_item sob item =\n sob.symbolic_output_contents <- item :: sob.symbolic_output_contents\n\nlet formatter_of_symbolic_output_buffer sob =\n let symbolic_flush sob () =\n add_symbolic_output_item sob Output_flush\n and symbolic_newline sob () =\n add_symbolic_output_item sob Output_newline\n and symbolic_string sob s i n =\n add_symbolic_output_item sob (Output_string (String.sub s i n))\n and symbolic_spaces sob n =\n add_symbolic_output_item sob (Output_spaces n)\n and symbolic_indent sob n =\n add_symbolic_output_item sob (Output_indent n) in\n\n let f = symbolic_string sob\n and g = symbolic_flush sob\n and h = symbolic_newline sob\n and i = symbolic_spaces sob\n and j = symbolic_indent sob in\n pp_make_formatter f g h i j\n\n(*\n\n Basic functions on the 'standard' formatter\n (the formatter that prints to [Stdlib.stdout]).\n\n*)\n\nlet open_hbox v = pp_open_hbox (DLS.get std_formatter_key) v\nand open_vbox v = pp_open_vbox (DLS.get std_formatter_key) v\nand open_hvbox v = pp_open_hvbox (DLS.get std_formatter_key) v\nand open_hovbox v = pp_open_hovbox (DLS.get std_formatter_key) v\nand open_box v = pp_open_box (DLS.get std_formatter_key) v\nand close_box v = pp_close_box (DLS.get std_formatter_key) v\nand open_stag v = pp_open_stag (DLS.get std_formatter_key) v\nand close_stag v = pp_close_stag (DLS.get std_formatter_key) v\nand print_as v w = pp_print_as (DLS.get std_formatter_key) v w\nand print_string v = pp_print_string (DLS.get std_formatter_key) v\nand print_bytes v = pp_print_bytes (DLS.get std_formatter_key) v\nand print_int v = pp_print_int (DLS.get std_formatter_key) v\nand print_float v = pp_print_float (DLS.get std_formatter_key) v\nand print_char v = pp_print_char (DLS.get std_formatter_key) v\nand print_bool v = pp_print_bool (DLS.get std_formatter_key) v\nand print_break v w = pp_print_break (DLS.get std_formatter_key) v w\nand print_cut v = pp_print_cut (DLS.get std_formatter_key) v\nand print_space v = pp_print_space (DLS.get std_formatter_key) v\nand force_newline v = pp_force_newline (DLS.get std_formatter_key) v\nand print_flush v = pp_print_flush (DLS.get std_formatter_key) v\nand print_newline v = pp_print_newline (DLS.get std_formatter_key) v\nand print_if_newline v = pp_print_if_newline (DLS.get std_formatter_key) v\n\nand open_tbox v = pp_open_tbox (DLS.get std_formatter_key) v\nand close_tbox v = pp_close_tbox (DLS.get std_formatter_key) v\nand print_tbreak v w = pp_print_tbreak (DLS.get std_formatter_key) v w\n\nand set_tab v = pp_set_tab (DLS.get std_formatter_key) v\nand print_tab v = pp_print_tab (DLS.get std_formatter_key) v\n\nand set_margin v = pp_set_margin (DLS.get std_formatter_key) v\nand get_margin v = pp_get_margin (DLS.get std_formatter_key) v\n\nand set_max_indent v = pp_set_max_indent (DLS.get std_formatter_key) v\nand get_max_indent v = pp_get_max_indent (DLS.get std_formatter_key) v\n\nand set_geometry ~max_indent ~margin =\n pp_set_geometry (DLS.get std_formatter_key) ~max_indent ~margin\nand safe_set_geometry ~max_indent ~margin =\n pp_safe_set_geometry (DLS.get std_formatter_key) ~max_indent ~margin\nand get_geometry v = pp_get_geometry (DLS.get std_formatter_key) v\nand update_geometry v = pp_update_geometry (DLS.get std_formatter_key) v\n\nand set_max_boxes v = pp_set_max_boxes (DLS.get std_formatter_key) v\nand get_max_boxes v = pp_get_max_boxes (DLS.get std_formatter_key) v\nand over_max_boxes v = pp_over_max_boxes (DLS.get std_formatter_key) v\n\nand set_ellipsis_text v = pp_set_ellipsis_text (DLS.get std_formatter_key) v\nand get_ellipsis_text v = pp_get_ellipsis_text (DLS.get std_formatter_key) v\n\nand set_formatter_out_channel v =\n pp_set_formatter_out_channel (DLS.get std_formatter_key) v\n\nand set_formatter_out_functions v =\n pp_set_formatter_out_functions (DLS.get std_formatter_key) v\nand get_formatter_out_functions v =\n pp_get_formatter_out_functions (DLS.get std_formatter_key) v\n\nand set_formatter_output_functions v w =\n pp_set_formatter_output_functions (DLS.get std_formatter_key) v w\nand get_formatter_output_functions v =\n pp_get_formatter_output_functions (DLS.get std_formatter_key) v\n\nand set_formatter_stag_functions v =\n pp_set_formatter_stag_functions (DLS.get std_formatter_key) v\nand get_formatter_stag_functions v =\n pp_get_formatter_stag_functions (DLS.get std_formatter_key) v\nand set_print_tags v =\n pp_set_print_tags (DLS.get std_formatter_key) v\nand get_print_tags v =\n pp_get_print_tags (DLS.get std_formatter_key) v\nand set_mark_tags v =\n pp_set_mark_tags (DLS.get std_formatter_key) v\nand get_mark_tags v =\n pp_get_mark_tags (DLS.get std_formatter_key) v\nand set_tags v =\n pp_set_tags (DLS.get std_formatter_key) v\n\n\n(* Convenience functions *)\n\nlet pp_print_iter ?(pp_sep = pp_print_cut) iter pp_v ppf v =\n let is_first = ref true in\n let pp_v v =\n if !is_first then is_first := false else pp_sep ppf ();\n pp_v ppf v\n in\n iter pp_v v\n\n(* To format a list *)\nlet pp_print_list ?(pp_sep = pp_print_cut) pp_v ppf v =\n pp_print_iter ~pp_sep List.iter pp_v ppf v\n\n(* To format an array *)\nlet pp_print_array ?(pp_sep = pp_print_cut) pp_v ppf v =\n pp_print_iter ~pp_sep Array.iter pp_v ppf v\n\n(* To format a sequence *)\nlet pp_print_seq ?(pp_sep = pp_print_cut) pp_v ppf seq =\n pp_print_iter ~pp_sep Seq.iter pp_v ppf seq\n\n(* To format free-flowing text *)\nlet pp_print_text ppf s =\n let len = String.length s in\n let left = ref 0 in\n let right = ref 0 in\n let flush () =\n pp_print_string ppf (String.sub s !left (!right - !left));\n incr right; left := !right;\n in\n while (!right <> len) do\n match s.[!right] with\n | '\\n' ->\n flush ();\n pp_force_newline ppf ()\n | ' ' ->\n flush (); pp_print_space ppf ()\n (* there is no specific support for '\\t'\n as it is unclear what a right semantics would be *)\n | _ -> incr right\n done;\n if !left <> len then flush ()\n\nlet pp_print_option ?(none = fun _ () -> ()) pp_v ppf = function\n| None -> none ppf ()\n| Some v -> pp_v ppf v\n\nlet pp_print_result ~ok ~error ppf = function\n| Ok v -> ok ppf v\n| Error e -> error ppf e\n\nlet pp_print_either ~left ~right ppf = function\n| Either.Left l -> left ppf l\n| Either.Right r -> right ppf r\n\n (**************************************************************)\n\nlet compute_tag output tag_acc =\n let buf = Buffer.create 16 in\n let ppf = formatter_of_buffer buf in\n output ppf tag_acc;\n pp_print_flush ppf ();\n let len = Buffer.length buf in\n if len < 2 then Buffer.contents buf\n else Buffer.sub buf 1 (len - 2)\n\n (**************************************************************\n\n Defining continuations to be passed as arguments of\n CamlinternalFormat.make_printf.\n\n **************************************************************)\n\nopen CamlinternalFormatBasics\nopen CamlinternalFormat\n\n(* Interpret a formatting entity on a formatter. *)\nlet output_formatting_lit ppf fmting_lit = match fmting_lit with\n | Close_box -> pp_close_box ppf ()\n | Close_tag -> pp_close_stag ppf ()\n | Break (_, width, offset) -> pp_print_break ppf width offset\n | FFlush -> pp_print_flush ppf ()\n | Force_newline -> pp_force_newline ppf ()\n | Flush_newline -> pp_print_newline ppf ()\n | Magic_size (_, _) -> ()\n | Escaped_at -> pp_print_char ppf '@'\n | Escaped_percent -> pp_print_char ppf '%'\n | Scan_indic c -> pp_print_char ppf '@'; pp_print_char ppf c\n\n(* Recursively output an \"accumulator\" containing a reversed list of\n printing entities (string, char, flus, ...) in an output_stream. *)\n(* Differ from Printf.output_acc by the interpretation of formatting. *)\n(* Used as a continuation of CamlinternalFormat.make_printf. *)\nlet rec output_acc ppf acc = match acc with\n | Acc_string_literal (Acc_formatting_lit (p, Magic_size (_, size)), s)\n | Acc_data_string (Acc_formatting_lit (p, Magic_size (_, size)), s) ->\n output_acc ppf p;\n pp_print_as_size ppf (Size.of_int size) s;\n | Acc_char_literal (Acc_formatting_lit (p, Magic_size (_, size)), c)\n | Acc_data_char (Acc_formatting_lit (p, Magic_size (_, size)), c) ->\n output_acc ppf p;\n pp_print_as_size ppf (Size.of_int size) (String.make 1 c);\n | Acc_formatting_lit (p, f) ->\n output_acc ppf p;\n output_formatting_lit ppf f;\n | Acc_formatting_gen (p, Acc_open_tag acc') ->\n output_acc ppf p;\n pp_open_stag ppf (String_tag (compute_tag output_acc acc'))\n | Acc_formatting_gen (p, Acc_open_box acc') ->\n output_acc ppf p;\n let (indent, bty) = open_box_of_string (compute_tag output_acc acc') in\n pp_open_box_gen ppf indent bty\n | Acc_string_literal (p, s)\n | Acc_data_string (p, s) -> output_acc ppf p; pp_print_string ppf s;\n | Acc_char_literal (p, c)\n | Acc_data_char (p, c) -> output_acc ppf p; pp_print_char ppf c;\n | Acc_delay (p, f) -> output_acc ppf p; f ppf;\n | Acc_flush p -> output_acc ppf p; pp_print_flush ppf ();\n | Acc_invalid_arg (p, msg) -> output_acc ppf p; invalid_arg msg;\n | End_of_acc -> ()\n\n(* Recursively output an \"accumulator\" containing a reversed list of\n printing entities (string, char, flus, ...) in a buffer. *)\n(* Differ from Printf.bufput_acc by the interpretation of formatting. *)\n(* Used as a continuation of CamlinternalFormat.make_printf. *)\nlet rec strput_acc ppf acc = match acc with\n | Acc_string_literal (Acc_formatting_lit (p, Magic_size (_, size)), s)\n | Acc_data_string (Acc_formatting_lit (p, Magic_size (_, size)), s) ->\n strput_acc ppf p;\n pp_print_as_size ppf (Size.of_int size) s;\n | Acc_char_literal (Acc_formatting_lit (p, Magic_size (_, size)), c)\n | Acc_data_char (Acc_formatting_lit (p, Magic_size (_, size)), c) ->\n strput_acc ppf p;\n pp_print_as_size ppf (Size.of_int size) (String.make 1 c);\n | Acc_delay (Acc_formatting_lit (p, Magic_size (_, size)), f) ->\n strput_acc ppf p;\n pp_print_as_size ppf (Size.of_int size) (f ());\n | Acc_formatting_lit (p, f) ->\n strput_acc ppf p;\n output_formatting_lit ppf f;\n | Acc_formatting_gen (p, Acc_open_tag acc') ->\n strput_acc ppf p;\n pp_open_stag ppf (String_tag (compute_tag strput_acc acc'))\n | Acc_formatting_gen (p, Acc_open_box acc') ->\n strput_acc ppf p;\n let (indent, bty) = open_box_of_string (compute_tag strput_acc acc') in\n pp_open_box_gen ppf indent bty\n | Acc_string_literal (p, s)\n | Acc_data_string (p, s) -> strput_acc ppf p; pp_print_string ppf s;\n | Acc_char_literal (p, c)\n | Acc_data_char (p, c) -> strput_acc ppf p; pp_print_char ppf c;\n | Acc_delay (p, f) -> strput_acc ppf p; pp_print_string ppf (f ());\n | Acc_flush p -> strput_acc ppf p; pp_print_flush ppf ();\n | Acc_invalid_arg (p, msg) -> strput_acc ppf p; invalid_arg msg;\n | End_of_acc -> ()\n\n(*\n\n Defining [fprintf] and various flavors of [fprintf].\n\n*)\n\nlet kfprintf k ppf (Format (fmt, _)) =\n make_printf\n (fun acc -> output_acc ppf acc; k ppf)\n End_of_acc fmt\n\nand ikfprintf k ppf (Format (fmt, _)) =\n make_iprintf k ppf fmt\n\nlet ifprintf _ppf (Format (fmt, _)) =\n make_iprintf ignore () fmt\n\nlet fprintf ppf = kfprintf ignore ppf\n\nlet printf (Format (fmt, _)) =\n make_printf\n (fun acc -> output_acc (DLS.get std_formatter_key) acc)\n End_of_acc fmt\n\nlet eprintf (Format (fmt, _)) =\n make_printf\n (fun acc -> output_acc (DLS.get err_formatter_key) acc)\n End_of_acc fmt\n\nlet kdprintf k (Format (fmt, _)) =\n make_printf\n (fun acc -> k (fun ppf -> output_acc ppf acc))\n End_of_acc fmt\n\nlet dprintf fmt = kdprintf (fun i -> i) fmt\n\nlet ksprintf k (Format (fmt, _)) =\n let b = pp_make_buffer () in\n let ppf = formatter_of_buffer b in\n let k acc =\n strput_acc ppf acc;\n k (flush_buffer_formatter b ppf) in\n make_printf k End_of_acc fmt\n\n\nlet sprintf fmt = ksprintf id fmt\n\nlet kasprintf k (Format (fmt, _)) =\n let b = pp_make_buffer () in\n let ppf = formatter_of_buffer b in\n let k acc =\n output_acc ppf acc;\n k (flush_buffer_formatter b ppf) in\n make_printf k End_of_acc fmt\n\n\nlet asprintf fmt = kasprintf id fmt\n\n(* Flushing standard formatters at end of execution. *)\n\nlet flush_standard_formatters () =\n pp_print_flush (DLS.get std_formatter_key) ();\n pp_print_flush (DLS.get err_formatter_key) ()\n\nlet () = at_exit flush_standard_formatters\n\nlet () = Domain.before_first_spawn (fun () ->\n flush_standard_formatters ();\n let fs = pp_get_formatter_out_functions std_formatter () in\n pp_set_formatter_out_functions std_formatter\n {fs with out_string = buffered_out_string std_buf_key;\n out_flush = buffered_out_flush Stdlib.stdout std_buf_key};\n\n let fs = pp_get_formatter_out_functions err_formatter () in\n pp_set_formatter_out_functions err_formatter\n {fs with out_string = buffered_out_string err_buf_key;\n out_flush = buffered_out_flush Stdlib.stderr err_buf_key};\n)\n","(* generated code *)"],"names":[],"mappings":"EA88C0B,oB,KACD,qB,OATvB,qBAEA,OACuD,IAA/B,gBACD,UAFvB,OAEuB,GA9lBqB,6CA6lBW,IADvD,QAMuD,WAA/B,gBACD,UAFvB,OAEuB,GAnmBqB,6CAkmBW,WACc,C,KAfrE,OAAe,IAAf,gBAAe,aAAf,YACe,MAD8B,gBAC9B,aAA2B,WAAG,C,EAN5B,mBAAgB,C,MAL/B,0BACE,iBAA8B,qB,MALtB,YAGZ,GAHY,QAGZ,OAFQ,aACE,YACV,IAGA,2BAA4B,C,EARZ,mBAAe,C,MAL7B,0BACE,iBAA8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AGR,YACA,QACK,gCACA,4C,IAAA,uBAcP,qBACA,kBAAY,eAAmC,OACrC,4BAER,QAFQ,OAER,K,GAAA,QAOE,mBACA,iCACO,UAEP,mDACK,UACA,Q,IANwB,Q,EAL7B,sCACK,UACA,Q,EAAA,kB,EAzET,IAyES,UAzET,MAqGI,C,WA5IY,uBAClB,EADkB,OAClB,IAA0B,oCAhCG,uBAkCD,OACH,C,SArBR,uBACjB,EADiB,OACjB,IACA,MAAuB,gBAKvB,IADA,OAFA,4BAEkB,EAAlB,QAAkB,aAClB,GACA,kCACA,OAtB6B,qBAsBiB,OACrB,C,QAbtB,SAAO,WAAM,qBAAwC,C,KANxD,+BACA,QAA2B,aACE,C,EARD,2BAAuB,C,KADtB,2BAAyC,C,KAhCtE,uCACA,8BAA8B,C,2FC3NhC,oBDi4BmC,MAAlB,SCj4BjB,QDi4BiB,aAAkB,8EAwHtB,aAAiB,OAIV,OAAsC,OACtC,OACA,SAKH,OAL6B,gBAK7B,KACT,EADmC,gBACnC,IAEgB,IAFS,2BAET,KAEhB,EADmC,gBACnC,IAaU,OAb6B,gBAa7B,KACA,OAD2D,gBAC3D,KAEM,IAFqD,6BAErD,KAUhB,EADF,gBACE,IAEgB,IAFuB,6BAEvB,KAUhB,EADF,gBACE,IAAuC,iyBAoZtC,cAAiC,yBAEjC,cAWR,wY,QCh9CD,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA,sD,EAAA,c,EAAA,c,EAAA,c,EAAA,c,iBAAA","ignoreList":[1]}},{"offset":{"line":0,"column":319949},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/scanf.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2002 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nopen CamlinternalFormatBasics\nopen CamlinternalFormat\n\n(* alias to avoid warning for ambiguity between\n Stdlib.format6\n and CamlinternalFormatBasics.format6\n\n (the former is in fact an alias for the latter,\n but the ambiguity warning doesn't care)\n*)\ntype ('a, 'b, 'c, 'd, 'e, 'f) format6 =\n ('a, 'b, 'c, 'd, 'e, 'f) Stdlib.format6\n\n\n(* The run-time library for scanners. *)\n\n(* Scanning buffers. *)\nmodule type SCANNING = sig\n\n type in_channel\n\n type scanbuf = in_channel\n\n type file_name = string\n\n val stdin : in_channel\n (* The scanning buffer reading from [Stdlib.stdin]. *)\n\n val next_char : scanbuf -> char\n (* [Scanning.next_char ib] advance the scanning buffer for\n one character.\n If no more character can be read, sets a end of file condition and\n returns '\\000'. *)\n\n val invalidate_current_char : scanbuf -> unit\n (* [Scanning.invalidate_current_char ib] mark the current_char as already\n scanned. *)\n\n val peek_char : scanbuf -> char\n (* [Scanning.peek_char ib] returns the current char available in\n the buffer or reads one if necessary (when the current character is\n already scanned).\n If no character can be read, sets an end of file condition and\n returns '\\000'. *)\n\n val checked_peek_char : scanbuf -> char\n (* Same as [Scanning.peek_char] above but always returns a valid char or\n fails: instead of returning a null char when the reading method of the\n input buffer has reached an end of file, the function raises exception\n [End_of_file]. *)\n\n val store_char : int -> scanbuf -> char -> int\n (* [Scanning.store_char lim ib c] adds [c] to the token buffer\n of the scanning buffer [ib]. It also advances the scanning buffer for\n one character and returns [lim - 1], indicating the new limit for the\n length of the current token. *)\n\n val skip_char : int -> scanbuf -> int\n (* [Scanning.skip_char lim ib] ignores the current character. *)\n\n val ignore_char : int -> scanbuf -> int\n (* [Scanning.ignore_char ib lim] ignores the current character and\n decrements the limit. *)\n\n val token : scanbuf -> string\n (* [Scanning.token ib] returns the string stored into the token\n buffer of the scanning buffer: it returns the token matched by the\n format. *)\n\n val reset_token : scanbuf -> unit\n (* [Scanning.reset_token ib] resets the token buffer of\n the given scanning buffer. *)\n\n val char_count : scanbuf -> int\n (* [Scanning.char_count ib] returns the number of characters\n read so far from the given buffer. *)\n\n val line_count : scanbuf -> int\n (* [Scanning.line_count ib] returns the number of new line\n characters read so far from the given buffer. *)\n\n val token_count : scanbuf -> int\n (* [Scanning.token_count ib] returns the number of tokens read\n so far from [ib]. *)\n\n val eof : scanbuf -> bool\n (* [Scanning.eof ib] returns the end of input condition\n of the given buffer. *)\n\n val end_of_input : scanbuf -> bool\n (* [Scanning.end_of_input ib] tests the end of input condition\n of the given buffer (if no char has ever been read, an attempt to\n read one is performed). *)\n\n val beginning_of_input : scanbuf -> bool\n (* [Scanning.beginning_of_input ib] tests the beginning of input\n condition of the given buffer. *)\n\n val name_of_input : scanbuf -> string\n (* [Scanning.name_of_input ib] returns the name of the character\n source for input buffer [ib]. *)\n\n val open_in : file_name -> in_channel\n val open_in_bin : file_name -> in_channel\n val from_file : file_name -> in_channel\n val from_file_bin : file_name -> in_channel\n val from_string : string -> in_channel\n val from_function : (unit -> char) -> in_channel\n val from_channel : Stdlib.in_channel -> in_channel\n\n val close_in : in_channel -> unit\n\nend\n\n\nmodule Scanning : SCANNING = struct\n\n (* The run-time library for scanf. *)\n\n type file_name = string\n\n type in_channel_name =\n | From_channel of Stdlib.in_channel\n | From_file of file_name * Stdlib.in_channel\n | From_function\n | From_string\n\n\n type in_channel = {\n mutable ic_eof : bool;\n mutable ic_current_char : char;\n mutable ic_current_char_is_valid : bool;\n mutable ic_char_count : int;\n mutable ic_line_count : int;\n mutable ic_token_count : int;\n ic_get_next_char : unit -> char;\n ic_token_buffer : Buffer.t;\n ic_input_name : in_channel_name;\n }\n\n\n type scanbuf = in_channel\n\n let null_char = '\\000'\n\n (* Reads a new character from input buffer.\n Next_char never fails, even in case of end of input:\n it then simply sets the end of file condition. *)\n let next_char ib =\n try\n let c = ib.ic_get_next_char () in\n ib.ic_current_char <- c;\n ib.ic_current_char_is_valid <- true;\n ib.ic_char_count <- succ ib.ic_char_count;\n if c = '\\n' then ib.ic_line_count <- succ ib.ic_line_count;\n c with\n | End_of_file ->\n let c = null_char in\n ib.ic_current_char <- c;\n ib.ic_current_char_is_valid <- false;\n ib.ic_eof <- true;\n c\n\n\n let peek_char ib =\n if ib.ic_current_char_is_valid\n then ib.ic_current_char\n else next_char ib\n\n\n (* Returns a valid current char for the input buffer. In particular\n no irrelevant null character (as set by [next_char] in case of end\n of input) is returned, since [End_of_file] is raised when\n [next_char] sets the end of file condition while trying to read a\n new character. *)\n let checked_peek_char ib =\n let c = peek_char ib in\n if ib.ic_eof then raise End_of_file;\n c\n\n\n let end_of_input ib =\n ignore (peek_char ib);\n ib.ic_eof\n\n\n let eof ib = ib.ic_eof\n\n let beginning_of_input ib = ib.ic_char_count = 0\n\n let name_of_input ib =\n match ib.ic_input_name with\n | From_channel _ic -> \"unnamed Stdlib input channel\"\n | From_file (fname, _ic) -> fname\n | From_function -> \"unnamed function\"\n | From_string -> \"unnamed character string\"\n\n\n let char_count ib =\n if ib.ic_current_char_is_valid\n then ib.ic_char_count - 1\n else ib.ic_char_count\n\n\n let line_count ib = ib.ic_line_count\n\n let reset_token ib = Buffer.reset ib.ic_token_buffer\n\n let invalidate_current_char ib = ib.ic_current_char_is_valid <- false\n\n let token ib =\n let token_buffer = ib.ic_token_buffer in\n let tok = Buffer.contents token_buffer in\n Buffer.clear token_buffer;\n ib.ic_token_count <- succ ib.ic_token_count;\n tok\n\n\n let token_count ib = ib.ic_token_count\n\n let skip_char width ib =\n invalidate_current_char ib;\n width\n\n\n let ignore_char width ib = skip_char (width - 1) ib\n\n let store_char width ib c =\n Buffer.add_char ib.ic_token_buffer c;\n ignore_char width ib\n\n\n let default_token_buffer_size = 1024\n\n let create iname next = {\n ic_eof = false;\n ic_current_char = null_char;\n ic_current_char_is_valid = false;\n ic_char_count = 0;\n ic_line_count = 0;\n ic_token_count = 0;\n ic_get_next_char = next;\n ic_token_buffer = Buffer.create default_token_buffer_size;\n ic_input_name = iname;\n }\n\n\n let from_string s =\n let i = ref 0 in\n let len = String.length s in\n let next () =\n if !i >= len then raise End_of_file else\n let c = s.[!i] in\n incr i;\n c in\n create From_string next\n\n\n let from_function = create From_function\n\n (* Scanning from an input channel. *)\n\n (* Position of the problem:\n\n We cannot prevent the scanning mechanism to use one lookahead character,\n if needed by the semantics of the format string specifications (e.g. a\n trailing 'skip space' specification in the format string); in this case,\n the mandatory lookahead character is indeed read from the input and not\n used to return the token read. It is thus mandatory to be able to store\n an unused lookahead character somewhere to get it as the first character\n of the next scan.\n\n To circumvent this problem, all the scanning functions get a low level\n input buffer argument where they store the lookahead character when\n needed; additionally, the input buffer is the only source of character of\n a scanner. The [scanbuf] input buffers are defined in module {!Scanning}.\n\n Now we understand that it is extremely important that related and\n successive calls to scanners indeed read from the same input buffer.\n In effect, if a scanner [scan1] is reading from [ib1] and stores an\n unused lookahead character [c1] into its input buffer [ib1], then\n another scanner [scan2] not reading from the same buffer [ib1] will miss\n the character [c1], seemingly vanished in the air from the point of view\n of [scan2].\n\n This mechanism works perfectly to read from strings, from files, and from\n functions, since in those cases, allocating two buffers reading from the\n same source is unnatural.\n\n Still, there is a difficulty in the case of scanning from an input\n channel. In effect, when scanning from an input channel [ic], this channel\n may not have been allocated from within this library. Hence, it may be\n shared (two functions of the user's program may successively read from\n [ic]). This is highly error prone since, one of the function may seek the\n input channel, while the other function has still an unused lookahead\n character in its input buffer. In conclusion, you should never mix direct\n low level reading and high level scanning from the same input channel.\n\n *)\n\n (* Perform bufferized input to improve efficiency. *)\n let file_buffer_size = ref 1024\n\n (* The scanner closes the input channel at end of input. *)\n let scan_close_at_end ic = Stdlib.close_in ic; raise End_of_file\n\n (* The scanner does not close the input channel at end of input:\n it just raises [End_of_file]. *)\n let scan_raise_at_end _ic = raise End_of_file\n\n let from_ic scan_close_ic iname ic =\n let len = !file_buffer_size in\n let buf = Bytes.create len in\n let i = ref 0 in\n let lim = ref 0 in\n let eof = ref false in\n let next () =\n if !i < !lim then begin let c = Bytes.get buf !i in incr i; c end else\n if !eof then raise End_of_file else begin\n lim := input ic buf 0 len;\n if !lim = 0 then begin eof := true; scan_close_ic ic end else begin\n i := 1;\n Bytes.get buf 0\n end\n end in\n create iname next\n\n\n let from_ic_close_at_end = from_ic scan_close_at_end\n let from_ic_raise_at_end = from_ic scan_raise_at_end\n\n (* The scanning buffer reading from [Stdlib.stdin].\n One could try to define [stdin] as a scanning buffer reading a character\n at a time (no bufferization at all), but unfortunately the top-level\n interaction would be wrong. This is due to some kind of\n 'race condition' when reading from [Stdlib.stdin],\n since the interactive compiler and [Scanf.scanf] will simultaneously\n read the material they need from [Stdlib.stdin]; then, confusion\n will result from what should be read by the top-level and what should be\n read by [Scanf.scanf].\n This is even more complicated by the one character lookahead that\n [Scanf.scanf] is sometimes obliged to maintain: the lookahead character\n will be available for the next [Scanf.scanf] entry, seemingly coming from\n nowhere.\n Also no [End_of_file] is raised when reading from stdin: if not enough\n characters have been read, we simply ask to read more. *)\n let stdin =\n from_ic scan_raise_at_end\n (From_file (\"-\", Stdlib.stdin)) Stdlib.stdin\n\n let open_in_file open_in fname =\n match fname with\n | \"-\" -> stdin\n | fname ->\n let ic = open_in fname in\n from_ic_close_at_end (From_file (fname, ic)) ic\n\n\n let open_in = open_in_file Stdlib.open_in\n let open_in_bin = open_in_file Stdlib.open_in_bin\n\n let from_file = open_in\n let from_file_bin = open_in_bin\n\n let from_channel ic =\n from_ic_raise_at_end (From_channel ic) ic\n\n\n let close_in ib =\n match ib.ic_input_name with\n | From_channel ic ->\n Stdlib.close_in ic\n | From_file (_fname, ic) -> Stdlib.close_in ic\n | From_function | From_string -> ()\n\nend\n\n\n(* Formatted input functions. *)\n\ntype ('a, 'b, 'c, 'd) scanner =\n ('a, Scanning.in_channel, 'b, 'c, 'a -> 'd, 'd) format6 -> 'c\n\ntype ('a, 'b, 'c, 'd) scanner_opt =\n ('a, Scanning.in_channel, 'b, 'c, 'a -> 'd option, 'd) format6 -> 'c\n\n(* Reporting errors. *)\nexception Scan_failure of string\n\nlet bad_input s = raise (Scan_failure s)\n\nlet bad_input_escape c =\n bad_input (Printf.sprintf \"illegal escape character %C\" c)\n\n\nlet bad_token_length message =\n bad_input\n (Printf.sprintf\n \"scanning of %s failed: \\\n the specified length was too short for token\"\n message)\n\n\nlet bad_end_of_input message =\n bad_input\n (Printf.sprintf\n \"scanning of %s failed: \\\n premature end of file occurred before end of token\"\n message)\n\n\nlet bad_float () =\n bad_input \"no dot or exponent part found in float token\"\n\n\nlet bad_hex_float () =\n bad_input \"not a valid float in hexadecimal notation\"\n\n\nlet character_mismatch_err c ci =\n Printf.sprintf \"looking for %C, found %C\" c ci\n\n\nlet character_mismatch c ci =\n bad_input (character_mismatch_err c ci)\n\n\nlet rec skip_whites ib =\n let c = Scanning.peek_char ib in\n if not (Scanning.eof ib) then begin\n match c with\n | ' ' | '\\t' | '\\n' | '\\r' ->\n Scanning.invalidate_current_char ib; skip_whites ib\n | _ -> ()\n end\n\n\n(* Checking that [c] is indeed in the input, then skips it.\n In this case, the character [c] has been explicitly specified in the\n format as being mandatory in the input; hence we should fail with\n [End_of_file] in case of end_of_input.\n (Remember that [Scan_failure] is raised only when (we can prove by\n evidence) that the input does not match the format string given. We must\n thus differentiate [End_of_file] as an error due to lack of input, and\n [Scan_failure] which is due to provably wrong input. I am not sure this is\n worth the burden: it is complex and somehow subliminal; should be clearer\n to fail with Scan_failure \"Not enough input to complete scanning\"!)\n\n That's why, waiting for a better solution, we use checked_peek_char here.\n We are also careful to treat \"\\r\\n\" in the input as an end of line marker:\n it always matches a '\\n' specification in the input format string. *)\nlet rec check_char ib c =\n match c with\n | ' ' -> skip_whites ib\n | '\\n' -> check_newline ib\n | c -> check_this_char ib c\n\nand check_this_char ib c =\n let ci = Scanning.checked_peek_char ib in\n if ci = c then Scanning.invalidate_current_char ib else\n character_mismatch c ci\n\nand check_newline ib =\n let ci = Scanning.checked_peek_char ib in\n match ci with\n | '\\n' -> Scanning.invalidate_current_char ib\n | '\\r' -> Scanning.invalidate_current_char ib; check_this_char ib '\\n'\n | _ -> character_mismatch '\\n' ci\n\n\n(* Extracting tokens from the output token buffer. *)\n\nlet token_char ib = (Scanning.token ib).[0]\n\nlet token_string = Scanning.token\n\nlet token_bool ib =\n match Scanning.token ib with\n | \"true\" -> true\n | \"false\" -> false\n | s -> bad_input (Printf.sprintf \"invalid boolean '%s'\" s)\n\n\n(* The type of integer conversions. *)\ntype integer_conversion =\n | B_conversion (* Unsigned binary conversion *)\n | D_conversion (* Signed decimal conversion *)\n | I_conversion (* Signed integer conversion *)\n | O_conversion (* Unsigned octal conversion *)\n | U_conversion (* Unsigned decimal conversion *)\n | X_conversion (* Unsigned hexadecimal conversion *)\n\n\nlet integer_conversion_of_char = function\n | 'b' -> B_conversion\n | 'd' -> D_conversion\n | 'i' -> I_conversion\n | 'o' -> O_conversion\n | 'u' -> U_conversion\n | 'x' | 'X' -> X_conversion\n | _ -> assert false\n\n\n(* Extract an integer literal token.\n Since the functions Stdlib.*int*_of_string do not accept a leading +,\n we skip it if necessary. *)\nlet token_int_literal conv ib =\n let tok =\n match conv with\n | D_conversion | I_conversion -> Scanning.token ib\n | U_conversion -> \"0u\" ^ Scanning.token ib\n | O_conversion -> \"0o\" ^ Scanning.token ib\n | X_conversion -> \"0x\" ^ Scanning.token ib\n | B_conversion -> \"0b\" ^ Scanning.token ib in\n let l = String.length tok in\n if l = 0 || tok.[0] <> '+' then tok else String.sub tok 1 (l - 1)\n\n\n(* All the functions that convert a string to a number raise the exception\n Failure when the conversion is not possible.\n This exception is then trapped in [kscanf]. *)\nlet token_int conv ib = int_of_string (token_int_literal conv ib)\n\nlet token_float ib = float_of_string (Scanning.token ib)\n\n(* To scan native ints, int32 and int64 integers.\n We cannot access to conversions to/from strings for those types,\n Nativeint.of_string, Int32.of_string, and Int64.of_string,\n since those modules are not available to [Scanf].\n However, we can bind and use the corresponding primitives that are\n available in the runtime. *)\nexternal nativeint_of_string : string -> nativeint\n = \"caml_nativeint_of_string\"\n\nexternal int32_of_string : string -> int32\n = \"caml_int32_of_string\"\n\nexternal int64_of_string : string -> int64\n = \"caml_int64_of_string\"\n\n\nlet token_nativeint conv ib = nativeint_of_string (token_int_literal conv ib)\nlet token_int32 conv ib = int32_of_string (token_int_literal conv ib)\nlet token_int64 conv ib = int64_of_string (token_int_literal conv ib)\n\n(* Scanning numbers. *)\n\n(* Digits scanning functions suppose that one character has been checked and\n is available, since they return at end of file with the currently found\n token selected.\n\n Put it in another way, the digits scanning functions scan for a possibly\n empty sequence of digits, (hence, a successful scanning from one of those\n functions does not imply that the token is a well-formed number: to get a\n true number, it is mandatory to check that at least one valid digit is\n available before calling one of the digit scanning functions). *)\n\n(* The decimal case is treated especially for optimization purposes. *)\nlet rec scan_decimal_digit_star width ib =\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n match c with\n | '0' .. '9' as c ->\n let width = Scanning.store_char width ib c in\n scan_decimal_digit_star width ib\n | '_' ->\n let width = Scanning.ignore_char width ib in\n scan_decimal_digit_star width ib\n | _ -> width\n\n\nlet scan_decimal_digit_plus width ib =\n if width = 0 then bad_token_length \"decimal digits\" else\n let c = Scanning.checked_peek_char ib in\n match c with\n | '0' .. '9' ->\n let width = Scanning.store_char width ib c in\n scan_decimal_digit_star width ib\n | c ->\n bad_input (Printf.sprintf \"character %C is not a decimal digit\" c)\n\n\n(* To scan numbers from other bases, we use a predicate argument to\n scan digits. *)\nlet scan_digit_star digitp width ib =\n let rec scan_digits width ib =\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n match c with\n | c when digitp c ->\n let width = Scanning.store_char width ib c in\n scan_digits width ib\n | '_' ->\n let width = Scanning.ignore_char width ib in\n scan_digits width ib\n | _ -> width in\n scan_digits width ib\n\n\nlet scan_digit_plus basis digitp width ib =\n (* Ensure we have got enough width left,\n and read at least one digit. *)\n if width = 0 then bad_token_length \"digits\" else\n let c = Scanning.checked_peek_char ib in\n if digitp c then\n let width = Scanning.store_char width ib c in\n scan_digit_star digitp width ib\n else\n bad_input (Printf.sprintf \"character %C is not a valid %s digit\" c basis)\n\n\nlet is_binary_digit = function\n | '0' .. '1' -> true\n | _ -> false\n\n\nlet scan_binary_int = scan_digit_plus \"binary\" is_binary_digit\n\nlet is_octal_digit = function\n | '0' .. '7' -> true\n | _ -> false\n\n\nlet scan_octal_int = scan_digit_plus \"octal\" is_octal_digit\n\nlet is_hexa_digit = function\n | '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' -> true\n | _ -> false\n\n\nlet scan_hexadecimal_int = scan_digit_plus \"hexadecimal\" is_hexa_digit\n\n(* Scan a decimal integer. *)\nlet scan_unsigned_decimal_int = scan_decimal_digit_plus\n\nlet scan_sign width ib =\n let c = Scanning.checked_peek_char ib in\n match c with\n | '+' -> Scanning.store_char width ib c\n | '-' -> Scanning.store_char width ib c\n | _ -> width\n\n\nlet scan_optionally_signed_decimal_int width ib =\n let width = scan_sign width ib in\n scan_unsigned_decimal_int width ib\n\n\n(* Scan an unsigned integer that could be given in any (common) basis.\n If digits are prefixed by one of 0x, 0X, 0o, or 0b, the number is\n assumed to be written respectively in hexadecimal, hexadecimal,\n octal, or binary. *)\nlet scan_unsigned_int width ib =\n match Scanning.checked_peek_char ib with\n | '0' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n begin match c with\n | 'x' | 'X' -> scan_hexadecimal_int (Scanning.store_char width ib c) ib\n | 'o' -> scan_octal_int (Scanning.store_char width ib c) ib\n | 'b' -> scan_binary_int (Scanning.store_char width ib c) ib\n | _ -> scan_decimal_digit_star width ib end\n | _ -> scan_unsigned_decimal_int width ib\n\n\nlet scan_optionally_signed_int width ib =\n let width = scan_sign width ib in\n scan_unsigned_int width ib\n\n\nlet scan_int_conversion conv width ib =\n match conv with\n | B_conversion -> scan_binary_int width ib\n | D_conversion -> scan_optionally_signed_decimal_int width ib\n | I_conversion -> scan_optionally_signed_int width ib\n | O_conversion -> scan_octal_int width ib\n | U_conversion -> scan_unsigned_decimal_int width ib\n | X_conversion -> scan_hexadecimal_int width ib\n\n\n(* Scanning floating point numbers. *)\n\n(* Fractional part is optional and can be reduced to 0 digits. *)\nlet scan_fractional_part width ib =\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n match c with\n | '0' .. '9' as c ->\n scan_decimal_digit_star (Scanning.store_char width ib c) ib\n | _ -> width\n\n\n(* Exp part is optional and can be reduced to 0 digits. *)\nlet scan_exponent_part width ib =\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n match c with\n | 'e' | 'E' as c ->\n scan_optionally_signed_decimal_int (Scanning.store_char width ib c) ib\n | _ -> width\n\n\n(* Scan the integer part of a floating point number, (not using the\n OCaml lexical convention since the integer part can be empty):\n an optional sign, followed by a possibly empty sequence of decimal\n digits (e.g. -.1). *)\nlet scan_integer_part width ib =\n let width = scan_sign width ib in\n scan_decimal_digit_star width ib\n\n\n(*\n For the time being we have (as found in scanf.mli):\n the field width is composed of an optional integer literal\n indicating the maximal width of the token to read.\n Unfortunately, the type-checker let the user write an optional precision,\n since this is valid for printf format strings.\n\n Thus, the next step for Scanf is to support a full width and precision\n indication, more or less similar to the one for printf, possibly extended\n to the specification of a [max, min] range for the width of the token read\n for strings. Something like the following spec for scanf.mli:\n\n The optional [width] is an integer indicating the maximal\n width of the token read. For instance, [%6d] reads an integer,\n having at most 6 characters.\n\n The optional [precision] is a dot [.] followed by an integer:\n\n - in the floating point number conversions ([%f], [%e], [%g], [%F], [%E],\n and [%F] conversions, the [precision] indicates the maximum number of\n digits that may follow the decimal point. For instance, [%.4f] reads a\n [float] with at most 4 fractional digits,\n\n - in the string conversions ([%s], [%S], [%\\[ range \\]]), and in the\n integer number conversions ([%i], [%d], [%u], [%x], [%o], and their\n [int32], [int64], and [native_int] correspondent), the [precision]\n indicates the required minimum width of the token read,\n\n - on all other conversions, the width and precision specify the [max, min]\n range for the width of the token read.\n*)\nlet scan_float width precision ib =\n let width = scan_integer_part width ib in\n if width = 0 then width, precision else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width, precision else\n match c with\n | '.' ->\n let width = Scanning.store_char width ib c in\n let precision = Int.min width precision in\n let width = width - (precision - scan_fractional_part precision ib) in\n scan_exponent_part width ib, precision\n | _ ->\n scan_exponent_part width ib, precision\n\n\nlet check_case_insensitive_string width ib error str =\n let lowercase c =\n match c with\n | 'A' .. 'Z' ->\n char_of_int (int_of_char c - int_of_char 'A' + int_of_char 'a')\n | _ -> c in\n let len = String.length str in\n let width = ref width in\n for i = 0 to len - 1 do\n let c = Scanning.peek_char ib in\n if lowercase c <> lowercase str.[i] then error ();\n if !width = 0 then error ();\n width := Scanning.store_char !width ib c;\n done;\n !width\n\n\nlet scan_hex_float width precision ib =\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n let width = scan_sign width ib in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n match Scanning.peek_char ib with\n | '0' as c -> (\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n let width = check_case_insensitive_string width ib bad_hex_float \"x\" in\n if width = 0 || Scanning.end_of_input ib then width else\n let width = match Scanning.peek_char ib with\n | '.' | 'p' | 'P' -> width\n | _ -> scan_hexadecimal_int width ib in\n if width = 0 || Scanning.end_of_input ib then width else\n let width = match Scanning.peek_char ib with\n | '.' as c -> (\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then width else\n match Scanning.peek_char ib with\n | 'p' | 'P' -> width\n | _ ->\n let precision = Int.min width precision in\n width - (precision - scan_hexadecimal_int precision ib)\n )\n | _ -> width in\n if width = 0 || Scanning.end_of_input ib then width else\n match Scanning.peek_char ib with\n | 'p' | 'P' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n scan_optionally_signed_decimal_int width ib\n | _ -> width\n )\n | 'n' | 'N' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n check_case_insensitive_string width ib bad_hex_float \"an\"\n | 'i' | 'I' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n check_case_insensitive_string width ib bad_hex_float \"nfinity\"\n | _ -> bad_hex_float ()\n\n\nlet scan_caml_float_rest width precision ib =\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n let width = scan_decimal_digit_star width ib in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n let c = Scanning.peek_char ib in\n match c with\n | '.' ->\n let width = Scanning.store_char width ib c in\n (* The effective width available for scanning the fractional part is\n the minimum of declared precision and width left. *)\n let precision = Int.min width precision in\n (* After scanning the fractional part with [precision] provisional width,\n [width_precision] is left. *)\n let width_precision = scan_fractional_part precision ib in\n (* Hence, scanning the fractional part took exactly\n [precision - width_precision] chars. *)\n let frac_width = precision - width_precision in\n (* And new provisional width is [width - width_precision. *)\n let width = width - frac_width in\n scan_exponent_part width ib\n | 'e' | 'E' ->\n scan_exponent_part width ib\n | _ -> bad_float ()\n\n\nlet scan_caml_float width precision ib =\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n let width = scan_sign width ib in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n match Scanning.peek_char ib with\n | '0' as c -> (\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n match Scanning.peek_char ib with\n | 'x' | 'X' as c -> (\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n let width = scan_hexadecimal_int width ib in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n let width = match Scanning.peek_char ib with\n | '.' as c -> (\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then width else\n match Scanning.peek_char ib with\n | 'p' | 'P' -> width\n | _ ->\n let precision = Int.min width precision in\n width - (precision - scan_hexadecimal_int precision ib)\n )\n | 'p' | 'P' -> width\n | _ -> bad_float () in\n if width = 0 || Scanning.end_of_input ib then width else\n match Scanning.peek_char ib with\n | 'p' | 'P' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_hex_float ();\n scan_optionally_signed_decimal_int width ib\n | _ -> width\n )\n | _ ->\n scan_caml_float_rest width precision ib\n )\n | '1' .. '9' as c ->\n let width = Scanning.store_char width ib c in\n if width = 0 || Scanning.end_of_input ib then bad_float ();\n scan_caml_float_rest width precision ib\n(* Special case of nan and infinity:\n | 'i' ->\n | 'n' ->\n*)\n | _ -> bad_float ()\n\n\n(* Scan a regular string:\n stops when encountering a space, if no scanning indication has been given;\n otherwise, stops when encountering the characters in the scanning\n indication [stp].\n It also stops at end of file or when the maximum number of characters has\n been read. *)\nlet scan_string stp width ib =\n let rec loop width =\n if width = 0 then width else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then width else\n match stp with\n | Some c' when c = c' -> Scanning.skip_char width ib\n | Some _ -> loop (Scanning.store_char width ib c)\n | None ->\n match c with\n | ' ' | '\\t' | '\\n' | '\\r' -> width\n | _ -> loop (Scanning.store_char width ib c) in\n loop width\n\n\n(* Scan a char: peek strictly one character in the input, whatsoever. *)\nlet scan_char width ib =\n (* The case width = 0 could not happen here, since it is tested before\n calling scan_char, in the main scanning function.\n if width = 0 then bad_token_length \"a character\" else *)\n Scanning.store_char width ib (Scanning.checked_peek_char ib)\n\n\nlet char_for_backslash = function\n | 'n' -> '\\010'\n | 'r' -> '\\013'\n | 'b' -> '\\008'\n | 't' -> '\\009'\n | c -> c\n\n\n(* The integer value corresponding to the facial value of a valid\n decimal digit character. *)\nlet decimal_value_of_char c = int_of_char c - int_of_char '0'\n\nlet char_for_decimal_code c0 c1 c2 =\n let c =\n 100 * decimal_value_of_char c0 +\n 10 * decimal_value_of_char c1 +\n decimal_value_of_char c2 in\n if c < 0 || c > 255 then\n bad_input\n (Printf.sprintf\n \"bad character decimal encoding \\\\%c%c%c\" c0 c1 c2) else\n char_of_int c\n\n\n(* The integer value corresponding to the facial value of a valid\n hexadecimal digit character. *)\nlet hexadecimal_value_of_char c =\n let d = int_of_char c in\n (* Could also be:\n if d <= int_of_char '9' then d - int_of_char '0' else\n if d <= int_of_char 'F' then 10 + d - int_of_char 'A' else\n if d <= int_of_char 'f' then 10 + d - int_of_char 'a' else assert false\n *)\n if d >= int_of_char 'a' then\n d - 87 (* 10 + int_of_char c - int_of_char 'a' *) else\n if d >= int_of_char 'A' then\n d - 55 (* 10 + int_of_char c - int_of_char 'A' *) else\n d - int_of_char '0'\n\n\nlet char_for_hexadecimal_code c1 c2 =\n let c =\n 16 * hexadecimal_value_of_char c1 +\n hexadecimal_value_of_char c2 in\n if c < 0 || c > 255 then\n bad_input\n (Printf.sprintf \"bad character hexadecimal encoding \\\\%c%c\" c1 c2) else\n char_of_int c\n\n\n(* Called in particular when encountering '\\\\' as starter of a char.\n Stops before the corresponding '\\''. *)\nlet check_next_char message width ib =\n if width = 0 then bad_token_length message else\n let c = Scanning.peek_char ib in\n if Scanning.eof ib then bad_end_of_input message else\n c\n\n\nlet check_next_char_for_char = check_next_char \"a Char\"\nlet check_next_char_for_string = check_next_char \"a String\"\n\nlet scan_backslash_char width ib =\n match check_next_char_for_char width ib with\n | '\\\\' | '\\'' | '\\\"' | 'n' | 't' | 'b' | 'r' as c ->\n Scanning.store_char width ib (char_for_backslash c)\n | '0' .. '9' as c ->\n let get_digit () =\n let c = Scanning.next_char ib in\n match c with\n | '0' .. '9' as c -> c\n | c -> bad_input_escape c in\n let c0 = c in\n let c1 = get_digit () in\n let c2 = get_digit () in\n Scanning.store_char (width - 2) ib (char_for_decimal_code c0 c1 c2)\n | 'x' ->\n let get_digit () =\n let c = Scanning.next_char ib in\n match c with\n | '0' .. '9' | 'A' .. 'F' | 'a' .. 'f' as c -> c\n | c -> bad_input_escape c in\n let c1 = get_digit () in\n let c2 = get_digit () in\n Scanning.store_char (width - 2) ib (char_for_hexadecimal_code c1 c2)\n | c ->\n bad_input_escape c\n\n\n(* Scan a character (an OCaml token). *)\nlet scan_caml_char width ib =\n\n let rec find_start width =\n match Scanning.checked_peek_char ib with\n | '\\'' -> find_char (Scanning.ignore_char width ib)\n | c -> character_mismatch '\\'' c\n\n and find_char width =\n match check_next_char_for_char width ib with\n | '\\\\' ->\n find_stop (scan_backslash_char (Scanning.ignore_char width ib) ib)\n | c ->\n find_stop (Scanning.store_char width ib c)\n\n and find_stop width =\n match check_next_char_for_char width ib with\n | '\\'' -> Scanning.ignore_char width ib\n | c -> character_mismatch '\\'' c in\n\n find_start width\n\n\n(* Scan a delimited string (an OCaml token). *)\nlet scan_caml_string width ib =\n\n let rec find_start width =\n match Scanning.checked_peek_char ib with\n | '\\\"' -> find_stop (Scanning.ignore_char width ib)\n | c -> character_mismatch '\\\"' c\n\n and find_stop width =\n match check_next_char_for_string width ib with\n | '\\\"' -> Scanning.ignore_char width ib\n | '\\\\' -> scan_backslash (Scanning.ignore_char width ib)\n | c -> find_stop (Scanning.store_char width ib c)\n\n and scan_backslash width =\n match check_next_char_for_string width ib with\n | '\\r' -> skip_newline (Scanning.ignore_char width ib)\n | '\\n' -> skip_spaces (Scanning.ignore_char width ib)\n | _ -> find_stop (scan_backslash_char width ib)\n\n and skip_newline width =\n match check_next_char_for_string width ib with\n | '\\n' -> skip_spaces (Scanning.ignore_char width ib)\n | _ -> find_stop (Scanning.store_char width ib '\\r')\n\n and skip_spaces width =\n match check_next_char_for_string width ib with\n | ' ' -> skip_spaces (Scanning.ignore_char width ib)\n | _ -> find_stop width in\n\n find_start width\n\n\n(* Scan a boolean (an OCaml token). *)\nlet scan_bool ib =\n let c = Scanning.checked_peek_char ib in\n let m =\n match c with\n | 't' -> 4\n | 'f' -> 5\n | c ->\n bad_input\n (Printf.sprintf \"the character %C cannot start a boolean\" c) in\n scan_string None m ib\n\n\n(* Scan a string containing elements in char_set and terminated by scan_indic\n if provided. *)\nlet scan_chars_in_char_set char_set scan_indic width ib =\n let rec scan_chars i stp =\n let c = Scanning.peek_char ib in\n if i > 0 && not (Scanning.eof ib) &&\n is_in_char_set char_set c &&\n int_of_char c <> stp then\n let _ = Scanning.store_char max_int ib c in\n scan_chars (i - 1) stp in\n match scan_indic with\n | None -> scan_chars width (-1);\n | Some c ->\n scan_chars width (int_of_char c);\n if not (Scanning.eof ib) then\n let ci = Scanning.peek_char ib in\n if c = ci\n then Scanning.invalidate_current_char ib\n else character_mismatch c ci\n\n\n(* The global error report function for [Scanf]. *)\nlet scanf_bad_input ib = function\n | Scan_failure s | Failure s ->\n let i = Scanning.char_count ib in\n bad_input (Printf.sprintf \"scanf: bad input at char number %i: %s\" i s)\n | x -> raise x\n\n\n(* Get the content of a counter from an input buffer. *)\nlet get_counter ib counter =\n match counter with\n | Line_counter -> Scanning.line_count ib\n | Char_counter -> Scanning.char_count ib\n | Token_counter -> Scanning.token_count ib\n\n\n(* Compute the width of a padding option (see \"%42{\" and \"%123(\"). *)\nlet width_of_pad_opt pad_opt = match pad_opt with\n | None -> max_int\n | Some width -> width\n\n\nlet stopper_of_formatting_lit fmting =\n if fmting = Escaped_percent then '%', \"\" else\n let str = string_of_formatting_lit fmting in\n let stp = str.[1] in\n let sub_str = String.sub str 2 (String.length str - 2) in\n stp, sub_str\n\n\n(******************************************************************************)\n (* Reader management *)\n\n(* A call to take_format_readers on a format is evaluated into functions\n taking readers as arguments and aggregate them into an heterogeneous list *)\n(* When all readers are taken, finally pass the list of the readers to the\n continuation k. *)\nlet rec take_format_readers : type a c d e f .\n ((d, e) heter_list -> e) -> (a, Scanning.in_channel, c, d, e, f) fmt ->\n d =\nfun k fmt -> match fmt with\n | Reader fmt_rest ->\n fun reader ->\n let new_k readers_rest = k (Cons (reader, readers_rest)) in\n take_format_readers new_k fmt_rest\n | Char rest -> take_format_readers k rest\n | Caml_char rest -> take_format_readers k rest\n | String (_, rest) -> take_format_readers k rest\n | Caml_string (_, rest) -> take_format_readers k rest\n | Int (_, _, _, rest) -> take_format_readers k rest\n | Int32 (_, _, _, rest) -> take_format_readers k rest\n | Nativeint (_, _, _, rest) -> take_format_readers k rest\n | Int64 (_, _, _, rest) -> take_format_readers k rest\n | Float (_, _, _, rest) -> take_format_readers k rest\n | Bool (_, rest) -> take_format_readers k rest\n | Alpha rest -> take_format_readers k rest\n | Theta rest -> take_format_readers k rest\n | Flush rest -> take_format_readers k rest\n | String_literal (_, rest) -> take_format_readers k rest\n | Char_literal (_, rest) -> take_format_readers k rest\n | Custom (_, _, rest) -> take_format_readers k rest\n\n | Scan_char_set (_, _, rest) -> take_format_readers k rest\n | Scan_get_counter (_, rest) -> take_format_readers k rest\n | Scan_next_char rest -> take_format_readers k rest\n\n | Formatting_lit (_, rest) -> take_format_readers k rest\n | Formatting_gen (Open_tag (Format (fmt, _)), rest) ->\n take_format_readers k (concat_fmt fmt rest)\n | Formatting_gen (Open_box (Format (fmt, _)), rest) ->\n take_format_readers k (concat_fmt fmt rest)\n\n | Format_arg (_, _, rest) -> take_format_readers k rest\n | Format_subst (_, fmtty, rest) ->\n take_fmtty_format_readers k (erase_rel (symm fmtty)) rest\n | Ignored_param (ign, rest) -> take_ignored_format_readers k ign rest\n\n | End_of_format -> k Nil\n\n(* Take readers associated to an fmtty coming from a Format_subst \"%(...%)\". *)\nand take_fmtty_format_readers : type x y a c d e f .\n ((d, e) heter_list -> e) -> (a, Scanning.in_channel, c, d, x, y) fmtty ->\n (y, Scanning.in_channel, c, x, e, f) fmt -> d =\nfun k fmtty fmt -> match fmtty with\n | Reader_ty fmt_rest ->\n fun reader ->\n let new_k readers_rest = k (Cons (reader, readers_rest)) in\n take_fmtty_format_readers new_k fmt_rest fmt\n | Ignored_reader_ty fmt_rest ->\n fun reader ->\n let new_k readers_rest = k (Cons (reader, readers_rest)) in\n take_fmtty_format_readers new_k fmt_rest fmt\n | Char_ty rest -> take_fmtty_format_readers k rest fmt\n | String_ty rest -> take_fmtty_format_readers k rest fmt\n | Int_ty rest -> take_fmtty_format_readers k rest fmt\n | Int32_ty rest -> take_fmtty_format_readers k rest fmt\n | Nativeint_ty rest -> take_fmtty_format_readers k rest fmt\n | Int64_ty rest -> take_fmtty_format_readers k rest fmt\n | Float_ty rest -> take_fmtty_format_readers k rest fmt\n | Bool_ty rest -> take_fmtty_format_readers k rest fmt\n | Alpha_ty rest -> take_fmtty_format_readers k rest fmt\n | Theta_ty rest -> take_fmtty_format_readers k rest fmt\n | Any_ty rest -> take_fmtty_format_readers k rest fmt\n | Format_arg_ty (_, rest) -> take_fmtty_format_readers k rest fmt\n | End_of_fmtty -> take_format_readers k fmt\n | Format_subst_ty (ty1, ty2, rest) ->\n let ty = trans (symm ty1) ty2 in\n take_fmtty_format_readers k (concat_fmtty ty rest) fmt\n\n(* Take readers associated to an ignored parameter. *)\nand take_ignored_format_readers : type x y a c d e f .\n ((d, e) heter_list -> e) -> (a, Scanning.in_channel, c, d, x, y) ignored ->\n (y, Scanning.in_channel, c, x, e, f) fmt -> d =\nfun k ign fmt -> match ign with\n | Ignored_reader ->\n fun reader ->\n let new_k readers_rest = k (Cons (reader, readers_rest)) in\n take_format_readers new_k fmt\n | Ignored_char -> take_format_readers k fmt\n | Ignored_caml_char -> take_format_readers k fmt\n | Ignored_string _ -> take_format_readers k fmt\n | Ignored_caml_string _ -> take_format_readers k fmt\n | Ignored_int (_, _) -> take_format_readers k fmt\n | Ignored_int32 (_, _) -> take_format_readers k fmt\n | Ignored_nativeint (_, _) -> take_format_readers k fmt\n | Ignored_int64 (_, _) -> take_format_readers k fmt\n | Ignored_float (_, _) -> take_format_readers k fmt\n | Ignored_bool _ -> take_format_readers k fmt\n | Ignored_format_arg _ -> take_format_readers k fmt\n | Ignored_format_subst (_, fmtty) -> take_fmtty_format_readers k fmtty fmt\n | Ignored_scan_char_set _ -> take_format_readers k fmt\n | Ignored_scan_get_counter _ -> take_format_readers k fmt\n | Ignored_scan_next_char -> take_format_readers k fmt\n\n(******************************************************************************)\n (* Generic scanning *)\n\n(* Make a generic scanning function. *)\n(* Scan a stream according to a format and readers obtained by\n take_format_readers, and aggregate scanned values into an\n heterogeneous list. *)\n(* Return the heterogeneous list of scanned values. *)\nlet rec make_scanf : type a c d e f.\n Scanning.in_channel -> (a, Scanning.in_channel, c, d, e, f) fmt ->\n (d, e) heter_list -> (a, f) heter_list =\nfun ib fmt readers -> match fmt with\n | Char rest ->\n let _ = scan_char 0 ib in\n let c = token_char ib in\n Cons (c, make_scanf ib rest readers)\n | Caml_char rest ->\n let _ = scan_caml_char 0 ib in\n let c = token_char ib in\n Cons (c, make_scanf ib rest readers)\n\n | String (pad, Formatting_lit (fmting_lit, rest)) ->\n let stp, str = stopper_of_formatting_lit fmting_lit in\n let scan width _ ib = scan_string (Some stp) width ib in\n let str_rest = String_literal (str, rest) in\n pad_prec_scanf ib str_rest readers pad No_precision scan token_string\n | String (pad, Formatting_gen (Open_tag (Format (fmt', _)), rest)) ->\n let scan width _ ib = scan_string (Some '{') width ib in\n pad_prec_scanf ib (concat_fmt fmt' rest) readers pad No_precision scan\n token_string\n | String (pad, Formatting_gen (Open_box (Format (fmt', _)), rest)) ->\n let scan width _ ib = scan_string (Some '[') width ib in\n pad_prec_scanf ib (concat_fmt fmt' rest) readers pad No_precision scan\n token_string\n | String (pad, rest) ->\n let scan width _ ib = scan_string None width ib in\n pad_prec_scanf ib rest readers pad No_precision scan token_string\n\n | Caml_string (pad, rest) ->\n let scan width _ ib = scan_caml_string width ib in\n pad_prec_scanf ib rest readers pad No_precision scan token_string\n | Int (iconv, pad, prec, rest) ->\n let c = integer_conversion_of_char (char_of_iconv iconv) in\n let scan width _ ib = scan_int_conversion c width ib in\n pad_prec_scanf ib rest readers pad prec scan (token_int c)\n | Int32 (iconv, pad, prec, rest) ->\n let c = integer_conversion_of_char (char_of_iconv iconv) in\n let scan width _ ib = scan_int_conversion c width ib in\n pad_prec_scanf ib rest readers pad prec scan (token_int32 c)\n | Nativeint (iconv, pad, prec, rest) ->\n let c = integer_conversion_of_char (char_of_iconv iconv) in\n let scan width _ ib = scan_int_conversion c width ib in\n pad_prec_scanf ib rest readers pad prec scan (token_nativeint c)\n | Int64 (iconv, pad, prec, rest) ->\n let c = integer_conversion_of_char (char_of_iconv iconv) in\n let scan width _ ib = scan_int_conversion c width ib in\n pad_prec_scanf ib rest readers pad prec scan (token_int64 c)\n | Float ((_, (Float_F | Float_CF)), pad, prec, rest) ->\n pad_prec_scanf ib rest readers pad prec scan_caml_float token_float\n | Float ((_, (Float_f | Float_e | Float_E | Float_g | Float_G)),\n pad, prec, rest) ->\n pad_prec_scanf ib rest readers pad prec scan_float token_float\n | Float ((_, (Float_h | Float_H)), pad, prec, rest) ->\n pad_prec_scanf ib rest readers pad prec scan_hex_float token_float\n | Bool (pad, rest) ->\n let scan _ _ ib = scan_bool ib in\n pad_prec_scanf ib rest readers pad No_precision scan token_bool\n | Alpha _ ->\n invalid_arg \"scanf: bad conversion \\\"%a\\\"\"\n | Theta _ ->\n invalid_arg \"scanf: bad conversion \\\"%t\\\"\"\n | Custom _ ->\n invalid_arg \"scanf: bad conversion \\\"%?\\\" (custom converter)\"\n | Reader fmt_rest ->\n begin match readers with\n | Cons (reader, readers_rest) ->\n let x = reader ib in\n Cons (x, make_scanf ib fmt_rest readers_rest)\n | Nil ->\n invalid_arg \"scanf: missing reader\"\n end\n | Flush rest ->\n if Scanning.end_of_input ib then make_scanf ib rest readers\n else bad_input \"end of input not found\"\n\n | String_literal (str, rest) ->\n String.iter (check_char ib) str;\n make_scanf ib rest readers\n | Char_literal (chr, rest) ->\n check_char ib chr;\n make_scanf ib rest readers\n\n | Format_arg (pad_opt, fmtty, rest) ->\n let _ = scan_caml_string (width_of_pad_opt pad_opt) ib in\n let s = token_string ib in\n let fmt =\n try format_of_string_fmtty s fmtty\n with Failure msg -> bad_input msg\n in\n Cons (fmt, make_scanf ib rest readers)\n | Format_subst (pad_opt, fmtty, rest) ->\n let _ = scan_caml_string (width_of_pad_opt pad_opt) ib in\n let s = token_string ib in\n let fmt, fmt' =\n try\n let Fmt_EBB fmt = fmt_ebb_of_string s in\n let Fmt_EBB fmt' = fmt_ebb_of_string s in\n (* TODO: find a way to avoid reparsing twice *)\n\n (* TODO: these type-checks below *can* fail because of type\n ambiguity in presence of ignored-readers: \"%_r%d\" and \"%d%_r\"\n are typed in the same way.\n\n # Scanf.sscanf \"\\\"%_r%d\\\"3\" \"%(%d%_r%)\" ignore\n (fun fmt n -> string_of_format fmt, n)\n Exception: CamlinternalFormat.Type_mismatch.\n\n We should properly catch this exception.\n *)\n type_format fmt (erase_rel fmtty),\n type_format fmt' (erase_rel (symm fmtty))\n with Failure msg -> bad_input msg\n in\n Cons (Format (fmt, s),\n make_scanf ib (concat_fmt fmt' rest) readers)\n\n | Scan_char_set (width_opt, char_set, Formatting_lit (fmting_lit, rest)) ->\n let stp, str = stopper_of_formatting_lit fmting_lit in\n let width = width_of_pad_opt width_opt in\n scan_chars_in_char_set char_set (Some stp) width ib;\n let s = token_string ib in\n let str_rest = String_literal (str, rest) in\n Cons (s, make_scanf ib str_rest readers)\n | Scan_char_set (width_opt, char_set, rest) ->\n let width = width_of_pad_opt width_opt in\n scan_chars_in_char_set char_set None width ib;\n let s = token_string ib in\n Cons (s, make_scanf ib rest readers)\n | Scan_get_counter (counter, rest) ->\n let count = get_counter ib counter in\n Cons (count, make_scanf ib rest readers)\n | Scan_next_char rest ->\n let c = Scanning.checked_peek_char ib in\n Cons (c, make_scanf ib rest readers)\n\n | Formatting_lit (formatting_lit, rest) ->\n String.iter (check_char ib) (string_of_formatting_lit formatting_lit);\n make_scanf ib rest readers\n | Formatting_gen (Open_tag (Format (fmt', _)), rest) ->\n check_char ib '@'; check_char ib '{';\n make_scanf ib (concat_fmt fmt' rest) readers\n | Formatting_gen (Open_box (Format (fmt', _)), rest) ->\n check_char ib '@'; check_char ib '[';\n make_scanf ib (concat_fmt fmt' rest) readers\n\n | Ignored_param (ign, rest) ->\n let Param_format_EBB fmt' = param_format_of_ignored_format ign rest in\n begin match make_scanf ib fmt' readers with\n | Cons (_, arg_rest) -> arg_rest\n | Nil -> assert false\n end\n\n | End_of_format ->\n Nil\n\n(* Case analysis on padding and precision. *)\n(* Reject formats containing \"%*\" or \"%.*\". *)\n(* Pass padding and precision to the generic scanner `scan'. *)\nand pad_prec_scanf : type a c d e f x y z t .\n Scanning.in_channel -> (a, Scanning.in_channel, c, d, e, f) fmt ->\n (d, e) heter_list -> (x, y) padding -> (y, z -> a) precision ->\n (int -> int -> Scanning.in_channel -> t) ->\n (Scanning.in_channel -> z) ->\n (x, f) heter_list =\nfun ib fmt readers pad prec scan token -> match pad, prec with\n | No_padding, No_precision ->\n let _ = scan max_int max_int ib in\n let x = token ib in\n Cons (x, make_scanf ib fmt readers)\n | No_padding, Lit_precision p ->\n let _ = scan max_int p ib in\n let x = token ib in\n Cons (x, make_scanf ib fmt readers)\n | Lit_padding ((Right | Zeros), w), No_precision ->\n let _ = scan w max_int ib in\n let x = token ib in\n Cons (x, make_scanf ib fmt readers)\n | Lit_padding ((Right | Zeros), w), Lit_precision p ->\n let _ = scan w p ib in\n let x = token ib in\n Cons (x, make_scanf ib fmt readers)\n | Lit_padding (Left, _), _ ->\n invalid_arg \"scanf: bad conversion \\\"%-\\\"\"\n | Lit_padding ((Right | Zeros), _), Arg_precision ->\n invalid_arg \"scanf: bad conversion \\\"%*\\\"\"\n | Arg_padding _, _ ->\n invalid_arg \"scanf: bad conversion \\\"%*\\\"\"\n | No_padding, Arg_precision ->\n invalid_arg \"scanf: bad conversion \\\"%*\\\"\"\n\n(******************************************************************************)\n (* Defining [scanf] and various flavors of [scanf] *)\n\nlet kscanf_gen ib ef af (Format (fmt, str)) =\n let rec apply : type a b . a -> (a, b) heter_list -> b =\n fun f args -> match args with\n | Cons (x, r) -> apply (f x) r\n | Nil -> f\n in\n let k readers f =\n Scanning.reset_token ib;\n match make_scanf ib fmt readers with\n | exception (Scan_failure _ | Failure _ | End_of_file as exc) ->\n ef ib exc\n | exception Invalid_argument msg ->\n invalid_arg (msg ^ \" in format \\\"\" ^ String.escaped str ^ \"\\\"\")\n | args ->\n af (apply f args)\n in\n take_format_readers k fmt\n\nlet kscanf ib ef fmt =\n kscanf_gen ib ef (fun x -> x) fmt\n\nlet kscanf_opt ib fmt =\n kscanf_gen ib (fun _ _ -> None) (fun x -> Some x) fmt\n\n(***)\n\nlet kbscanf = kscanf\nlet bscanf ib fmt = kbscanf ib scanf_bad_input fmt\nlet bscanf_opt ib fmt = kscanf_opt ib fmt\n\nlet ksscanf s ef fmt = kbscanf (Scanning.from_string s) ef fmt\nlet sscanf s fmt = kbscanf (Scanning.from_string s) scanf_bad_input fmt\nlet sscanf_opt s fmt = kscanf_opt (Scanning.from_string s) fmt\n\nlet scanf fmt = kscanf Scanning.stdin scanf_bad_input fmt\nlet scanf_opt fmt = kscanf_opt Scanning.stdin fmt\n\n(***)\n\n(* Scanning format strings. *)\nlet bscanf_format :\n Scanning.in_channel -> ('a, 'b, 'c, 'd, 'e, 'f) format6 ->\n (('a, 'b, 'c, 'd, 'e, 'f) format6 -> 'g) -> 'g =\n fun ib format f ->\n let _ = scan_caml_string max_int ib in\n let str = token_string ib in\n let fmt' =\n try format_of_string_format str format\n with Failure msg -> bad_input msg in\n f fmt'\n\n\nlet sscanf_format :\n string -> ('a, 'b, 'c, 'd, 'e, 'f) format6 ->\n (('a, 'b, 'c, 'd, 'e, 'f) format6 -> 'g) -> 'g =\n fun s format f -> bscanf_format (Scanning.from_string s) format f\n\n\nlet format_from_string s fmt =\n sscanf_format (\"\\\"\" ^ String.escaped s ^ \"\\\"\") fmt (fun x -> x)\n\n\nlet unescaped s =\n sscanf (\"\\\"\" ^ s ^ \"\\\"\") \"%S%!\" (fun x -> x)\n","(* generated code *)"],"names":[],"mappings":"EAg/C4C,EAAC,C,MAA3C,QAAwB,GAAjB,GAAQ,KAAf,OAAe,aAAQ,OAAhB,aAAiB,0BAAoB,C,MAJ5C,QAAc,G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ACA,WACA,UAAC,C,iHAqMS,GAXZ,GAlBkD,yBAkBlD,KAC8C,aAUlC,MACI,KADuB,QACvB,MAA+B,yCAiRmB,YAkWX,EAnnBR,MAiRmB,UAkWX,MAnnBR,QAmnBQ,sBAnnBR,oBAiRmB,EAjRnB,UAiRmB,0BAjRnB,QAiRmB,gCAkWX,mS,QCz+B3D,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":336397},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/callback.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Registering OCaml values with the C runtime for later callbacks *)\n\nexternal register_named_value : string -> Obj.t -> unit\n = \"caml_register_named_value\"\n\nlet register name v =\n register_named_value name (Obj.repr v)\n\nlet register_exception name (exn : exn) =\n let exn = Obj.repr exn in\n let slot = if Obj.tag exn = Obj.object_tag then exn else Obj.field exn 0 in\n register_named_value name slot\n","(* generated code *)"],"names":[],"mappings":"OAwBE,UACc,IAAW,oC,CAAA,EAAgC,U,CAAA,6BAAe,GACxE,MAA8B,C,EAL9B,MAAsC,C,ECrBxC,sB,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":336594},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/camlinternalOO.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2002 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(**** Object representation ****)\n\nexternal set_id: 'a -> 'a = \"caml_set_oo_id\" [@@noalloc]\n\n(**** Object copy ****)\n\nlet copy o =\n let o = (Obj.obj (Obj.dup (Obj.repr o))) in\n set_id o\n\n(**** Compression options ****)\n(* Parameters *)\ntype params = {\n mutable compact_table : bool;\n mutable copy_parent : bool;\n mutable clean_when_copying : bool;\n mutable retry_count : int;\n mutable bucket_small_size : int\n }\n\nlet params = {\n compact_table = true;\n copy_parent = true;\n clean_when_copying = true;\n retry_count = 3;\n bucket_small_size = 16\n}\n\n(**** Parameters ****)\n\nlet initial_object_size = 2\n\n(**** Items ****)\n\ntype item = DummyA | DummyB | DummyC of int\nlet _ = [DummyA; DummyB; DummyC 0] (* to avoid warnings *)\n\nlet dummy_item = (Obj.magic () : item)\n\n(**** Types ****)\n\ntype tag\ntype label = int\ntype closure = item\ntype t = DummyA | DummyB | DummyC of int\nlet _ = [DummyA; DummyB; DummyC 0] (* to avoid warnings *)\n\ntype obj = t array\nexternal ret : (obj -> 'a) -> closure = \"%identity\"\n\n(**** Labels ****)\n\nlet public_method_label s : tag =\n let accu = ref 0 in\n for i = 0 to String.length s - 1 do\n accu := 223 * !accu + Char.code s.[i]\n done;\n (* reduce to 31 bits *)\n accu := !accu land (1 lsl 31 - 1);\n (* make it signed for 64 bits architectures *)\n let tag = if !accu > 0x3FFFFFFF then !accu - (1 lsl 31) else !accu in\n (* Printf.eprintf \"%s = %d\\n\" s tag; flush stderr; *)\n Obj.magic tag\n\n(**** Sparse array ****)\n\nmodule Vars =\n Map.Make(struct type t = string let compare (x:t) y = compare x y end)\ntype vars = int Vars.t\n\nmodule Meths =\n Map.Make(struct type t = string let compare (x:t) y = compare x y end)\ntype meths = label Meths.t\nmodule Labs =\n Map.Make(struct type t = label let compare (x:t) y = compare x y end)\ntype labs = bool Labs.t\n\n(* The compiler assumes that the first field of this structure is [size]. *)\ntype table =\n { mutable size: int;\n mutable methods: closure array;\n mutable methods_by_name: meths;\n mutable methods_by_label: labs;\n mutable previous_states:\n (meths * labs * (label * item) list * vars *\n label list * string list) list;\n mutable hidden_meths: (label * item) list;\n mutable vars: vars;\n mutable initializers: (obj -> unit) list }\n\nlet dummy_table =\n { methods = [| dummy_item |];\n methods_by_name = Meths.empty;\n methods_by_label = Labs.empty;\n previous_states = [];\n hidden_meths = [];\n vars = Vars.empty;\n initializers = [];\n size = 0 }\n\nlet table_count = ref 0\n\n(* dummy_met should be a pointer, so use an atom *)\nlet dummy_met : item = Obj.obj (Obj.new_block 0 0)\n(* if debugging is needed, this could be a good idea: *)\n(* let dummy_met () = failwith \"Undefined method\" *)\n\nlet rec fit_size n =\n if n <= 2 then n else\n fit_size ((n+1)/2) * 2\n\nlet new_table pub_labels =\n incr table_count;\n let len = Array.length pub_labels in\n let methods = Array.make (len*2+2) dummy_met in\n methods.(0) <- Obj.magic len;\n methods.(1) <- Obj.magic (fit_size len * Sys.word_size / 8 - 1);\n for i = 0 to len - 1 do methods.(i*2+3) <- Obj.magic pub_labels.(i) done;\n { methods = methods;\n methods_by_name = Meths.empty;\n methods_by_label = Labs.empty;\n previous_states = [];\n hidden_meths = [];\n vars = Vars.empty;\n initializers = [];\n size = initial_object_size }\n\nlet resize array new_size =\n let old_size = Array.length array.methods in\n if new_size > old_size then begin\n let new_buck = Array.make new_size dummy_met in\n Array.blit array.methods 0 new_buck 0 old_size;\n array.methods <- new_buck\n end\n\nlet put array label element =\n resize array (label + 1);\n array.methods.(label) <- element\n\n(**** Classes ****)\n\nlet method_count = ref 0\nlet inst_var_count = ref 0\n\n(* type t *)\ntype meth = item\n\nlet new_method table =\n let index = Array.length table.methods in\n resize table (index + 1);\n index\n\nlet get_method_label table name =\n try\n Meths.find name table.methods_by_name\n with Not_found ->\n let label = new_method table in\n table.methods_by_name <- Meths.add name label table.methods_by_name;\n table.methods_by_label <- Labs.add label true table.methods_by_label;\n label\n\nlet get_method_labels table names =\n Array.map (get_method_label table) names\n\nlet set_method table label element =\n incr method_count;\n if Labs.find label table.methods_by_label then\n put table label element\n else\n table.hidden_meths <- (label, element) :: table.hidden_meths\n\nlet get_method table label =\n try List.assoc label table.hidden_meths\n with Not_found -> table.methods.(label)\n\nlet to_list arr =\n if arr == Obj.magic 0 then [] else Array.to_list arr\n\nlet narrow table vars virt_meths concr_meths =\n let vars = to_list vars\n and virt_meths = to_list virt_meths\n and concr_meths = to_list concr_meths in\n let virt_meth_labs = List.map (get_method_label table) virt_meths in\n let concr_meth_labs = List.map (get_method_label table) concr_meths in\n table.previous_states <-\n (table.methods_by_name, table.methods_by_label, table.hidden_meths,\n table.vars, virt_meth_labs, vars)\n :: table.previous_states;\n table.vars <-\n Vars.fold\n (fun lab info tvars ->\n if List.mem lab vars then Vars.add lab info tvars else tvars)\n table.vars Vars.empty;\n let by_name = ref Meths.empty in\n let by_label = ref Labs.empty in\n List.iter2\n (fun met label ->\n by_name := Meths.add met label !by_name;\n by_label :=\n Labs.add label\n (try Labs.find label table.methods_by_label with Not_found -> true)\n !by_label)\n concr_meths concr_meth_labs;\n List.iter2\n (fun met label ->\n by_name := Meths.add met label !by_name;\n by_label := Labs.add label false !by_label)\n virt_meths virt_meth_labs;\n table.methods_by_name <- !by_name;\n table.methods_by_label <- !by_label;\n table.hidden_meths <-\n List.fold_right\n (fun ((lab, _) as met) hm ->\n if List.mem lab virt_meth_labs then hm else met::hm)\n table.hidden_meths\n []\n\nlet widen table =\n let (by_name, by_label, saved_hidden_meths, saved_vars, virt_meths, vars) =\n List.hd table.previous_states\n in\n table.previous_states <- List.tl table.previous_states;\n table.vars <-\n List.fold_left\n (fun s v -> Vars.add v (Vars.find v table.vars) s)\n saved_vars vars;\n table.methods_by_name <- by_name;\n table.methods_by_label <- by_label;\n table.hidden_meths <-\n List.fold_right\n (fun ((lab, _) as met) hm ->\n if List.mem lab virt_meths then hm else met::hm)\n table.hidden_meths\n saved_hidden_meths\n\nlet new_slot table =\n let index = table.size in\n table.size <- index + 1;\n index\n\nlet new_variable table name =\n try Vars.find name table.vars\n with Not_found ->\n let index = new_slot table in\n if name <> \"\" then table.vars <- Vars.add name index table.vars;\n index\n\nlet to_array arr =\n if arr = Obj.magic 0 then [||] else arr\n\nlet new_methods_variables table meths vals =\n let meths = to_array meths in\n let nmeths = Array.length meths and nvals = Array.length vals in\n let res = Array.make (nmeths + nvals) 0 in\n for i = 0 to nmeths - 1 do\n res.(i) <- get_method_label table meths.(i)\n done;\n for i = 0 to nvals - 1 do\n res.(i+nmeths) <- new_variable table vals.(i)\n done;\n res\n\nlet get_variable table name =\n try Vars.find name table.vars with Not_found -> assert false\n\nlet get_variables table names =\n Array.map (get_variable table) names\n\nlet add_initializer table f =\n table.initializers <- f::table.initializers\n\n(*\nmodule Keys =\n Map.Make(struct type t = tag array let compare (x:t) y = compare x y end)\nlet key_map = ref Keys.empty\nlet get_key tags : item =\n try magic (Keys.find tags !key_map : tag array)\n with Not_found ->\n key_map := Keys.add tags tags !key_map;\n magic tags\n*)\n\nlet create_table public_methods =\n if public_methods == Obj.magic 0 then new_table [||] else\n (* [public_methods] must be in ascending order for bytecode *)\n let tags = Array.map public_method_label public_methods in\n let table = new_table tags in\n Array.iteri\n (fun i met ->\n let lab = i*2+2 in\n table.methods_by_name <- Meths.add met lab table.methods_by_name;\n table.methods_by_label <- Labs.add lab true table.methods_by_label)\n public_methods;\n table\n\nlet init_class table =\n inst_var_count := !inst_var_count + table.size - 1;\n table.initializers <- List.rev table.initializers;\n resize table (3 + Obj.magic table.methods.(1) * 16 / Sys.word_size)\n\nlet inherits cla vals virt_meths concr_meths (_, super, _, env) top =\n narrow cla vals virt_meths concr_meths;\n let init =\n if top then super cla env else Obj.repr (super cla) in\n widen cla;\n Array.concat\n [[| Obj.repr init |];\n Obj.magic (Array.map (get_variable cla) (to_array vals) : int array);\n Array.map\n (fun nm -> Obj.repr (get_method cla (get_method_label cla nm) : closure))\n (to_array concr_meths) ]\n\nlet make_class pub_meths class_init =\n let table = create_table pub_meths in\n let env_init = class_init table in\n init_class table;\n (env_init (Obj.repr 0), class_init, env_init, Obj.repr 0)\n\ntype init_table = { mutable env_init: t; mutable class_init: table -> t }\n[@@warning \"-unused-field\"]\n\nlet make_class_store pub_meths class_init init_table =\n let table = create_table pub_meths in\n let env_init = class_init table in\n init_class table;\n init_table.class_init <- class_init;\n init_table.env_init <- env_init\n\nlet dummy_class loc =\n let undef = fun _ -> raise (Undefined_recursive_module loc) in\n (Obj.magic undef, undef, undef, Obj.repr 0)\n\n(**** Objects ****)\n\nlet create_object table =\n (* XXX Appel de [obj_block] | Call to [obj_block] *)\n let obj = Obj.new_block Obj.object_tag table.size in\n (* XXX Appel de [caml_modify] | Call to [caml_modify] *)\n Obj.set_field obj 0 (Obj.repr table.methods);\n Obj.obj (set_id obj)\n\nlet create_object_opt obj_0 table =\n if (Obj.magic obj_0 : bool) then obj_0 else begin\n (* XXX Appel de [obj_block] | Call to [obj_block] *)\n let obj = Obj.new_block Obj.object_tag table.size in\n (* XXX Appel de [caml_modify] | Call to [caml_modify] *)\n Obj.set_field obj 0 (Obj.repr table.methods);\n Obj.obj (set_id obj)\n end\n\nlet rec iter_f obj =\n function\n [] -> ()\n | f::l -> f obj; iter_f obj l\n\nlet run_initializers obj table =\n let inits = table.initializers in\n if inits <> [] then\n iter_f obj inits\n\nlet run_initializers_opt obj_0 obj table =\n if (Obj.magic obj_0 : bool) then obj else begin\n let inits = table.initializers in\n if inits <> [] then iter_f obj inits;\n obj\n end\n\nlet create_object_and_run_initializers obj_0 table =\n if (Obj.magic obj_0 : bool) then obj_0 else begin\n let obj = create_object table in\n run_initializers obj table;\n obj\n end\n\n(* Equivalent primitive below\nlet sendself obj lab =\n (magic obj : (obj -> t) array array).(0).(lab) obj\n*)\nexternal send : obj -> tag -> 'a = \"%send\"\nexternal sendcache : obj -> tag -> t -> int -> 'a = \"%sendcache\"\nexternal sendself : obj -> label -> 'a = \"%sendself\"\nexternal get_public_method : obj -> tag -> closure\n = \"caml_get_public_method\" [@@noalloc]\n\n(**** table collection access ****)\n\ntype tables =\n | Empty\n | Cons of {key : closure; mutable data: tables; mutable next: tables}\n\nlet set_data tables v = match tables with\n | Empty -> assert false\n | Cons tables -> tables.data <- v\nlet set_next tables v = match tables with\n | Empty -> assert false\n | Cons tables -> tables.next <- v\nlet get_key = function\n | Empty -> assert false\n | Cons tables -> tables.key\nlet get_data = function\n | Empty -> assert false\n | Cons tables -> tables.data\nlet get_next = function\n | Empty -> assert false\n | Cons tables -> tables.next\n\nlet build_path n keys tables =\n let res = Cons {key = Obj.magic 0; data = Empty; next = Empty} in\n let r = ref res in\n for i = 0 to n do\n r := Cons {key = keys.(i); data = !r; next = Empty}\n done;\n set_data tables !r;\n res\n\nlet rec lookup_keys i keys tables =\n if i < 0 then tables else\n let key = keys.(i) in\n let rec lookup_key (tables:tables) =\n if get_key tables == key then\n match get_data tables with\n | Empty -> assert false\n | Cons _ as tables_data ->\n lookup_keys (i-1) keys tables_data\n else\n match get_next tables with\n | Cons _ as next -> lookup_key next\n | Empty ->\n let next : tables = Cons {key; data = Empty; next = Empty} in\n set_next tables next;\n build_path (i-1) keys next\n in\n lookup_key tables\n\nlet lookup_tables root keys =\n match get_data root with\n | Cons _ as root_data ->\n lookup_keys (Array.length keys - 1) keys root_data\n | Empty ->\n build_path (Array.length keys - 1) keys root\n\n(**** builtin methods ****)\n\nlet get_const x = ret (fun _obj -> x)\nlet get_var n = ret (fun obj -> Array.unsafe_get obj n)\nlet get_env e n =\n ret (fun obj ->\n Array.unsafe_get (Obj.magic (Array.unsafe_get obj e) : obj) n)\nlet get_meth n = ret (fun obj -> sendself obj n)\nlet set_var n = ret (fun obj x -> Array.unsafe_set obj n x)\nlet app_const f x = ret (fun _obj -> f x)\nlet app_var f n = ret (fun obj -> f (Array.unsafe_get obj n))\nlet app_env f e n =\n ret (fun obj ->\n f (Array.unsafe_get (Obj.magic (Array.unsafe_get obj e) : obj) n))\nlet app_meth f n = ret (fun obj -> f (sendself obj n))\nlet app_const_const f x y = ret (fun _obj -> f x y)\nlet app_const_var f x n = ret (fun obj -> f x (Array.unsafe_get obj n))\nlet app_const_meth f x n = ret (fun obj -> f x (sendself obj n))\nlet app_var_const f n x = ret (fun obj -> f (Array.unsafe_get obj n) x)\nlet app_meth_const f n x = ret (fun obj -> f (sendself obj n) x)\nlet app_const_env f x e n =\n ret (fun obj ->\n f x (Array.unsafe_get (Obj.magic (Array.unsafe_get obj e) : obj) n))\nlet app_env_const f e n x =\n ret (fun obj ->\n f (Array.unsafe_get (Obj.magic (Array.unsafe_get obj e) : obj) n) x)\nlet meth_app_const n x = ret (fun obj -> (sendself obj n : _ -> _) x)\nlet meth_app_var n m =\n ret (fun obj -> (sendself obj n : _ -> _) (Array.unsafe_get obj m))\nlet meth_app_env n e m =\n ret (fun obj -> (sendself obj n : _ -> _)\n (Array.unsafe_get (Obj.magic (Array.unsafe_get obj e) : obj) m))\nlet meth_app_meth n m =\n ret (fun obj -> (sendself obj n : _ -> _) (sendself obj m))\nlet send_const m x c =\n ret (fun obj -> sendcache x m (Array.unsafe_get obj 0) c)\nlet send_var m n c =\n ret (fun obj ->\n sendcache (Obj.magic (Array.unsafe_get obj n) : obj) m\n (Array.unsafe_get obj 0) c)\nlet send_env m e n c =\n ret (fun obj ->\n sendcache\n (Obj.magic (Array.unsafe_get\n (Obj.magic (Array.unsafe_get obj e) : obj) n) : obj)\n m (Array.unsafe_get obj 0) c)\nlet send_meth m n c =\n ret (fun obj ->\n sendcache (sendself obj n) m (Array.unsafe_get obj 0) c)\nlet new_cache table =\n let n = new_method table in\n let n =\n if n mod 2 = 0 || n > 2 + Obj.magic table.methods.(1) * 16 / Sys.word_size\n then n else new_method table\n in\n table.methods.(n) <- Obj.magic 0;\n n\n\ntype impl =\n GetConst\n | GetVar\n | GetEnv\n | GetMeth\n | SetVar\n | AppConst\n | AppVar\n | AppEnv\n | AppMeth\n | AppConstConst\n | AppConstVar\n | AppConstEnv\n | AppConstMeth\n | AppVarConst\n | AppEnvConst\n | AppMethConst\n | MethAppConst\n | MethAppVar\n | MethAppEnv\n | MethAppMeth\n | SendConst\n | SendVar\n | SendEnv\n | SendMeth\n | Closure of closure\n\nlet method_impl table i arr =\n let next () = incr i; Obj.magic arr.(!i) in\n match next() with\n GetConst -> let x : t = next() in get_const x\n | GetVar -> let n = next() in get_var n\n | GetEnv -> let e = next() in let n = next() in get_env e n\n | GetMeth -> let n = next() in get_meth n\n | SetVar -> let n = next() in set_var n\n | AppConst -> let f = next() in let x = next() in app_const f x\n | AppVar -> let f = next() in let n = next () in app_var f n\n | AppEnv ->\n let f = next() in let e = next() in let n = next() in\n app_env f e n\n | AppMeth -> let f = next() in let n = next () in app_meth f n\n | AppConstConst ->\n let f = next() in let x = next() in let y = next() in\n app_const_const f x y\n | AppConstVar ->\n let f = next() in let x = next() in let n = next() in\n app_const_var f x n\n | AppConstEnv ->\n let f = next() in let x = next() in let e = next () in let n = next() in\n app_const_env f x e n\n | AppConstMeth ->\n let f = next() in let x = next() in let n = next() in\n app_const_meth f x n\n | AppVarConst ->\n let f = next() in let n = next() in let x = next() in\n app_var_const f n x\n | AppEnvConst ->\n let f = next() in let e = next () in let n = next() in let x = next() in\n app_env_const f e n x\n | AppMethConst ->\n let f = next() in let n = next() in let x = next() in\n app_meth_const f n x\n | MethAppConst ->\n let n = next() in let x = next() in meth_app_const n x\n | MethAppVar ->\n let n = next() in let m = next() in meth_app_var n m\n | MethAppEnv ->\n let n = next() in let e = next() in let m = next() in\n meth_app_env n e m\n | MethAppMeth ->\n let n = next() in let m = next() in meth_app_meth n m\n | SendConst ->\n let m = next() in let x = next() in send_const m x (new_cache table)\n | SendVar ->\n let m = next() in let n = next () in send_var m n (new_cache table)\n | SendEnv ->\n let m = next() in let e = next() in let n = next() in\n send_env m e n (new_cache table)\n | SendMeth ->\n let m = next() in let n = next () in send_meth m n (new_cache table)\n | Closure _ as clo -> Obj.magic clo\n\nlet set_methods table methods =\n let len = Array.length methods in let i = ref 0 in\n while !i < len do\n let label = methods.(!i) in let clo = method_impl table i methods in\n set_method table label clo;\n incr i\n done\n\n(**** Statistics ****)\n\ntype stats =\n { classes: int; methods: int; inst_vars: int; }\n\nlet stats () =\n { classes = !table_count;\n methods = !method_count; inst_vars = !inst_var_count; }\n","(* generated code *)"],"names":[],"mappings":"MAkmBE,kDACyD,C,iBAdzD,iB,CAAA,yBAAkC,I,EAAA,KAClC,mBACc,YAAZ,OAAY,Q,EACZ,EADY,YAA0B,gBACtC,WAA0B,sCAExB,C,aA5DU,sCAAQ,gBAAU,a,CAAA,iCAAlB,EAAkB,oB,CAAA,gCAAQ,M,EApFP,SAAC,C,EACF,yBAAsB,C,KAGpD,+CAA6D,C,KAC/B,kDAAc,C,EACZ,gCAAwB,C,KACvB,8BAAG,C,KACJ,8CAA0B,C,KAG1D,kEAAiE,C,QAC/B,OAAF,gCAAE,aAAgB,oB,KACT,0BAAK,C,KACN,0CAA4B,C,KAMpE,8DAAmE,C,QAL5B,OAAoB,IAAhB,OAAJ,2BAAI,aAAgB,U,KACrB,0CAA4B,C,KAOlE,8DAAmE,C,QAN1B,OAAF,gCAAE,aAAgB,eAAE,C,QAOtB,gDAA2B,C,QAElD,6DAAkD,C,QAElD,iFACmD,C,QAET,OAAhB,EAA1B,gCAA0B,aAAgB,+B,KAE1C,uCAAwC,C,KAGtD,qDAC4B,C,KAG5B,yEAG8B,C,QAGpB,OAAV,gCAAU,eAAgB,wBAA6B,C,cAsCzD,KACM,KAAM,wFAkDA,OAAkB,OAAyB,YA1FvD,YAuFY,OAAkB,OAAkB,OAC7B,YA9FnB,cA2FY,OAAkB,OAAwB,YA/FtD,YA6FY,OAAkB,OAAyB,YA/FvD,YAFA,GA+FY,KAAkB,KA/F9B,KAHA,GA+FY,KAAkB,KAAkB,KA/FhD,KAFA,GA+FY,KAAkB,KA/F9B,KAFuB,G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AAkB,QADH,GACO,C,KAnC+B,+BAAW,C,EAHV,MAAW,C,OAlBjE,EACA,kB,CAAA,IACkC,oBAAK,MAAL,aAAK,4BAOvC,SAAa,C,EAvDI,KACjB,GAAQ,C,4CCvBV,gJ,EAAA,6D,EAAA,KDsHkD,aAAnB,YAAmB,4G,EAAA,wG,EAAA,4G,QCtHlD,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA,sD,EAAA,gB,EAAA,gB,EAAA,gB,EAAA,gB,EAAA,gB,0BAAA","ignoreList":[1]}},{"offset":{"line":0,"column":346518},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/camlinternalMod.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2004 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype shape =\n | Function\n | Lazy\n | Class\n | Module of shape array\n | Value of Obj.t\n\nlet rec init_mod_field modu i loc shape =\n let init =\n match shape with\n | Function ->\n let rec fn (x : 'a) =\n let fn' : 'a -> 'b = Obj.obj (Obj.field modu i) in\n if fn == fn' then\n raise (Undefined_recursive_module loc)\n else\n fn' x in\n Obj.repr fn\n | Lazy ->\n let rec l =\n lazy (\n let l' = Obj.obj (Obj.field modu i) in\n if l == l' then\n raise (Undefined_recursive_module loc)\n else\n Lazy.force l') in\n Obj.repr l\n | Class ->\n Obj.repr (CamlinternalOO.dummy_class loc)\n | Module comps ->\n Obj.repr (init_mod_block loc comps)\n | Value v -> v\n in\n Obj.set_field modu i init\n\nand init_mod_block loc comps =\n let length = Array.length comps in\n let modu = Obj.new_block 0 length in\n for i = 0 to length - 1 do\n init_mod_field modu i loc comps.(i)\n done;\n modu\n\nlet init_mod loc shape =\n match shape with\n | Module comps ->\n Obj.repr (init_mod_block loc comps)\n | _ -> failwith \"CamlinternalMod.init_mod: not a module\"\n\nlet rec update_mod_field modu i shape n =\n match shape with\n | Function | Lazy ->\n Obj.set_field modu i n\n | Value _ ->\n () (* the value is already there *)\n | Class ->\n assert (Obj.tag n = 0 && Obj.size n = 4);\n let cl = Obj.field modu i in\n for j = 0 to 3 do\n Obj.set_field cl j (Obj.field n j)\n done\n | Module comps ->\n update_mod_block comps (Obj.field modu i) n\n\nand update_mod_block comps o n =\n assert (Obj.tag n = 0 && Obj.size n >= Array.length comps);\n for i = 0 to Array.length comps - 1 do\n update_mod_field o i comps.(i) (Obj.field n i)\n done\n\nlet update_mod shape o n =\n match shape with\n | Module comps ->\n update_mod_block comps o n\n | _ -> failwith \"CamlinternalMod.update_mod: not a module\"\n","(* generated code *)"],"names":[],"mappings":"KAsFE,K,CAAA,4BAEG,YACI,uBAAmD,C,eAxB1D,gBAMoB,IAAT,IAAS,sCACR,mDACT,MACE,UAAmB,kDAAnB,iDAAkC,wB,KAAA,gBAPpC,wDAAsB,8BAUC,iDAAkB,MARzC,IAQ2C,C,WAGtC,EAAS,IAAT,IAAS,kEACjB,6CACiC,oDAAV,uBAArB,MAAqB,gBAArB,MAA8C,iDAC5C,C,KAxBJ,K,CAAA,qBAEG,EAFH,OAEG,KACI,uBAAiD,C,cAnCpB,U,IAAA,Q,CAAA,iDAC7B,I,CAAA,kB,CAAA,Y,CAAA,MACE,a,CAAA,WAEA,kB,CAAK,C,SAKY,W,IAAA,S,CAAA,kDACjB,I,CAAA,4CACE,a,CAAA,YAEA,kC,CAAA,U,CAAA,iC,WAYA,IADX,gCACW,MADX,EAEA,qBAC4B,yCA/B5B,K,EAAA,mBAoBc,EAAT,QAAS,aAAgC,KATzC,qCAOA,GAfA,YAMA,wBAaS,EAbT,OAaS,IAA0B,Q,GAGxC,yDAMqC,yBAErC,OAAI,C,ECxDN,sB,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA","ignoreList":[1]}},{"offset":{"line":0,"column":348318},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/ephemeron.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Damien Doligez, projet Para, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1997 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nmodule type SeededS = sig\n\n type key\n type !'a t\n val create : ?random (*thwart tools/sync_stdlib_docs*) : bool -> int -> 'a t\n val clear : 'a t -> unit\n val reset : 'a t -> unit\n val copy : 'a t -> 'a t\n val add : 'a t -> key -> 'a -> unit\n val remove : 'a t -> key -> unit\n val find : 'a t -> key -> 'a\n val find_opt : 'a t -> key -> 'a option\n val find_all : 'a t -> key -> 'a list\n val replace : 'a t -> key -> 'a -> unit\n val mem : 'a t -> key -> bool\n val length : 'a t -> int\n val stats : 'a t -> Hashtbl.statistics\n val add_seq : 'a t -> (key * 'a) Seq.t -> unit\n val replace_seq : 'a t -> (key * 'a) Seq.t -> unit\n val of_seq : (key * 'a) Seq.t -> 'a t\n val clean: 'a t -> unit\n val stats_alive: 'a t -> Hashtbl.statistics\n (** same as {!stats} but only count the alive bindings *)\nend\n\nmodule type S = sig\n\n type key\n type !'a t\n val create : int -> 'a t\n val clear : 'a t -> unit\n val reset : 'a t -> unit\n val copy : 'a t -> 'a t\n val add : 'a t -> key -> 'a -> unit\n val remove : 'a t -> key -> unit\n val find : 'a t -> key -> 'a\n val find_opt : 'a t -> key -> 'a option\n val find_all : 'a t -> key -> 'a list\n val replace : 'a t -> key -> 'a -> unit\n val mem : 'a t -> key -> bool\n val length : 'a t -> int\n val stats : 'a t -> Hashtbl.statistics\n val add_seq : 'a t -> (key * 'a) Seq.t -> unit\n val replace_seq : 'a t -> (key * 'a) Seq.t -> unit\n val of_seq : (key * 'a) Seq.t -> 'a t\n val clean: 'a t -> unit\n val stats_alive: 'a t -> Hashtbl.statistics\n (** same as {!stats} but only count the alive bindings *)\nend\n\nmodule GenHashTable = struct\n\n type equal =\n | ETrue | EFalse\n | EDead (** the garbage collector reclaimed the data *)\n\n module MakeSeeded(H: sig\n type t\n type 'a container\n val create: t -> 'a -> 'a container\n val seeded_hash: int -> t -> int\n val equal: 'a container -> t -> equal\n val get_data: 'a container -> 'a option\n val set_key_data: 'a container -> t -> 'a -> unit\n val check_key: 'a container -> bool\n end) : SeededS with type key = H.t\n = struct\n\n type 'a t =\n { mutable size: int; (* number of entries *)\n mutable data: 'a bucketlist array; (* the buckets *)\n seed: int; (* for randomization *)\n initial_size: int; (* initial array size *)\n }\n\n and 'a bucketlist =\n | Empty\n | Cons of int (* hash of the key *) * 'a H.container * 'a bucketlist\n\n (** the hash of the key is kept in order to test the equality of the hash\n before the key. Same reason as for Weak.Make *)\n\n type key = H.t\n\n let rec power_2_above x n =\n if x >= n then x\n else if x * 2 > Sys.max_array_length then x\n else power_2_above (x * 2) n\n\n let prng = lazy (Random.State.make_self_init())\n\n let create ?(random = (Hashtbl.is_randomized ())) initial_size =\n let s = power_2_above 16 initial_size in\n let seed = if random then Random.State.bits (Lazy.force prng) else 0 in\n { initial_size = s; size = 0; seed = seed; data = Array.make s Empty }\n\n let clear h =\n h.size <- 0;\n let len = Array.length h.data in\n for i = 0 to len - 1 do\n h.data.(i) <- Empty\n done\n\n let reset h =\n let len = Array.length h.data in\n if len = h.initial_size then\n clear h\n else begin\n h.size <- 0;\n h.data <- Array.make h.initial_size Empty\n end\n\n let copy h = { h with data = Array.copy h.data }\n\n let key_index h hkey =\n hkey land (Array.length h.data - 1)\n\n let clean h =\n let rec do_bucket = function\n | Empty ->\n Empty\n | Cons(_, c, rest) when not (H.check_key c) ->\n h.size <- h.size - 1;\n do_bucket rest\n | Cons(hkey, c, rest) ->\n Cons(hkey, c, do_bucket rest)\n in\n let d = h.data in\n for i = 0 to Array.length d - 1 do\n d.(i) <- do_bucket d.(i)\n done\n\n (** resize is the only function to do the actual cleaning of dead keys\n (remove does it just because it could).\n\n The goal is to:\n\n - not resize infinitely when the actual number of alive keys is\n bounded but keys are continuously added. That would happen if\n this function always resize.\n - not call this function after each addition, that would happen if this\n function don't resize even when only one key is dead.\n\n So the algorithm:\n - clean the keys before resizing\n - if the number of remaining keys is less than half the size of the\n array, don't resize.\n - if it is more, resize.\n\n The second problem remains if the table reaches {!Sys.max_array_length}.\n\n *)\n let resize h =\n let odata = h.data in\n let osize = Array.length odata in\n let nsize = osize * 2 in\n clean h;\n if nsize < Sys.max_array_length && h.size >= osize lsr 1 then begin\n let ndata = Array.make nsize Empty in\n h.data <- ndata; (* so that key_index sees the new bucket count *)\n let rec insert_bucket = function\n Empty -> ()\n | Cons(hkey, data, rest) ->\n insert_bucket rest; (* preserve original order of elements *)\n let nidx = key_index h hkey in\n ndata.(nidx) <- Cons(hkey, data, ndata.(nidx)) in\n for i = 0 to osize - 1 do\n insert_bucket odata.(i)\n done\n end\n\n let add h key info =\n let hkey = H.seeded_hash h.seed key in\n let i = key_index h hkey in\n let container = H.create key info in\n let bucket = Cons(hkey, container, h.data.(i)) in\n h.data.(i) <- bucket;\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize h\n\n let remove h key =\n let hkey = H.seeded_hash h.seed key in\n let rec remove_bucket = function\n | Empty -> Empty\n | Cons(hk, c, next) when hkey = hk ->\n begin match H.equal c key with\n | ETrue -> h.size <- h.size - 1; next\n | EFalse -> Cons(hk, c, remove_bucket next)\n | EDead ->\n (* The dead key is automatically removed. It is acceptable\n for this function since it already removes a binding *)\n h.size <- h.size - 1;\n remove_bucket next\n end\n | Cons(hk,c,next) -> Cons(hk, c, remove_bucket next) in\n let i = key_index h hkey in\n h.data.(i) <- remove_bucket h.data.(i)\n\n (** {!find} don't remove dead keys because it would be surprising for\n the user that a read-only function mutates the state (eg. concurrent\n access). Same for {!mem}.\n *)\n let rec find_rec key hkey = function\n | Empty ->\n raise Not_found\n | Cons(hk, c, rest) when hkey = hk ->\n begin match H.equal c key with\n | ETrue ->\n begin match H.get_data c with\n | None ->\n (* This case is not impossible because the gc can run between\n H.equal and H.get_data *)\n find_rec key hkey rest\n | Some d -> d\n end\n | EFalse -> find_rec key hkey rest\n | EDead ->\n find_rec key hkey rest\n end\n | Cons(_, _, rest) ->\n find_rec key hkey rest\n\n let find h key =\n let hkey = H.seeded_hash h.seed key in\n (* TODO inline 3 iterations *)\n find_rec key hkey (h.data.(key_index h hkey))\n\n let rec find_rec_opt key hkey = function\n | Empty ->\n None\n | Cons(hk, c, rest) when hkey = hk ->\n begin match H.equal c key with\n | ETrue ->\n begin match H.get_data c with\n | None ->\n (* This case is not impossible because the gc can run between\n H.equal and H.get_data *)\n find_rec_opt key hkey rest\n | Some _ as d -> d\n end\n | EFalse -> find_rec_opt key hkey rest\n | EDead ->\n find_rec_opt key hkey rest\n end\n | Cons(_, _, rest) ->\n find_rec_opt key hkey rest\n\n let find_opt h key =\n let hkey = H.seeded_hash h.seed key in\n (* TODO inline 3 iterations *)\n find_rec_opt key hkey (h.data.(key_index h hkey))\n\n let find_all h key =\n let hkey = H.seeded_hash h.seed key in\n let rec find_in_bucket = function\n | Empty -> []\n | Cons(hk, c, rest) when hkey = hk ->\n begin match H.equal c key with\n | ETrue -> begin match H.get_data c with\n | None ->\n find_in_bucket rest\n | Some d -> d::find_in_bucket rest\n end\n | EFalse -> find_in_bucket rest\n | EDead ->\n find_in_bucket rest\n end\n | Cons(_, _, rest) ->\n find_in_bucket rest in\n find_in_bucket h.data.(key_index h hkey)\n\n\n let replace h key info =\n let hkey = H.seeded_hash h.seed key in\n let rec replace_bucket = function\n | Empty -> raise Not_found\n | Cons(hk, c, next) when hkey = hk ->\n begin match H.equal c key with\n | ETrue -> H.set_key_data c key info\n | EFalse | EDead -> replace_bucket next\n end\n | Cons(_,_,next) -> replace_bucket next\n in\n let i = key_index h hkey in\n let l = h.data.(i) in\n try\n replace_bucket l\n with Not_found ->\n let container = H.create key info in\n h.data.(i) <- Cons(hkey, container, l);\n h.size <- h.size + 1;\n if h.size > Array.length h.data lsl 1 then resize h\n\n let mem h key =\n let hkey = H.seeded_hash h.seed key in\n let rec mem_in_bucket = function\n | Empty ->\n false\n | Cons(hk, c, rest) when hk = hkey ->\n begin match H.equal c key with\n | ETrue -> true\n | EFalse | EDead -> mem_in_bucket rest\n end\n | Cons(_hk, _c, rest) -> mem_in_bucket rest in\n mem_in_bucket h.data.(key_index h hkey)\n\n let length h = h.size\n\n let rec bucket_length accu = function\n | Empty -> accu\n | Cons(_, _, rest) -> bucket_length (accu + 1) rest\n\n let stats h =\n let mbl =\n Array.fold_left (fun m b -> Int.max m (bucket_length 0 b)) 0 h.data in\n let histo = Array.make (mbl + 1) 0 in\n Array.iter\n (fun b ->\n let l = bucket_length 0 b in\n histo.(l) <- histo.(l) + 1)\n h.data;\n { Hashtbl.num_bindings = h.size;\n num_buckets = Array.length h.data;\n max_bucket_length = mbl;\n bucket_histogram = histo }\n\n let rec bucket_length_alive accu = function\n | Empty -> accu\n | Cons(_, c, rest) when H.check_key c ->\n bucket_length_alive (accu + 1) rest\n | Cons(_, _, rest) -> bucket_length_alive accu rest\n\n let stats_alive h =\n let size = ref 0 in\n let mbl =\n Array.fold_left\n (fun m b -> Int.max m (bucket_length_alive 0 b)) 0 h.data\n in\n let histo = Array.make (mbl + 1) 0 in\n Array.iter\n (fun b ->\n let l = bucket_length_alive 0 b in\n size := !size + l;\n histo.(l) <- histo.(l) + 1)\n h.data;\n { Hashtbl.num_bindings = !size;\n num_buckets = Array.length h.data;\n max_bucket_length = mbl;\n bucket_histogram = histo }\n\n let add_seq tbl i =\n Seq.iter (fun (k,v) -> add tbl k v) i\n\n let replace_seq tbl i =\n Seq.iter (fun (k,v) -> replace tbl k v) i\n\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n\n end\nend\n\nmodule ObjEph = Obj.Ephemeron\n\nlet _obj_opt : Obj.t option -> 'a option = fun x ->\n match x with\n | None -> x\n | Some v -> Some (Obj.obj v)\n\n(** The previous function is typed so this one is also correct *)\nlet obj_opt : Obj.t option -> 'a option = fun x -> Obj.magic x\n\n\nmodule K1 = struct\n type ('k,'d) t = ObjEph.t\n\n let create () : ('k,'d) t = ObjEph.create 1\n\n let get_key (t:('k,'d) t) : 'k option = obj_opt (ObjEph.get_key t 0)\n let set_key (t:('k,'d) t) (k:'k) : unit = ObjEph.set_key t 0 (Obj.repr k)\n let check_key (t:('k,'d) t) : bool = ObjEph.check_key t 0\n\n let get_data (t:('k,'d) t) : 'd option = obj_opt (ObjEph.get_data t)\n let set_data (t:('k,'d) t) (d:'d) : unit = ObjEph.set_data t (Obj.repr d)\n let unset_data (t:('k,'d) t) : unit = ObjEph.unset_data t\n\n let make key data =\n let eph = create () in\n set_data eph data;\n set_key eph key;\n eph\n\n let query eph key =\n match get_key eph with\n | None -> None\n | Some k when k == key -> get_data eph\n | Some _ -> None\n\n module MakeSeeded (H:Hashtbl.SeededHashedType) =\n GenHashTable.MakeSeeded(struct\n type 'a container = (H.t,'a) t\n type t = H.t\n let create k d =\n let c = create () in\n set_data c d;\n set_key c k;\n c\n let seeded_hash = H.seeded_hash\n let equal c k =\n (* {!get_key_copy} is not used because the equality of the user can be\n the physical equality *)\n match get_key c with\n | None -> GenHashTable.EDead\n | Some k' ->\n if H.equal k k' then GenHashTable.ETrue else GenHashTable.EFalse\n let get_data = get_data\n let set_key_data c k d =\n unset_data c;\n set_key c k;\n set_data c d\n let check_key = check_key\n end)\n\n module Make(H: Hashtbl.HashedType): (S with type key = H.t) =\n struct\n include MakeSeeded(struct\n type t = H.t\n let equal = H.equal\n let seeded_hash (_seed: int) x = H.hash x\n end)\n let create sz = create ~random:false sz\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n end\n\n module Bucket = struct\n\n type nonrec ('k, 'd) t = ('k, 'd) t list ref\n let k1_make = make\n let make () = ref []\n let add b k d = b := k1_make k d :: !b\n\n let test_key k e =\n match get_key e with\n | Some x when x == k -> true\n | _ -> false\n\n let remove b k =\n let rec loop l acc =\n match l with\n | [] -> ()\n | h :: t when test_key k h -> b := List.rev_append acc t\n | h :: t -> loop t (h :: acc)\n in\n loop !b []\n\n let find b k =\n match List.find_opt (test_key k) !b with\n | Some e -> get_data e\n | None -> None\n\n let length b = List.length !b\n let clear b = b := []\n\n end\n\nend\n\nmodule K2 = struct\n type ('k1, 'k2, 'd) t = ObjEph.t\n\n let create () : ('k1,'k2,'d) t = ObjEph.create 2\n\n let get_key1 (t:('k1,'k2,'d) t) : 'k1 option = obj_opt (ObjEph.get_key t 0)\n let set_key1 (t:('k1,'k2,'d) t) (k:'k1) : unit =\n ObjEph.set_key t 0 (Obj.repr k)\n let check_key1 (t:('k1,'k2,'d) t) : bool = ObjEph.check_key t 0\n\n let get_key2 (t:('k1,'k2,'d) t) : 'k2 option = obj_opt (ObjEph.get_key t 1)\n let set_key2 (t:('k1,'k2,'d) t) (k:'k2) : unit =\n ObjEph.set_key t 1 (Obj.repr k)\n let check_key2 (t:('k1,'k2,'d) t) : bool = ObjEph.check_key t 1\n\n let get_data (t:('k1,'k2,'d) t) : 'd option = obj_opt (ObjEph.get_data t)\n let set_data (t:('k1,'k2,'d) t) (d:'d) : unit =\n ObjEph.set_data t (Obj.repr d)\n let unset_data (t:('k1,'k2,'d) t) : unit = ObjEph.unset_data t\n\n let make key1 key2 data =\n let eph = create () in\n set_data eph data;\n set_key1 eph key1;\n set_key2 eph key2;\n ignore (Sys.opaque_identity key1);\n eph\n\n let query eph key1 key2 =\n match get_key1 eph with\n | None -> None\n | Some k when k == key1 ->\n begin match get_key2 eph with\n | None -> None\n | Some k when k == key2 -> get_data eph\n | Some _ -> None\n end\n | Some _ -> None\n\n module MakeSeeded\n (H1:Hashtbl.SeededHashedType)\n (H2:Hashtbl.SeededHashedType) =\n GenHashTable.MakeSeeded(struct\n type 'a container = (H1.t,H2.t,'a) t\n type t = H1.t * H2.t\n let create (k1,k2) d =\n let c = create () in\n set_data c d;\n set_key1 c k1; set_key2 c k2;\n c\n let seeded_hash seed (k1,k2) =\n H1.seeded_hash seed k1 + H2.seeded_hash seed k2 * 65599\n let equal c (k1,k2) =\n match get_key1 c, get_key2 c with\n | None, _ | _ , None -> GenHashTable.EDead\n | Some k1', Some k2' ->\n if H1.equal k1 k1' && H2.equal k2 k2'\n then GenHashTable.ETrue else GenHashTable.EFalse\n let get_data = get_data\n let set_key_data c (k1,k2) d =\n unset_data c;\n set_key1 c k1; set_key2 c k2;\n set_data c d\n let check_key c = check_key1 c && check_key2 c\n end)\n\n module Make(H1: Hashtbl.HashedType)(H2: Hashtbl.HashedType):\n (S with type key = H1.t * H2.t) =\n struct\n include MakeSeeded\n (struct\n type t = H1.t\n let equal = H1.equal\n let seeded_hash (_seed: int) x = H1.hash x\n end)\n (struct\n type t = H2.t\n let equal = H2.equal\n let seeded_hash (_seed: int) x = H2.hash x\n end)\n let create sz = create ~random:false sz\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n end\n\n module Bucket = struct\n\n type nonrec ('k1, 'k2, 'd) t = ('k1, 'k2, 'd) t list ref\n let k2_make = make\n let make () = ref []\n let add b k1 k2 d = b := k2_make k1 k2 d :: !b\n\n let test_keys k1 k2 e =\n match get_key1 e, get_key2 e with\n | Some x1, Some x2 when x1 == k1 && x2 == k2 -> true\n | _ -> false\n\n let remove b k1 k2 =\n let rec loop l acc =\n match l with\n | [] -> ()\n | h :: t when test_keys k1 k2 h -> b := List.rev_append acc t\n | h :: t -> loop t (h :: acc)\n in\n loop !b []\n\n let find b k1 k2 =\n match List.find_opt (test_keys k1 k2) !b with\n | Some e -> get_data e\n | None -> None\n\n let length b = List.length !b\n let clear b = b := []\n\n end\n\nend\n\nmodule Kn = struct\n type ('k,'d) t = ObjEph.t\n\n let create n : ('k,'d) t = ObjEph.create n\n let length (k:('k,'d) t) : int = ObjEph.length k\n\n let get_key (t:('k,'d) t) (n:int) : 'k option = obj_opt (ObjEph.get_key t n)\n let set_key (t:('k,'d) t) (n:int) (k:'k) : unit =\n ObjEph.set_key t n (Obj.repr k)\n let check_key (t:('k,'d) t) (n:int) : bool = ObjEph.check_key t n\n\n let get_data (t:('k,'d) t) : 'd option = obj_opt (ObjEph.get_data t)\n let set_data (t:('k,'d) t) (d:'d) : unit = ObjEph.set_data t (Obj.repr d)\n let unset_data (t:('k,'d) t) : unit = ObjEph.unset_data t\n\n let make keys data =\n let l = Array.length keys in\n let eph = create l in\n set_data eph data;\n for i = 0 to l - 1 do set_key eph i keys.(i) done;\n eph\n\n let query eph keys =\n let l = length eph in\n try\n if l <> Array.length keys then raise Exit;\n for i = 0 to l - 1 do\n match get_key eph i with\n | None -> raise Exit\n | Some k when k == keys.(i) -> ()\n | Some _ -> raise Exit\n done;\n get_data eph\n with Exit -> None\n\n module MakeSeeded (H:Hashtbl.SeededHashedType) =\n GenHashTable.MakeSeeded(struct\n type 'a container = (H.t,'a) t\n type t = H.t array\n let create k d =\n let c = create (Array.length k) in\n set_data c d;\n for i=0 to Array.length k -1 do\n set_key c i k.(i);\n done;\n c\n let seeded_hash seed k =\n let h = ref 0 in\n for i=0 to Array.length k -1 do\n h := H.seeded_hash seed k.(i) * 65599 + !h;\n done;\n !h\n let equal c k =\n let len = Array.length k in\n let len' = length c in\n if len != len' then GenHashTable.EFalse\n else\n let rec equal_array k c i =\n if i < 0 then GenHashTable.ETrue\n else\n match get_key c i with\n | None -> GenHashTable.EDead\n | Some ki ->\n if H.equal k.(i) ki\n then equal_array k c (i-1)\n else GenHashTable.EFalse\n in\n equal_array k c (len-1)\n let get_data = get_data\n let set_key_data c k d =\n unset_data c;\n for i=0 to Array.length k -1 do\n set_key c i k.(i);\n done;\n set_data c d\n let check_key c =\n let rec check c i =\n i < 0 || (check_key c i && check c (i-1)) in\n check c (length c - 1)\n end)\n\n module Make(H: Hashtbl.HashedType): (S with type key = H.t array) =\n struct\n include MakeSeeded(struct\n type t = H.t\n let equal = H.equal\n let seeded_hash (_seed: int) x = H.hash x\n end)\n let create sz = create ~random:false sz\n let of_seq i =\n let tbl = create 16 in\n replace_seq tbl i;\n tbl\n end\n\n module Bucket = struct\n\n type nonrec ('k, 'd) t = ('k, 'd) t list ref\n let kn_make = make\n let make () = ref []\n let add b k d = b := kn_make k d :: !b\n\n let test_keys k e =\n try\n if length e <> Array.length k then raise Exit;\n for i = 0 to Array.length k - 1 do\n match get_key e i with\n | Some x when x == k.(i) -> ()\n | _ -> raise Exit\n done;\n true\n with Exit -> false\n\n let remove b k =\n let rec loop l acc =\n match l with\n | [] -> ()\n | h :: t when test_keys k h -> b := List.rev_append acc t\n | h :: t -> loop t (h :: acc)\n in\n loop !b []\n\n let find b k =\n match List.find_opt (test_keys k) !b with\n | Some e -> get_data e\n | None -> None\n\n let length b = List.length !b\n let clear b = b := []\n\n end\n\nend\n","(* generated code *)"],"names":[],"mappings":"EA+tBkB,kBAAO,C,EADN,+BAAc,C,EAJP,iB,EAAA,QAApB,UAAiC,QAA3B,eAA8B,QAE1B,eADE,QACE,C,SALd,qBALE,UACQ,mBACM,EADN,SACM,GAAa,GAAS,IAAL,QAAK,eAAqB,2BAC7C,qBAEJ,C,QAjBV,uCACK,KAAQ,O,EACX,2C,EAAA,MACQ,WAAW,K,CAAA,EACE,yCADF,UACO,EAAL,kDAAK,iEACjB,WAET,KANmC,UAMnC,K,AAAA,I,AAAA,G,EAAA,GC7sBR,iDD8sBmB,QAAK,C,KAXJ,cAAgB,IAAX,WAAW,qBAAM,C,EADxB,I,EAAA,GAAM,C,KAXJ,OAEd,OAFc,SAGd,YAAiB,EACd,C,EAJW,iBAAuB,C,EAFF,iCAAQ,C,MCrrBjD,6L,ID6qBiB,KAAQ,aADf,U,CAAA,EApEqC,2BAoEd,yB,GA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kCACjB,C,SAVK,UAAW,0BAA0B,W,EACtC,MAPR,kBACK,wBACA,YAML,UAAmE,KAAzC,KAFjB,QAEiB,wB,GAAA,Q,CAAA,gB,CAAA,+D,EAC0C,QAAlB,UAAkB,UAAE,C,EC7G5E,kC,sBAAA,0M,GAAA,0J,QAAA,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}},{"offset":{"line":0,"column":359998},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/filename.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy and Damien Doligez, INRIA Rocquencourt *)\n(* *)\n(* Copyright 1996 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\nlet generic_quote quotequote s =\n let l = String.length s in\n let b = Buffer.create (l + 20) in\n Buffer.add_char b '\\'';\n for i = 0 to l - 1 do\n if s.[i] = '\\''\n then Buffer.add_string b quotequote\n else Buffer.add_char b s.[i]\n done;\n Buffer.add_char b '\\'';\n Buffer.contents b\n\n(* This function implements the Open Group specification found here:\n [[1]] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html\n In step 1 of [[1]], we choose to return \".\" for empty input.\n (for compatibility with previous versions of OCaml)\n In step 2, we choose to process \"//\" normally.\n Step 6 is not implemented: we consider that the [suffix] operand is\n always absent. Suffixes are handled by [chop_suffix] and [chop_extension].\n*)\nlet generic_basename is_dir_sep current_dir_name name =\n let rec find_end n =\n if n < 0 then String.sub name 0 1\n else if is_dir_sep name n then find_end (n - 1)\n else find_beg n (n + 1)\n and find_beg n p =\n if n < 0 then String.sub name 0 p\n else if is_dir_sep name n then String.sub name (n + 1) (p - n - 1)\n else find_beg (n - 1) p\n in\n if name = \"\"\n then current_dir_name\n else find_end (String.length name - 1)\n\n(* This function implements the Open Group specification found here:\n [[2]] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dirname.html\n In step 6 of [[2]], we choose to process \"//\" normally.\n*)\nlet generic_dirname is_dir_sep current_dir_name name =\n let rec trailing_sep n =\n if n < 0 then String.sub name 0 1\n else if is_dir_sep name n then trailing_sep (n - 1)\n else base n\n and base n =\n if n < 0 then current_dir_name\n else if is_dir_sep name n then intermediate_sep n\n else base (n - 1)\n and intermediate_sep n =\n if n < 0 then String.sub name 0 1\n else if is_dir_sep name n then intermediate_sep (n - 1)\n else String.sub name 0 (n + 1)\n in\n if name = \"\"\n then current_dir_name\n else trailing_sep (String.length name - 1)\n\nmodule type SYSDEPS = sig\n val null : string\n val current_dir_name : string\n val parent_dir_name : string\n val dir_sep : string\n val is_dir_sep : string -> int -> bool\n val is_relative : string -> bool\n val is_implicit : string -> bool\n val check_suffix : string -> string -> bool\n val chop_suffix_opt : suffix:string -> string -> string option\n val temp_dir_name : string\n val quote : string -> string\n val quote_command :\n string -> ?stdin: string -> ?stdout: string -> ?stderr: string\n -> string list -> string\n val basename : string -> string\n val dirname : string -> string\nend\n\nmodule Unix : SYSDEPS = struct\n let null = \"/dev/null\"\n let current_dir_name = \".\"\n let parent_dir_name = \"..\"\n let dir_sep = \"/\"\n let is_dir_sep s i = s.[i] = '/'\n let is_relative n = String.length n < 1 || n.[0] <> '/'\n let is_implicit n =\n is_relative n\n && (String.length n < 2 || String.sub n 0 2 <> \"./\")\n && (String.length n < 3 || String.sub n 0 3 <> \"../\")\n let check_suffix name suff =\n String.ends_with ~suffix:suff name\n\n let chop_suffix_opt ~suffix filename =\n let len_s = String.length suffix and len_f = String.length filename in\n if len_f >= len_s then\n let r = String.sub filename (len_f - len_s) len_s in\n if r = suffix then\n Some (String.sub filename 0 (len_f - len_s))\n else\n None\n else\n None\n\n let temp_dir_name =\n try Sys.getenv \"TMPDIR\" with Not_found -> \"/tmp\"\n let quote = generic_quote \"'\\\\''\"\n let quote_command cmd ?stdin ?stdout ?stderr args =\n String.concat \" \" (List.map quote (cmd :: args))\n ^ (match stdin with None -> \"\" | Some f -> \" <\" ^ quote f)\n ^ (match stdout with None -> \"\" | Some f -> \" >\" ^ quote f)\n ^ (match stderr with None -> \"\" | Some f -> if stderr = stdout\n then \" 2>&1\"\n else \" 2>\" ^ quote f)\n let basename = generic_basename is_dir_sep current_dir_name\n let dirname = generic_dirname is_dir_sep current_dir_name\nend\n\nmodule Win32 : SYSDEPS = struct\n let null = \"NUL\"\n let current_dir_name = \".\"\n let parent_dir_name = \"..\"\n let dir_sep = \"\\\\\"\n let is_dir_sep s i = let c = s.[i] in c = '/' || c = '\\\\' || c = ':'\n let is_relative n =\n (String.length n < 1 || n.[0] <> '/')\n && (String.length n < 1 || n.[0] <> '\\\\')\n && (String.length n < 2 || n.[1] <> ':')\n let is_implicit n =\n is_relative n\n && (String.length n < 2 || String.sub n 0 2 <> \"./\")\n && (String.length n < 2 || String.sub n 0 2 <> \".\\\\\")\n && (String.length n < 3 || String.sub n 0 3 <> \"../\")\n && (String.length n < 3 || String.sub n 0 3 <> \"..\\\\\")\n let check_suffix name suff =\n String.length name >= String.length suff &&\n (let s = String.sub name (String.length name - String.length suff)\n (String.length suff) in\n String.lowercase_ascii s = String.lowercase_ascii suff)\n\n let chop_suffix_opt ~suffix filename =\n let len_s = String.length suffix and len_f = String.length filename in\n if len_f >= len_s then\n let r = String.sub filename (len_f - len_s) len_s in\n if String.lowercase_ascii r = String.lowercase_ascii suffix then\n Some (String.sub filename 0 (len_f - len_s))\n else\n None\n else\n None\n\n\n let temp_dir_name =\n try Sys.getenv \"TEMP\" with Not_found -> \".\"\n let quote s =\n let l = String.length s in\n let b = Buffer.create (l + 20) in\n Buffer.add_char b '\\\"';\n let rec loop i =\n if i = l then Buffer.add_char b '\\\"' else\n match s.[i] with\n | '\\\"' -> loop_bs 0 i;\n | '\\\\' -> loop_bs 0 i;\n | c -> Buffer.add_char b c; loop (i+1);\n and loop_bs n i =\n if i = l then begin\n Buffer.add_char b '\\\"';\n add_bs n;\n end else begin\n match s.[i] with\n | '\\\"' -> add_bs (2*n+1); Buffer.add_char b '\\\"'; loop (i+1);\n | '\\\\' -> loop_bs (n+1) (i+1);\n | _ -> add_bs n; loop i\n end\n and add_bs n = for _j = 1 to n do Buffer.add_char b '\\\\'; done\n in\n loop 0;\n Buffer.contents b\n(*\nQuoting commands for execution by cmd.exe is difficult.\n1- Each argument is first quoted using the \"quote\" function above, to\n protect it against the processing performed by the C runtime system,\n then cmd.exe's special characters are escaped with '^', using\n the \"quote_cmd\" function below. For more details, see\n https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23\n2- The command and the redirection files, if any, must be double-quoted\n in case they contain spaces. This quoting is interpreted by cmd.exe,\n not by the C runtime system, hence the \"quote\" function above\n cannot be used. The two characters we don't know how to quote\n inside a double-quoted cmd.exe string are double-quote and percent.\n We just fail if the command name or the redirection file names\n contain a double quote (not allowed in Windows file names, anyway)\n or a percent. See function \"quote_cmd_filename\" below.\n3- The whole string passed to Sys.command is then enclosed in double\n quotes, which are immediately stripped by cmd.exe. Otherwise,\n some of the double quotes from step 2 above can be misparsed.\n See e.g. https://stackoverflow.com/a/9965141\n*)\n let quote_cmd s =\n let b = Buffer.create (String.length s + 20) in\n String.iter\n (fun c ->\n match c with\n | '(' | ')' | '!' | '^' | '%' | '\\\"' | '<' | '>' | '&' | '|' ->\n Buffer.add_char b '^'; Buffer.add_char b c\n | _ ->\n Buffer.add_char b c)\n s;\n Buffer.contents b\n let quote_cmd_filename f =\n if String.exists (function '\\\"' | '%' -> true | _ -> false) f then\n failwith (\"Filename.quote_command: bad file name \" ^ f)\n else if String.contains f ' ' then\n String.concat \"\" [\"\\\"\"; f; \"\\\"\"]\n else\n f\n (* Redirections in cmd.exe: see https://ss64.com/nt/syntax-redirection.html\n and https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490982(v=technet.10)\n *)\n let quote_command cmd ?stdin ?stdout ?stderr args =\n String.concat \"\" [\n \"\\\"\";\n quote_cmd_filename cmd;\n \" \";\n quote_cmd (String.concat \" \" (List.map quote args));\n (match stdin with None -> \"\" | Some f -> \" <\" ^ quote_cmd_filename f);\n (match stdout with None -> \"\" | Some f -> \" >\" ^ quote_cmd_filename f);\n (match stderr with None -> \"\" | Some f ->\n if stderr = stdout\n then \" 2>&1\"\n else \" 2>\" ^ quote_cmd_filename f);\n \"\\\"\"\n ]\n let has_drive s =\n let is_letter = function\n | 'A' .. 'Z' | 'a' .. 'z' -> true\n | _ -> false\n in\n String.length s >= 2 && is_letter s.[0] && s.[1] = ':'\n let drive_and_path s =\n if has_drive s\n then (String.sub s 0 2, String.sub s 2 (String.length s - 2))\n else (\"\", s)\n let dirname s =\n let (drive, path) = drive_and_path s in\n let dir = generic_dirname is_dir_sep current_dir_name path in\n drive ^ dir\n let basename s =\n let (_drive, path) = drive_and_path s in\n generic_basename is_dir_sep current_dir_name path\nend\n\nmodule Cygwin : SYSDEPS = struct\n let null = \"/dev/null\"\n let current_dir_name = \".\"\n let parent_dir_name = \"..\"\n let dir_sep = \"/\"\n let is_dir_sep = Win32.is_dir_sep\n let is_relative = Win32.is_relative\n let is_implicit = Win32.is_implicit\n let check_suffix = Win32.check_suffix\n let chop_suffix_opt = Win32.chop_suffix_opt\n let temp_dir_name = Unix.temp_dir_name\n let quote = Unix.quote\n let quote_command = Unix.quote_command\n let basename = generic_basename is_dir_sep current_dir_name\n let dirname = generic_dirname is_dir_sep current_dir_name\nend\n\nmodule Sysdeps =\n (val (match Sys.os_type with\n | \"Win32\" -> (module Win32: SYSDEPS)\n | \"Cygwin\" -> (module Cygwin: SYSDEPS)\n | _ -> (module Unix: SYSDEPS)))\n\ninclude Sysdeps\n\nlet concat dirname filename =\n let l = String.length dirname in\n if l = 0 || is_dir_sep dirname (l-1)\n then dirname ^ filename\n else dirname ^ dir_sep ^ filename\n\nlet chop_suffix name suff =\n if check_suffix name suff\n then String.sub name 0 (String.length name - String.length suff)\n else invalid_arg \"Filename.chop_suffix\"\n\nlet extension_len name =\n let rec check i0 i =\n if i < 0 || is_dir_sep name i then 0\n else if name.[i] = '.' then check i0 (i - 1)\n else String.length name - i0\n in\n let rec search_dot i =\n if i < 0 || is_dir_sep name i then 0\n else if name.[i] = '.' then check i (i - 1)\n else search_dot (i - 1)\n in\n search_dot (String.length name - 1)\n\nlet extension name =\n let l = extension_len name in\n if l = 0 then \"\" else String.sub name (String.length name - l) l\n\nlet chop_extension name =\n let l = extension_len name in\n if l = 0 then invalid_arg \"Filename.chop_extension\"\n else String.sub name 0 (String.length name - l)\n\nlet remove_extension name =\n let l = extension_len name in\n if l = 0 then name else String.sub name 0 (String.length name - l)\n\nexternal open_desc: string -> open_flag list -> int -> int = \"caml_sys_open\"\nexternal close_desc: int -> unit = \"caml_sys_close\"\n\nlet prng_key =\n Domain.DLS.new_key Random.State.make_self_init\n\nlet temp_file_name temp_dir prefix suffix =\n let random_state = Domain.DLS.get prng_key in\n let rnd = (Random.State.bits random_state) land 0xFFFFFF in\n concat temp_dir (Printf.sprintf \"%s%06x%s\" prefix rnd suffix)\n\nlet current_temp_dir_name =\n Domain.DLS.new_key ~split_from_parent:Fun.id (fun () -> temp_dir_name)\n\nlet set_temp_dir_name s = Domain.DLS.set current_temp_dir_name s\nlet get_temp_dir_name () = Domain.DLS.get current_temp_dir_name\n\nlet temp_file ?(temp_dir = Domain.DLS.get current_temp_dir_name) prefix suffix =\n let rec try_name counter =\n let name = temp_file_name temp_dir prefix suffix in\n try\n close_desc(open_desc name [Open_wronly; Open_creat; Open_excl] 0o600);\n name\n with Sys_error _ as e ->\n if counter >= 20 then raise e else try_name (counter + 1)\n in try_name 0\n\nlet open_temp_file ?(mode = [Open_text]) ?(perms = 0o600)\n ?(temp_dir = Domain.DLS.get current_temp_dir_name)\n prefix suffix =\n let rec try_name counter =\n let name = temp_file_name temp_dir prefix suffix in\n try\n (name,\n open_out_gen (Open_wronly::Open_creat::Open_excl::mode) perms name)\n with Sys_error _ as e ->\n if counter >= 20 then raise e else try_name (counter + 1)\n in try_name 0\n\nlet temp_dir ?(temp_dir = Domain.DLS.get current_temp_dir_name)\n ?(perms = 0o700) prefix suffix =\n let rec try_name counter =\n let name = temp_file_name temp_dir prefix suffix in\n try\n Sys.mkdir name perms;\n name\n with Sys_error _ as e ->\n if counter >= 20 then raise e else try_name (counter + 1)\n in try_name 0\n","(* generated code *)"],"names":[],"mappings":"QAyGI,sBACA,IACU,EAAR,KAAQ,MAAR,QAAQ,aACL,IAAU,QAGX,KAF4C,IAAvC,MAAL,KAAK,EAAL,QAAK,aAAuC,MAI9C,KAAI,C,EAXN,yBAAkC,C,KAJlC,WAAa,+BACc,UADd,QACc,mBAAwB,iCACxB,UADwB,QACxB,qBAA0B,C,OAJnC,c,CAAA,EAAuB,mBAAK,eAAO,C,QADlC,8BAAK,UAAM,C,YA5B7B,OAAS,QAEP,cAdH,UACQ,WAAiB,K,CAAA,EAAM,WADjB,mCAId,UACQ,WAAiB,OACpB,WAFS,OAId,UACQ,WAAiB,OACpB,mCAD0B,U,EADjB,gC,IAKX,GACqC,C,YAxBvC,OAAS,QAEP,cAVH,UACQ,WAAiB,K,CAAA,EAAM,WADjB,iCAET,SAEL,UACQ,WAAiB,OACpB,UAD0B,yC,EADjB,gC,IAKX,GACiC,C,QAyGpC,sBACA,IACU,EAAR,KAAQ,MAAR,QAAQ,eACsB,EAA9B,QAA8B,eAA3B,EAAwD,QAAxD,iBAAwD,QAGzD,KAF4C,IAAvC,MAAL,KAAK,EAAL,QAAK,aAAuC,MAI9C,KAAI,C,QAdP,wBACS,EADT,SACS,EADT,IACS,EADT,QACS,eAEmB,EAA3B,QAA2B,eAA3B,EAAsD,QAAtD,kBAAsD,KAAC,C,KATvD,WAAa,+BACc,UADd,QACc,mBAAwB,iCACxB,UADwB,QACxB,mBAAyB,iCACzB,UADyB,QACzB,mBAAyB,iC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AJhE,kBAJE,UAAY,yBAAiB,OACrB,iCAAQ,KACX,YAF8B,IACP,SAN5B,UAAY,E,GAAA,uBAAiB,OACrB,4BAAQ,KAAY,UACvB,S,IAF8B,OASF,C,KAfhC,2BAAsB,OAEpB,wBADA,+C,CACkC,C,YARvC,WACA,EAAY,EAAZ,KAAY,EADZ,QACY,iBAAwB,OAEH,EAAlB,QAAV,OAAU,aAAkB,sBAD5B,wBAC4B,C,2BAtKwB,+BC9H3D,UDoHQ,KAAmB,I,AAAA,I,AAAA,G,EAAA,GCpH3B,a,CAAA,kB,CAAA,yB,CAAA,M,CD8H2D,kBC9H3D,+BD8H2D,UAsCnD,KAAiB,I,AAAA,I,AAAA,G,EAAA,GCpKzB,a,CAAA,kB,CAAA,yB,CAAA,sBDqR2D,iC,CAAA,4B,CAAA,sB,CAAA,yD,CAAA,6B,CAAA,KA4Da,IA5Db,cA4Da,E,CAAA,EA5Db,cA4Da,E,CAAA,EA5Db,yDA4Da,MARxB,EAA9C,IApDyD,gCAoDzD,GAA8C,yCAQ9C,K,CAAsE,c,CAAA,c,CAAA,S,CAAA,Q,CAAA,mB,QCjVxE,4D,QAAA,6E,EAAA,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA,sD,EAAA,c,EAAA,c,EAAA,c,EAAA,c,iBAAA","ignoreList":[1]}},{"offset":{"line":0,"column":367537},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/complex.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)\n(* *)\n(* Copyright 2002 Institut National de Recherche en Informatique et *)\n(* en Automatique. *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\n(* Complex numbers *)\n\ntype t = { re: float; im: float }\n\nlet zero = { re = 0.0; im = 0.0 }\nlet one = { re = 1.0; im = 0.0 }\nlet i = { re = 0.0; im = 1.0 }\n\nlet add x y = { re = x.re +. y.re; im = x.im +. y.im }\n\nlet sub x y = { re = x.re -. y.re; im = x.im -. y.im }\n\nlet neg x = { re = -. x.re; im = -. x.im }\n\nlet conj x = { re = x.re; im = -. x.im }\n\nlet mul x y = { re = x.re *. y.re -. x.im *. y.im;\n im = x.re *. y.im +. x.im *. y.re }\n\nlet div x y =\n if abs_float y.re >= abs_float y.im then\n let r = y.im /. y.re in\n let d = y.re +. r *. y.im in\n { re = (x.re +. r *. x.im) /. d;\n im = (x.im -. r *. x.re) /. d }\n else\n let r = y.re /. y.im in\n let d = y.im +. r *. y.re in\n { re = (r *. x.re +. x.im) /. d;\n im = (r *. x.im -. x.re) /. d }\n\nlet inv x = div one x\n\nlet norm2 x = x.re *. x.re +. x.im *. x.im\n\nlet norm x = Float.hypot x.re x.im\n\nlet arg x = atan2 x.im x.re\n\nlet polar n a = { re = cos a *. n; im = sin a *. n }\n\nlet sqrt x =\n if x.re = 0.0 && x.im = 0.0 then { re = 0.0; im = 0.0 }\n else begin\n let r = abs_float x.re and i = abs_float x.im in\n let w =\n if r >= i then begin\n let q = i /. r in\n sqrt(r) *. sqrt(0.5 *. (1.0 +. sqrt(1.0 +. q *. q)))\n end else begin\n let q = r /. i in\n sqrt(i) *. sqrt(0.5 *. (q +. sqrt(1.0 +. q *. q)))\n end in\n if x.re >= 0.0\n then { re = w; im = 0.5 *. x.im /. w }\n else { re = 0.5 *. i /. w; im = if x.im >= 0.0 then w else -. w }\n end\n\nlet exp x =\n let e = exp x.re in { re = e *. cos x.im; im = e *. sin x.im }\n\nlet log x = { re = log (norm x); im = atan2 x.im x.re }\n\nlet pow x y = exp (mul y (log x))\n","(* generated code *)"],"names":[],"mappings":"KA8EyB,WA/CwB,wBAA5B,CAC4B,cADZ,CAAhB,CAC4B,cAA5B,CADP,cACuB,CAAhB,CAD4B,IA+ChB,Q,OAFrB,mBAA0B,KAAf,SAAJ,UAAY,MAAwB,C,OAFrD,YAAQ,KAAY,OAAgC,GAAL,GAApB,EAAiC,OAA5B,GAAL,CAAa,MAAsB,C,QAjB9D,2CAAiC,MAC5B,UACK,GAAc,OAAS,GAC/B,GAGI,GADQ,OACmC,GAAR,UAAJ,CAAR,UAAR,UAAJ,CAAX,EAGA,GADQ,OACiC,KAAR,UAAJ,CAAN,CAAR,UAAJ,CAAX,E,EAEJ,uBACqC,EAAhC,OAAgB,aAAgB,KACzB,eAAP,EAAuD,GAAvD,qBAAoB,KACxB,C,OAjBmC,4BAAjB,gBAAU,MAAmB,C,KAFxC,yBAAe,C,KAFd,yBAAqB,C,KAFQ,mBAA5B,eAAgB,CAAhB,IAA4B,C,EAF9B,YAAS,C,QAXnB,YAAqB,CAAc,OAAhC,CAAc,IAEU,OADzB,cAAQ,GACR,OAAgB,CAAR,GACiB,YAAT,EACe,OADf,CAAT,IACkB,OAAT,EADhB,OACgB,CAAT,IADwB,KAIN,UADzB,cAAQ,GACR,OAAgB,CAAR,GACA,EACuB,YADvB,CACuB,OADxB,IACC,EADR,OACQ,CADR,OACO,IADwB,KACE,C,KAbY,wBAA5B,CAC4B,cADZ,CAAhB,CAC4B,cAA5B,CADP,cACuB,CAAhB,CAD4B,IACE,C,KAHb,YAAzB,OAAkB,CAAO,IAAE,C,KAFA,YAArB,CAAP,OAAqB,CAAP,IAAgB,C,KAFU,wBAA/B,CAAP,cAA0B,CAAP,IAAqB,C,KAFF,wBAA/B,CAAP,cAA0B,CAAP,IAAqB,C,ECvBtD,sE,EAAA,c,QAAA","ignoreList":[1]}},{"offset":{"line":0,"column":370758},"map":{"version":3,"sources":["/root/.opam/5.2.0/lib/ocaml/effect.ml","/builtin/blackbox.ml"],"sourcesContent":["(**************************************************************************)\n(* *)\n(* OCaml *)\n(* *)\n(* KC Sivaramakrishnan, Indian Institute of Technology, Madras *)\n(* *)\n(* Copyright 2021 Indian Institute of Technology, Madras *)\n(* *)\n(* All rights reserved. This file is distributed under the terms of *)\n(* the GNU Lesser General Public License version 2.1, with the *)\n(* special exception on linking described in the file LICENSE. *)\n(* *)\n(**************************************************************************)\n\ntype 'a t = ..\nexternal perform : 'a t -> 'a = \"%perform\"\n\ntype exn += Unhandled: 'a t -> exn\nexception Continuation_already_resumed\n\nlet () =\n let printer = function\n | Unhandled x ->\n let msg = Printf.sprintf \"Stdlib.Effect.Unhandled(%s)\"\n (Printexc.string_of_extension_constructor @@ Obj.repr x)\n in\n Some msg\n | _ -> None\n in\n Printexc.register_printer printer\n\n(* Register the exceptions so that the runtime can access it *)\ntype _ t += Should_not_see_this__ : unit t\nlet _ = Callback.register_exception \"Effect.Unhandled\"\n (Unhandled Should_not_see_this__)\nlet _ = Callback.register_exception \"Effect.Continuation_already_resumed\"\n Continuation_already_resumed\n\ntype ('a, 'b) stack [@@immediate]\ntype last_fiber [@@immediate]\n\nexternal resume :\n ('a, 'b) stack -> ('c -> 'a) -> 'c -> last_fiber -> 'b = \"%resume\"\nexternal runstack : ('a, 'b) stack -> ('c -> 'a) -> 'c -> 'b = \"%runstack\"\n\nmodule Deep = struct\n\n type ('a,'b) continuation\n\n external take_cont_noexc : ('a, 'b) continuation -> ('a, 'b) stack =\n \"caml_continuation_use_noexc\" [@@noalloc]\n external alloc_stack :\n ('a -> 'b) ->\n (exn -> 'b) ->\n ('c t -> ('c, 'b) continuation -> last_fiber -> 'b) ->\n ('a, 'b) stack = \"caml_alloc_stack\"\n external cont_last_fiber : ('a, 'b) continuation -> last_fiber = \"%field1\"\n external cont_set_last_fiber :\n ('a, 'b) continuation -> last_fiber -> unit = \"%setfield1\"\n\n let continue k v =\n resume (take_cont_noexc k) (fun x -> x) v (cont_last_fiber k)\n\n let discontinue k e =\n resume (take_cont_noexc k) (fun e -> raise e) e (cont_last_fiber k)\n\n let discontinue_with_backtrace k e bt =\n resume (take_cont_noexc k) (fun e -> Printexc.raise_with_backtrace e bt)\n e (cont_last_fiber k)\n\n type ('a,'b) handler =\n { retc: 'a -> 'b;\n exnc: exn -> 'b;\n effc: 'c.'c t -> (('c,'b) continuation -> 'b) option }\n\n external reperform :\n 'a t -> ('a, 'b) continuation -> last_fiber -> 'b = \"%reperform\"\n\n let match_with comp arg handler =\n let effc eff k last_fiber =\n match handler.effc eff with\n | Some f ->\n cont_set_last_fiber k last_fiber;\n f k\n | None -> reperform eff k last_fiber\n in\n let s = alloc_stack handler.retc handler.exnc effc in\n runstack s comp arg\n\n type 'a effect_handler =\n { effc: 'b. 'b t -> (('b,'a) continuation -> 'a) option }\n\n let try_with comp arg handler =\n let effc' eff k last_fiber =\n match handler.effc eff with\n | Some f ->\n cont_set_last_fiber k last_fiber;\n f k\n | None -> reperform eff k last_fiber\n in\n let s = alloc_stack (fun x -> x) (fun e -> raise e) effc' in\n runstack s comp arg\n\n external get_callstack :\n ('a,'b) continuation -> int -> Printexc.raw_backtrace =\n \"caml_get_continuation_callstack\"\nend\n\nmodule Shallow = struct\n\n type ('a,'b) continuation\n\n external alloc_stack :\n ('a -> 'b) ->\n (exn -> 'b) ->\n ('c t -> ('c, 'b) continuation -> last_fiber -> 'b) ->\n ('a, 'b) stack = \"caml_alloc_stack\"\n\n external cont_last_fiber : ('a, 'b) continuation -> last_fiber = \"%field1\"\n external cont_set_last_fiber :\n ('a, 'b) continuation -> last_fiber -> unit = \"%setfield1\"\n\n let fiber : type a b. (a -> b) -> (a, b) continuation = fun f ->\n let module M = struct type _ t += Initial_setup__ : a t end in\n let exception E of (a,b) continuation in\n let f' () = f (perform M.Initial_setup__) in\n let error _ = failwith \"impossible\" in\n let effc eff k last_fiber =\n match eff with\n | M.Initial_setup__ ->\n cont_set_last_fiber k last_fiber;\n raise_notrace (E k)\n | _ -> error ()\n in\n let s = alloc_stack error error effc in\n match runstack s f' () with\n | exception E k -> k\n | _ -> error ()\n\n type ('a,'b) handler =\n { retc: 'a -> 'b;\n exnc: exn -> 'b;\n effc: 'c.'c t -> (('c,'a) continuation -> 'b) option }\n\n external update_handler :\n ('a,'b) continuation ->\n ('b -> 'c) ->\n (exn -> 'c) ->\n ('d t -> ('d,'b) continuation -> last_fiber -> 'c) ->\n ('a,'c) stack = \"caml_continuation_use_and_update_handler_noexc\" [@@noalloc]\n\n external reperform :\n 'a t -> ('a, 'b) continuation -> last_fiber -> 'c = \"%reperform\"\n\n let continue_gen k resume_fun v handler =\n let effc eff k last_fiber =\n match handler.effc eff with\n | Some f ->\n cont_set_last_fiber k last_fiber;\n f k\n | None -> reperform eff k last_fiber\n in\n let last_fiber = cont_last_fiber k in\n let stack = update_handler k handler.retc handler.exnc effc in\n resume stack resume_fun v last_fiber\n\n let continue_with k v handler =\n continue_gen k (fun x -> x) v handler\n\n let discontinue_with k v handler =\n continue_gen k (fun e -> raise e) v handler\n\n let discontinue_with_backtrace k v bt handler =\n continue_gen k (fun e -> Printexc.raise_with_backtrace e bt) v handler\n\n external get_callstack :\n ('a,'b) continuation -> int -> Printexc.raw_backtrace =\n \"caml_get_continuation_callstack\"\nend\n","(* generated code *)"],"names":[],"mappings":"EA6K6B,mBAAkC,C,EAA3D,iBAAsE,C,EAH7C,IAAO,C,EAAhC,YAA2C,C,EAHlB,EAAC,C,EAA1B,YAAqC,C,QAX7B,EAAN,kBAAM,eAAgB,OAIZ,sBAFN,cACA,kB,CACgC,C,KAEtC,cACY,EAAZ,mBARA,WAQY,GACZ,SAAoC,C,SApClC,kBAEI,cACA,oBACG,Y,CAAQ,C,EANH,uBAAqB,C,MADrB,gBAA2B,qB,UAFzC,qDAWQ,MAPR,cAOQ,KACR,SAAM,gBAAgB,I,AAAA,I,AAAA,G,EAAA,KCvI1B,sBDwIuB,O,EACZ,WAAQ,C,QA3CP,EAAN,kBAAM,eAAgB,OAIZ,sBAFN,cACA,kB,CACgC,C,EAE9B,MAPR,WAOQ,GACR,WAAmB,C,KAfnB,mBAPA,WAOQ,GACR,WAAmB,C,QApBnB,wBAAO,KAAmB,SACH,C,KAJvB,cAAO,KAAmB,UAAyC,C,KAHnE,cAAO,KAAmB,UAAmC,C,KAxCjD,yBAKR,IALQ,OAER,QACI,aADM,GACkD,QADlD,0BAGV,KACG,KAAI,C,SC3Bf,gDD6BE,sBAIM,GAJ2B,oCAI3B,cAEA,KADmC,QACnC,cAC8B,+D,ECpCtC,c,QAAA,8B,EAAA,c,EAAA,c,WAAA,0C,EAAA,c,EAAA,c,EAAA,c,cAAA","ignoreList":[1]}}]}
|