From 6737fe8b2b94713f403a2a2d1106a8da5539cda4 Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Wed, 28 Aug 2024 05:27:51 +0900 Subject: [PATCH] remove (almost) Caml String/Bytes/Char/Stream --- jscomp/core/js_of_lam_string.ml | 11 - jscomp/core/js_of_lam_string.mli | 6 - jscomp/core/lam_analysis.ml | 10 +- jscomp/core/lam_compile_primitive.ml | 17 - jscomp/core/lam_convert.ml | 7 - jscomp/core/lam_dispatch_primitive.ml | 27 -- jscomp/core/lam_primitive.ml | 12 - jscomp/core/lam_primitive.mli | 6 - jscomp/core/lam_print.ml | 6 - jscomp/ext/js_runtime_modules.ml | 3 - jscomp/ml/ctype.ml | 6 +- jscomp/ml/lambda.ml | 2 - jscomp/ml/lambda.mli | 2 - jscomp/ml/predef.ml | 6 +- jscomp/ml/predef.mli | 2 - jscomp/ml/printlambda.ml | 13 - jscomp/ml/translcore.ml | 45 +-- jscomp/ml/typeopt.ml | 1 - jscomp/runtime/caml_bytes.res | Bin 3511 -> 0 bytes jscomp/runtime/caml_bytes.resi | 40 --- jscomp/runtime/caml_hash_primitive.res | 3 +- jscomp/runtime/caml_int64.res | 11 +- jscomp/runtime/caml_string_extern.res | 1 - jscomp/runtime/release.ninja | 8 +- jscomp/stdlib-406/bytes.res | Bin 13113 -> 0 bytes jscomp/stdlib-406/bytes.resi | 427 ----------------------- jscomp/stdlib-406/bytesLabels.res | Bin 13251 -> 0 bytes jscomp/stdlib-406/bytesLabels.resi | 269 -------------- jscomp/stdlib-406/char.res | 26 -- jscomp/stdlib-406/char.resi | 7 - jscomp/stdlib-406/release.ninja | 16 +- jscomp/stdlib-406/stdLabels.res | 4 - jscomp/stdlib-406/stdLabels.resi | 8 +- jscomp/stdlib-406/stream.res | 227 ------------ jscomp/stdlib-406/stream.resi | 99 ------ jscomp/stdlib-406/string.res | 204 ----------- jscomp/stdlib-406/string.resi | 235 ------------- jscomp/stdlib-406/stringLabels.res | 235 ------------- jscomp/stdlib-406/stringLabels.resi | 233 ------------- jscomp/test/build.ninja | 8 +- jscomp/test/bytes_split_gpr_743_test.js | 84 ----- jscomp/test/bytes_split_gpr_743_test.res | 38 -- jscomp/test/complex_if_test.js | 143 -------- jscomp/test/complex_if_test.res | 82 ----- jscomp/test/equal_exception_test.js | 46 +-- jscomp/test/equal_exception_test.res | 5 - jscomp/test/gray_code_test.js | 22 -- jscomp/test/gray_code_test.res | 16 - jscomp/test/hash_test.js | 4 +- jscomp/test/hash_test.res | 2 +- jscomp/test/inline_regression_test.js | 7 +- jscomp/test/inline_regression_test.res | 8 +- jscomp/test/string_bound_get_test.js | 12 - jscomp/test/string_bound_get_test.res | 6 - jscomp/test/string_get_set_test.js | 19 - jscomp/test/string_get_set_test.res | 66 ---- jscomp/test/string_runtime_test.js | 76 ---- jscomp/test/string_runtime_test.res | 35 -- jscomp/test/test_bug.js | 109 ------ jscomp/test/test_bug.res | 67 ---- jscomp/test/test_bytes.js | 12 - jscomp/test/test_bytes.res | 4 - jscomp/test/test_js_ffi.js | 4 +- jscomp/test/test_non_export.res | 2 +- jscomp/test/test_per.js | 11 - jscomp/test/test_per.res | 16 - jscomp/test/test_string.js | 9 +- jscomp/test/test_string.res | 3 +- jscomp/test/ticker.js | 26 +- jscomp/test/ticker.res | 10 +- lib/es6/char.js | 60 ---- lib/es6/stdLabels.js | 6 - lib/es6/string.js | 331 ------------------ lib/js/char.js | 60 ---- lib/js/stdLabels.js | 6 - lib/js/string.js | 331 ------------------ 76 files changed, 57 insertions(+), 3924 deletions(-) delete mode 100644 jscomp/runtime/caml_bytes.res delete mode 100644 jscomp/runtime/caml_bytes.resi delete mode 100644 jscomp/stdlib-406/bytes.res delete mode 100644 jscomp/stdlib-406/bytes.resi delete mode 100644 jscomp/stdlib-406/bytesLabels.res delete mode 100644 jscomp/stdlib-406/bytesLabels.resi delete mode 100644 jscomp/stdlib-406/stream.res delete mode 100644 jscomp/stdlib-406/stream.resi delete mode 100644 jscomp/stdlib-406/stringLabels.res delete mode 100644 jscomp/stdlib-406/stringLabels.resi delete mode 100644 jscomp/test/bytes_split_gpr_743_test.js delete mode 100644 jscomp/test/bytes_split_gpr_743_test.res delete mode 100644 jscomp/test/complex_if_test.js delete mode 100644 jscomp/test/complex_if_test.res delete mode 100644 jscomp/test/string_get_set_test.js delete mode 100644 jscomp/test/string_get_set_test.res delete mode 100644 jscomp/test/string_runtime_test.js delete mode 100644 jscomp/test/string_runtime_test.res delete mode 100644 jscomp/test/test_bug.js delete mode 100644 jscomp/test/test_bug.res delete mode 100644 jscomp/test/test_bytes.js delete mode 100644 jscomp/test/test_bytes.res diff --git a/jscomp/core/js_of_lam_string.ml b/jscomp/core/js_of_lam_string.ml index 1ec3f77e985..765a9d3ee71 100644 --- a/jscomp/core/js_of_lam_string.ml +++ b/jscomp/core/js_of_lam_string.ml @@ -34,15 +34,6 @@ let const_char (i : int) = E.int ~c:i (Int32.of_int @@ i) (* string [s[i]] expects to return a [ocaml_char] *) let ref_string e e1 = E.string_index e e1 -(* [s[i]] excepts to return a [ocaml_char] - We use normal array for [bytes] - TODO: we can use [Buffer] in the future -*) -let ref_byte e e0 = E.array_index e e0 - -(* {Bytes.set : bytes -> int -> char -> unit }*) -let set_byte e e0 e1 = E.assign (E.array_index e e0) e1 - (** Note that [String.fromCharCode] also works, but it only work for small arrays, however, for {bytes_to_string} it is likely the bytes @@ -59,5 +50,3 @@ let set_byte e e0 e1 = E.assign (E.array_index e e0) e1 Maxiume call stack size exceeded ]} *) -let bytes_to_string e = - E.runtime_call Js_runtime_modules.bytes_ "to_string" [ e ] diff --git a/jscomp/core/js_of_lam_string.mli b/jscomp/core/js_of_lam_string.mli index eb6ca708ddf..68feda72ad2 100644 --- a/jscomp/core/js_of_lam_string.mli +++ b/jscomp/core/js_of_lam_string.mli @@ -30,10 +30,4 @@ val ref_string : J.expression -> J.expression -> J.expression -val ref_byte : J.expression -> J.expression -> J.expression - -val set_byte : J.expression -> J.expression -> J.expression -> J.expression - val const_char : int -> J.expression - -val bytes_to_string : J.expression -> J.expression diff --git a/jscomp/core/lam_analysis.ml b/jscomp/core/lam_analysis.ml index 782ca084fd4..99b2dd556db 100644 --- a/jscomp/core/lam_analysis.ml +++ b/jscomp/core/lam_analysis.ml @@ -47,7 +47,7 @@ let rec no_side_effects (lam : Lam.t) : bool = ( "?int64_float_of_bits" (* more safe to check if arguments are constant *) (* non-observable side effect *) - | "?string_repeat" | "?make_vect" | "?create_bytes" | "?obj_dup" + | "?make_vect" | "?obj_dup" | "caml_array_dup" | "?nativeint_add" | "?nativeint_div" | "?nativeint_mod" | "?nativeint_lsr" | "?nativeint_mul" ), _ ) -> @@ -62,7 +62,7 @@ let rec no_side_effects (lam : Lam.t) : bool = | Pundefined_to_opt | Pnull_undefined_to_opt | Pjs_fn_make _ | Pjs_fn_make_unit | Pjs_object_create _ | Pimport (* TODO: check *) - | Pbytes_to_string | Pmakeblock _ + | Pmakeblock _ (* whether it's mutable or not *) | Pfield _ | Pval_from_option | Pval_from_option_not_nest (* NOP The compiler already [t option] is the same as t *) @@ -80,8 +80,8 @@ let rec no_side_effects (lam : Lam.t) : bool = | Pandbigint | Porbigint | Pxorbigint | Plslbigint | Pasrbigint | Pbigintcomp _ (* String operations *) - | Pstringlength | Pstringrefu | Pstringrefs | Pbyteslength | Pbytesrefu - | Pbytesrefs | Pmakearray | Parraylength | Parrayrefu | Parrayrefs + | Pstringlength | Pstringrefu | Pstringrefs + | Pmakearray | Parraylength | Parrayrefu | Parrayrefs (* Test if the argument is a block or an immediate integer *) | Pisint | Pis_poly_var_block (* Test if the (integer) argument is outside an interval *) @@ -102,7 +102,7 @@ let rec no_side_effects (lam : Lam.t) : bool = | Pjs_unsafe_downgrade _ | Pdebugger | Pvoid_run | Pfull_apply | Pjs_fn_method (* TODO *) - | Praw_js_code _ | Pbytessetu | Pbytessets + | Praw_js_code _ (* Operations on boxed integers (Nativeint.t, Int32.t, Int64.t) *) | Parraysets (* byte swap *) diff --git a/jscomp/core/lam_compile_primitive.ml b/jscomp/core/lam_compile_primitive.ml index 2856d4c5af7..caed2a99102 100644 --- a/jscomp/core/lam_compile_primitive.ml +++ b/jscomp/core/lam_compile_primitive.ml @@ -308,24 +308,7 @@ let translate output_prefix loc (cxt : Lam_compile_context.t) *) | [ range; e ] -> E.is_out (E.offset e off) range | _ -> assert false) - | Pbytes_to_string -> - Js_of_lam_string.bytes_to_string (Ext_list.singleton_exn args) | Pstringlength -> E.string_length (Ext_list.singleton_exn args) - | Pbyteslength -> E.bytes_length (Ext_list.singleton_exn args) - (* This should only be Pbyteset(u|s), which in js, is an int array - Bytes is an int array in javascript - *) - | Pbytessetu -> ( - match args with - | [ e; e0; e1 ] -> - ensure_value_unit cxt.continuation (Js_of_lam_string.set_byte e e0 e1) - | _ -> assert false) - | Pbytessets -> E.runtime_call Js_runtime_modules.bytes "set" args - | Pbytesrefu -> ( - match args with - | [ e; e1 ] -> Js_of_lam_string.ref_byte e e1 - | _ -> assert false) - | Pbytesrefs -> E.runtime_call Js_runtime_modules.bytes "get" args | Pstringrefs -> E.runtime_call Js_runtime_modules.string "get" args (* For bytes and string, they both return [int] in ocaml we need tell Pbyteref from Pstringref diff --git a/jscomp/core/lam_convert.ml b/jscomp/core/lam_convert.ml index 52a87ad149d..f0903c0a858 100644 --- a/jscomp/core/lam_convert.ml +++ b/jscomp/core/lam_convert.ml @@ -165,8 +165,6 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t = | Prevapply -> assert false | Pdirapply -> assert false | Ploc _ -> assert false (* already compiled away here*) - | Pbytes_to_string (* handled very early *) -> - prim ~primitive:Pbytes_to_string ~args loc | Pcreate_extension s -> prim ~primitive:(Pcreate_extension s) ~args loc | Pignore -> (* Pignore means return unit, it is not an nop *) @@ -239,11 +237,6 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args loc : Lam.t = | Pstringrefu -> prim ~primitive:Pstringrefu ~args loc | Pabsfloat -> assert false | Pstringrefs -> prim ~primitive:Pstringrefs ~args loc - | Pbyteslength -> prim ~primitive:Pbyteslength ~args loc - | Pbytesrefu -> prim ~primitive:Pbytesrefu ~args loc - | Pbytessetu -> prim ~primitive:Pbytessetu ~args loc - | Pbytesrefs -> prim ~primitive:Pbytesrefs ~args loc - | Pbytessets -> prim ~primitive:Pbytessets ~args loc | Pisint -> prim ~primitive:Pisint ~args loc | Pisout -> ( match args with diff --git a/jscomp/core/lam_dispatch_primitive.ml b/jscomp/core/lam_dispatch_primitive.ml index a3097f27769..e2e7e420ed9 100644 --- a/jscomp/core/lam_dispatch_primitive.ml +++ b/jscomp/core/lam_dispatch_primitive.ml @@ -77,9 +77,6 @@ let translate loc (prim_name : string) (args : J.expression list) : J.expression Location.prerr_warning loc Warnings.Bs_polymorphic_comparison; call Js_runtime_modules.obj_runtime (* generated by the compiler, not user facing *) - | "caml_bytes_greaterthan" | "caml_bytes_greaterequal" | "caml_bytes_lessthan" - | "caml_bytes_lessequal" | "caml_bytes_compare" | "caml_bytes_equal" -> - call Js_runtime_modules.bytes | "caml_string_equal" -> ( match args with [ e0; e1 ] -> E.string_equal e0 e1 | _ -> assert false) | "caml_string_notequal" -> ( @@ -177,30 +174,6 @@ let translate loc (prim_name : string) (args : J.expression list) : J.expression call Js_runtime_modules.float | "?fmod_float" (* float module like js number module *) -> ( match args with [ e0; e1 ] -> E.float_mod e0 e1 | _ -> assert false) - | "?string_repeat" -> ( - match args with - | [ n; { expression_desc = Number (Int { i }) } ] -> ( - let str = String.make 1 (Char.chr (Int32.to_int i)) in - match n.expression_desc with - | Number (Int { i = 1l }) -> E.str str - | _ -> - E.call - (E.dot (E.str str) "repeat") - [ n ] ~info:Js_call_info.builtin_runtime_call) - | _ -> E.runtime_call Js_runtime_modules.string "make" args) - | "?create_bytes" -> ( - (* Bytes.create *) - (* Note that for invalid range, JS raise an Exception RangeError, - here in OCaml it's [Invalid_argument], we have to preserve this semantics. - Also, it's creating a [bytes] which is a js array actually. - *) - match args with - | [ { expression_desc = Number (Int { i; _ }); _ } ] when i < 8l -> - (*Invariants: assuming bytes are [int array]*) - E.array NA - (if i = 0l then [] - else Ext_list.init (Int32.to_int i) (fun _ -> E.zero_int_literal)) - | _ -> E.runtime_call Js_runtime_modules.bytes "create" args) (* Note we captured [exception/extension] creation in the early pass, this primitive is like normal one to set the identifier *) | "?exn_slot_name" | "?is_extension" -> call Js_runtime_modules.exceptions diff --git a/jscomp/core/lam_primitive.ml b/jscomp/core/lam_primitive.ml index 9c94e01a23b..35246880987 100644 --- a/jscomp/core/lam_primitive.ml +++ b/jscomp/core/lam_primitive.ml @@ -33,7 +33,6 @@ type record_representation = (* Inlined record under extension *) type t = - | Pbytes_to_string (* Operations on heap blocks *) | Pmakeblock of int * Lam_tag_info.t * Asttypes.mutable_flag | Pfield of int * Lam_compat.field_dbg_info @@ -105,11 +104,6 @@ type t = | Pstringrefu | Pstringrefs | Pstringadd - | Pbyteslength - | Pbytesrefu - | Pbytessetu - | Pbytesrefs - | Pbytessets (* Array operations *) | Pmakearray | Parraylength @@ -185,7 +179,6 @@ let eq_primitive_approx (lhs : t) (rhs : t) = | Pcreate_extension a -> ( match rhs with Pcreate_extension b -> a = (b : string) | _ -> false) | Pwrap_exn -> rhs = Pwrap_exn - | Pbytes_to_string -> rhs = Pbytes_to_string | Praise -> rhs = Praise | Psequand -> rhs = Psequand | Psequor -> rhs = Psequor @@ -231,11 +224,6 @@ let eq_primitive_approx (lhs : t) (rhs : t) = | Pstringrefu -> rhs = Pstringrefu | Pstringrefs -> rhs = Pstringrefs | Pstringadd -> rhs = Pstringadd - | Pbyteslength -> rhs = Pbyteslength - | Pbytesrefu -> rhs = Pbytesrefu - | Pbytessetu -> rhs = Pbytessetu - | Pbytesrefs -> rhs = Pbytesrefs - | Pbytessets -> rhs = Pbytessets | Pundefined_to_opt -> rhs = Pundefined_to_opt | Pnull_to_opt -> rhs = Pnull_to_opt | Pnull_undefined_to_opt -> rhs = Pnull_undefined_to_opt diff --git a/jscomp/core/lam_primitive.mli b/jscomp/core/lam_primitive.mli index de5748d675d..e938dd3a72c 100644 --- a/jscomp/core/lam_primitive.mli +++ b/jscomp/core/lam_primitive.mli @@ -31,7 +31,6 @@ type record_representation = (* Inlined record under extension *) type t = - | Pbytes_to_string | Pmakeblock of int * Lam_tag_info.t * Asttypes.mutable_flag | Pfield of int * Lambda.field_dbg_info | Psetfield of int * Lambda.set_field_dbg_info @@ -94,11 +93,6 @@ type t = | Pstringrefu | Pstringrefs | Pstringadd - | Pbyteslength - | Pbytesrefu - | Pbytessetu - | Pbytesrefs - | Pbytessets (* Array operations *) | Pmakearray | Parraylength diff --git a/jscomp/core/lam_print.ml b/jscomp/core/lam_print.ml index c66214df02e..bcf0637631b 100644 --- a/jscomp/core/lam_print.ml +++ b/jscomp/core/lam_print.ml @@ -55,7 +55,6 @@ let primitive ppf (prim : Lam_primitive.t) = | Pcaml_obj_length -> fprintf ppf "#obj_length" | Pinit_mod -> fprintf ppf "init_mod!" | Pupdate_mod -> fprintf ppf "update_mod!" - | Pbytes_to_string -> fprintf ppf "bytes_to_string" | Pjs_apply -> fprintf ppf "#apply" | Pjs_runtime_apply -> fprintf ppf "#runtime_apply" | Pjs_unsafe_downgrade { name; setter } -> @@ -161,11 +160,6 @@ let primitive ppf (prim : Lam_primitive.t) = | Pstringlength -> fprintf ppf "string.length" | Pstringrefu -> fprintf ppf "string.unsafe_get" | Pstringrefs -> fprintf ppf "string.get" - | Pbyteslength -> fprintf ppf "bytes.length" - | Pbytesrefu -> fprintf ppf "bytes.unsafe_get" - | Pbytessetu -> fprintf ppf "bytes.unsafe_set" - | Pbytesrefs -> fprintf ppf "bytes.get" - | Pbytessets -> fprintf ppf "bytes.set" | Parraylength -> fprintf ppf "array.length" | Pmakearray -> fprintf ppf "makearray" | Parrayrefu -> fprintf ppf "array.unsafe_get" diff --git a/jscomp/ext/js_runtime_modules.ml b/jscomp/ext/js_runtime_modules.ml index ac4d7521ae2..eb75190679e 100644 --- a/jscomp/ext/js_runtime_modules.ml +++ b/jscomp/ext/js_runtime_modules.ml @@ -30,9 +30,6 @@ let array = "Caml_array" let string = "Caml_string" -let bytes = "Caml_bytes" -let bytes_ = "Bytes" - let float = "Caml_float" let hash_primitive = "Caml_hash_primitive" diff --git a/jscomp/ml/ctype.ml b/jscomp/ml/ctype.ml index 950a1a598f8..0337f008c40 100644 --- a/jscomp/ml/ctype.ml +++ b/jscomp/ml/ctype.ml @@ -1893,11 +1893,7 @@ let is_instantiable env p = (* PR#7113: -safe-string should be a global property *) -let compatible_paths p1 p2 = - let open Predef in - Path.same p1 p2 || - Path.same p1 path_bytes && Path.same p2 path_string || - Path.same p1 path_string && Path.same p2 path_bytes +let compatible_paths p1 p2 = Path.same p1 p2 (* Check for datatypes carefully; see PR#6348 *) let rec expands_to_datatype env ty = diff --git a/jscomp/ml/lambda.ml b/jscomp/ml/lambda.ml index e7b8839fdcc..08afad40f1b 100644 --- a/jscomp/ml/lambda.ml +++ b/jscomp/ml/lambda.ml @@ -177,7 +177,6 @@ type is_safe = type primitive = | Pidentity - | Pbytes_to_string | Pignore | Prevapply | Pdirapply @@ -221,7 +220,6 @@ type primitive = | Pbigintcomp of comparison (* String operations *) | Pstringlength | Pstringrefu | Pstringrefs - | Pbyteslength | Pbytesrefu | Pbytessetu | Pbytesrefs | Pbytessets (* Array operations *) | Pmakearray of Asttypes.mutable_flag | Parraylength diff --git a/jscomp/ml/lambda.mli b/jscomp/ml/lambda.mli index 8e5caf5484e..331a8e10d49 100644 --- a/jscomp/ml/lambda.mli +++ b/jscomp/ml/lambda.mli @@ -150,7 +150,6 @@ type pointer_info = type primitive = | Pidentity - | Pbytes_to_string | Pignore | Prevapply | Pdirapply @@ -193,7 +192,6 @@ type primitive = | Pbigintcomp of comparison (* String operations *) | Pstringlength | Pstringrefu | Pstringrefs - | Pbyteslength | Pbytesrefu | Pbytessetu | Pbytesrefs | Pbytessets (* Array operations *) | Pmakearray of mutable_flag | Parraylength diff --git a/jscomp/ml/predef.ml b/jscomp/ml/predef.ml index 4258d3ef2f8..4900cc0e0ed 100644 --- a/jscomp/ml/predef.ml +++ b/jscomp/ml/predef.ml @@ -31,7 +31,6 @@ let ident_create_predef_exn = wrap Ident.create_predef_exn let ident_int = ident_create "int" and ident_char = ident_create "char" -and ident_bytes = ident_create "bytes" and ident_float = ident_create "float" and ident_bool = ident_create "bool" and ident_unit = ident_create "unit" @@ -75,7 +74,6 @@ let type_is_builtin_path_but_option (p : Path.t) : test = let path_int = Pident ident_int and path_char = Pident ident_char -and path_bytes = Pident ident_bytes and path_float = Pident ident_float and path_bool = Pident ident_bool and path_unit = Pident ident_unit @@ -101,7 +99,6 @@ and path_uncurried = Pident ident_uncurried let type_int = newgenty (Tconstr(path_int, [], ref Mnil)) and type_char = newgenty (Tconstr(path_char, [], ref Mnil)) -and type_bytes = newgenty (Tconstr(path_bytes, [], ref Mnil)) and type_float = newgenty (Tconstr(path_float, [], ref Mnil)) and type_bool = newgenty (Tconstr(path_bool, [], ref Mnil)) and type_unit = newgenty (Tconstr(path_unit, [], ref Mnil)) @@ -325,12 +322,11 @@ let common_initial_env add_type add_extension empty_env = let build_initial_env add_type add_exception empty_env = let common = common_initial_env add_type add_exception empty_env in - let res = add_type ident_bytes decl_abstr common in let decl_type_char = {decl_abstr with type_manifest = Some type_int; type_private = Private} in - add_type ident_char decl_type_char res + add_type ident_char decl_type_char common let builtin_values = diff --git a/jscomp/ml/predef.mli b/jscomp/ml/predef.mli index a8049b5325d..742d108bd29 100644 --- a/jscomp/ml/predef.mli +++ b/jscomp/ml/predef.mli @@ -20,7 +20,6 @@ open Types val type_int: type_expr val type_char: type_expr val type_string: type_expr -val type_bytes: type_expr val type_float: type_expr val type_bool: type_expr val type_unit: type_expr @@ -40,7 +39,6 @@ val type_floatarray:type_expr val path_int: Path.t val path_char: Path.t val path_string: Path.t -val path_bytes: Path.t val path_float: Path.t val path_bool: Path.t val path_unit: Path.t diff --git a/jscomp/ml/printlambda.ml b/jscomp/ml/printlambda.ml index 35f1c4d4ca5..e4a1df71b26 100644 --- a/jscomp/ml/printlambda.ml +++ b/jscomp/ml/printlambda.ml @@ -122,7 +122,6 @@ let print_taginfo ppf = function let primitive ppf = function | Pidentity -> fprintf ppf "id" - | Pbytes_to_string -> fprintf ppf "bytes_to_string" | Pignore -> fprintf ppf "ignore" | Prevapply -> fprintf ppf "revapply" | Pdirapply -> fprintf ppf "dirapply" @@ -197,12 +196,6 @@ let primitive ppf = function | Pstringlength -> fprintf ppf "string.length" | Pstringrefu -> fprintf ppf "string.unsafe_get" | Pstringrefs -> fprintf ppf "string.get" - | Pbyteslength -> fprintf ppf "bytes.length" - | Pbytesrefu -> fprintf ppf "bytes.unsafe_get" - | Pbytessetu -> fprintf ppf "bytes.unsafe_set" - | Pbytesrefs -> fprintf ppf "bytes.get" - | Pbytessets -> fprintf ppf "bytes.set" - | Parraylength -> fprintf ppf "array.length" | Pmakearray Mutable -> fprintf ppf "makearray" | Pmakearray Immutable -> fprintf ppf "makearray_imm" @@ -242,7 +235,6 @@ let primitive ppf = function | Pcreate_extension s -> fprintf ppf "extension[%s]" s let name_of_primitive = function | Pidentity -> "Pidentity" - | Pbytes_to_string -> "Pbytes_to_string" | Pignore -> "Pignore" | Prevapply -> "Prevapply" | Pdirapply -> "Pdirapply" @@ -298,11 +290,6 @@ let name_of_primitive = function | Pstringlength -> "Pstringlength" | Pstringrefu -> "Pstringrefu" | Pstringrefs -> "Pstringrefs" - | Pbyteslength -> "Pbyteslength" - | Pbytesrefu -> "Pbytesrefu" - | Pbytessetu -> "Pbytessetu" - | Pbytesrefs -> "Pbytesrefs" - | Pbytessets -> "Pbytessets" | Parraylength -> "Parraylength" | Pmakearray _-> "Pmakearray" | Parrayrefu -> "Parrayrefu" diff --git a/jscomp/ml/translcore.ml b/jscomp/ml/translcore.ml index eca5fd0b306..266b8752f53 100644 --- a/jscomp/ml/translcore.ml +++ b/jscomp/ml/translcore.ml @@ -55,7 +55,6 @@ type specialized = { boolcomp : Lambda.primitive; floatcomp : Lambda.primitive; stringcomp : Lambda.primitive; - bytescomp : Lambda.primitive; int64comp : Lambda.primitive; bigintcomp : Lambda.primitive; simplify_constant_constructor : bool; @@ -79,9 +78,6 @@ let comparisons_table = stringcomp = Pccall (Primitive.simple ~name:"caml_string_equal" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_equal" ~arity:2 ~alloc:false); int64comp = Pbintcomp (Pint64, Ceq); bigintcomp = Pbigintcomp Ceq; simplify_constant_constructor = true; @@ -99,10 +95,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_notequal" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_notequal" ~arity:2 - ~alloc:false); int64comp = Pbintcomp (Pint64, Cneq); bigintcomp = Pbigintcomp Cneq; simplify_constant_constructor = true; @@ -120,10 +112,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_lessthan" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_lessthan" ~arity:2 - ~alloc:false); int64comp = Pbintcomp (Pint64, Clt); bigintcomp = Pbigintcomp Clt; simplify_constant_constructor = false; @@ -143,10 +131,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_greaterthan" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_greaterthan" ~arity:2 - ~alloc:false); int64comp = Pbintcomp (Pint64, Cgt); bigintcomp = Pbigintcomp Cgt; simplify_constant_constructor = false; @@ -166,10 +150,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_lessequal" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_lessequal" ~arity:2 - ~alloc:false); int64comp = Pbintcomp (Pint64, Cle); bigintcomp = Pbigintcomp Cle; simplify_constant_constructor = false; @@ -189,10 +169,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_greaterequal" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_greaterequal" ~arity:2 - ~alloc:false); int64comp = Pbintcomp (Pint64, Cge); bigintcomp = Pbigintcomp Cge; simplify_constant_constructor = false; @@ -215,9 +191,6 @@ let comparisons_table = Pccall (Primitive.simple ~name:"caml_string_compare" ~arity:2 ~alloc:false); - bytescomp = - Pccall - (Primitive.simple ~name:"caml_bytes_compare" ~arity:2 ~alloc:false); int64comp = Pccall (Primitive.simple ~name:"caml_int64_compare" ~arity:2 ~alloc:false); @@ -229,8 +202,6 @@ let comparisons_table = ( "%bs_max", { gencomp = arity2 "caml_max"; - bytescomp = arity2 "caml_max"; - (* FIXME bytescomp*) intcomp = arity2 "caml_int_max"; boolcomp = arity2 "caml_bool_max"; floatcomp = arity2 "caml_float_max"; @@ -242,7 +213,6 @@ let comparisons_table = ( "%bs_min", { gencomp = arity2 "caml_min"; - bytescomp = arity2 "caml_min"; intcomp = arity2 "caml_int_min"; boolcomp = arity2 "caml_bool_min"; floatcomp = arity2 "caml_float_min"; @@ -254,8 +224,6 @@ let comparisons_table = ( "%bs_equal_null", { gencomp = arity2 "caml_equal_null"; - bytescomp = arity2 "caml_equal_null"; - (* FIXME*) intcomp = arity2 "caml_int_equal_null"; boolcomp = arity2 "caml_bool_equal_null"; floatcomp = arity2 "caml_float_equal_null"; @@ -267,8 +235,6 @@ let comparisons_table = ( "%bs_equal_undefined", { gencomp = arity2 "caml_equal_undefined"; - bytescomp = arity2 "caml_equal_undefined"; - (* FIXME*) intcomp = arity2 "caml_int_equal_undefined"; boolcomp = arity2 "caml_bool_equal_undefined"; floatcomp = arity2 "caml_float_equal_undefined"; @@ -280,8 +246,6 @@ let comparisons_table = ( "%bs_equal_nullable", { gencomp = arity2 "caml_equal_nullable"; - bytescomp = arity2 "caml_equal_nullable"; - (* FIXME *) intcomp = arity2 "caml_int_equal_nullable"; boolcomp = arity2 "caml_bool_equal_nullable"; floatcomp = arity2 "caml_float_equal_nullable"; @@ -296,7 +260,6 @@ let primitives_table = create_hashtable 57 [ ("%identity", Pidentity); - ("%bytes_to_string", Pbytes_to_string); ("%ignore", Pignore); ("%revapply", Prevapply); ("%apply", Pdirapply); @@ -378,11 +341,6 @@ let primitives_table = ("%string_length", Pstringlength); ("%string_safe_get", Pstringrefs); ("%string_unsafe_get", Pstringrefu); - ("%bytes_length", Pbyteslength); - ("%bytes_safe_get", Pbytesrefs); - ("%bytes_safe_set", Pbytessets); - ("%bytes_unsafe_get", Pbytesrefu); - ("%bytes_unsafe_set", Pbytessetu); ("%array_length", Parraylength); ("%array_safe_get", Parrayrefs); ("%array_safe_set", Parraysets); @@ -419,7 +377,7 @@ let primitives_table = let find_primitive prim_name = Hashtbl.find primitives_table prim_name let specialize_comparison - ({ gencomp; intcomp; floatcomp; stringcomp; bytescomp; int64comp; bigintcomp; boolcomp } : + ({ gencomp; intcomp; floatcomp; stringcomp; int64comp; bigintcomp; boolcomp } : specialized) env ty = match () with | () @@ -429,7 +387,6 @@ let specialize_comparison intcomp | () when is_base_type env ty Predef.path_float -> floatcomp | () when is_base_type env ty Predef.path_string -> stringcomp - | () when is_base_type env ty Predef.path_bytes -> bytescomp | () when is_base_type env ty Predef.path_int64 -> int64comp | () when is_base_type env ty Predef.path_bigint -> bigintcomp | () when is_base_type env ty Predef.path_bool -> boolcomp diff --git a/jscomp/ml/typeopt.ml b/jscomp/ml/typeopt.ml index 565cc3b7995..e698cbb6cce 100644 --- a/jscomp/ml/typeopt.ml +++ b/jscomp/ml/typeopt.ml @@ -140,7 +140,6 @@ let classify env ty = if Path.same p Predef.path_float then Float else if Path.same p Predef.path_lazy_t then Lazy else if Path.same p Predef.path_string - || Path.same p Predef.path_bytes || Path.same p Predef.path_array || Path.same p Predef.path_int64 then Addr else begin diff --git a/jscomp/runtime/caml_bytes.res b/jscomp/runtime/caml_bytes.res deleted file mode 100644 index afab0966dd5c181424e6df64f4a4a264c34034f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3511 zcmcgvVQ(5a5WUa*iV@PakXs0l>zyubqN7pLBGCi^Q598HWOfZ$U2JOahH&lu_j_aS z5=e4stCLQuBCtJgp5L1p)BQai6f1r<6oz!#Y^IwGmCZ|O!_hwpSyrYZmg`p{!xEk{l+AGG&5n9+DG_7^n0s3QV;@6@1Q>l?$mek7by`64d=w*fRqgXFj_l zZR|p%*j=U~hI-JpP|wNOOZ{tM9D}i%<+b5x4R>L{*jOvw(&z+Cs0>7DiCrf*B>)(P zb90lYiBIV7;iZEI_v7ki3EXdlZ8sFE0$k>12^cmL)xJ_`N)ySxPV+S4oM;Yu-y6TZ zxExdW{EFUphr{mq`0AzC$6#09zz~K~kWE1obQ#yy8uS_A-Rbb;Eke4ld;Q+{iVZ#M zjn7XQmfN$w;Sz)*6$Hrj=D|S+pkpq)N)1g z7HzLFd+_Bt*Gi+=MXLUi$ssA7(a|y5Izx*dQMC(C*40X76O(Hvrt*3wvqP%+V-W|{ zIVzqD%RxW;bwHO#s}JJcz4*undlWDNhx;f9*g{FAo@MjHlIL;Yy@?6ipq z2cDdTb5w}sSM-Wn^z|z~93N4Lsku6R!8VZ<%E?+!-$0t=TG(06yTozNL^E&ZlDrdiC2KxK!Ez4q9D7! zN9QI%`Lh!AVJP%Wo?2_{N0d-3{X@c4<;6s_m-A`yMtC>%tQnF%A{+aK8JDN5&x7*x z6p@aIJ6FMU_=nEn+zo0M(!)BBaNmLFKRxGrvkCk+9Ky%K6Et}!r)wVMc=4}Ae(POo z7pg?$I-8GXI*mASgyAv0GZD*>fe8g6_(C-i(F8|OgY69|_5p|M4EkU(@I;9ULN9La z)eiJSo%!8YTf2>&?U0@xUI`>PCw>@!>Mw*Zn_Fzu*(qh*FQ|lih`An?0*`g<-xNRe z`85)hwLjQuFKzaO< bPr)4R;-vV$$&XUO8@f$}A%2+0E9UVJlD12* diff --git a/jscomp/runtime/caml_bytes.resi b/jscomp/runtime/caml_bytes.resi deleted file mode 100644 index a76db5d5f84..00000000000 --- a/jscomp/runtime/caml_bytes.resi +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2015-2016 Bloomberg Finance L.P. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * In addition to the permissions granted to you by the LGPL, you may combine - * or link a "work that uses the Library" with a publicly distributed version - * of this file to produce a combined library or application, then distribute - * that combined work under the terms of your choosing, with no requirement - * to comply with the obligations normally placed on you by section 4 of the - * LGPL version 3 (or the corresponding section of a later version of the LGPL - * should you choose to use a later version). - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -let create: int => bytes - -let get: (bytes, int) => char -let set: (bytes, int, char) => unit - -let bytes_compare: (bytes, bytes) => int - -let bytes_greaterthan: (bytes, bytes) => bool - -let bytes_greaterequal: (bytes, bytes) => bool - -let bytes_lessthan: (bytes, bytes) => bool - -let bytes_lessequal: (bytes, bytes) => bool - -let bytes_equal: (bytes, bytes) => bool diff --git a/jscomp/runtime/caml_hash_primitive.res b/jscomp/runtime/caml_hash_primitive.res index 281b6231683..7bdd6153084 100644 --- a/jscomp/runtime/caml_hash_primitive.res +++ b/jscomp/runtime/caml_hash_primitive.res @@ -25,6 +25,7 @@ let rotl32 = (x: int, n) => lor(lsl(x, n), lsr(x, 32 - n)) @send external charCodeAt: (string, int) => int = "charCodeAt" +@get external stringLength: string => int = "length" let hash_mix_int = (h, d) => { let d = ref(d) @@ -46,7 +47,7 @@ let hash_final_mix = h => { /* Caml_nativeint_extern.logand (h.contents ^ (h.contents >>> 16)) 0x3FFFFFFFn */ let hash_mix_string = (h, s) => { - let len = Caml_string_extern.length(s) + let len = stringLength(s) let block = len / 4 - 1 let hash = ref(h) for i in 0 to block { diff --git a/jscomp/runtime/caml_int64.res b/jscomp/runtime/caml_int64.res index d079cdc4af7..d67c879983a 100644 --- a/jscomp/runtime/caml_int64.res +++ b/jscomp/runtime/caml_int64.res @@ -33,6 +33,10 @@ let {shift_right_logical: \">>>~", add: \"+~", mul: \"*~"} = module(Caml_nativeint_extern) ) +@get external stringLength: string => int = "length" +@send external stringRepeat: (string, int) => string = "repeat" +@send external intToString: (int, ~radix: int=?) => string = "toString" + let {i64_eq: eq, i64_ge: ge, i64_gt: gt} = module(Caml) let lognot = x => lxor(x, -1) @@ -499,8 +503,7 @@ let to_int32 = x => lor(x.lo, 0) /* signed integer */ let to_hex = (x: int64) => { let {hi: x_hi, lo: x_lo} = unsafe_of_int64(x) - let aux = (v): string => - Caml_string_extern.of_int(Caml_nativeint_extern.shift_right_logical(v, 0), ~base=16) + let aux = (v): string => intToString(Caml_nativeint_extern.shift_right_logical(v, 0), ~radix=16) switch (x_hi, x_lo) { | (0, 0) => "0" @@ -508,11 +511,11 @@ let to_hex = (x: int64) => { | (0, _) => aux(x_lo) | (_, _) => let lo = aux(x_lo) - let pad = 8 - Caml_string_extern.length(lo) + let pad = 8 - stringLength(lo) if pad <= 0 { aux(x_hi) ++ lo } else { - aux(x_hi) ++ (Caml_string_extern.repeat("0", pad) ++ lo) + aux(x_hi) ++ (stringRepeat("0", pad) ++ lo) } } } diff --git a/jscomp/runtime/caml_string_extern.res b/jscomp/runtime/caml_string_extern.res index 6bfafc88f7b..19af91186f2 100644 --- a/jscomp/runtime/caml_string_extern.res +++ b/jscomp/runtime/caml_string_extern.res @@ -49,7 +49,6 @@ external of_small_int_array: (@as(json`null`) _, array) => string = "String external length: string => int = "%string_length" external unsafe_get: (string, int) => char = "%string_unsafe_get" -external unsafe_set: (bytes, int, char) => unit = "%bytes_unsafe_set" external get: (string, int) => char = "%string_unsafe_get" @send external repeat: (string, int) => string = "repeat" diff --git a/jscomp/runtime/release.ninja b/jscomp/runtime/release.ninja index 97b01db6b0e..f7f8a79691e 100644 --- a/jscomp/runtime/release.ninja +++ b/jscomp/runtime/release.ninja @@ -19,19 +19,17 @@ o runtime/caml_array.cmj : cc_cmi runtime/caml_array.res | runtime/caml_array.cm o runtime/caml_array.cmi : cc runtime/caml_array.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_bigint.cmj : cc_cmi runtime/caml_bigint.res | runtime/caml_bigint.cmi runtime/caml_bigint_extern.cmj o runtime/caml_bigint.cmi : cc runtime/caml_bigint.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_bytes.cmj : cc_cmi runtime/caml_bytes.res | runtime/caml_bytes.cmi -o runtime/caml_bytes.cmi : cc runtime/caml_bytes.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_exceptions.cmj : cc_cmi runtime/caml_exceptions.res | runtime/caml_exceptions.cmi o runtime/caml_exceptions.cmi : cc runtime/caml_exceptions.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_float.cmj : cc_cmi runtime/caml_float.res | runtime/caml_float.cmi runtime/caml_float_extern.cmj o runtime/caml_float.cmi : cc runtime/caml_float.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_hash.cmj : cc_cmi runtime/caml_hash.res | runtime/caml_hash.cmi runtime/caml_hash_primitive.cmj runtime/caml_nativeint_extern.cmj o runtime/caml_hash.cmi : cc runtime/caml_hash.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_hash_primitive.cmj : cc_cmi runtime/caml_hash_primitive.res | runtime/caml_hash_primitive.cmi runtime/caml_string_extern.cmj +o runtime/caml_hash_primitive.cmj : cc_cmi runtime/caml_hash_primitive.res | runtime/caml_hash_primitive.cmi o runtime/caml_hash_primitive.cmi : cc runtime/caml_hash_primitive.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_int32.cmj : cc_cmi runtime/caml_int32.res | runtime/caml_int32.cmi runtime/caml_nativeint_extern.cmj o runtime/caml_int32.cmi : cc runtime/caml_int32.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_int64.cmj : cc_cmi runtime/caml_int64.res | runtime/caml.cmj runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_int64.cmi runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmj +o runtime/caml_int64.cmj : cc_cmi runtime/caml_int64.res | runtime/caml.cmj runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_int64.cmi runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj o runtime/caml_int64.cmi : cc runtime/caml_int64.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_module.cmj : cc_cmi runtime/caml_module.res | runtime/caml_array_extern.cmj runtime/caml_module.cmi runtime/caml_obj.cmj o runtime/caml_module.cmi : cc runtime/caml_module.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj @@ -52,4 +50,4 @@ o runtime/caml_nativeint_extern.cmi runtime/caml_nativeint_extern.cmj : cc runti o runtime/caml_string_extern.cmi runtime/caml_string_extern.cmj : cc runtime/caml_string_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj : cc runtime/caml_undefined_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/curry.cmi runtime/curry.cmj : cc runtime/curry.res | runtime/bs_stdlib_mini.cmi runtime/caml_array.cmj runtime/caml_array_extern.cmj runtime/js.cmi runtime/js.cmj -o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/caml.cmi runtime/caml.cmj runtime/caml_array.cmi runtime/caml_array.cmj runtime/caml_bigint.cmi runtime/caml_bigint.cmj runtime/caml_bytes.cmi runtime/caml_bytes.cmj runtime/caml_exceptions.cmi runtime/caml_exceptions.cmj runtime/caml_float.cmi runtime/caml_float.cmj runtime/caml_hash.cmi runtime/caml_hash.cmj runtime/caml_hash_primitive.cmi runtime/caml_hash_primitive.cmj runtime/caml_int32.cmi runtime/caml_int32.cmj runtime/caml_int64.cmi runtime/caml_int64.cmj runtime/caml_module.cmi runtime/caml_module.cmj runtime/caml_obj.cmi runtime/caml_obj.cmj runtime/caml_option.cmi runtime/caml_option.cmj runtime/caml_splice_call.cmi runtime/caml_splice_call.cmj runtime/caml_string.cmi runtime/caml_string.cmj runtime/caml_array_extern.cmi runtime/caml_array_extern.cmj runtime/caml_bigint_extern.cmi runtime/caml_bigint_extern.cmj runtime/caml_float_extern.cmi runtime/caml_float_extern.cmj runtime/caml_int64_extern.cmi runtime/caml_int64_extern.cmj runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj runtime/caml_nativeint_extern.cmi runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmi runtime/caml_string_extern.cmj runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj runtime/curry.cmi runtime/curry.cmj +o runtime : phony runtime/bs_stdlib_mini.cmi runtime/js.cmj runtime/js.cmi runtime/caml.cmi runtime/caml.cmj runtime/caml_array.cmi runtime/caml_array.cmj runtime/caml_bigint.cmi runtime/caml_bigint.cmj runtime/caml_exceptions.cmi runtime/caml_exceptions.cmj runtime/caml_float.cmi runtime/caml_float.cmj runtime/caml_hash.cmi runtime/caml_hash.cmj runtime/caml_hash_primitive.cmi runtime/caml_hash_primitive.cmj runtime/caml_int32.cmi runtime/caml_int32.cmj runtime/caml_int64.cmi runtime/caml_int64.cmj runtime/caml_module.cmi runtime/caml_module.cmj runtime/caml_obj.cmi runtime/caml_obj.cmj runtime/caml_option.cmi runtime/caml_option.cmj runtime/caml_splice_call.cmi runtime/caml_splice_call.cmj runtime/caml_string.cmi runtime/caml_string.cmj runtime/caml_array_extern.cmi runtime/caml_array_extern.cmj runtime/caml_bigint_extern.cmi runtime/caml_bigint_extern.cmj runtime/caml_float_extern.cmi runtime/caml_float_extern.cmj runtime/caml_int64_extern.cmi runtime/caml_int64_extern.cmj runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj runtime/caml_nativeint_extern.cmi runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmi runtime/caml_string_extern.cmj runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj runtime/curry.cmi runtime/curry.cmj diff --git a/jscomp/stdlib-406/bytes.res b/jscomp/stdlib-406/bytes.res deleted file mode 100644 index d7f9c5cb7b623da73096b8f280aff6ffd111309a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13113 zcmd5@`)?b^5$?}I|A-BNL`RFFB_Svp!BXO=L0}+I0y{+t*amYtF2$9Pcg)>UmKwW% zd%v04=aH7^S5dW=$bHQ7o7vg9%fkoi!6*7r4<7D3e4y-~pU?6|nGXFczc#v2Kk25v z9jRqgU+GSrHKy(Ia-^P|KYj98J*|sBR=O(cRnw)r&+6rEV=m{NI{fCFzo{ox+nH|F zsq?%ub(NQDs?}3n%yol*N>^AhtD6O8K~RB{h=+;CtFE@=g9vt8=KV2i#f^pX@*__&t>V;Ob zRaM9|OX}>HH(E_sOBf?3J7SKET3wC-88~f6DWzvKQy3uO7Ou!!a2TuK=J4Kay;6&M zYG${rdR@USWCcf?<|_@VT}^cCQq#e8j$^`bOsjsK!`+dz^ZZ(?Tn+q|=|C0rVxg-} z;x_^2IDWX;Q*w? zh$E=iF`)u`h|HHVF2JQk|*;^(O^6r55#yg5MxHU}g^=_SK=CRmz(yYe(u8hz)t$ zTl{{D*scp4Y2#^KWCQgqM|R6w_2(C?_86yGS9iBdJuYxg{f1<2s<#T5C#Av=RLk{G-|eN6`}XNP`cna*9*9GYbTz;?u?-W2(T}10<7QR&d%J)sw0l zs#)T5x$Sg5rPC{lKh!CdPWxDGj{sFikv#Qm zMyOBGEy$Me2G>U?vdmdo0^JY@*#{(99Oe`}ktd)CAcb78!4t-Mg0@f^;J;}I^trLb zpO9TdpGi~Z+FGIAzwAmJvEWVtF*bf9tM!~dai_TWUcOOGj^N0?^Z5)2i7Q1whzS`g< z#L}f{At1mL<+4M@2d?0Ih1>*e!YE!PpOsurYW)-}5PjLBt^G?#>I%=>6YZG~1XFwN z<9>D1S)24E1N;8SURW;T2Khka?T$@Ci~N#M z3s$#|7S*Yi*6dDNX$FXoiBJj?6PyjROtJ~-;2G(~vbzN*D<9zM3qFkUb;_y1;X*-! z+g8@Ph@<Rmu6BayvQ7ZRlqWg)`Q&S5Xo2p+&wohU+zd1 zPhf&*&ZpM*vBmsn@l(5^Dwcpz&+v;%gnVKh{r>2^t5Aq=0jsGO|JuY4Z1900$wN!g>ArtbOelxR3jG#9)uZ|XYnEc z7oN+fQ*OUV|13wF46d4$^=r5fFeNKf4tX)y+Z&MKfc}dFdId&vWLUc1v}nQ=b1Wh= zVxjyg=#Lz1Fl^VX^hn9?S&q99VG!f|8CimcWZpUk2Wf0$8#B09SJS~zK?N@{-|OC} z2_?UR?PM)Qw{YN4{9fu=HaQakH!+c!W(3kbNu{zLX9Kp8HV4WSV zUK|lzc=IRRQ(!2IDpxn#aEB7qHIUfnFCpT&+$IxKUclUuTgacox+5yfiG#1=HUO8T zd#7S@W9L0VRk1Ek>14>CeAvPP@BtP8 zL08KrR(K{IS$2|hcBIdprm;Hn^<nGaxyqUjwxDbe5&$f}`cG*Q0ctK>-C26*47(-U=T ztM(hRO?>Z8oFX|D$21-%hzI1bY;>X8)x!3$sfx(*q5v@U641aSsJzJ+mZQ!6Jj6`j z;Biaa{rQ%%F?K-!J2Id0m<88-I>hPGTQE}N@wh8_T_ix}b#`e`c8feh20kqcq-rN) zS4u|X$RUNIM93N;{Xvr&#Q?U1eOv2>{e9i=Jw43lQ!W|sV zYi|HCRG_pIwj2Tv@;x2|GkatJ_AD^xT*9-zJC$kk3|lDl%A-i2Ba)|I4^RuX+ zj&F$3UA2q2-2E&6eo@JvM*eiWWC|+PAgHaYxIV*IYdK`|1$b<6QKJM%Jrpi^q#t3z zrTY>2mzp9@@HpGj&BHH^4%ec=m6Bx<2V7YeL<)(Uri9Uz-%U9&(7JTZFmdNt zrH)Tv82X7?JbQM?BE+JSjylr7o#cdq-GPAPMS>VW1ye69a4r})N0ufg@W1g`?f!?y zUH91{idtp#Lq#Y3gJC1V&_8pL@1&roLDB$7>_s8if`MxX1R~@zXbZ*F0e`&TO8zc$ zhb6LLiXlD9!cB;tK*^8Yho)23?xMrueLaGiUPMi0Qvp?c5x;k%eVoQ#piuqH>~%UXIg+9mO!GZ65(p`OfI47j=o(cK}L~ewCxI=kId>qM?8YLL|iD}AM zyNfBGYZv*FY>FEKl4o2GVASU$Y@lnT^!RPgCn9m3-7gG8tzH6((sSZ96biTlBsULE z$JRI^xO9ZKFr)^T6;LTV160Pnd2$UG^=MYz zxvw|R`*-%iyS$`b$eFr4>edmE4_3?138@$1X=g+C)BHrD)QGw-JG0 zSvyW~z87|*2`gQ1)$$IEk#kTQb1vNOs!!ru(dDU#SBQx^Pjlf7vRmBd6RS+nv)!|@u z$f(Z$>%H}ex@#YWq4n;OHy4}ABA0wX-Oc+WAdrr1^_lcx4(mG6@Ev-2PrbKpgk!uj znufR24JHCU#Vg{BPZ!pKDLKW^;rBivE!&frPAPh5dCFUO+LG7++hB_QLuvs_x^sbX z2UKH{&actfx>Hj%*cA-bZNyKUxdE&}3->D7r^rS@Vu!;IbY~>7m5i<{)itiojI424)eR0V zmsjGv>q>gtQKGs4oi{u%lnnER9wST9Kqa^9G*PnNI$=9Wll0&Q*=i&Z3bQTG`ebYG zJc~o>z4Agz)EOC%4I}4nW#teg9!Vc(;~jbfS5Za7uOqpaF&5|{y2lJ?mg6mac|ZOa q{1+a1Yp(GU1HDm+McEBKgW&2K|A_-$;YZboXA|)zlw)`= 0] and [start] and [start+len] are valid - positions in [s]. - - Byte sequences can be modified in place, for instance via the [set] - and [blit] functions described below. See also strings (module - {!String}), which are almost the same data structure, but cannot be - modified in place. - - Bytes are represented by the OCaml type [char]. - - @since 4.02.0 -*/ - -/** Return the length (number of bytes) of the argument. */ -external length: bytes => int = "%bytes_length" - -/** [get s n] returns the byte at index [n] in argument [s]. - - Raise [Invalid_argument] if [n] is not a valid index in [s]. */ -external get: (bytes, int) => char = "%bytes_safe_get" - -/** [set s n c] modifies [s] in place, replacing the byte at index [n] - with [c]. - - Raise [Invalid_argument] if [n] is not a valid index in [s]. */ -external set: (bytes, int, char) => unit = "%bytes_safe_set" - -/** [create n] returns a new byte sequence of length [n]. The - sequence is uninitialized and contains arbitrary bytes. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -external create: int => bytes = "?create_bytes" - -/** [make n c] returns a new byte sequence of length [n], filled with - the byte [c]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let make: (int, char) => bytes - -/** [Bytes.init n f] returns a fresh byte sequence of length [n], with - character [i] initialized to the result of [f i] (in increasing - index order). - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let init: (int, int => char) => bytes - -/** A byte sequence of size 0. */ -let empty: bytes - -/** Return a new byte sequence that contains the same bytes as the - argument. */ -let copy: bytes => bytes - -/** Return a new byte sequence that contains the same bytes as the - given string. */ -let of_string: string => bytes - -/** Return a new string that contains the same bytes as the given byte - sequence. */ -let to_string: bytes => string - -/** [sub s start len] returns a new byte sequence of length [len], - containing the subsequence of [s] that starts at position [start] - and has length [len]. - - Raise [Invalid_argument] if [start] and [len] do not designate a - valid range of [s]. */ -let sub: (bytes, int, int) => bytes - -/** Same as [sub] but return a string instead of a byte sequence. */ -let sub_string: (bytes, int, int) => string - -/** [extend s left right] returns a new byte sequence that contains - the bytes of [s], with [left] uninitialized bytes prepended and - [right] uninitialized bytes appended to it. If [left] or [right] - is negative, then bytes are removed (instead of appended) from - the corresponding side of [s]. - - Raise [Invalid_argument] if the result length is negative or - longer than {!Sys.max_string_length} bytes. */ -let extend: (bytes, int, int) => bytes - -/** [fill s start len c] modifies [s] in place, replacing [len] - characters with [c], starting at [start]. - - Raise [Invalid_argument] if [start] and [len] do not designate a - valid range of [s]. */ -let fill: (bytes, int, int, char) => unit - -/** [blit src srcoff dst dstoff len] copies [len] bytes from sequence - [src], starting at index [srcoff], to sequence [dst], starting at - index [dstoff]. It works correctly even if [src] and [dst] are the - same byte sequence, and the source and destination intervals - overlap. - - Raise [Invalid_argument] if [srcoff] and [len] do not - designate a valid range of [src], or if [dstoff] and [len] - do not designate a valid range of [dst]. */ -let blit: (bytes, int, bytes, int, int) => unit - -/** [blit src srcoff dst dstoff len] copies [len] bytes from string - [src], starting at index [srcoff], to byte sequence [dst], - starting at index [dstoff]. - - Raise [Invalid_argument] if [srcoff] and [len] do not - designate a valid range of [src], or if [dstoff] and [len] - do not designate a valid range of [dst]. */ -let blit_string: (string, int, bytes, int, int) => unit - -/** [concat sep sl] concatenates the list of byte sequences [sl], - inserting the separator byte sequence [sep] between each, and - returns the result as a new byte sequence. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. */ -let concat: (bytes, list) => bytes - -/** [cat s1 s2] concatenates [s1] and [s2] and returns the result - as new byte sequence. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. */ -let cat: (bytes, bytes) => bytes - -/** [iter f s] applies function [f] in turn to all the bytes of [s]. - It is equivalent to [f (get s 0); f (get s 1); ...; f (get s - (length s - 1)); ()]. */ -let iter: (char => unit, bytes) => unit - -/** Same as {!Bytes.iter}, but the function is applied to the index of - the byte as first argument and the byte itself as second - argument. */ -let iteri: ((int, char) => unit, bytes) => unit - -/** [map f s] applies function [f] in turn to all the bytes of [s] - (in increasing index order) and stores the resulting bytes in - a new sequence that is returned as the result. */ -let map: (char => char, bytes) => bytes - -/** [mapi f s] calls [f] with each character of [s] and its - index (in increasing index order) and stores the resulting bytes - in a new sequence that is returned as the result. */ -let mapi: ((int, char) => char, bytes) => bytes - -/** Return a copy of the argument, without leading and trailing - whitespace. The bytes regarded as whitespace are the ASCII - characters [' '], ['\x0c'], ['\n'], ['\r'], and ['\t']. */ -let trim: bytes => bytes - -/** Return a copy of the argument, with special characters represented - by escape sequences, following the lexical conventions of OCaml. - All characters outside the ASCII printable range (32..126) are - escaped, as well as backslash and double-quote. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. */ -let escaped: bytes => bytes - -/** [index s c] returns the index of the first occurrence of byte [c] - in [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let index: (bytes, char) => int - -/** [index_opt s c] returns the index of the first occurrence of byte [c] - in [s] or [None] if [c] does not occur in [s]. - @since 4.05 */ -let index_opt: (bytes, char) => option - -/** [rindex s c] returns the index of the last occurrence of byte [c] - in [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let rindex: (bytes, char) => int - -/** [rindex_opt s c] returns the index of the last occurrence of byte [c] - in [s] or [None] if [c] does not occur in [s]. - @since 4.05 */ -let rindex_opt: (bytes, char) => option - -/** [index_from s i c] returns the index of the first occurrence of - byte [c] in [s] after position [i]. [Bytes.index s c] is - equivalent to [Bytes.index_from s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] after position [i]. */ -let index_from: (bytes, int, char) => int - -/** [index_from _opts i c] returns the index of the first occurrence of - byte [c] in [s] after position [i] or [None] if [c] does not occur in [s] after position [i]. - [Bytes.index_opt s c] is equivalent to [Bytes.index_from_opt s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - @since 4.05 */ -let index_from_opt: (bytes, int, char) => option - -/** [rindex_from s i c] returns the index of the last occurrence of - byte [c] in [s] before position [i+1]. [rindex s c] is equivalent - to [rindex_from s (Bytes.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] before position [i+1]. */ -let rindex_from: (bytes, int, char) => int - -/** [rindex_from_opt s i c] returns the index of the last occurrence - of byte [c] in [s] before position [i+1] or [None] if [c] does not - occur in [s] before position [i+1]. [rindex_opt s c] is equivalent to - [rindex_from s (Bytes.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - @since 4.05 */ -let rindex_from_opt: (bytes, int, char) => option - -/** [contains s c] tests if byte [c] appears in [s]. */ -let contains: (bytes, char) => bool - -/** [contains_from s start c] tests if byte [c] appears in [s] after - position [start]. [contains s c] is equivalent to [contains_from - s 0 c]. - - Raise [Invalid_argument] if [start] is not a valid position in [s]. */ -let contains_from: (bytes, int, char) => bool - -/** [rcontains_from s stop c] tests if byte [c] appears in [s] before - position [stop+1]. - - Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid - position in [s]. */ -let rcontains_from: (bytes, int, char) => bool - -/** Return a copy of the argument, with all lowercase letters - translated to uppercase, using the US-ASCII character set. - @since 4.03.0 */ -let uppercase_ascii: bytes => bytes - -/** Return a copy of the argument, with all uppercase letters - translated to lowercase, using the US-ASCII character set. - @since 4.03.0 */ -let lowercase_ascii: bytes => bytes - -/** Return a copy of the argument, with the first character set to uppercase, - using the US-ASCII character set. - @since 4.03.0 */ -let capitalize_ascii: bytes => bytes - -/** Return a copy of the argument, with the first character set to lowercase, - using the US-ASCII character set. - @since 4.03.0 */ -let uncapitalize_ascii: bytes => bytes - -/** An alias for the type of byte sequences. */ -type t = bytes - -/** The comparison function for byte sequences, with the same - specification as {!Pervasives.compare}. Along with the type [t], - this function [compare] allows the module [Bytes] to be passed as - argument to the functors {!Set.Make} and {!Map.Make}. */ -let compare: (t, t) => int - -/** The equality function for byte sequences. - @since 4.03.0 */ -let equal: (t, t) => bool - -/* {3 Unsafe conversions (for advanced users)} - - This section describes unsafe, low-level conversion functions - between [bytes] and [string]. They do not copy the internal data; - used improperly, they can break the immutability invariant on - strings provided by the [-safe-string] option. They are available for - expert library authors, but for most purposes you should use the - always-correct {!Bytes.to_string} and {!Bytes.of_string} instead. -*/ - -/** Unsafely convert a byte sequence into a string. - - To reason about the use of [unsafe_to_string], it is convenient to - consider an "ownership" discipline. A piece of code that - manipulates some data "owns" it; there are several disjoint ownership - modes, including: - - Unique ownership: the data may be accessed and mutated - - Shared ownership: the data has several owners, that may only - access it, not mutate it. - - Unique ownership is linear: passing the data to another piece of - code means giving up ownership (we cannot write the - data again). A unique owner may decide to make the data shared - (giving up mutation rights on it), but shared data may not become - uniquely-owned again. - - [unsafe_to_string s] can only be used when the caller owns the byte - sequence [s] -- either uniquely or as shared immutable data. The - caller gives up ownership of [s], and gains ownership of the - returned string. - - There are two valid use-cases that respect this ownership - discipline: - - 1. Creating a string by initializing and mutating a byte sequence - that is never changed after initialization is performed. - - {[ -let string_init len f : string = - let s = Bytes.create len in - for i = 0 to len - 1 do Bytes.set s i (f i) done; - Bytes.unsafe_to_string s - ]} - - This function is safe because the byte sequence [s] will never be - accessed or mutated after [unsafe_to_string] is called. The - [string_init] code gives up ownership of [s], and returns the - ownership of the resulting string to its caller. - - Note that it would be unsafe if [s] was passed as an additional - parameter to the function [f] as it could escape this way and be - mutated in the future -- [string_init] would give up ownership of - [s] to pass it to [f], and could not call [unsafe_to_string] - safely. - - We have provided the {!String.init}, {!String.map} and - {!String.mapi} functions to cover most cases of building - new strings. You should prefer those over [to_string] or - [unsafe_to_string] whenever applicable. - - 2. Temporarily giving ownership of a byte sequence to a function - that expects a uniquely owned string and returns ownership back, so - that we can mutate the sequence again after the call ended. - - {[ -let bytes_length (s : bytes) = - String.length (Bytes.unsafe_to_string s) - ]} - - In this use-case, we do not promise that [s] will never be mutated - after the call to [bytes_length s]. The {!String.length} function - temporarily borrows unique ownership of the byte sequence - (and sees it as a [string]), but returns this ownership back to - the caller, which may assume that [s] is still a valid byte - sequence after the call. Note that this is only correct because we - know that {!String.length} does not capture its argument -- it could - escape by a side-channel such as a memoization combinator. - - The caller may not mutate [s] while the string is borrowed (it has - temporarily given up ownership). This affects concurrent programs, - but also higher-order functions: if {!String.length} returned - a closure to be called later, [s] should not be mutated until this - closure is fully applied and returns ownership. -*/ -let unsafe_to_string: bytes => string - -/** Unsafely convert a shared string to a byte sequence that should - not be mutated. - - The same ownership discipline that makes [unsafe_to_string] - correct applies to [unsafe_of_string]: you may use it if you were - the owner of the [string] value, and you will own the return - [bytes] in the same mode. - - In practice, unique ownership of string values is extremely - difficult to reason about correctly. You should always assume - strings are shared, never uniquely owned. - - For example, string literals are implicitly shared by the - compiler, so you never uniquely own them. - - {[ -let incorrect = Bytes.unsafe_of_string "hello" -let s = Bytes.of_string "hello" - ]} - - The first declaration is incorrect, because the string literal - ["hello"] could be shared by the compiler with other parts of the - program, and mutating [incorrect] is a bug. You must always use - the second version, which performs a copy and is thus correct. - - Assuming unique ownership of strings that are not string - literals, but are (partly) built from string literals, is also - incorrect. For example, mutating [unsafe_of_string ("foo" ^ s)] - could mutate the shared string ["foo"] -- assuming a rope-like - representation of strings. More generally, functions operating on - strings will assume shared ownership, they do not preserve unique - ownership. It is thus incorrect to assume unique ownership of the - result of [unsafe_of_string]. - - The only case we have reasonable confidence is safe is if the - produced [bytes] is shared -- used as an immutable byte - sequence. This is possibly useful for incremental migration of - low-level programs that manipulate immutable sequences of bytes - (for example {!Marshal.from_bytes}) and previously used the - [string] type for this purpose. -*/ -let unsafe_of_string: string => bytes - -/* The following is for system use only. Do not call directly. */ - -external unsafe_get: (bytes, int) => char = "%bytes_unsafe_get" -external unsafe_set: (bytes, int, char) => unit = "%bytes_unsafe_set" diff --git a/jscomp/stdlib-406/bytesLabels.res b/jscomp/stdlib-406/bytesLabels.res deleted file mode 100644 index 527d76a20ad3c2eaa73a5c6f868cde6c630f448a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13251 zcmd5@e{b7H61~5T`w&|Jt*Ka6Y@;|_jo3}X7fFw|9lCo%1q>iK<`1eH*H*u)brC9&!4FmRr2p;RwmW5Zo}0l)#9ek&u6XL|L(iLspn~OyM(yxOINEY_n7?%M|*wVAp2#yiwKEkmJx#r~ibi4XCJ}vNEe7 z;jhcHB2U!Md6Jb)rmnKOf#~XBygyQJ^L8erw3y8zOL8p9u9Iv*1r`1;^71k-&!K6P zKn6&Vm$F8L`}z6FkEbtx?5T85&IL>!Z_&L!+_af$GI3I-ss$9Ic#WO^{n?At=chj% zs+ZL~Q`2Rc=xLGE+A*#(l`a=BMoc?mjz%rd$AAo+wxyKHrqevhfrJ~lB5uH8tbU)t zdpFfm&8sw@-iYc|3AfM+mNw_h3{=~Sbj+=J3)fkW0mCux`fUbxd(zJ0t4zge&@D*^ zDyio4tZY?$R$&q@&TDvLnwL2>9B;uu*)@PbEWRF$zlw%~LltSoMqt?v)zPs^W^t{K z)ZlA9FOE9>9nrqC*XQgrP(-MEQ*`Kmg7=n<#{_hRA=yOLjgfZ^Gui&ky)6pnk30S_4LU6-i=y*a|s3Hv37)CR8R&fk_%SK{MQF;j{cv8#ah9>P6 zCqPk~9cuNCt-5OPy`Go|SKlzsF?Y)9ZuJ)sWAKP*3u<@_{ST6J8Fj;;%eKNaZadSs+In zHIUDWKxKi+s^C#$fQ$K&!X}a&c9=j|=TlXvW3{LLWQ;Sjs7uCvj@*Em9bD|HeKV^h zXkWd7xuRyIEm~~Re~LDoK{IRP%mR7x42P%ekE#;v6;11d$Y*K3AU-< zk<0V)y#nT`lpBJ|QM2!4M&8d4Ab3_1#aiNgUp>L7kqQ~NtQI0VCXP6PJVR|rxsJ>8 zY!YK!MX8-}&9zmw9 zV9nLVqgM0)iUMXP#GUe&zVfo^{`Sj1emPWcx&5)Uz)rM4Ia1?dS)|y6+kB3oRI*)k zyO>I_c>u}u%MwnTp?FeN&6366mYX(9(^Ir%(byX+ke^CaU_CU1+=m88(FRA^oiZYweR&e z#^eZ&>^oof0GGHz1bE&H>HxT2Qj~TgGxQo4GK<{iz>m8RMVAXC=RWPcUiJ#Pta03D zvf0RG>uGxqGa`$dXiQ^8RE0%cBkP+T)f5KKH{Et3Sz1;ig6eD<4X_{SeWPJrXGU?= z4QJ;V+}}I+7WXmVB7zY^-+ZGYjbt+M;U>P$HwR1N<5skV%OZDcV>e{e|ns&;3 zQoMG)=q$fd6h)N523%KdND>n1!nEKJ&=HlgLyr$^!FP$=1Z=`6ol0F+vN@^greFc@ z%MO?JPZ6OjI^G@8p7}s9wC664SJ$nvNl!Ac?~m-b+qJk(KG1l-Ws=Z5zRa*XDp_~2 zP-Hr{=+!lPBtZ2_MAm70BPC04cVlU>PBpYXOm8I?rT~ARaMd`uU~`y8I-O97j#D;Y zv^QX71O#5YiVvf5p0avKyfA8T+=?0-ay$!~#hBu#VazSq=vRxDX1caYBA{Hdj!paz z4^5t+1=nVbD7MrnM+~p~dw@^0yYAJ#Xs;xf6*@1ke&CsLEH-$fc6V9uobfb{K1G&( zZ_8gIP)?$B2?}=oC2)(jjgfc7L_C)QM7Xg&=}nj0z)`M z?5TI}Oybtp96ojkgq>uSuAA}_&4)Ziqv1TVodYs^EFGU_jBD9GRuc9qf>$ssA_gdi z*3jI9K1h2AIs1reHZVF^Mpze_yN{d|0BCqLPE%>i=)PKv_8D9_EvmP0E8t7(Gr7DT z?CcC^P(;O90LcWSF;XwjJq?<3$qYBqs<=^qB>d1j9_-xK%WS0d?`e!f60wPKxkmQj zke)Yw!Vc@3+{6+N++{i#DyYy&EC;@KYQmUK#B9cJJe~ue1`kCxZDBj3DYhG-n5|DP=pP&lX$by#x8?3UO$-3 zE~HuBS3C(r8&LeR8c{|WPBO>^)-Zx;Mi{@__yhL%50K?e=;J}lwxQ^$BquE+yNSMCEQ=X>%^F5P2 zRzUzWGD~I5z-yKcu{rf_7^(4i+!k`5CqUHcY;&w$t>w{V;M63+K44{R3opp1ke6je zBP0}PQXxlSiCed^Zdl*f4d27kVU|j*>R37DDV<`1_lbD=e>yEs!AMlXeq}ksMvk>r zR*T>*YofLHW3jbrV5-2x8btzkxoKlNO7*RcpzA+#Y7(r0o{<|w*T`#59zIr}wUxFQ z0ucJUKL}=K9|G*G@}d02uab=x`m-z(lJakFubq~QEa$-m}@<< zx`bp|&m#?z%aNPZ70Z#g7SB1Hd^=k1AX(ec=z0uzY#uN0WVmN|+X)jBuieucmNRxw zE7joxQ7}$n{BSPmvTPUvfq9N2pPv4&~(qjdp_R zK`?0cqUhVdv-CoPWq)t4Yre88usNIqQh3t^9SV{g;U7+3og==CWJrw(hCe<{J=Sbv zs>`+WctM-;xPa{Gmj)Q_5)xMM^r@dSnDkF7{xi0IjiB}FWgss<2W~^nfb&3b43T_n ztfM8@y(qIaLvZf7|2L9{$C*2XUoP-MRuVUODWFMm>LDctbb>xdC&0_NcMIJkCu#J? z?poTrMV881d8>#eUu4~F9Bcbbn>o1KmijIPqWdoF0PZysvAgGZmk^J_L-neD11UDA>T(BumJG8lS)sv&W2 z0s}F#vaMpDPt3yH-D#VS?er+Dkn>3D}V_#&byc>T1}iBHa7XctfTo^3kfpJ5*@Az$A!hCwO_pN+A7*~_K5 z?Z^R4NUYZXtId6ny6q{sq1BdBXD%_7K`wp3Zt8~cnNSzcRu80)a9Gue!?)bV#v-R!4aQPa6_zVCzh=yUzx) zPIopiZh@*#()!gKTXkxvhPXnYx{3IKGuMFCX<^@LyN_(-B(^yGOm}(`>s+x)`AgmE zu~syn5;KW*jCaYJ=j698U;dOw&7kMEbSTG z52;Ve3n5W!WIU$yoV$^gU66E0`Z61D@nvAeibmdyvaf~A(N(lh9?(C>8~ysP0)EBc on#4_hh1V(gawl$zuK8F(s%!kQ1^%P}RU;l(_=~PtRo`s=7mN-Y*#H0l diff --git a/jscomp/stdlib-406/bytesLabels.resi b/jscomp/stdlib-406/bytesLabels.resi deleted file mode 100644 index 411f939e209..00000000000 --- a/jscomp/stdlib-406/bytesLabels.resi +++ /dev/null @@ -1,269 +0,0 @@ -/* ************************************************************************ */ -/* */ -/* OCaml */ -/* */ -/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1996 Institut National de Recherche en Informatique et */ -/* en Automatique. */ -/* */ -/* All rights reserved. This file is distributed under the terms of */ -/* the GNU Lesser General Public License version 2.1, with the */ -/* special exception on linking described in the file LICENSE. */ -/* */ -/* ************************************************************************ */ - -/*** Byte sequence operations. - @since 4.02.0 -*/ - -/** Return the length (number of bytes) of the argument. */ -external length: bytes => int = "%bytes_length" - -/** [get s n] returns the byte at index [n] in argument [s]. - - Raise [Invalid_argument] if [n] is not a valid index in [s]. */ -external get: (bytes, int) => char = "%bytes_safe_get" - -/** [set s n c] modifies [s] in place, replacing the byte at index [n] - with [c]. - - Raise [Invalid_argument] if [n] is not a valid index in [s]. */ -external set: (bytes, int, char) => unit = "%bytes_safe_set" - -/** [create n] returns a new byte sequence of length [n]. The - sequence is uninitialized and contains arbitrary bytes. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -external create: int => bytes = "?create_bytes" - -/** [make n c] returns a new byte sequence of length [n], filled with - the byte [c]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let make: (int, char) => bytes - -/** [init n f] returns a fresh byte sequence of length [n], - with character [i] initialized to the result of [f i]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let init: (int, ~f: int => char) => bytes - -/** A byte sequence of size 0. */ -let empty: bytes - -/** Return a new byte sequence that contains the same bytes as the - argument. */ -let copy: bytes => bytes - -/** Return a new byte sequence that contains the same bytes as the - given string. */ -let of_string: string => bytes - -/** Return a new string that contains the same bytes as the given byte - sequence. */ -let to_string: bytes => string - -/** [sub s start len] returns a new byte sequence of length [len], - containing the subsequence of [s] that starts at position [start] - and has length [len]. - - Raise [Invalid_argument] if [start] and [len] do not designate a - valid range of [s]. */ -let sub: (bytes, ~pos: int, ~len: int) => bytes - -/** Same as [sub] but return a string instead of a byte sequence. */ -let sub_string: (bytes, ~pos: int, ~len: int) => string - -/** [extend s left right] returns a new byte sequence that contains - the bytes of [s], with [left] uninitialized bytes prepended and - [right] uninitialized bytes appended to it. If [left] or [right] - is negative, then bytes are removed (instead of appended) from - the corresponding side of [s]. - - Raise [Invalid_argument] if the result length is negative or - longer than {!Sys.max_string_length} bytes. - @since 4.05.0 */ -let extend: (bytes, ~left: int, ~right: int) => bytes - -/** [fill s start len c] modifies [s] in place, replacing [len] - characters with [c], starting at [start]. - - Raise [Invalid_argument] if [start] and [len] do not designate a - valid range of [s]. */ -let fill: (bytes, ~pos: int, ~len: int, char) => unit - -/** [blit src srcoff dst dstoff len] copies [len] bytes from sequence - [src], starting at index [srcoff], to sequence [dst], starting at - index [dstoff]. It works correctly even if [src] and [dst] are the - same byte sequence, and the source and destination intervals - overlap. - - Raise [Invalid_argument] if [srcoff] and [len] do not - designate a valid range of [src], or if [dstoff] and [len] - do not designate a valid range of [dst]. */ -let blit: (~src: bytes, ~src_pos: int, ~dst: bytes, ~dst_pos: int, ~len: int) => unit - -/** [blit src srcoff dst dstoff len] copies [len] bytes from string - [src], starting at index [srcoff], to byte sequence [dst], - starting at index [dstoff]. - - Raise [Invalid_argument] if [srcoff] and [len] do not - designate a valid range of [src], or if [dstoff] and [len] - do not designate a valid range of [dst]. - @since 4.05.0 */ -let blit_string: (~src: string, ~src_pos: int, ~dst: bytes, ~dst_pos: int, ~len: int) => unit - -/** [concat sep sl] concatenates the list of byte sequences [sl], - inserting the separator byte sequence [sep] between each, and - returns the result as a new byte sequence. */ -let concat: (~sep: bytes, list) => bytes - -/** [cat s1 s2] concatenates [s1] and [s2] and returns the result - as new byte sequence. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. - @since 4.05.0 */ -let cat: (bytes, bytes) => bytes - -/** [iter f s] applies function [f] in turn to all the bytes of [s]. - It is equivalent to [f (get s 0); f (get s 1); ...; f (get s - (length s - 1)); ()]. */ -let iter: (~f: char => unit, bytes) => unit - -/** Same as {!Bytes.iter}, but the function is applied to the index of - the byte as first argument and the byte itself as second - argument. */ -let iteri: (~f: (int, char) => unit, bytes) => unit - -/** [map f s] applies function [f] in turn to all the bytes of [s] and - stores the resulting bytes in a new sequence that is returned as - the result. */ -let map: (~f: char => char, bytes) => bytes - -/** [mapi f s] calls [f] with each character of [s] and its - index (in increasing index order) and stores the resulting bytes - in a new sequence that is returned as the result. */ -let mapi: (~f: (int, char) => char, bytes) => bytes - -/** Return a copy of the argument, without leading and trailing - whitespace. The bytes regarded as whitespace are the ASCII - characters [' '], ['\x0c'], ['\n'], ['\r'], and ['\t']. */ -let trim: bytes => bytes - -/** Return a copy of the argument, with special characters represented - by escape sequences, following the lexical conventions of OCaml. */ -let escaped: bytes => bytes - -/** [index s c] returns the index of the first occurrence of byte [c] - in [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let index: (bytes, char) => int - -/** [index_opt s c] returns the index of the first occurrence of byte [c] - in [s] or [None] if [c] does not occur in [s]. - @since 4.05 */ -let index_opt: (bytes, char) => option - -/** [rindex s c] returns the index of the last occurrence of byte [c] - in [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let rindex: (bytes, char) => int - -/** [rindex_opt s c] returns the index of the last occurrence of byte [c] - in [s] or [None] if [c] does not occur in [s]. - @since 4.05 */ -let rindex_opt: (bytes, char) => option - -/** [index_from s i c] returns the index of the first occurrence of - byte [c] in [s] after position [i]. [Bytes.index s c] is - equivalent to [Bytes.index_from s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] after position [i]. */ -let index_from: (bytes, int, char) => int - -/** [index_from _opts i c] returns the index of the first occurrence of - byte [c] in [s] after position [i] or [None] if [c] does not occur in [s] after position [i]. - [Bytes.index_opt s c] is equivalent to [Bytes.index_from_opt s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - @since 4.05 */ -let index_from_opt: (bytes, int, char) => option - -/** [rindex_from s i c] returns the index of the last occurrence of - byte [c] in [s] before position [i+1]. [rindex s c] is equivalent - to [rindex_from s (Bytes.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] before position [i+1]. */ -let rindex_from: (bytes, int, char) => int - -/** [rindex_from_opt s i c] returns the index of the last occurrence - of byte [c] in [s] before position [i+1] or [None] if [c] does not - occur in [s] before position [i+1]. [rindex_opt s c] is equivalent to - [rindex_from s (Bytes.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - @since 4.05 */ -let rindex_from_opt: (bytes, int, char) => option - -/** [contains s c] tests if byte [c] appears in [s]. */ -let contains: (bytes, char) => bool - -/** [contains_from s start c] tests if byte [c] appears in [s] after - position [start]. [contains s c] is equivalent to [contains_from - s 0 c]. - - Raise [Invalid_argument] if [start] is not a valid position in [s]. */ -let contains_from: (bytes, int, char) => bool - -/** [rcontains_from s stop c] tests if byte [c] appears in [s] before - position [stop+1]. - - Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid - position in [s]. */ -let rcontains_from: (bytes, int, char) => bool - -/** Return a copy of the argument, with all lowercase letters - translated to uppercase, using the US-ASCII character set. - @since 4.05.0 */ -let uppercase_ascii: bytes => bytes - -/** Return a copy of the argument, with all uppercase letters - translated to lowercase, using the US-ASCII character set. - @since 4.05.0 */ -let lowercase_ascii: bytes => bytes - -/** Return a copy of the argument, with the first character set to uppercase, - using the US-ASCII character set. - @since 4.05.0 */ -let capitalize_ascii: bytes => bytes - -/** Return a copy of the argument, with the first character set to lowercase, - using the US-ASCII character set. - @since 4.05.0 */ -let uncapitalize_ascii: bytes => bytes - -/** An alias for the type of byte sequences. */ -type t = bytes - -/** The comparison function for byte sequences, with the same - specification as {!Pervasives.compare}. Along with the type [t], - this function [compare] allows the module [Bytes] to be passed as - argument to the functors {!Set.Make} and {!Map.Make}. */ -let compare: (t, t) => int - -/** The equality function for byte sequences. - @since 4.05.0 */ -let equal: (t, t) => bool - -/* The following is for system use only. Do not call directly. */ - -external unsafe_get: (bytes, int) => char = "%bytes_unsafe_get" -external unsafe_set: (bytes, int, char) => unit = "%bytes_unsafe_set" -let unsafe_to_string: bytes => string -let unsafe_of_string: string => bytes diff --git a/jscomp/stdlib-406/char.res b/jscomp/stdlib-406/char.res index afc28ae3f11..0eed32caa6c 100644 --- a/jscomp/stdlib-406/char.res +++ b/jscomp/stdlib-406/char.res @@ -25,32 +25,6 @@ let chr = n => unsafe_chr(n) } -external bytes_create: int => bytes = "?create_bytes" -external bytes_unsafe_set: (bytes, int, char) => unit = "%bytes_unsafe_set" -external unsafe_to_string: bytes => string = "%bytes_to_string" - -let escaped = param => - switch param { - | '\'' => "\\'" - | '\\' => "\\\\" - | '\n' => "\\n" - | '\t' => "\\t" - | '\r' => "\\r" - | '\b' => "\\b" - | ' ' .. '~' as c => - let s = bytes_create(1) - bytes_unsafe_set(s, 0, c) - unsafe_to_string(s) - | c => - let n = code(c) - let s = bytes_create(4) - bytes_unsafe_set(s, 0, '\\') - bytes_unsafe_set(s, 1, unsafe_chr(48 + n / 100)) - bytes_unsafe_set(s, 2, unsafe_chr(48 + mod(n / 10, 10))) - bytes_unsafe_set(s, 3, unsafe_chr(48 + mod(n, 10))) - unsafe_to_string(s) - } - let lowercase = c => if (c >= 'A' && c <= 'Z') || ((c >= 'À' && c <= 'Ö') || c >= 'Ø' && c <= 'Þ') { unsafe_chr(code(c) + 32) diff --git a/jscomp/stdlib-406/char.resi b/jscomp/stdlib-406/char.resi index 78e07aa735d..fccaf30769d 100644 --- a/jscomp/stdlib-406/char.resi +++ b/jscomp/stdlib-406/char.resi @@ -23,13 +23,6 @@ external code: char => int = "%identity" outside the range 0--255. */ let chr: int => char -/** Return a string representing the given character, - with special characters escaped following the lexical conventions - of OCaml. - All characters outside the ASCII printable range (32..126) are - escaped, as well as backslash, double-quote, and single-quote. */ -let escaped: char => string - @deprecated("Use Char.lowercase_ascii instead.") /** Convert the given character to its equivalent lowercase character, using the ISO Latin-1 (8859-1) character set. diff --git a/jscomp/stdlib-406/release.ninja b/jscomp/stdlib-406/release.ninja index 27616506c91..da92c4eef18 100644 --- a/jscomp/stdlib-406/release.ninja +++ b/jscomp/stdlib-406/release.ninja @@ -16,10 +16,6 @@ o stdlib-406/array.cmj : cc_cmi stdlib-406/array.res | stdlib-406/array.cmi $bsc o stdlib-406/array.cmi : cc stdlib-406/array.resi | stdlib-406/pervasives.cmj $bsc others o stdlib-406/arrayLabels.cmj : cc_cmi stdlib-406/arrayLabels.res | stdlib-406/arrayLabels.cmi $bsc others o stdlib-406/arrayLabels.cmi : cc stdlib-406/arrayLabels.resi | stdlib-406/pervasives.cmj $bsc others -o stdlib-406/bytes.cmj : cc_cmi stdlib-406/bytes.res | stdlib-406/bytes.cmi stdlib-406/char.cmj $bsc others -o stdlib-406/bytes.cmi : cc stdlib-406/bytes.resi | stdlib-406/pervasives.cmj $bsc others -o stdlib-406/bytesLabels.cmj : cc_cmi stdlib-406/bytesLabels.res | stdlib-406/bytesLabels.cmi stdlib-406/char.cmj $bsc others -o stdlib-406/bytesLabels.cmi : cc stdlib-406/bytesLabels.resi | stdlib-406/pervasives.cmj $bsc others o stdlib-406/callback.cmj : cc_cmi stdlib-406/callback.res | stdlib-406/callback.cmi $bsc others o stdlib-406/callback.cmi : cc stdlib-406/callback.resi | stdlib-406/pervasives.cmj $bsc others o stdlib-406/camlinternalLazy.cmj : cc_cmi stdlib-406/camlinternalLazy.res | stdlib-406/camlinternalLazy.cmi $bsc others @@ -56,12 +52,8 @@ o stdlib-406/sort.cmj : cc_cmi stdlib-406/sort.res | stdlib-406/array.cmj stdlib o stdlib-406/sort.cmi : cc stdlib-406/sort.resi | stdlib-406/pervasives.cmj $bsc others o stdlib-406/stack.cmj : cc_cmi stdlib-406/stack.res | stdlib-406/list.cmj stdlib-406/stack.cmi $bsc others o stdlib-406/stack.cmi : cc stdlib-406/stack.resi | stdlib-406/pervasives.cmj $bsc others -o stdlib-406/stdLabels.cmj : cc_cmi stdlib-406/stdLabels.res | stdlib-406/arrayLabels.cmj stdlib-406/bytesLabels.cmj stdlib-406/listLabels.cmj stdlib-406/stdLabels.cmi stdlib-406/stringLabels.cmj $bsc others -o stdlib-406/stdLabels.cmi : cc stdlib-406/stdLabels.resi | stdlib-406/arrayLabels.cmi stdlib-406/bytesLabels.cmi stdlib-406/listLabels.cmi stdlib-406/pervasives.cmj stdlib-406/stringLabels.cmi $bsc others -o stdlib-406/stream.cmj : cc_cmi stdlib-406/stream.res | stdlib-406/bytes.cmj stdlib-406/lazy.cmj stdlib-406/list.cmj stdlib-406/stream.cmi stdlib-406/string.cmj $bsc others -o stdlib-406/stream.cmi : cc stdlib-406/stream.resi | stdlib-406/pervasives.cmj $bsc others -o stdlib-406/string.cmj : cc_cmi stdlib-406/string.res | stdlib-406/array.cmj stdlib-406/bytes.cmj stdlib-406/string.cmi $bsc others +o stdlib-406/stdLabels.cmj : cc_cmi stdlib-406/stdLabels.res | stdlib-406/arrayLabels.cmj stdlib-406/listLabels.cmj stdlib-406/stdLabels.cmi $bsc others +o stdlib-406/stdLabels.cmi : cc stdlib-406/stdLabels.resi | stdlib-406/arrayLabels.cmi stdlib-406/listLabels.cmi stdlib-406/pervasives.cmj $bsc others +o stdlib-406/string.cmj : cc_cmi stdlib-406/string.res | stdlib-406/string.cmi $bsc others o stdlib-406/string.cmi : cc stdlib-406/string.resi | stdlib-406/pervasives.cmj $bsc others -o stdlib-406/stringLabels.cmj : cc_cmi stdlib-406/stringLabels.res | stdlib-406/array.cmj stdlib-406/bytes.cmj stdlib-406/stringLabels.cmi $bsc others -o stdlib-406/stringLabels.cmi : cc stdlib-406/stringLabels.resi | stdlib-406/pervasives.cmj $bsc others -o $stdlib : phony stdlib-406/array.cmi stdlib-406/array.cmj stdlib-406/arrayLabels.cmi stdlib-406/arrayLabels.cmj stdlib-406/bytes.cmi stdlib-406/bytes.cmj stdlib-406/bytesLabels.cmi stdlib-406/bytesLabels.cmj stdlib-406/callback.cmi stdlib-406/callback.cmj stdlib-406/camlinternalLazy.cmi stdlib-406/camlinternalLazy.cmj stdlib-406/camlinternalMod.cmi stdlib-406/camlinternalMod.cmj stdlib-406/char.cmi stdlib-406/char.cmj stdlib-406/complex.cmi stdlib-406/complex.cmj stdlib-406/hashtbl.cmi stdlib-406/hashtbl.cmj stdlib-406/int32.cmi stdlib-406/int32.cmj stdlib-406/int64.cmi stdlib-406/int64.cmj stdlib-406/lazy.cmi stdlib-406/lazy.cmj stdlib-406/list.cmi stdlib-406/list.cmj stdlib-406/listLabels.cmi stdlib-406/listLabels.cmj stdlib-406/map.cmi stdlib-406/map.cmj stdlib-406/mapLabels.cmi stdlib-406/mapLabels.cmj stdlib-406/obj.cmi stdlib-406/obj.cmj stdlib-406/queue.cmi stdlib-406/queue.cmj stdlib-406/set.cmi stdlib-406/set.cmj stdlib-406/setLabels.cmi stdlib-406/setLabels.cmj stdlib-406/sort.cmi stdlib-406/sort.cmj stdlib-406/stack.cmi stdlib-406/stack.cmj stdlib-406/stdLabels.cmi stdlib-406/stdLabels.cmj stdlib-406/stream.cmi stdlib-406/stream.cmj stdlib-406/string.cmi stdlib-406/string.cmj stdlib-406/stringLabels.cmi stdlib-406/stringLabels.cmj +o $stdlib : phony stdlib-406/array.cmi stdlib-406/array.cmj stdlib-406/arrayLabels.cmi stdlib-406/arrayLabels.cmj stdlib-406/callback.cmi stdlib-406/callback.cmj stdlib-406/camlinternalLazy.cmi stdlib-406/camlinternalLazy.cmj stdlib-406/camlinternalMod.cmi stdlib-406/camlinternalMod.cmj stdlib-406/char.cmi stdlib-406/char.cmj stdlib-406/complex.cmi stdlib-406/complex.cmj stdlib-406/hashtbl.cmi stdlib-406/hashtbl.cmj stdlib-406/int32.cmi stdlib-406/int32.cmj stdlib-406/int64.cmi stdlib-406/int64.cmj stdlib-406/lazy.cmi stdlib-406/lazy.cmj stdlib-406/list.cmi stdlib-406/list.cmj stdlib-406/listLabels.cmi stdlib-406/listLabels.cmj stdlib-406/map.cmi stdlib-406/map.cmj stdlib-406/mapLabels.cmi stdlib-406/mapLabels.cmj stdlib-406/obj.cmi stdlib-406/obj.cmj stdlib-406/queue.cmi stdlib-406/queue.cmj stdlib-406/set.cmi stdlib-406/set.cmj stdlib-406/setLabels.cmi stdlib-406/setLabels.cmj stdlib-406/sort.cmi stdlib-406/sort.cmj stdlib-406/stack.cmi stdlib-406/stack.cmj stdlib-406/stdLabels.cmi stdlib-406/stdLabels.cmj stdlib-406/string.cmi stdlib-406/string.cmj diff --git a/jscomp/stdlib-406/stdLabels.res b/jscomp/stdlib-406/stdLabels.res index 8e35db9f808..e82101734fb 100644 --- a/jscomp/stdlib-406/stdLabels.res +++ b/jscomp/stdlib-406/stdLabels.res @@ -18,7 +18,3 @@ module Array = ArrayLabels module List = ListLabels - -module String = StringLabels - -module Bytes = BytesLabels diff --git a/jscomp/stdlib-406/stdLabels.resi b/jscomp/stdlib-406/stdLabels.resi index a36e9d33a3a..832b9dd3362 100644 --- a/jscomp/stdlib-406/stdLabels.resi +++ b/jscomp/stdlib-406/stdLabels.resi @@ -15,15 +15,11 @@ /*** Standard labeled libraries. - This meta-module provides labelized version of the {!Array}, - {!Bytes}, {!List} and {!String} modules. + This meta-module provides labelized version of the {!Array} and {!List} modules. They only differ by their labels. Detailed interfaces can be found - in [arrayLabels.mli], [bytesLabels.mli], [listLabels.mli] - and [stringLabels.mli]. + in [arrayLabels.mli] and [listLabels.mli]. */ module Array = ArrayLabels -module Bytes = BytesLabels module List = ListLabels -module String = StringLabels diff --git a/jscomp/stdlib-406/stream.res b/jscomp/stdlib-406/stream.res deleted file mode 100644 index b2615b996e6..00000000000 --- a/jscomp/stdlib-406/stream.res +++ /dev/null @@ -1,227 +0,0 @@ -/* ************************************************************************ */ -/* */ -/* OCaml */ -/* */ -/* Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1997 Institut National de Recherche en Informatique et */ -/* en Automatique. */ -/* */ -/* All rights reserved. This file is distributed under the terms of */ -/* the GNU Lesser General Public License version 2.1, with the */ -/* special exception on linking described in the file LICENSE. */ -/* */ -/* ************************************************************************ */ - -type rec t<'a> = option> -and cell<'a> = {mutable count: int, mutable data: data<'a>} -and data<'a> = - | Sempty - | Scons('a, data<'a>) - | Sapp(data<'a>, data<'a>) - | Slazy(Lazy.t>) - | Sgen(gen<'a>) -and gen<'a> = {mutable curr: option>, func: int => option<'a>} - -exception Failure -exception Error(string) - -let count = param => - switch param { - | None => 0 - | Some({count}) => count - } -let data = param => - switch param { - | None => Sempty - | Some({data}) => data - } - -let rec get_data: - type v. (int, data) => data = - (count, d) => - switch d { - /* Returns either Sempty or Scons(a, _) even when d is a generator - or a buffer. In those cases, the item a is seen as extracted from - the generator/buffer. - The count parameter is used for calling `Sgen-functions'. */ - | Sempty | Scons(_, _) => d - | Sapp(d1, d2) => - switch get_data(count, d1) { - | Scons(a, d11) => Scons(a, Sapp(d11, d2)) - | Sempty => get_data(count, d2) - | _ => assert(false) - } - | Sgen({curr: Some(None)}) => Sempty - | Sgen({curr: Some(Some(a))} as g) => - g.curr = None - Scons(a, d) - | Sgen(g) => - switch g.func(count) { - | None => - g.curr = Some(None) - Sempty - | Some(a) => Scons(a, d) - /* Warning: anyone using g thinks that an item has been read */ - } - | Slazy(f) => get_data(count, Lazy.force(f)) - } - -let rec peek_data: - type v. cell => option = - s => - /* consult the first item of s */ - switch s.data { - | Sempty => None - | Scons(a, _) => Some(a) - | Sapp(_, _) => - switch get_data(s.count, s.data) { - | Scons(a, _) as d => - s.data = d - Some(a) - | Sempty => None - | _ => assert(false) - } - | Slazy(f) => - s.data = Lazy.force(f) - peek_data(s) - | Sgen({curr: Some(a)}) => a - | Sgen(g) => - let x = g.func(s.count) - g.curr = Some(x) - x - } - -let peek = param => - switch param { - | None => None - | Some(s) => peek_data(s) - } - -let rec junk_data: - type v. cell => unit = - s => - switch s.data { - | Scons(_, d) => - s.count = succ(s.count) - s.data = d - | Sgen({curr: Some(_)} as g) => - s.count = succ(s.count) - g.curr = None - | _ => - switch peek_data(s) { - | None => () - | Some(_) => junk_data(s) - } - } - -let junk = param => - switch param { - | None => () - | Some(data) => junk_data(data) - } - -let rec nget_data = (n, s) => - if n <= 0 { - (list{}, s.data, 0) - } else { - switch peek_data(s) { - | Some(a) => - junk_data(s) - let (al, d, k) = nget_data(pred(n), s) - (list{a, ...al}, Scons(a, d), succ(k)) - | None => (list{}, s.data, 0) - } - } - -let npeek_data = (n, s) => { - let (al, d, len) = nget_data(n, s) - s.count = s.count - len - s.data = d - al -} - -let npeek = (n, param) => - switch param { - | None => list{} - | Some(d) => npeek_data(n, d) - } - -let next = s => - switch peek(s) { - | Some(a) => - junk(s) - a - | None => raise(Failure) - } - -let empty = s => - switch peek(s) { - | Some(_) => raise(Failure) - | None => () - } - -let iter = (f, strm) => { - let rec do_rec = () => - switch peek(strm) { - | Some(a) => - junk(strm) - ignore(f(a)) - do_rec() - | None => () - } - - do_rec() -} - -/* Stream building functions */ - -let from = f => Some({count: 0, data: Sgen({curr: None, func: f})}) - -let of_list = l => Some({count: 0, data: List.fold_right((x, l) => Scons(x, l), l, Sempty)}) - -let of_string = s => { - let count = ref(0) - from(_ => { - /* We cannot use the index passed by the [from] function directly - because it returns the current stream count, with absolutely no - guarantee that it will start from 0. For example, in the case - of [Stream.icons 'c' (Stream.from_string "ab")], the first - access to the string will be made with count [1] already. - */ - let c = count.contents - if c < String.length(s) { - incr(count) - Some(String.get(s, c)) - } else { - None - } - }) -} - -let of_bytes = s => { - let count = ref(0) - from(_ => { - let c = count.contents - if c < Bytes.length(s) { - incr(count) - Some(Bytes.get(s, c)) - } else { - None - } - }) -} - -/* Stream expressions builders */ - -let iapp = (i, s) => Some({count: 0, data: Sapp(data(i), data(s))}) -let icons = (i, s) => Some({count: 0, data: Scons(i, data(s))}) -let ising = i => Some({count: 0, data: Scons(i, Sempty)}) - -let lapp = (f, s) => Some({count: 0, data: Slazy(Lazy.from_fun(() => Sapp(data(f()), data(s))))}) - -let lcons = (f, s) => Some({count: 0, data: Slazy(Lazy.from_fun(() => Scons(f(), data(s))))}) -let lsing = f => Some({count: 0, data: Slazy(Lazy.from_fun(() => Scons(f(), Sempty)))}) - -let sempty = None -let slazy = f => Some({count: 0, data: Slazy(Lazy.from_fun(() => data(f())))}) diff --git a/jscomp/stdlib-406/stream.resi b/jscomp/stdlib-406/stream.resi deleted file mode 100644 index 9f76f3efbe6..00000000000 --- a/jscomp/stdlib-406/stream.resi +++ /dev/null @@ -1,99 +0,0 @@ -/* ************************************************************************ */ -/* */ -/* OCaml */ -/* */ -/* Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1997 Institut National de Recherche en Informatique et */ -/* en Automatique. */ -/* */ -/* All rights reserved. This file is distributed under the terms of */ -/* the GNU Lesser General Public License version 2.1, with the */ -/* special exception on linking described in the file LICENSE. */ -/* */ -/* ************************************************************************ */ - -/*** Streams and parsers. */ - -/** The type of streams holding values of type ['a]. */ -type t<'a> - -/** Raised by parsers when none of the first components of the stream - patterns is accepted. */ -exception Failure - -/** Raised by parsers when the first component of a stream pattern is - accepted, but one of the following components is rejected. */ -exception Error(string) - -/*** {1 Stream builders} */ - -/** [Stream.from f] returns a stream built from the function [f]. - To create a new stream element, the function [f] is called with - the current stream count. The user function [f] must return either - [Some ] for a value or [None] to specify the end of the - stream. - - Do note that the indices passed to [f] may not start at [0] in the - general case. For example, [[< '0; '1; Stream.from f >]] would call - [f] the first time with count [2]. -*/ -let from: (int => option<'a>) => t<'a> - -/** Return the stream holding the elements of the list in the same - order. */ -let of_list: list<'a> => t<'a> - -/** Return the stream of the characters of the string parameter. */ -let of_string: string => t - -/** Return the stream of the characters of the bytes parameter. - @since 4.02.0 */ -let of_bytes: bytes => t - -/* {1 Stream iterator} */ - -/** [Stream.iter f s] scans the whole stream s, applying function [f] - in turn to each stream element encountered. */ -let iter: ('a => unit, t<'a>) => unit - -/* {1 Predefined parsers} */ - -/** Return the first element of the stream and remove it from the - stream. Raise {!Stream.Failure} if the stream is empty. */ -let next: t<'a> => 'a - -/** Return [()] if the stream is empty, else raise {!Stream.Failure}. */ -let empty: t<'a> => unit - -/* {1 Useful functions} */ - -/** Return [Some] of "the first element" of the stream, or [None] if - the stream is empty. */ -let peek: t<'a> => option<'a> - -/** Remove the first element of the stream, possibly unfreezing - it before. */ -let junk: t<'a> => unit - -/** Return the current count of the stream elements, i.e. the number - of the stream elements discarded. */ -let count: t<'a> => int - -/** [npeek n] returns the list of the [n] first elements of - the stream, or all its remaining elements if less than [n] - elements are available. */ -let npeek: (int, t<'a>) => list<'a> - -/* The following is for system use only. Do not call directly. */ - -let iapp: (t<'a>, t<'a>) => t<'a> -let icons: ('a, t<'a>) => t<'a> -let ising: 'a => t<'a> - -let lapp: (unit => t<'a>, t<'a>) => t<'a> -let lcons: (unit => 'a, t<'a>) => t<'a> -let lsing: (unit => 'a) => t<'a> - -let sempty: t<'a> -let slazy: (unit => t<'a>) => t<'a> diff --git a/jscomp/stdlib-406/string.res b/jscomp/stdlib-406/string.res index a038bfdaf8f..8b4dec814a5 100644 --- a/jscomp/stdlib-406/string.res +++ b/jscomp/stdlib-406/string.res @@ -25,211 +25,7 @@ external length: string => int = "%string_length" external get: (string, int) => char = "%string_safe_get" external unsafe_get: (string, int) => char = "%string_unsafe_get" -module B = Bytes - -let bts = B.unsafe_to_string -let bos = B.unsafe_of_string - -external make: (int, char) => string = "?string_repeat" - -let init = (n, f) => bts(B.init(n, f)) -let sub = (s, ofs, len) => bts(B.sub(bos(s), ofs, len)) -let blit = B.blit_string - -%%private(@send external join: (array, string) => string = "join") - -let concat = (sep: string, xs: list) => xs->Array.of_list->join(sep) - -/* duplicated in bytes.ml */ -let iter = (f, s) => - for i in 0 to length(s) - 1 { - f(unsafe_get(s, i)) - } - -/* duplicated in bytes.ml */ -let iteri = (f, s) => - for i in 0 to length(s) - 1 { - f(i, unsafe_get(s, i)) - } - -let map = (f, s) => bts(B.map(f, bos(s))) -let mapi = (f, s) => bts(B.mapi(f, bos(s))) - -/* Beware: we cannot use B.trim or B.escape because they always make a - copy, but String.mli spells out some cases where we are not allowed - to make a copy. */ - -let is_space = param => - switch param { - | ' ' | ' ' | '\n' | '\r' | '\t' => true - | _ => false - } - -let trim = s => - if s == "" { - s - } else if is_space(unsafe_get(s, 0)) || is_space(unsafe_get(s, length(s) - 1)) { - bts(B.trim(bos(s))) - } else { - s - } - -let escaped = s => { - let rec needs_escape = i => - if i >= length(s) { - false - } else { - switch unsafe_get(s, i) { - | '"' | '\\' | '\n' | '\t' | '\r' | '\b' => true - | ' ' .. '~' => needs_escape(i + 1) - | _ => true - } - } - - if needs_escape(0) { - bts(B.escaped(bos(s))) - } else { - s - } -} - -/* duplicated in bytes.ml */ -let rec index_rec = (s, lim, i, c) => - if i >= lim { - raise(Not_found) - } else if unsafe_get(s, i) == c { - i - } else { - index_rec(s, lim, i + 1, c) - } - -/* duplicated in bytes.ml */ -let index = (s, c) => index_rec(s, length(s), 0, c) - -/* duplicated in bytes.ml */ -let rec index_rec_opt = (s, lim, i, c) => - if i >= lim { - None - } else if unsafe_get(s, i) == c { - Some(i) - } else { - index_rec_opt(s, lim, i + 1, c) - } - -/* duplicated in bytes.ml */ -let index_opt = (s, c) => index_rec_opt(s, length(s), 0, c) - -/* duplicated in bytes.ml */ -let index_from = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.index_from / Bytes.index_from") - } else { - index_rec(s, l, i, c) - } -} - -/* duplicated in bytes.ml */ -let index_from_opt = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.index_from_opt / Bytes.index_from_opt") - } else { - index_rec_opt(s, l, i, c) - } -} - -/* duplicated in bytes.ml */ -let rec rindex_rec = (s, i, c) => - if i < 0 { - raise(Not_found) - } else if unsafe_get(s, i) == c { - i - } else { - rindex_rec(s, i - 1, c) - } - -/* duplicated in bytes.ml */ -let rindex = (s, c) => rindex_rec(s, length(s) - 1, c) - -/* duplicated in bytes.ml */ -let rindex_from = (s, i, c) => - if i < -1 || i >= length(s) { - invalid_arg("String.rindex_from / Bytes.rindex_from") - } else { - rindex_rec(s, i, c) - } - -/* duplicated in bytes.ml */ -let rec rindex_rec_opt = (s, i, c) => - if i < 0 { - None - } else if unsafe_get(s, i) == c { - Some(i) - } else { - rindex_rec_opt(s, i - 1, c) - } - -/* duplicated in bytes.ml */ -let rindex_opt = (s, c) => rindex_rec_opt(s, length(s) - 1, c) - -/* duplicated in bytes.ml */ -let rindex_from_opt = (s, i, c) => - if i < -1 || i >= length(s) { - invalid_arg("String.rindex_from_opt / Bytes.rindex_from_opt") - } else { - rindex_rec_opt(s, i, c) - } - -/* duplicated in bytes.ml */ -let contains_from = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.contains_from / Bytes.contains_from") - } else { - try { - ignore(index_rec(s, l, i, c)) - true - } catch { - | Not_found => false - } - } -} - -/* duplicated in bytes.ml */ -let contains = (s, c) => contains_from(s, 0, c) - -/* duplicated in bytes.ml */ -let rcontains_from = (s, i, c) => - if i < 0 || i >= length(s) { - invalid_arg("String.rcontains_from / Bytes.rcontains_from") - } else { - try { - ignore(rindex_rec(s, i, c)) - true - } catch { - | Not_found => false - } - } - -let uppercase_ascii = s => bts(B.uppercase_ascii(bos(s))) -let lowercase_ascii = s => bts(B.lowercase_ascii(bos(s))) -let capitalize_ascii = s => bts(B.capitalize_ascii(bos(s))) -let uncapitalize_ascii = s => bts(B.uncapitalize_ascii(bos(s))) - type t = string let compare = (x: t, y: t) => Pervasives.compare(x, y) let equal: (string, string) => bool = (a, b) => a == b - -let split_on_char = (sep, s) => { - let r = ref(list{}) - let j = ref(length(s)) - for i in length(s) - 1 downto 0 { - if unsafe_get(s, i) == sep { - r := list{sub(s, i + 1, j.contents - i - 1), ...r.contents} - j := i - } - } - list{sub(s, 0, j.contents), ...r.contents} -} diff --git a/jscomp/stdlib-406/string.resi b/jscomp/stdlib-406/string.resi index 319e089ae4b..8f0a69c7841 100644 --- a/jscomp/stdlib-406/string.resi +++ b/jscomp/stdlib-406/string.resi @@ -13,40 +13,6 @@ /* */ /* ************************************************************************ */ -/*** String operations. - - A string is an immutable data structure that contains a - fixed-length sequence of (single-byte) characters. Each character - can be accessed in constant time through its index. - - Given a string [s] of length [l], we can access each of the [l] - characters of [s] via its index in the sequence. Indexes start at - [0], and we will call an index valid in [s] if it falls within the - range [[0...l-1]] (inclusive). A position is the point between two - characters or at the beginning or end of the string. We call a - position valid in [s] if it falls within the range [[0...l]] - (inclusive). Note that the character at index [n] is between - positions [n] and [n+1]. - - Two parameters [start] and [len] are said to designate a valid - substring of [s] if [len >= 0] and [start] and [start+len] are - valid positions in [s]. - - OCaml strings used to be modifiable in place, for instance via the - {!String.set} and {!String.blit} functions described below. This - usage is deprecated and only possible when the compiler is put in - "unsafe-string" mode by giving the [-unsafe-string] command-line - option (which is currently the default for reasons of backward - compatibility). This is done by making the types [string] and - [bytes] (see module {!Bytes}) interchangeable so that functions - expecting byte sequences can also accept strings as arguments and - modify them. - - All new code should avoid this feature and be compiled with the - [-safe-string] command-line option to enforce the separation between - the types [string] and [bytes]. -*/ - /** Return the length (number of characters) of the given string. */ external length: string => int = "%string_length" @@ -56,192 +22,6 @@ external length: string => int = "%string_length" Raise [Invalid_argument] if [n] not a valid index in [s]. */ external get: (string, int) => char = "%string_safe_get" -/** [String.make n c] returns a fresh string of length [n], - filled with the character [c]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let make: (int, char) => string - -/** [String.init n f] returns a string of length [n], with character - [i] initialized to the result of [f i] (called in increasing - index order). - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. - - @since 4.02.0 -*/ -let init: (int, int => char) => string - -/** [String.sub s start len] returns a fresh string of length [len], - containing the substring of [s] that starts at position [start] and - has length [len]. - - Raise [Invalid_argument] if [start] and [len] do not - designate a valid substring of [s]. */ -let sub: (string, int, int) => string - -/** Same as {!Bytes.blit_string}. */ -let blit: (string, int, bytes, int, int) => unit - -/** [String.concat sep sl] concatenates the list of strings [sl], - inserting the separator string [sep] between each. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. */ -let concat: (string, list) => string - -/** [String.iter f s] applies function [f] in turn to all - the characters of [s]. It is equivalent to - [f s.[0]; f s.[1]; ...; f s.[String.length s - 1]; ()]. */ -let iter: (char => unit, string) => unit - -/** Same as {!String.iter}, but the - function is applied to the index of the element as first argument - (counting from 0), and the character itself as second argument. - @since 4.00.0 */ -let iteri: ((int, char) => unit, string) => unit - -/** [String.map f s] applies function [f] in turn to all the - characters of [s] (in increasing index order) and stores the - results in a new string that is returned. - @since 4.00.0 */ -let map: (char => char, string) => string - -/** [String.mapi f s] calls [f] with each character of [s] and its - index (in increasing index order) and stores the results in a new - string that is returned. - @since 4.02.0 */ -let mapi: ((int, char) => char, string) => string - -/** Return a copy of the argument, without leading and trailing - whitespace. The characters regarded as whitespace are: [' '], - ['\x0c'], ['\n'], ['\r'], and ['\t']. If there is neither leading nor - trailing whitespace character in the argument, return the original - string itself, not a copy. - @since 4.00.0 */ -let trim: string => string - -/** Return a copy of the argument, with special characters - represented by escape sequences, following the lexical - conventions of OCaml. - All characters outside the ASCII printable range (32..126) are - escaped, as well as backslash and double-quote. - - If there is no special character in the argument that needs - escaping, return the original string itself, not a copy. - - Raise [Invalid_argument] if the result is longer than - {!Sys.max_string_length} bytes. - - The function {!Scanf.unescaped} is a left inverse of [escaped], - i.e. [Scanf.unescaped (escaped s) = s] for any string [s] (unless - [escape s] fails). */ -let escaped: string => string - -/** [String.index s c] returns the index of the first - occurrence of character [c] in string [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let index: (string, char) => int - -/** [String.index_opt s c] returns the index of the first - occurrence of character [c] in string [s], or - [None] if [c] does not occur in [s]. - @since 4.05 */ -let index_opt: (string, char) => option - -/** [String.rindex s c] returns the index of the last - occurrence of character [c] in string [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let rindex: (string, char) => int - -/** [String.rindex_opt s c] returns the index of the last occurrence - of character [c] in string [s], or [None] if [c] does not occur in - [s]. - @since 4.05 */ -let rindex_opt: (string, char) => option - -/** [String.index_from s i c] returns the index of the - first occurrence of character [c] in string [s] after position [i]. - [String.index s c] is equivalent to [String.index_from s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] after position [i]. */ -let index_from: (string, int, char) => int - -/** [String.index_from_opt s i c] returns the index of the - first occurrence of character [c] in string [s] after position [i] - or [None] if [c] does not occur in [s] after position [i]. - - [String.index_opt s c] is equivalent to [String.index_from_opt s 0 c]. - Raise [Invalid_argument] if [i] is not a valid position in [s]. - - @since 4.05 -*/ -let index_from_opt: (string, int, char) => option - -/** [String.rindex_from s i c] returns the index of the - last occurrence of character [c] in string [s] before position [i+1]. - [String.rindex s c] is equivalent to - [String.rindex_from s (String.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] before position [i+1]. */ -let rindex_from: (string, int, char) => int - -/** [String.rindex_from_opt s i c] returns the index of the - last occurrence of character [c] in string [s] before position [i+1] - or [None] if [c] does not occur in [s] before position [i+1]. - - [String.rindex_opt s c] is equivalent to - [String.rindex_from_opt s (String.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - - @since 4.05 -*/ -let rindex_from_opt: (string, int, char) => option - -/** [String.contains s c] tests if character [c] - appears in the string [s]. */ -let contains: (string, char) => bool - -/** [String.contains_from s start c] tests if character [c] - appears in [s] after position [start]. - [String.contains s c] is equivalent to - [String.contains_from s 0 c]. - - Raise [Invalid_argument] if [start] is not a valid position in [s]. */ -let contains_from: (string, int, char) => bool - -/** [String.rcontains_from s stop c] tests if character [c] - appears in [s] before position [stop+1]. - - Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid - position in [s]. */ -let rcontains_from: (string, int, char) => bool - -/** Return a copy of the argument, with all lowercase letters - translated to uppercase, using the US-ASCII character set. - @since 4.03.0 */ -let uppercase_ascii: string => string - -/** Return a copy of the argument, with all uppercase letters - translated to lowercase, using the US-ASCII character set. - @since 4.03.0 */ -let lowercase_ascii: string => string - -/** Return a copy of the argument, with the first character set to uppercase, - using the US-ASCII character set. - @since 4.03.0 */ -let capitalize_ascii: string => string - -/** Return a copy of the argument, with the first character set to lowercase, - using the US-ASCII character set. - @since 4.03.0 */ -let uncapitalize_ascii: string => string - /** An alias for the type of strings. */ type t = string @@ -255,21 +35,6 @@ let compare: (t, t) => int @since 4.03.0 */ let equal: (t, t) => bool -/** [String.split_on_char sep s] returns the list of all (possibly empty) - substrings of [s] that are delimited by the [sep] character. - - The function's output is specified by the following invariants: - - - The list is not empty. - - Concatenating its elements using [sep] as a separator returns a - string equal to the input ([String.concat (String.make 1 sep) - (String.split_on_char sep s) = s]). - - No string in the result contains the [sep] character. - - @since 4.04.0 -*/ -let split_on_char: (char, string) => list - /* The following is for system use only. Do not call directly. */ external unsafe_get: (string, int) => char = "%string_unsafe_get" diff --git a/jscomp/stdlib-406/stringLabels.res b/jscomp/stdlib-406/stringLabels.res deleted file mode 100644 index a9ea486d14e..00000000000 --- a/jscomp/stdlib-406/stringLabels.res +++ /dev/null @@ -1,235 +0,0 @@ -/* ************************************************************************ */ -/* */ -/* OCaml */ -/* */ -/* Damien Doligez, projet Gallium, INRIA Rocquencourt */ -/* */ -/* Copyright 2014 Institut National de Recherche en Informatique et */ -/* en Automatique. */ -/* */ -/* All rights reserved. This file is distributed under the terms of */ -/* the GNU Lesser General Public License version 2.1, with the */ -/* special exception on linking described in the file LICENSE. */ -/* */ -/* ************************************************************************ */ - -/* String operations, based on byte sequence operations */ - -/* WARNING: Some functions in this file are duplicated in bytes.ml for - efficiency reasons. When you modify the one in this file you need to - modify its duplicate in bytes.ml. - These functions have a "duplicated" comment above their definition. -*/ - -external length: string => int = "%string_length" -external get: (string, int) => char = "%string_safe_get" -external unsafe_get: (string, int) => char = "%string_unsafe_get" - -module B = Bytes - -let bts = B.unsafe_to_string -let bos = B.unsafe_of_string - -external make: (int, char) => string = "?string_repeat" - -let init = (n, ~f) => bts(B.init(n, f)) -let sub = (s, ~pos as ofs, ~len) => bts(B.sub(bos(s), ofs, len)) -let blit = (~src, ~src_pos, ~dst, ~dst_pos, ~len) => B.blit_string(src, src_pos, dst, dst_pos, len) - -%%private(@send external join: (array, string) => string = "join") - -let concat = (~sep: string, xs: list) => xs->Array.of_list->join(sep) - -/* duplicated in bytes.ml */ -let iter = (~f, s) => - for i in 0 to length(s) - 1 { - f(unsafe_get(s, i)) - } - -/* duplicated in bytes.ml */ -let iteri = (~f, s) => - for i in 0 to length(s) - 1 { - f(i, unsafe_get(s, i)) - } - -let map = (~f, s) => bts(B.map(f, bos(s))) -let mapi = (~f, s) => bts(B.mapi(f, bos(s))) - -/* Beware: we cannot use B.trim or B.escape because they always make a - copy, but String.mli spells out some cases where we are not allowed - to make a copy. */ - -let is_space = param => - switch param { - | ' ' | ' ' | '\n' | '\r' | '\t' => true - | _ => false - } - -let trim = s => - if s == "" { - s - } else if is_space(unsafe_get(s, 0)) || is_space(unsafe_get(s, length(s) - 1)) { - bts(B.trim(bos(s))) - } else { - s - } - -let escaped = s => { - let rec needs_escape = i => - if i >= length(s) { - false - } else { - switch unsafe_get(s, i) { - | '"' | '\\' | '\n' | '\t' | '\r' | '\b' => true - | ' ' .. '~' => needs_escape(i + 1) - | _ => true - } - } - - if needs_escape(0) { - bts(B.escaped(bos(s))) - } else { - s - } -} - -/* duplicated in bytes.ml */ -let rec index_rec = (s, lim, i, c) => - if i >= lim { - raise(Not_found) - } else if unsafe_get(s, i) == c { - i - } else { - index_rec(s, lim, i + 1, c) - } - -/* duplicated in bytes.ml */ -let index = (s, c) => index_rec(s, length(s), 0, c) - -/* duplicated in bytes.ml */ -let rec index_rec_opt = (s, lim, i, c) => - if i >= lim { - None - } else if unsafe_get(s, i) == c { - Some(i) - } else { - index_rec_opt(s, lim, i + 1, c) - } - -/* duplicated in bytes.ml */ -let index_opt = (s, c) => index_rec_opt(s, length(s), 0, c) - -/* duplicated in bytes.ml */ -let index_from = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.index_from / Bytes.index_from") - } else { - index_rec(s, l, i, c) - } -} - -/* duplicated in bytes.ml */ -let index_from_opt = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.index_from_opt / Bytes.index_from_opt") - } else { - index_rec_opt(s, l, i, c) - } -} - -/* duplicated in bytes.ml */ -let rec rindex_rec = (s, i, c) => - if i < 0 { - raise(Not_found) - } else if unsafe_get(s, i) == c { - i - } else { - rindex_rec(s, i - 1, c) - } - -/* duplicated in bytes.ml */ -let rindex = (s, c) => rindex_rec(s, length(s) - 1, c) - -/* duplicated in bytes.ml */ -let rindex_from = (s, i, c) => - if i < -1 || i >= length(s) { - invalid_arg("String.rindex_from / Bytes.rindex_from") - } else { - rindex_rec(s, i, c) - } - -/* duplicated in bytes.ml */ -let rec rindex_rec_opt = (s, i, c) => - if i < 0 { - None - } else if unsafe_get(s, i) == c { - Some(i) - } else { - rindex_rec_opt(s, i - 1, c) - } - -/* duplicated in bytes.ml */ -let rindex_opt = (s, c) => rindex_rec_opt(s, length(s) - 1, c) - -/* duplicated in bytes.ml */ -let rindex_from_opt = (s, i, c) => - if i < -1 || i >= length(s) { - invalid_arg("String.rindex_from_opt / Bytes.rindex_from_opt") - } else { - rindex_rec_opt(s, i, c) - } - -/* duplicated in bytes.ml */ -let contains_from = (s, i, c) => { - let l = length(s) - if i < 0 || i > l { - invalid_arg("String.contains_from / Bytes.contains_from") - } else { - try { - ignore(index_rec(s, l, i, c)) - true - } catch { - | Not_found => false - } - } -} - -/* duplicated in bytes.ml */ -let contains = (s, c) => contains_from(s, 0, c) - -/* duplicated in bytes.ml */ -let rcontains_from = (s, i, c) => - if i < 0 || i >= length(s) { - invalid_arg("String.rcontains_from / Bytes.rcontains_from") - } else { - try { - ignore(rindex_rec(s, i, c)) - true - } catch { - | Not_found => false - } - } - -let uppercase_ascii = s => bts(B.uppercase_ascii(bos(s))) -let lowercase_ascii = s => bts(B.lowercase_ascii(bos(s))) -let capitalize_ascii = s => bts(B.capitalize_ascii(bos(s))) -let uncapitalize_ascii = s => bts(B.uncapitalize_ascii(bos(s))) - -type t = string - -let compare = (x: t, y: t) => Pervasives.compare(x, y) -let equal: (string, string) => bool = (a, b) => a == b - -let split_on_char = (~sep, s) => { - let r = ref(list{}) - let j = ref(length(s)) - for i in length(s) - 1 downto 0 { - if unsafe_get(s, i) == sep { - r := list{sub(s, ~pos=i + 1, ~len=j.contents - i - 1), ...r.contents} - j := i - } - } - list{sub(s, ~pos=0, ~len=j.contents), ...r.contents} -} diff --git a/jscomp/stdlib-406/stringLabels.resi b/jscomp/stdlib-406/stringLabels.resi deleted file mode 100644 index 2886ac2a44b..00000000000 --- a/jscomp/stdlib-406/stringLabels.resi +++ /dev/null @@ -1,233 +0,0 @@ -/* ************************************************************************ */ -/* */ -/* OCaml */ -/* */ -/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ -/* */ -/* Copyright 1996 Institut National de Recherche en Informatique et */ -/* en Automatique. */ -/* */ -/* All rights reserved. This file is distributed under the terms of */ -/* the GNU Lesser General Public License version 2.1, with the */ -/* special exception on linking described in the file LICENSE. */ -/* */ -/* ************************************************************************ */ - -/*** String operations. */ - -/** Return the length (number of characters) of the given string. */ -external length: string => int = "%string_length" - -/** [String.get s n] returns the character at index [n] in string [s]. - You can also write [s.[n]] instead of [String.get s n]. - - Raise [Invalid_argument] if [n] not a valid index in [s]. */ -external get: (string, int) => char = "%string_safe_get" - -/** [String.make n c] returns a fresh string of length [n], - filled with the character [c]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. */ -let make: (int, char) => string - -/** [init n f] returns a string of length [n], - with character [i] initialized to the result of [f i]. - - Raise [Invalid_argument] if [n < 0] or [n > ]{!Sys.max_string_length}. - @since 4.02.0 */ -let init: (int, ~f: int => char) => string - -/** [String.sub s start len] returns a fresh string of length [len], - containing the substring of [s] that starts at position [start] and - has length [len]. - - Raise [Invalid_argument] if [start] and [len] do not - designate a valid substring of [s]. */ -let sub: (string, ~pos: int, ~len: int) => string - -/** [String.blit src srcoff dst dstoff len] copies [len] bytes - from the string [src], starting at index [srcoff], - to byte sequence [dst], starting at character number [dstoff]. - - Raise [Invalid_argument] if [srcoff] and [len] do not - designate a valid range of [src], or if [dstoff] and [len] - do not designate a valid range of [dst]. */ -let blit: (~src: string, ~src_pos: int, ~dst: bytes, ~dst_pos: int, ~len: int) => unit - -/** [String.concat sep sl] concatenates the list of strings [sl], - inserting the separator string [sep] between each. */ -let concat: (~sep: string, list) => string - -/** [String.iter f s] applies function [f] in turn to all - the characters of [s]. It is equivalent to - [f s.[0]; f s.[1]; ...; f s.[String.length s - 1]; ()]. */ -let iter: (~f: char => unit, string) => unit - -/** Same as {!String.iter}, but the - function is applied to the index of the element as first argument - (counting from 0), and the character itself as second argument. - @since 4.00.0 */ -let iteri: (~f: (int, char) => unit, string) => unit - -/** [String.map f s] applies function [f] in turn to all - the characters of [s] and stores the results in a new string that - is returned. - @since 4.00.0 */ -let map: (~f: char => char, string) => string - -/** [String.mapi f s] calls [f] with each character of [s] and its - index (in increasing index order) and stores the results in a new - string that is returned. - @since 4.02.0 */ -let mapi: (~f: (int, char) => char, string) => string - -/** Return a copy of the argument, without leading and trailing - whitespace. The characters regarded as whitespace are: [' '], - ['\x0c'], ['\n'], ['\r'], and ['\t']. If there is no leading nor - trailing whitespace character in the argument, return the original - string itself, not a copy. - @since 4.00.0 */ -let trim: string => string - -/** Return a copy of the argument, with special characters - represented by escape sequences, following the lexical - conventions of OCaml. If there is no special - character in the argument, return the original string itself, - not a copy. Its inverse function is Scanf.unescaped. */ -let escaped: string => string - -/** [String.index s c] returns the index of the first - occurrence of character [c] in string [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let index: (string, char) => int - -/** [String.index_opt s c] returns the index of the first - occurrence of character [c] in string [s], or - [None] if [c] does not occur in [s]. - @since 4.05 */ -let index_opt: (string, char) => option - -/** [String.rindex s c] returns the index of the last - occurrence of character [c] in string [s]. - - Raise [Not_found] if [c] does not occur in [s]. */ -let rindex: (string, char) => int - -/** [String.rindex_opt s c] returns the index of the last occurrence - of character [c] in string [s], or [None] if [c] does not occur in - [s]. - @since 4.05 */ -let rindex_opt: (string, char) => option - -/** [String.index_from s i c] returns the index of the - first occurrence of character [c] in string [s] after position [i]. - [String.index s c] is equivalent to [String.index_from s 0 c]. - - Raise [Invalid_argument] if [i] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] after position [i]. */ -let index_from: (string, int, char) => int - -/** [String.index_from_opt s i c] returns the index of the - first occurrence of character [c] in string [s] after position [i] - or [None] if [c] does not occur in [s] after position [i]. - - [String.index_opt s c] is equivalent to [String.index_from_opt s 0 c]. - Raise [Invalid_argument] if [i] is not a valid position in [s]. - - @since 4.05 -*/ -let index_from_opt: (string, int, char) => option - -/** [String.rindex_from s i c] returns the index of the - last occurrence of character [c] in string [s] before position [i+1]. - [String.rindex s c] is equivalent to - [String.rindex_from s (String.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - Raise [Not_found] if [c] does not occur in [s] before position [i+1]. */ -let rindex_from: (string, int, char) => int - -/** [String.rindex_from_opt s i c] returns the index of the - last occurrence of character [c] in string [s] before position [i+1] - or [None] if [c] does not occur in [s] before position [i+1]. - - [String.rindex_opt s c] is equivalent to - [String.rindex_from_opt s (String.length s - 1) c]. - - Raise [Invalid_argument] if [i+1] is not a valid position in [s]. - - @since 4.05 -*/ -let rindex_from_opt: (string, int, char) => option - -/** [String.contains s c] tests if character [c] - appears in the string [s]. */ -let contains: (string, char) => bool - -/** [String.contains_from s start c] tests if character [c] - appears in [s] after position [start]. - [String.contains s c] is equivalent to - [String.contains_from s 0 c]. - - Raise [Invalid_argument] if [start] is not a valid position in [s]. */ -let contains_from: (string, int, char) => bool - -/** [String.rcontains_from s stop c] tests if character [c] - appears in [s] before position [stop+1]. - - Raise [Invalid_argument] if [stop < 0] or [stop+1] is not a valid - position in [s]. */ -let rcontains_from: (string, int, char) => bool - -/** Return a copy of the argument, with all lowercase letters - translated to uppercase, using the US-ASCII character set. - @since 4.05.0 */ -let uppercase_ascii: string => string - -/** Return a copy of the argument, with all uppercase letters - translated to lowercase, using the US-ASCII character set. - @since 4.05.0 */ -let lowercase_ascii: string => string - -/** Return a copy of the argument, with the first character set to uppercase, - using the US-ASCII character set. - @since 4.05.0 */ -let capitalize_ascii: string => string - -/** Return a copy of the argument, with the first character set to lowercase, - using the US-ASCII character set. - @since 4.05.0 */ -let uncapitalize_ascii: string => string - -/** An alias for the type of strings. */ -type t = string - -/** The comparison function for strings, with the same specification as - {!Pervasives.compare}. Along with the type [t], this function [compare] - allows the module [String] to be passed as argument to the functors - {!Set.Make} and {!Map.Make}. */ -let compare: (t, t) => int - -/** The equal function for strings. - @since 4.05.0 */ -let equal: (t, t) => bool - -/** [String.split_on_char sep s] returns the list of all (possibly empty) - substrings of [s] that are delimited by the [sep] character. - - The function's output is specified by the following invariants: - - - The list is not empty. - - Concatenating its elements using [sep] as a separator returns a - string equal to the input ([String.concat (String.make 1 sep) - (String.split_on_char sep s) = s]). - - No string in the result contains the [sep] character. - - @since 4.05.0 -*/ -let split_on_char: (~sep: char, string) => list - -/* The following is for system use only. Do not call directly. */ - -external unsafe_get: (string, int) => char = "%string_unsafe_get" diff --git a/jscomp/test/build.ninja b/jscomp/test/build.ninja index cdfe830f6f7..348bc107654 100644 --- a/jscomp/test/build.ninja +++ b/jscomp/test/build.ninja @@ -104,7 +104,6 @@ o test/bs_splice_partial.cmi test/bs_splice_partial.cmj : cc test/bs_splice_part o test/bs_stack_test.cmi test/bs_stack_test.cmj : cc test/bs_stack_test.res | test/mt.cmj $bsc $stdlib runtime o test/bs_string_test.cmi test/bs_string_test.cmj : cc test/bs_string_test.res | test/mt.cmj $bsc $stdlib runtime o test/bs_unwrap_test.cmi test/bs_unwrap_test.cmj : cc test/bs_unwrap_test.res | $bsc $stdlib runtime -o test/bytes_split_gpr_743_test.cmi test/bytes_split_gpr_743_test.cmj : cc test/bytes_split_gpr_743_test.res | test/mt.cmj $bsc $stdlib runtime o test/caml_compare_bigint_test.cmi test/caml_compare_bigint_test.cmj : cc test/caml_compare_bigint_test.res | test/mt.cmj $bsc $stdlib runtime o test/caml_compare_test.cmi test/caml_compare_test.cmj : cc test/caml_compare_test.res | test/mt.cmj $bsc $stdlib runtime o test/chain_code_test.cmi test/chain_code_test.cmj : cc test/chain_code_test.res | test/mt.cmj $bsc $stdlib runtime @@ -113,7 +112,6 @@ o test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj : cc test/class_type o test/coercion_module_alias_test.cmi test/coercion_module_alias_test.cmj : cc test/coercion_module_alias_test.res | $bsc $stdlib runtime o test/compare_test.cmi test/compare_test.cmj : cc test/compare_test.res | $bsc $stdlib runtime o test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj : cc test/complete_parmatch_test.res | $bsc $stdlib runtime -o test/complex_if_test.cmi test/complex_if_test.cmj : cc test/complex_if_test.res | test/mt.cmj $bsc $stdlib runtime o test/complex_test.cmi test/complex_test.cmj : cc test/complex_test.res | test/mt.cmj $bsc $stdlib runtime o test/complex_while_loop.cmi test/complex_while_loop.cmj : cc test/complex_while_loop.res | $bsc $stdlib runtime o test/condition_compilation_test.cmi test/condition_compilation_test.cmj : cc test/condition_compilation_test.res | test/mt.cmj $bsc $stdlib runtime @@ -510,8 +508,6 @@ o test/stack_comp_test.cmi test/stack_comp_test.cmj : cc test/stack_comp_test.re o test/stack_test.cmi test/stack_test.cmj : cc test/stack_test.res | test/mt.cmj $bsc $stdlib runtime o test/string_bound_get_test.cmi test/string_bound_get_test.cmj : cc test/string_bound_get_test.res | $bsc $stdlib runtime o test/string_constant_compare.cmi test/string_constant_compare.cmj : cc test/string_constant_compare.res | $bsc $stdlib runtime -o test/string_get_set_test.cmi test/string_get_set_test.cmj : cc test/string_get_set_test.res | test/mt.cmj $bsc $stdlib runtime -o test/string_runtime_test.cmi test/string_runtime_test.cmj : cc test/string_runtime_test.res | test/mt.cmj test/test_char.cmj $bsc $stdlib runtime o test/string_set.cmi test/string_set.cmj : cc test/string_set.res | test/set_gen.cmj $bsc $stdlib runtime o test/string_set_test.cmi test/string_set_test.cmj : cc test/string_set_test.res | test/mt.cmj test/string_set.cmj $bsc $stdlib runtime o test/string_unicode_test.cmi test/string_unicode_test.cmj : cc test/string_unicode_test.res | test/mt.cmj $bsc $stdlib runtime @@ -531,8 +527,6 @@ o test/test_array_append.cmi test/test_array_append.cmj : cc test/test_array_app o test/test_array_primitive.cmi test/test_array_primitive.cmj : cc test/test_array_primitive.res | $bsc $stdlib runtime o test/test_bool_equal.cmi test/test_bool_equal.cmj : cc test/test_bool_equal.res | $bsc $stdlib runtime o test/test_bs_this.cmi test/test_bs_this.cmj : cc test/test_bs_this.res | $bsc $stdlib runtime -o test/test_bug.cmi test/test_bug.cmj : cc test/test_bug.res | test/test_char.cmj $bsc $stdlib runtime -o test/test_bytes.cmi test/test_bytes.cmj : cc test/test_bytes.res | $bsc $stdlib runtime o test/test_case_opt_collision.cmi test/test_case_opt_collision.cmj : cc test/test_case_opt_collision.res | test/mt.cmj $bsc $stdlib runtime o test/test_case_set.cmi test/test_case_set.cmj : cc test/test_case_set.res | $bsc $stdlib runtime o test/test_char.cmi test/test_char.cmj : cc test/test_char.res | $bsc $stdlib runtime @@ -650,4 +644,4 @@ o test/update_record_test.cmi test/update_record_test.cmj : cc test/update_recor o test/variant.cmi test/variant.cmj : cc test/variant.res | $bsc $stdlib runtime o test/variantsMatching.cmi test/variantsMatching.cmj : cc test/variantsMatching.res | $bsc $stdlib runtime o test/webpack_config.cmi test/webpack_config.cmj : cc test/webpack_config.res | $bsc $stdlib runtime -o test : phony test/AsInUncurriedExternals.cmi test/AsInUncurriedExternals.cmj test/Coercion.cmi test/Coercion.cmj test/DerivingAccessorsCurried.cmi test/DerivingAccessorsCurried.cmj test/DerivingAccessorsUncurried.cmi test/DerivingAccessorsUncurried.cmj test/DictInference.cmi test/DictInference.cmj test/DisambiguateOptionalFields.cmi test/DisambiguateOptionalFields.cmj test/DotDotDot.cmi test/DotDotDot.cmj test/EmptyRecord.cmi test/EmptyRecord.cmj test/ExternalArity.cmi test/ExternalArity.cmj test/FFI.cmi test/FFI.cmj test/Import.cmi test/Import.cmj test/ImportAttributes.cmi test/ImportAttributes.cmj test/PartialApplicationNoRuntimeCurry.cmi test/PartialApplicationNoRuntimeCurry.cmj test/RecordCoercion.cmi test/RecordCoercion.cmj test/RecordOrObject.cmi test/RecordOrObject.cmj test/SafePromises.cmi test/SafePromises.cmj test/UncurriedAlways.cmi test/UncurriedAlways.cmj test/UncurriedExternals.cmi test/UncurriedExternals.cmj test/UncurriedPervasives.cmi test/UncurriedPervasives.cmj test/UntaggedVariants.cmi test/UntaggedVariants.cmj test/VariantCoercion.cmi test/VariantCoercion.cmj test/VariantSpreads.cmi test/VariantSpreads.cmj test/a.cmi test/a.cmj test/a_recursive_type.cmi test/a_recursive_type.cmj test/a_scope_bug.cmi test/a_scope_bug.cmj test/abstract_type.cmi test/abstract_type.cmj test/adt_optimize_test.cmi test/adt_optimize_test.cmj test/alias_default_value_test.cmi test/alias_default_value_test.cmj test/alias_test.cmi test/alias_test.cmj test/and_or_tailcall_test.cmi test/and_or_tailcall_test.cmj test/ari_regress_test.cmi test/ari_regress_test.cmj test/arith_syntax.cmi test/arith_syntax.cmj test/arity.cmi test/arity.cmj test/arity_deopt.cmi test/arity_deopt.cmj test/arity_infer.cmi test/arity_infer.cmj test/array_data_util.cmi test/array_data_util.cmj test/array_safe_get.cmi test/array_safe_get.cmj test/array_subtle_test.cmi test/array_subtle_test.cmj test/array_test.cmi test/array_test.cmj test/as_inline_record_test.cmi test/as_inline_record_test.cmj test/ast_abstract_test.cmi test/ast_abstract_test.cmj test/ast_mapper_unused_warning_test.cmi test/ast_mapper_unused_warning_test.cmj test/async_await.cmi test/async_await.cmj test/async_inline.cmi test/async_inline.cmj test/async_inside_loop.cmi test/async_inside_loop.cmj test/attr_test.cmi test/attr_test.cmj test/b.cmi test/b.cmj test/bal_set_mini.cmi test/bal_set_mini.cmj test/bang_primitive.cmi test/bang_primitive.cmj test/basic_module_test.cmi test/basic_module_test.cmj test/bb.cmi test/bb.cmj test/bdd.cmi test/bdd.cmj test/belt_float_ntest.cmi test/belt_float_ntest.cmj test/belt_hashmap_ntest.cmi test/belt_hashmap_ntest.cmj test/belt_hashset_int_ntest.cmi test/belt_hashset_int_ntest.cmj test/belt_int_ntest.cmi test/belt_int_ntest.cmj test/belt_internal_test.cmi test/belt_internal_test.cmj test/belt_list_ntest.cmi test/belt_list_ntest.cmj test/belt_mapint_ntest.cmi test/belt_mapint_ntest.cmj test/belt_result_alias_test.cmi test/belt_result_alias_test.cmj test/belt_sortarray_ntest.cmi test/belt_sortarray_ntest.cmj test/bench.cmi test/bench.cmj test/big_enum.cmi test/big_enum.cmj test/big_polyvar_test.cmi test/big_polyvar_test.cmj test/bigint_test.cmi test/bigint_test.cmj test/block_alias_test.cmi test/block_alias_test.cmj test/boolean_test.cmi test/boolean_test.cmj test/bs_abstract_test.cmi test/bs_abstract_test.cmj test/bs_array_test.cmi test/bs_array_test.cmj test/bs_auto_uncurry.cmi test/bs_auto_uncurry.cmj test/bs_auto_uncurry_test.cmi test/bs_auto_uncurry_test.cmj test/bs_ignore_effect.cmi test/bs_ignore_effect.cmj test/bs_ignore_test.cmi test/bs_ignore_test.cmj test/bs_map_set_dict_test.cmi test/bs_map_set_dict_test.cmj test/bs_map_test.cmi test/bs_map_test.cmj test/bs_min_max_test.cmi test/bs_min_max_test.cmj test/bs_mutable_set_test.cmi test/bs_mutable_set_test.cmj test/bs_poly_map_test.cmi test/bs_poly_map_test.cmj test/bs_poly_mutable_map_test.cmi test/bs_poly_mutable_map_test.cmj test/bs_poly_mutable_set_test.cmi test/bs_poly_mutable_set_test.cmj test/bs_poly_set_test.cmi test/bs_poly_set_test.cmj test/bs_qualified.cmi test/bs_qualified.cmj test/bs_queue_test.cmi test/bs_queue_test.cmj test/bs_rest_test.cmi test/bs_rest_test.cmj test/bs_set_int_test.cmi test/bs_set_int_test.cmj test/bs_splice_partial.cmi test/bs_splice_partial.cmj test/bs_stack_test.cmi test/bs_stack_test.cmj test/bs_string_test.cmi test/bs_string_test.cmj test/bs_unwrap_test.cmi test/bs_unwrap_test.cmj test/bytes_split_gpr_743_test.cmi test/bytes_split_gpr_743_test.cmj test/caml_compare_bigint_test.cmi test/caml_compare_bigint_test.cmj test/caml_compare_test.cmi test/caml_compare_test.cmj test/chain_code_test.cmi test/chain_code_test.cmj test/chn_test.cmi test/chn_test.cmj test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj test/coercion_module_alias_test.cmi test/coercion_module_alias_test.cmj test/compare_test.cmi test/compare_test.cmj test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj test/complex_if_test.cmi test/complex_if_test.cmj test/complex_test.cmi test/complex_test.cmj test/complex_while_loop.cmi test/complex_while_loop.cmj test/condition_compilation_test.cmi test/condition_compilation_test.cmj test/config1_test.cmi test/config1_test.cmj test/console_log_test.cmi test/console_log_test.cmj test/const_block_test.cmi test/const_block_test.cmj test/const_defs.cmi test/const_defs.cmj test/const_defs_test.cmi test/const_defs_test.cmj test/const_test.cmi test/const_test.cmj test/cont_int_fold_test.cmi test/cont_int_fold_test.cmj test/cps_test.cmi test/cps_test.cmj test/cross_module_inline_test.cmi test/cross_module_inline_test.cmj test/custom_error_test.cmi test/custom_error_test.cmj test/debug_keep_test.cmi test/debug_keep_test.cmj test/debug_mode_value.cmi test/debug_mode_value.cmj test/debug_tmp.cmi test/debug_tmp.cmj test/debugger_test.cmi test/debugger_test.cmj test/default_export_test.cmi test/default_export_test.cmj test/defunctor_make_test.cmi test/defunctor_make_test.cmj test/demo_int_map.cmi test/demo_int_map.cmj test/demo_page.cmi test/demo_page.cmj test/demo_pipe.cmi test/demo_pipe.cmj test/derive_projector_test.cmi test/derive_projector_test.cmj test/directives.cmi test/directives.cmj test/div_by_zero_test.cmi test/div_by_zero_test.cmj test/dollar_escape_test.cmi test/dollar_escape_test.cmj test/earger_curry_test.cmi test/earger_curry_test.cmj test/effect.cmi test/effect.cmj test/epsilon_test.cmi test/epsilon_test.cmj test/equal_box_test.cmi test/equal_box_test.cmj test/equal_exception_test.cmi test/equal_exception_test.cmj test/equal_test.cmi test/equal_test.cmj test/es6_export.cmi test/es6_export.cmj test/es6_import.cmi test/es6_import.cmj test/es6_module_test.cmi test/es6_module_test.cmj test/escape_esmodule.cmi test/escape_esmodule.cmj test/esmodule_ref.cmi test/esmodule_ref.cmj test/event_ffi.cmi test/event_ffi.cmj test/exception_alias.cmi test/exception_alias.cmj test/exception_raise_test.cmi test/exception_raise_test.cmj test/exception_rebound_err_test.cmi test/exception_rebound_err_test.cmj test/exception_value_test.cmi test/exception_value_test.cmj test/exotic_labels_test.cmi test/exotic_labels_test.cmj test/exponentiation_precedence_test.cmi test/exponentiation_precedence_test.cmj test/export_keyword.cmi test/export_keyword.cmj test/ext_array_test.cmi test/ext_array_test.cmj test/ext_pervasives_test.cmi test/ext_pervasives_test.cmj test/extensible_variant_test.cmi test/extensible_variant_test.cmj test/external_ppx.cmi test/external_ppx.cmj test/external_ppx2.cmi test/external_ppx2.cmj test/ffi_arity_test.cmi test/ffi_arity_test.cmj test/ffi_array_test.cmi test/ffi_array_test.cmj test/ffi_js_test.cmi test/ffi_js_test.cmj test/ffi_splice_test.cmi test/ffi_splice_test.cmj test/ffi_test.cmi test/ffi_test.cmj test/fib.cmi test/fib.cmj test/flattern_order_test.cmi test/flattern_order_test.cmj test/flexible_array_test.cmi test/flexible_array_test.cmj test/float_array.cmi test/float_array.cmj test/float_of_bits_test.cmi test/float_of_bits_test.cmj test/float_record.cmi test/float_record.cmj test/float_test.cmi test/float_test.cmj test/floatarray_test.cmi test/floatarray_test.cmj test/for_loop_test.cmi test/for_loop_test.cmj test/for_side_effect_test.cmi test/for_side_effect_test.cmj test/format_regression.cmi test/format_regression.cmj test/fun_pattern_match.cmi test/fun_pattern_match.cmj test/function_directives.cmi test/function_directives.cmj test/function_directives_no_inline.cmi test/function_directives_no_inline.cmj test/functor_app_test.cmi test/functor_app_test.cmj test/functor_def.cmi test/functor_def.cmj test/functor_ffi.cmi test/functor_ffi.cmj test/functor_inst.cmi test/functor_inst.cmj test/functors.cmi test/functors.cmj test/gbk.cmi test/gbk.cmj test/gentTypeReTest.cmi test/gentTypeReTest.cmj test/global_exception_regression_test.cmi test/global_exception_regression_test.cmj test/global_mangles.cmi test/global_mangles.cmj test/global_module_alias_test.cmi test/global_module_alias_test.cmj test/google_closure_test.cmi test/google_closure_test.cmj test/gpr496_test.cmi test/gpr496_test.cmj test/gpr_1072.cmi test/gpr_1072.cmj test/gpr_1072_reg.cmi test/gpr_1072_reg.cmj test/gpr_1150.cmi test/gpr_1150.cmj test/gpr_1154_test.cmi test/gpr_1154_test.cmj test/gpr_1170.cmi test/gpr_1170.cmj test/gpr_1240_missing_unbox.cmi test/gpr_1240_missing_unbox.cmj test/gpr_1245_test.cmi test/gpr_1245_test.cmj test/gpr_1268.cmi test/gpr_1268.cmj test/gpr_1409_test.cmi test/gpr_1409_test.cmj test/gpr_1423_app_test.cmi test/gpr_1423_app_test.cmj test/gpr_1423_nav.cmi test/gpr_1423_nav.cmj test/gpr_1438.cmi test/gpr_1438.cmj test/gpr_1481.cmi test/gpr_1481.cmj test/gpr_1484.cmi test/gpr_1484.cmj test/gpr_1539_test.cmi test/gpr_1539_test.cmj test/gpr_1658_test.cmi test/gpr_1658_test.cmj test/gpr_1667_test.cmi test/gpr_1667_test.cmj test/gpr_1692_test.cmi test/gpr_1692_test.cmj test/gpr_1698_test.cmi test/gpr_1698_test.cmj test/gpr_1701_test.cmi test/gpr_1701_test.cmj test/gpr_1716_test.cmi test/gpr_1716_test.cmj test/gpr_1717_test.cmi test/gpr_1717_test.cmj test/gpr_1728_test.cmi test/gpr_1728_test.cmj test/gpr_1749_test.cmi test/gpr_1749_test.cmj test/gpr_1759_test.cmi test/gpr_1759_test.cmj test/gpr_1760_test.cmi test/gpr_1760_test.cmj test/gpr_1762_test.cmi test/gpr_1762_test.cmj test/gpr_1817_test.cmi test/gpr_1817_test.cmj test/gpr_1822_test.cmi test/gpr_1822_test.cmj test/gpr_1891_test.cmi test/gpr_1891_test.cmj test/gpr_1943_test.cmi test/gpr_1943_test.cmj test/gpr_1946_test.cmi test/gpr_1946_test.cmj test/gpr_2316_test.cmi test/gpr_2316_test.cmj test/gpr_2352_test.cmi test/gpr_2352_test.cmj test/gpr_2413_test.cmi test/gpr_2413_test.cmj test/gpr_2474.cmi test/gpr_2474.cmj test/gpr_2487.cmi test/gpr_2487.cmj test/gpr_2503_test.cmi test/gpr_2503_test.cmj test/gpr_2608_test.cmi test/gpr_2608_test.cmj test/gpr_2614_test.cmi test/gpr_2614_test.cmj test/gpr_2633_test.cmi test/gpr_2633_test.cmj test/gpr_2642_test.cmi test/gpr_2642_test.cmj test/gpr_2682_test.cmi test/gpr_2682_test.cmj test/gpr_2700_test.cmi test/gpr_2700_test.cmj test/gpr_2731_test.cmi test/gpr_2731_test.cmj test/gpr_2789_test.cmi test/gpr_2789_test.cmj test/gpr_2931_test.cmi test/gpr_2931_test.cmj test/gpr_3142_test.cmi test/gpr_3142_test.cmj test/gpr_3154_test.cmi test/gpr_3154_test.cmj test/gpr_3209_test.cmi test/gpr_3209_test.cmj test/gpr_3492_test.cmi test/gpr_3492_test.cmj test/gpr_3519_jsx_test.cmi test/gpr_3519_jsx_test.cmj test/gpr_3519_test.cmi test/gpr_3519_test.cmj test/gpr_3536_test.cmi test/gpr_3536_test.cmj test/gpr_3546_test.cmi test/gpr_3546_test.cmj test/gpr_3548_test.cmi test/gpr_3548_test.cmj test/gpr_3549_test.cmi test/gpr_3549_test.cmj test/gpr_3566_drive_test.cmi test/gpr_3566_drive_test.cmj test/gpr_3566_test.cmi test/gpr_3566_test.cmj test/gpr_3595_test.cmi test/gpr_3595_test.cmj test/gpr_3609_test.cmi test/gpr_3609_test.cmj test/gpr_3697_test.cmi test/gpr_3697_test.cmj test/gpr_373_test.cmi test/gpr_373_test.cmj test/gpr_3770_test.cmi test/gpr_3770_test.cmj test/gpr_3852_alias.cmi test/gpr_3852_alias.cmj test/gpr_3852_alias_reify.cmi test/gpr_3852_alias_reify.cmj test/gpr_3852_effect.cmi test/gpr_3852_effect.cmj test/gpr_3865.cmi test/gpr_3865.cmj test/gpr_3865_bar.cmi test/gpr_3865_bar.cmj test/gpr_3865_foo.cmi test/gpr_3865_foo.cmj test/gpr_3875_test.cmi test/gpr_3875_test.cmj test/gpr_3877_test.cmi test/gpr_3877_test.cmj test/gpr_3895_test.cmi test/gpr_3895_test.cmj test/gpr_3897_test.cmi test/gpr_3897_test.cmj test/gpr_3931_test.cmi test/gpr_3931_test.cmj test/gpr_3980_test.cmi test/gpr_3980_test.cmj test/gpr_4025_test.cmi test/gpr_4025_test.cmj test/gpr_4069_test.cmi test/gpr_4069_test.cmj test/gpr_4265_test.cmi test/gpr_4265_test.cmj test/gpr_4274_test.cmi test/gpr_4274_test.cmj test/gpr_4280_test.cmi test/gpr_4280_test.cmj test/gpr_4407_test.cmi test/gpr_4407_test.cmj test/gpr_441.cmi test/gpr_441.cmj test/gpr_4442_test.cmi test/gpr_4442_test.cmj test/gpr_4491_test.cmi test/gpr_4491_test.cmj test/gpr_4494_test.cmi test/gpr_4494_test.cmj test/gpr_4519_test.cmi test/gpr_4519_test.cmj test/gpr_459_test.cmi test/gpr_459_test.cmj test/gpr_4632.cmi test/gpr_4632.cmj test/gpr_4639_test.cmi test/gpr_4639_test.cmj test/gpr_4900_test.cmi test/gpr_4900_test.cmj test/gpr_4924_test.cmi test/gpr_4924_test.cmj test/gpr_4931.cmi test/gpr_4931.cmj test/gpr_4931_allow.cmi test/gpr_4931_allow.cmj test/gpr_5071_test.cmi test/gpr_5071_test.cmj test/gpr_5169_test.cmi test/gpr_5169_test.cmj test/gpr_5218_test.cmi test/gpr_5218_test.cmj test/gpr_5280_optimize_test.cmi test/gpr_5280_optimize_test.cmj test/gpr_5557.cmi test/gpr_5557.cmj test/gpr_5753.cmi test/gpr_5753.cmj test/gpr_658.cmi test/gpr_658.cmj test/gpr_858_test.cmi test/gpr_858_test.cmj test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj test/gpr_904_test.cmi test/gpr_904_test.cmj test/gpr_974_test.cmi test/gpr_974_test.cmj test/gpr_977_test.cmi test/gpr_977_test.cmj test/gpr_return_type_unused_attribute.cmi test/gpr_return_type_unused_attribute.cmj test/gray_code_test.cmi test/gray_code_test.cmj test/guide_for_ext.cmi test/guide_for_ext.cmj test/hash_collision_test.cmi test/hash_collision_test.cmj test/hash_sugar_desugar.cmi test/hash_sugar_desugar.cmj test/hash_test.cmi test/hash_test.cmj test/hello.foo.cmi test/hello.foo.cmj test/hello_res.cmi test/hello_res.cmj test/ignore_test.cmi test/ignore_test.cmj test/ignore_uncurry_attribute.cmi test/ignore_uncurry_attribute.cmj test/import2.cmi test/import2.cmj test/import_external.cmi test/import_external.cmj test/import_side_effect.cmi test/import_side_effect.cmj test/import_side_effect_free.cmi test/import_side_effect_free.cmj test/include_side_effect.cmi test/include_side_effect.cmj test/include_side_effect_free.cmi test/include_side_effect_free.cmj test/incomplete_toplevel_test.cmi test/incomplete_toplevel_test.cmj test/infer_type_test.cmi test/infer_type_test.cmj test/inline_condition_with_pattern_matching.cmi test/inline_condition_with_pattern_matching.cmj test/inline_const.cmi test/inline_const.cmj test/inline_const_test.cmi test/inline_const_test.cmj test/inline_edge_cases.cmi test/inline_edge_cases.cmj test/inline_map2_test.cmi test/inline_map2_test.cmj test/inline_map_demo.cmi test/inline_map_demo.cmj test/inline_map_test.cmi test/inline_map_test.cmj test/inline_record_test.cmi test/inline_record_test.cmj test/inline_regression_test.cmi test/inline_regression_test.cmj test/inline_string_test.cmi test/inline_string_test.cmj test/inner_call.cmi test/inner_call.cmj test/inner_define.cmi test/inner_define.cmj test/inner_unused.cmi test/inner_unused.cmj test/installation_test.cmi test/installation_test.cmj test/int32_test.cmi test/int32_test.cmj test/int_map.cmi test/int_map.cmj test/int_overflow_test.cmi test/int_overflow_test.cmj test/int_poly_var.cmi test/int_poly_var.cmj test/int_switch_test.cmi test/int_switch_test.cmj test/internal_unused_test.cmi test/internal_unused_test.cmj test/js_array_test.cmi test/js_array_test.cmj test/js_bool_test.cmi test/js_bool_test.cmj test/js_cast_test.cmi test/js_cast_test.cmj test/js_date_test.cmi test/js_date_test.cmj test/js_dict_test.cmi test/js_dict_test.cmj test/js_exception_catch_test.cmi test/js_exception_catch_test.cmj test/js_float_test.cmi test/js_float_test.cmj test/js_global_test.cmi test/js_global_test.cmj test/js_int_test.cmi test/js_int_test.cmj test/js_json_test.cmi test/js_json_test.cmj test/js_math_test.cmi test/js_math_test.cmj test/js_null_test.cmi test/js_null_test.cmj test/js_null_undefined_test.cmi test/js_null_undefined_test.cmj test/js_nullable_test.cmi test/js_nullable_test.cmj test/js_obj_test.cmi test/js_obj_test.cmj test/js_option_test.cmi test/js_option_test.cmj test/js_re_test.cmi test/js_re_test.cmj test/js_string_test.cmi test/js_string_test.cmj test/js_undefined_test.cmi test/js_undefined_test.cmj test/js_val.cmi test/js_val.cmj test/jsoo_400_test.cmi test/jsoo_400_test.cmj test/jsoo_485_test.cmi test/jsoo_485_test.cmj test/jsxv4_newtype.cmi test/jsxv4_newtype.cmj test/keep_uncurry_attribute.cmi test/keep_uncurry_attribute.cmj test/key_word_property.cmi test/key_word_property.cmj test/key_word_property2.cmi test/key_word_property2.cmj test/key_word_property_plus_test.cmi test/key_word_property_plus_test.cmj test/label_uncurry.cmi test/label_uncurry.cmj test/large_integer_pat.cmi test/large_integer_pat.cmj test/large_record_duplication_test.cmi test/large_record_duplication_test.cmj test/largest_int_flow.cmi test/largest_int_flow.cmj test/lazy_demo.cmi test/lazy_demo.cmj test/lazy_test.cmi test/lazy_test.cmj test/lib_js_test.cmi test/lib_js_test.cmj test/libqueue_test.cmi test/libqueue_test.cmj test/limits_test.cmi test/limits_test.cmj test/list_stack.cmi test/list_stack.cmj test/list_test.cmi test/list_test.cmj test/local_exception_test.cmi test/local_exception_test.cmj test/loop_regression_test.cmi test/loop_regression_test.cmj test/map_find_test.cmi test/map_find_test.cmj test/map_test.cmi test/map_test.cmj test/mario_game.cmi test/mario_game.cmj test/meth_annotation.cmi test/meth_annotation.cmj test/method_name_test.cmi test/method_name_test.cmj test/method_string_name.cmi test/method_string_name.cmj test/minimal_test.cmi test/minimal_test.cmj test/miss_colon_test.cmi test/miss_colon_test.cmj test/mock_mt.cmi test/mock_mt.cmj test/module_alias_test.cmi test/module_alias_test.cmj test/module_as_class_ffi.cmi test/module_as_class_ffi.cmj test/module_as_function.cmi test/module_as_function.cmj test/module_missing_conversion.cmi test/module_missing_conversion.cmj test/module_parameter_test.cmi test/module_parameter_test.cmj test/module_splice_test.cmi test/module_splice_test.cmj test/more_poly_variant_test.cmi test/more_poly_variant_test.cmj test/more_uncurry.cmi test/more_uncurry.cmj test/mpr_6033_test.cmi test/mpr_6033_test.cmj test/mt.cmi test/mt.cmj test/mt_global.cmi test/mt_global.cmj test/mutable_obj_test.cmi test/mutable_obj_test.cmj test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj test/name_mangle_test.cmi test/name_mangle_test.cmj test/nested_include.cmi test/nested_include.cmj test/nested_module_alias.cmi test/nested_module_alias.cmj test/nested_obj_literal.cmi test/nested_obj_literal.cmj test/nested_obj_test.cmi test/nested_obj_test.cmj test/nested_pattern_match_test.cmi test/nested_pattern_match_test.cmj test/noassert.cmi test/noassert.cmj test/node_assert.cmi test/node_assert.cmj test/node_path_test.cmi test/node_path_test.cmj test/node_test.cmi test/node_test.cmj test/node_test_util.cmi test/node_test_util.cmj test/obj_literal_ppx.cmi test/obj_literal_ppx.cmj test/obj_literal_ppx_test.cmi test/obj_literal_ppx_test.cmj test/obj_magic_test.cmi test/obj_magic_test.cmj test/obj_type_test.cmi test/obj_type_test.cmj test/offset.cmi test/offset.cmj test/omit_trailing_undefined_in_external_calls.cmi test/omit_trailing_undefined_in_external_calls.cmj test/option_encoding_test.cmi test/option_encoding_test.cmj test/option_repr_test.cmi test/option_repr_test.cmj test/optional_ffi_test.cmi test/optional_ffi_test.cmj test/optional_regression_test.cmi test/optional_regression_test.cmj test/pipe_send_readline.cmi test/pipe_send_readline.cmj test/pipe_syntax.cmi test/pipe_syntax.cmj test/poly_empty_array.cmi test/poly_empty_array.cmj test/poly_variant_test.cmi test/poly_variant_test.cmj test/polymorphic_raw_test.cmi test/polymorphic_raw_test.cmj test/polymorphism_test.cmi test/polymorphism_test.cmj test/polyvar_convert.cmi test/polyvar_convert.cmj test/polyvar_test.cmi test/polyvar_test.cmj test/ppx_apply_test.cmi test/ppx_apply_test.cmj test/pq_test.cmi test/pq_test.cmj test/pr6726.cmi test/pr6726.cmj test/prepend_data_ffi.cmi test/prepend_data_ffi.cmj test/primitive_reg_test.cmi test/primitive_reg_test.cmj test/print_alpha_test.cmi test/print_alpha_test.cmj test/queue_402.cmi test/queue_402.cmj test/queue_test.cmi test/queue_test.cmj test/raw_output_test.cmi test/raw_output_test.cmj test/raw_pure_test.cmi test/raw_pure_test.cmj test/rbset.cmi test/rbset.cmj test/react.cmi test/react.cmj test/reactDOMRe.cmi test/reactDOMRe.cmj test/reactDOMServerRe.cmi test/reactDOMServerRe.cmj test/reactEvent.cmi test/reactEvent.cmj test/reactTestUtils.cmi test/reactTestUtils.cmj test/reasonReact.cmi test/reasonReact.cmj test/reasonReactCompat.cmi test/reasonReactCompat.cmj test/reasonReactOptimizedCreateClass.cmi test/reasonReactOptimizedCreateClass.cmj test/reasonReactRouter.cmi test/reasonReactRouter.cmj test/rebind_module.cmi test/rebind_module.cmj test/rebind_module_test.cmi test/rebind_module_test.cmj test/rec_array_test.cmi test/rec_array_test.cmj test/rec_fun_test.cmi test/rec_fun_test.cmj test/rec_module_opt.cmi test/rec_module_opt.cmj test/rec_module_test.cmi test/rec_module_test.cmj test/recmodule.cmi test/recmodule.cmj test/record_debug_test.cmi test/record_debug_test.cmj test/record_extension_test.cmi test/record_extension_test.cmj test/record_name_test.cmi test/record_name_test.cmj test/record_regression.cmi test/record_regression.cmj test/record_type_spread.cmi test/record_type_spread.cmj test/record_with_test.cmi test/record_with_test.cmj test/recursive_module.cmi test/recursive_module.cmj test/recursive_module_test.cmi test/recursive_module_test.cmj test/recursive_react_component.cmi test/recursive_react_component.cmj test/recursive_records_test.cmi test/recursive_records_test.cmj test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj test/regression_print.cmi test/regression_print.cmj test/relative_path.cmi test/relative_path.cmj test/res_debug.cmi test/res_debug.cmj test/return_check.cmi test/return_check.cmj test/runtime_encoding_test.cmi test/runtime_encoding_test.cmj test/set_annotation.cmi test/set_annotation.cmj test/set_gen.cmi test/set_gen.cmj test/side_effect.cmi test/side_effect.cmj test/side_effect2.cmi test/side_effect2.cmj test/side_effect_free.cmi test/side_effect_free.cmj test/simplify_lambda_632o.cmi test/simplify_lambda_632o.cmj test/single_module_alias.cmi test/single_module_alias.cmj test/singular_unit_test.cmi test/singular_unit_test.cmj test/small_inline_test.cmi test/small_inline_test.cmj test/splice_test.cmi test/splice_test.cmj test/stack_comp_test.cmi test/stack_comp_test.cmj test/stack_test.cmi test/stack_test.cmj test/string_bound_get_test.cmi test/string_bound_get_test.cmj test/string_constant_compare.cmi test/string_constant_compare.cmj test/string_get_set_test.cmi test/string_get_set_test.cmj test/string_runtime_test.cmi test/string_runtime_test.cmj test/string_set.cmi test/string_set.cmj test/string_set_test.cmi test/string_set_test.cmj test/string_unicode_test.cmi test/string_unicode_test.cmj test/stringmatch_test.cmi test/stringmatch_test.cmj test/submodule.cmi test/submodule.cmj test/submodule_call.cmi test/submodule_call.cmj test/switch_case_test.cmi test/switch_case_test.cmj test/switch_string.cmi test/switch_string.cmj test/tagged_template_test.cmi test/tagged_template_test.cmj test/tailcall_inline_test.cmi test/tailcall_inline_test.cmj test/template.cmi test/template.cmj test/test2.cmi test/test2.cmj test/test_alias.cmi test/test_alias.cmj test/test_ari.cmi test/test_ari.cmj test/test_array.cmi test/test_array.cmj test/test_array_append.cmi test/test_array_append.cmj test/test_array_primitive.cmi test/test_array_primitive.cmj test/test_bool_equal.cmi test/test_bool_equal.cmj test/test_bs_this.cmi test/test_bs_this.cmj test/test_bug.cmi test/test_bug.cmj test/test_bytes.cmi test/test_bytes.cmj test/test_case_opt_collision.cmi test/test_case_opt_collision.cmj test/test_case_set.cmi test/test_case_set.cmj test/test_char.cmi test/test_char.cmj test/test_closure.cmi test/test_closure.cmj test/test_common.cmi test/test_common.cmj test/test_const_elim.cmi test/test_const_elim.cmj test/test_const_propogate.cmi test/test_const_propogate.cmj test/test_cpp.cmi test/test_cpp.cmj test/test_cps.cmi test/test_cps.cmj test/test_demo.cmi test/test_demo.cmj test/test_dup_param.cmi test/test_dup_param.cmj test/test_eq.cmi test/test_eq.cmj test/test_exception.cmi test/test_exception.cmj test/test_exception_escape.cmi test/test_exception_escape.cmj test/test_export2.cmi test/test_export2.cmj test/test_external.cmi test/test_external.cmj test/test_external_unit.cmi test/test_external_unit.cmj test/test_ffi.cmi test/test_ffi.cmj test/test_fib.cmi test/test_fib.cmj test/test_for_loop.cmi test/test_for_loop.cmj test/test_for_map.cmi test/test_for_map.cmj test/test_for_map2.cmi test/test_for_map2.cmj test/test_functor_dead_code.cmi test/test_functor_dead_code.cmj test/test_generative_module.cmi test/test_generative_module.cmj test/test_global_print.cmi test/test_global_print.cmj test/test_google_closure.cmi test/test_google_closure.cmj test/test_include.cmi test/test_include.cmj test/test_incomplete.cmi test/test_incomplete.cmj test/test_incr_ref.cmi test/test_incr_ref.cmj test/test_int_map_find.cmi test/test_int_map_find.cmj test/test_is_js.cmi test/test_is_js.cmj test/test_js_ffi.cmi test/test_js_ffi.cmj test/test_let.cmi test/test_let.cmj test/test_list.cmi test/test_list.cmj test/test_literal.cmi test/test_literal.cmj test/test_literals.cmi test/test_literals.cmj test/test_match_exception.cmi test/test_match_exception.cmj test/test_mutliple.cmi test/test_mutliple.cmj test/test_nat64.cmi test/test_nat64.cmj test/test_nested_let.cmi test/test_nested_let.cmj test/test_nested_print.cmi test/test_nested_print.cmj test/test_non_export.cmi test/test_non_export.cmj test/test_nullary.cmi test/test_nullary.cmj test/test_obj.cmi test/test_obj.cmj test/test_order.cmi test/test_order.cmj test/test_order_tailcall.cmi test/test_order_tailcall.cmj test/test_other_exn.cmi test/test_other_exn.cmj test/test_per.cmi test/test_per.cmj test/test_pervasive.cmi test/test_pervasive.cmj test/test_pervasives2.cmi test/test_pervasives2.cmj test/test_pervasives3.cmi test/test_pervasives3.cmj test/test_primitive.cmi test/test_primitive.cmj test/test_ramification.cmi test/test_ramification.cmj test/test_react.cmi test/test_react.cmj test/test_react_case.cmi test/test_react_case.cmj test/test_regex.cmi test/test_regex.cmj test/test_runtime_encoding.cmi test/test_runtime_encoding.cmj test/test_scope.cmi test/test_scope.cmj test/test_seq.cmi test/test_seq.cmj test/test_set.cmi test/test_set.cmj test/test_side_effect_functor.cmi test/test_side_effect_functor.cmj test/test_simple_include.cmi test/test_simple_include.cmj test/test_simple_pattern_match.cmi test/test_simple_pattern_match.cmj test/test_simple_ref.cmi test/test_simple_ref.cmj test/test_simple_tailcall.cmi test/test_simple_tailcall.cmj test/test_small.cmi test/test_small.cmj test/test_stack.cmi test/test_stack.cmj test/test_static_catch_ident.cmi test/test_static_catch_ident.cmj test/test_string.cmi test/test_string.cmj test/test_string_case.cmi test/test_string_case.cmj test/test_string_const.cmi test/test_string_const.cmj test/test_string_map.cmi test/test_string_map.cmj test/test_string_switch.cmi test/test_string_switch.cmj test/test_switch.cmi test/test_switch.cmj test/test_trywith.cmi test/test_trywith.cmj test/test_tuple.cmi test/test_tuple.cmj test/test_tuple_destructring.cmi test/test_tuple_destructring.cmj test/test_type_based_arity.cmi test/test_type_based_arity.cmj test/test_u.cmi test/test_u.cmj test/test_unknown.cmi test/test_unknown.cmj test/test_unsafe_cmp.cmi test/test_unsafe_cmp.cmj test/test_unsafe_obj_ffi.cmi test/test_unsafe_obj_ffi.cmj test/test_unsafe_obj_ffi_ppx.cmi test/test_unsafe_obj_ffi_ppx.cmj test/test_while_closure.cmi test/test_while_closure.cmj test/test_while_side_effect.cmi test/test_while_side_effect.cmj test/test_zero_nullable.cmi test/test_zero_nullable.cmj test/then_mangle_test.cmi test/then_mangle_test.cmj test/ticker.cmi test/ticker.cmj test/to_string_test.cmi test/to_string_test.cmj test/topsort_test.cmi test/topsort_test.cmj test/tramp_fib.cmi test/tramp_fib.cmj test/tuple_alloc.cmi test/tuple_alloc.cmj test/type-coercion-free-vars.cmi test/type-coercion-free-vars.cmj test/type_disambiguate.cmi test/type_disambiguate.cmj test/typeof_test.cmi test/typeof_test.cmj test/unboxed_attribute.cmi test/unboxed_attribute.cmj test/unboxed_attribute_test.cmi test/unboxed_attribute_test.cmj test/unboxed_crash.cmi test/unboxed_crash.cmj test/unboxed_use_case.cmi test/unboxed_use_case.cmj test/uncurried_cast.cmi test/uncurried_cast.cmj test/uncurried_default.args.cmi test/uncurried_default.args.cmj test/uncurried_pipe.cmi test/uncurried_pipe.cmj test/uncurry_external_test.cmi test/uncurry_external_test.cmj test/uncurry_glob_test.cmi test/uncurry_glob_test.cmj test/uncurry_test.cmi test/uncurry_test.cmj test/undef_regression_test.cmi test/undef_regression_test.cmj test/unit_undefined_test.cmi test/unit_undefined_test.cmj test/unsafe_full_apply_primitive.cmi test/unsafe_full_apply_primitive.cmj test/unsafe_ppx_test.cmi test/unsafe_ppx_test.cmj test/update_record_test.cmi test/update_record_test.cmj test/variant.cmi test/variant.cmj test/variantsMatching.cmi test/variantsMatching.cmj test/webpack_config.cmi test/webpack_config.cmj +o test : phony test/AsInUncurriedExternals.cmi test/AsInUncurriedExternals.cmj test/Coercion.cmi test/Coercion.cmj test/DerivingAccessorsCurried.cmi test/DerivingAccessorsCurried.cmj test/DerivingAccessorsUncurried.cmi test/DerivingAccessorsUncurried.cmj test/DictInference.cmi test/DictInference.cmj test/DisambiguateOptionalFields.cmi test/DisambiguateOptionalFields.cmj test/DotDotDot.cmi test/DotDotDot.cmj test/EmptyRecord.cmi test/EmptyRecord.cmj test/ExternalArity.cmi test/ExternalArity.cmj test/FFI.cmi test/FFI.cmj test/Import.cmi test/Import.cmj test/ImportAttributes.cmi test/ImportAttributes.cmj test/PartialApplicationNoRuntimeCurry.cmi test/PartialApplicationNoRuntimeCurry.cmj test/RecordCoercion.cmi test/RecordCoercion.cmj test/RecordOrObject.cmi test/RecordOrObject.cmj test/SafePromises.cmi test/SafePromises.cmj test/UncurriedAlways.cmi test/UncurriedAlways.cmj test/UncurriedExternals.cmi test/UncurriedExternals.cmj test/UncurriedPervasives.cmi test/UncurriedPervasives.cmj test/UntaggedVariants.cmi test/UntaggedVariants.cmj test/VariantCoercion.cmi test/VariantCoercion.cmj test/VariantSpreads.cmi test/VariantSpreads.cmj test/a.cmi test/a.cmj test/a_recursive_type.cmi test/a_recursive_type.cmj test/a_scope_bug.cmi test/a_scope_bug.cmj test/abstract_type.cmi test/abstract_type.cmj test/adt_optimize_test.cmi test/adt_optimize_test.cmj test/alias_default_value_test.cmi test/alias_default_value_test.cmj test/alias_test.cmi test/alias_test.cmj test/and_or_tailcall_test.cmi test/and_or_tailcall_test.cmj test/ari_regress_test.cmi test/ari_regress_test.cmj test/arith_syntax.cmi test/arith_syntax.cmj test/arity.cmi test/arity.cmj test/arity_deopt.cmi test/arity_deopt.cmj test/arity_infer.cmi test/arity_infer.cmj test/array_data_util.cmi test/array_data_util.cmj test/array_safe_get.cmi test/array_safe_get.cmj test/array_subtle_test.cmi test/array_subtle_test.cmj test/array_test.cmi test/array_test.cmj test/as_inline_record_test.cmi test/as_inline_record_test.cmj test/ast_abstract_test.cmi test/ast_abstract_test.cmj test/ast_mapper_unused_warning_test.cmi test/ast_mapper_unused_warning_test.cmj test/async_await.cmi test/async_await.cmj test/async_inline.cmi test/async_inline.cmj test/async_inside_loop.cmi test/async_inside_loop.cmj test/attr_test.cmi test/attr_test.cmj test/b.cmi test/b.cmj test/bal_set_mini.cmi test/bal_set_mini.cmj test/bang_primitive.cmi test/bang_primitive.cmj test/basic_module_test.cmi test/basic_module_test.cmj test/bb.cmi test/bb.cmj test/bdd.cmi test/bdd.cmj test/belt_float_ntest.cmi test/belt_float_ntest.cmj test/belt_hashmap_ntest.cmi test/belt_hashmap_ntest.cmj test/belt_hashset_int_ntest.cmi test/belt_hashset_int_ntest.cmj test/belt_int_ntest.cmi test/belt_int_ntest.cmj test/belt_internal_test.cmi test/belt_internal_test.cmj test/belt_list_ntest.cmi test/belt_list_ntest.cmj test/belt_mapint_ntest.cmi test/belt_mapint_ntest.cmj test/belt_result_alias_test.cmi test/belt_result_alias_test.cmj test/belt_sortarray_ntest.cmi test/belt_sortarray_ntest.cmj test/bench.cmi test/bench.cmj test/big_enum.cmi test/big_enum.cmj test/big_polyvar_test.cmi test/big_polyvar_test.cmj test/bigint_test.cmi test/bigint_test.cmj test/block_alias_test.cmi test/block_alias_test.cmj test/boolean_test.cmi test/boolean_test.cmj test/bs_abstract_test.cmi test/bs_abstract_test.cmj test/bs_array_test.cmi test/bs_array_test.cmj test/bs_auto_uncurry.cmi test/bs_auto_uncurry.cmj test/bs_auto_uncurry_test.cmi test/bs_auto_uncurry_test.cmj test/bs_ignore_effect.cmi test/bs_ignore_effect.cmj test/bs_ignore_test.cmi test/bs_ignore_test.cmj test/bs_map_set_dict_test.cmi test/bs_map_set_dict_test.cmj test/bs_map_test.cmi test/bs_map_test.cmj test/bs_min_max_test.cmi test/bs_min_max_test.cmj test/bs_mutable_set_test.cmi test/bs_mutable_set_test.cmj test/bs_poly_map_test.cmi test/bs_poly_map_test.cmj test/bs_poly_mutable_map_test.cmi test/bs_poly_mutable_map_test.cmj test/bs_poly_mutable_set_test.cmi test/bs_poly_mutable_set_test.cmj test/bs_poly_set_test.cmi test/bs_poly_set_test.cmj test/bs_qualified.cmi test/bs_qualified.cmj test/bs_queue_test.cmi test/bs_queue_test.cmj test/bs_rest_test.cmi test/bs_rest_test.cmj test/bs_set_int_test.cmi test/bs_set_int_test.cmj test/bs_splice_partial.cmi test/bs_splice_partial.cmj test/bs_stack_test.cmi test/bs_stack_test.cmj test/bs_string_test.cmi test/bs_string_test.cmj test/bs_unwrap_test.cmi test/bs_unwrap_test.cmj test/caml_compare_bigint_test.cmi test/caml_compare_bigint_test.cmj test/caml_compare_test.cmi test/caml_compare_test.cmj test/chain_code_test.cmi test/chain_code_test.cmj test/chn_test.cmi test/chn_test.cmj test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj test/coercion_module_alias_test.cmi test/coercion_module_alias_test.cmj test/compare_test.cmi test/compare_test.cmj test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj test/complex_test.cmi test/complex_test.cmj test/complex_while_loop.cmi test/complex_while_loop.cmj test/condition_compilation_test.cmi test/condition_compilation_test.cmj test/config1_test.cmi test/config1_test.cmj test/console_log_test.cmi test/console_log_test.cmj test/const_block_test.cmi test/const_block_test.cmj test/const_defs.cmi test/const_defs.cmj test/const_defs_test.cmi test/const_defs_test.cmj test/const_test.cmi test/const_test.cmj test/cont_int_fold_test.cmi test/cont_int_fold_test.cmj test/cps_test.cmi test/cps_test.cmj test/cross_module_inline_test.cmi test/cross_module_inline_test.cmj test/custom_error_test.cmi test/custom_error_test.cmj test/debug_keep_test.cmi test/debug_keep_test.cmj test/debug_mode_value.cmi test/debug_mode_value.cmj test/debug_tmp.cmi test/debug_tmp.cmj test/debugger_test.cmi test/debugger_test.cmj test/default_export_test.cmi test/default_export_test.cmj test/defunctor_make_test.cmi test/defunctor_make_test.cmj test/demo_int_map.cmi test/demo_int_map.cmj test/demo_page.cmi test/demo_page.cmj test/demo_pipe.cmi test/demo_pipe.cmj test/derive_projector_test.cmi test/derive_projector_test.cmj test/directives.cmi test/directives.cmj test/div_by_zero_test.cmi test/div_by_zero_test.cmj test/dollar_escape_test.cmi test/dollar_escape_test.cmj test/earger_curry_test.cmi test/earger_curry_test.cmj test/effect.cmi test/effect.cmj test/epsilon_test.cmi test/epsilon_test.cmj test/equal_box_test.cmi test/equal_box_test.cmj test/equal_exception_test.cmi test/equal_exception_test.cmj test/equal_test.cmi test/equal_test.cmj test/es6_export.cmi test/es6_export.cmj test/es6_import.cmi test/es6_import.cmj test/es6_module_test.cmi test/es6_module_test.cmj test/escape_esmodule.cmi test/escape_esmodule.cmj test/esmodule_ref.cmi test/esmodule_ref.cmj test/event_ffi.cmi test/event_ffi.cmj test/exception_alias.cmi test/exception_alias.cmj test/exception_raise_test.cmi test/exception_raise_test.cmj test/exception_rebound_err_test.cmi test/exception_rebound_err_test.cmj test/exception_value_test.cmi test/exception_value_test.cmj test/exotic_labels_test.cmi test/exotic_labels_test.cmj test/exponentiation_precedence_test.cmi test/exponentiation_precedence_test.cmj test/export_keyword.cmi test/export_keyword.cmj test/ext_array_test.cmi test/ext_array_test.cmj test/ext_pervasives_test.cmi test/ext_pervasives_test.cmj test/extensible_variant_test.cmi test/extensible_variant_test.cmj test/external_ppx.cmi test/external_ppx.cmj test/external_ppx2.cmi test/external_ppx2.cmj test/ffi_arity_test.cmi test/ffi_arity_test.cmj test/ffi_array_test.cmi test/ffi_array_test.cmj test/ffi_js_test.cmi test/ffi_js_test.cmj test/ffi_splice_test.cmi test/ffi_splice_test.cmj test/ffi_test.cmi test/ffi_test.cmj test/fib.cmi test/fib.cmj test/flattern_order_test.cmi test/flattern_order_test.cmj test/flexible_array_test.cmi test/flexible_array_test.cmj test/float_array.cmi test/float_array.cmj test/float_of_bits_test.cmi test/float_of_bits_test.cmj test/float_record.cmi test/float_record.cmj test/float_test.cmi test/float_test.cmj test/floatarray_test.cmi test/floatarray_test.cmj test/for_loop_test.cmi test/for_loop_test.cmj test/for_side_effect_test.cmi test/for_side_effect_test.cmj test/format_regression.cmi test/format_regression.cmj test/fun_pattern_match.cmi test/fun_pattern_match.cmj test/function_directives.cmi test/function_directives.cmj test/function_directives_no_inline.cmi test/function_directives_no_inline.cmj test/functor_app_test.cmi test/functor_app_test.cmj test/functor_def.cmi test/functor_def.cmj test/functor_ffi.cmi test/functor_ffi.cmj test/functor_inst.cmi test/functor_inst.cmj test/functors.cmi test/functors.cmj test/gbk.cmi test/gbk.cmj test/gentTypeReTest.cmi test/gentTypeReTest.cmj test/global_exception_regression_test.cmi test/global_exception_regression_test.cmj test/global_mangles.cmi test/global_mangles.cmj test/global_module_alias_test.cmi test/global_module_alias_test.cmj test/google_closure_test.cmi test/google_closure_test.cmj test/gpr496_test.cmi test/gpr496_test.cmj test/gpr_1072.cmi test/gpr_1072.cmj test/gpr_1072_reg.cmi test/gpr_1072_reg.cmj test/gpr_1150.cmi test/gpr_1150.cmj test/gpr_1154_test.cmi test/gpr_1154_test.cmj test/gpr_1170.cmi test/gpr_1170.cmj test/gpr_1240_missing_unbox.cmi test/gpr_1240_missing_unbox.cmj test/gpr_1245_test.cmi test/gpr_1245_test.cmj test/gpr_1268.cmi test/gpr_1268.cmj test/gpr_1409_test.cmi test/gpr_1409_test.cmj test/gpr_1423_app_test.cmi test/gpr_1423_app_test.cmj test/gpr_1423_nav.cmi test/gpr_1423_nav.cmj test/gpr_1438.cmi test/gpr_1438.cmj test/gpr_1481.cmi test/gpr_1481.cmj test/gpr_1484.cmi test/gpr_1484.cmj test/gpr_1539_test.cmi test/gpr_1539_test.cmj test/gpr_1658_test.cmi test/gpr_1658_test.cmj test/gpr_1667_test.cmi test/gpr_1667_test.cmj test/gpr_1692_test.cmi test/gpr_1692_test.cmj test/gpr_1698_test.cmi test/gpr_1698_test.cmj test/gpr_1701_test.cmi test/gpr_1701_test.cmj test/gpr_1716_test.cmi test/gpr_1716_test.cmj test/gpr_1717_test.cmi test/gpr_1717_test.cmj test/gpr_1728_test.cmi test/gpr_1728_test.cmj test/gpr_1749_test.cmi test/gpr_1749_test.cmj test/gpr_1759_test.cmi test/gpr_1759_test.cmj test/gpr_1760_test.cmi test/gpr_1760_test.cmj test/gpr_1762_test.cmi test/gpr_1762_test.cmj test/gpr_1817_test.cmi test/gpr_1817_test.cmj test/gpr_1822_test.cmi test/gpr_1822_test.cmj test/gpr_1891_test.cmi test/gpr_1891_test.cmj test/gpr_1943_test.cmi test/gpr_1943_test.cmj test/gpr_1946_test.cmi test/gpr_1946_test.cmj test/gpr_2316_test.cmi test/gpr_2316_test.cmj test/gpr_2352_test.cmi test/gpr_2352_test.cmj test/gpr_2413_test.cmi test/gpr_2413_test.cmj test/gpr_2474.cmi test/gpr_2474.cmj test/gpr_2487.cmi test/gpr_2487.cmj test/gpr_2503_test.cmi test/gpr_2503_test.cmj test/gpr_2608_test.cmi test/gpr_2608_test.cmj test/gpr_2614_test.cmi test/gpr_2614_test.cmj test/gpr_2633_test.cmi test/gpr_2633_test.cmj test/gpr_2642_test.cmi test/gpr_2642_test.cmj test/gpr_2682_test.cmi test/gpr_2682_test.cmj test/gpr_2700_test.cmi test/gpr_2700_test.cmj test/gpr_2731_test.cmi test/gpr_2731_test.cmj test/gpr_2789_test.cmi test/gpr_2789_test.cmj test/gpr_2931_test.cmi test/gpr_2931_test.cmj test/gpr_3142_test.cmi test/gpr_3142_test.cmj test/gpr_3154_test.cmi test/gpr_3154_test.cmj test/gpr_3209_test.cmi test/gpr_3209_test.cmj test/gpr_3492_test.cmi test/gpr_3492_test.cmj test/gpr_3519_jsx_test.cmi test/gpr_3519_jsx_test.cmj test/gpr_3519_test.cmi test/gpr_3519_test.cmj test/gpr_3536_test.cmi test/gpr_3536_test.cmj test/gpr_3546_test.cmi test/gpr_3546_test.cmj test/gpr_3548_test.cmi test/gpr_3548_test.cmj test/gpr_3549_test.cmi test/gpr_3549_test.cmj test/gpr_3566_drive_test.cmi test/gpr_3566_drive_test.cmj test/gpr_3566_test.cmi test/gpr_3566_test.cmj test/gpr_3595_test.cmi test/gpr_3595_test.cmj test/gpr_3609_test.cmi test/gpr_3609_test.cmj test/gpr_3697_test.cmi test/gpr_3697_test.cmj test/gpr_373_test.cmi test/gpr_373_test.cmj test/gpr_3770_test.cmi test/gpr_3770_test.cmj test/gpr_3852_alias.cmi test/gpr_3852_alias.cmj test/gpr_3852_alias_reify.cmi test/gpr_3852_alias_reify.cmj test/gpr_3852_effect.cmi test/gpr_3852_effect.cmj test/gpr_3865.cmi test/gpr_3865.cmj test/gpr_3865_bar.cmi test/gpr_3865_bar.cmj test/gpr_3865_foo.cmi test/gpr_3865_foo.cmj test/gpr_3875_test.cmi test/gpr_3875_test.cmj test/gpr_3877_test.cmi test/gpr_3877_test.cmj test/gpr_3895_test.cmi test/gpr_3895_test.cmj test/gpr_3897_test.cmi test/gpr_3897_test.cmj test/gpr_3931_test.cmi test/gpr_3931_test.cmj test/gpr_3980_test.cmi test/gpr_3980_test.cmj test/gpr_4025_test.cmi test/gpr_4025_test.cmj test/gpr_4069_test.cmi test/gpr_4069_test.cmj test/gpr_4265_test.cmi test/gpr_4265_test.cmj test/gpr_4274_test.cmi test/gpr_4274_test.cmj test/gpr_4280_test.cmi test/gpr_4280_test.cmj test/gpr_4407_test.cmi test/gpr_4407_test.cmj test/gpr_441.cmi test/gpr_441.cmj test/gpr_4442_test.cmi test/gpr_4442_test.cmj test/gpr_4491_test.cmi test/gpr_4491_test.cmj test/gpr_4494_test.cmi test/gpr_4494_test.cmj test/gpr_4519_test.cmi test/gpr_4519_test.cmj test/gpr_459_test.cmi test/gpr_459_test.cmj test/gpr_4632.cmi test/gpr_4632.cmj test/gpr_4639_test.cmi test/gpr_4639_test.cmj test/gpr_4900_test.cmi test/gpr_4900_test.cmj test/gpr_4924_test.cmi test/gpr_4924_test.cmj test/gpr_4931.cmi test/gpr_4931.cmj test/gpr_4931_allow.cmi test/gpr_4931_allow.cmj test/gpr_5071_test.cmi test/gpr_5071_test.cmj test/gpr_5169_test.cmi test/gpr_5169_test.cmj test/gpr_5218_test.cmi test/gpr_5218_test.cmj test/gpr_5280_optimize_test.cmi test/gpr_5280_optimize_test.cmj test/gpr_5557.cmi test/gpr_5557.cmj test/gpr_5753.cmi test/gpr_5753.cmj test/gpr_658.cmi test/gpr_658.cmj test/gpr_858_test.cmi test/gpr_858_test.cmj test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj test/gpr_904_test.cmi test/gpr_904_test.cmj test/gpr_974_test.cmi test/gpr_974_test.cmj test/gpr_977_test.cmi test/gpr_977_test.cmj test/gpr_return_type_unused_attribute.cmi test/gpr_return_type_unused_attribute.cmj test/gray_code_test.cmi test/gray_code_test.cmj test/guide_for_ext.cmi test/guide_for_ext.cmj test/hash_collision_test.cmi test/hash_collision_test.cmj test/hash_sugar_desugar.cmi test/hash_sugar_desugar.cmj test/hash_test.cmi test/hash_test.cmj test/hello.foo.cmi test/hello.foo.cmj test/hello_res.cmi test/hello_res.cmj test/ignore_test.cmi test/ignore_test.cmj test/ignore_uncurry_attribute.cmi test/ignore_uncurry_attribute.cmj test/import2.cmi test/import2.cmj test/import_external.cmi test/import_external.cmj test/import_side_effect.cmi test/import_side_effect.cmj test/import_side_effect_free.cmi test/import_side_effect_free.cmj test/include_side_effect.cmi test/include_side_effect.cmj test/include_side_effect_free.cmi test/include_side_effect_free.cmj test/incomplete_toplevel_test.cmi test/incomplete_toplevel_test.cmj test/infer_type_test.cmi test/infer_type_test.cmj test/inline_condition_with_pattern_matching.cmi test/inline_condition_with_pattern_matching.cmj test/inline_const.cmi test/inline_const.cmj test/inline_const_test.cmi test/inline_const_test.cmj test/inline_edge_cases.cmi test/inline_edge_cases.cmj test/inline_map2_test.cmi test/inline_map2_test.cmj test/inline_map_demo.cmi test/inline_map_demo.cmj test/inline_map_test.cmi test/inline_map_test.cmj test/inline_record_test.cmi test/inline_record_test.cmj test/inline_regression_test.cmi test/inline_regression_test.cmj test/inline_string_test.cmi test/inline_string_test.cmj test/inner_call.cmi test/inner_call.cmj test/inner_define.cmi test/inner_define.cmj test/inner_unused.cmi test/inner_unused.cmj test/installation_test.cmi test/installation_test.cmj test/int32_test.cmi test/int32_test.cmj test/int_map.cmi test/int_map.cmj test/int_overflow_test.cmi test/int_overflow_test.cmj test/int_poly_var.cmi test/int_poly_var.cmj test/int_switch_test.cmi test/int_switch_test.cmj test/internal_unused_test.cmi test/internal_unused_test.cmj test/js_array_test.cmi test/js_array_test.cmj test/js_bool_test.cmi test/js_bool_test.cmj test/js_cast_test.cmi test/js_cast_test.cmj test/js_date_test.cmi test/js_date_test.cmj test/js_dict_test.cmi test/js_dict_test.cmj test/js_exception_catch_test.cmi test/js_exception_catch_test.cmj test/js_float_test.cmi test/js_float_test.cmj test/js_global_test.cmi test/js_global_test.cmj test/js_int_test.cmi test/js_int_test.cmj test/js_json_test.cmi test/js_json_test.cmj test/js_math_test.cmi test/js_math_test.cmj test/js_null_test.cmi test/js_null_test.cmj test/js_null_undefined_test.cmi test/js_null_undefined_test.cmj test/js_nullable_test.cmi test/js_nullable_test.cmj test/js_obj_test.cmi test/js_obj_test.cmj test/js_option_test.cmi test/js_option_test.cmj test/js_re_test.cmi test/js_re_test.cmj test/js_string_test.cmi test/js_string_test.cmj test/js_undefined_test.cmi test/js_undefined_test.cmj test/js_val.cmi test/js_val.cmj test/jsoo_400_test.cmi test/jsoo_400_test.cmj test/jsoo_485_test.cmi test/jsoo_485_test.cmj test/jsxv4_newtype.cmi test/jsxv4_newtype.cmj test/keep_uncurry_attribute.cmi test/keep_uncurry_attribute.cmj test/key_word_property.cmi test/key_word_property.cmj test/key_word_property2.cmi test/key_word_property2.cmj test/key_word_property_plus_test.cmi test/key_word_property_plus_test.cmj test/label_uncurry.cmi test/label_uncurry.cmj test/large_integer_pat.cmi test/large_integer_pat.cmj test/large_record_duplication_test.cmi test/large_record_duplication_test.cmj test/largest_int_flow.cmi test/largest_int_flow.cmj test/lazy_demo.cmi test/lazy_demo.cmj test/lazy_test.cmi test/lazy_test.cmj test/lib_js_test.cmi test/lib_js_test.cmj test/libqueue_test.cmi test/libqueue_test.cmj test/limits_test.cmi test/limits_test.cmj test/list_stack.cmi test/list_stack.cmj test/list_test.cmi test/list_test.cmj test/local_exception_test.cmi test/local_exception_test.cmj test/loop_regression_test.cmi test/loop_regression_test.cmj test/map_find_test.cmi test/map_find_test.cmj test/map_test.cmi test/map_test.cmj test/mario_game.cmi test/mario_game.cmj test/meth_annotation.cmi test/meth_annotation.cmj test/method_name_test.cmi test/method_name_test.cmj test/method_string_name.cmi test/method_string_name.cmj test/minimal_test.cmi test/minimal_test.cmj test/miss_colon_test.cmi test/miss_colon_test.cmj test/mock_mt.cmi test/mock_mt.cmj test/module_alias_test.cmi test/module_alias_test.cmj test/module_as_class_ffi.cmi test/module_as_class_ffi.cmj test/module_as_function.cmi test/module_as_function.cmj test/module_missing_conversion.cmi test/module_missing_conversion.cmj test/module_parameter_test.cmi test/module_parameter_test.cmj test/module_splice_test.cmi test/module_splice_test.cmj test/more_poly_variant_test.cmi test/more_poly_variant_test.cmj test/more_uncurry.cmi test/more_uncurry.cmj test/mpr_6033_test.cmi test/mpr_6033_test.cmj test/mt.cmi test/mt.cmj test/mt_global.cmi test/mt_global.cmj test/mutable_obj_test.cmi test/mutable_obj_test.cmj test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj test/name_mangle_test.cmi test/name_mangle_test.cmj test/nested_include.cmi test/nested_include.cmj test/nested_module_alias.cmi test/nested_module_alias.cmj test/nested_obj_literal.cmi test/nested_obj_literal.cmj test/nested_obj_test.cmi test/nested_obj_test.cmj test/nested_pattern_match_test.cmi test/nested_pattern_match_test.cmj test/noassert.cmi test/noassert.cmj test/node_assert.cmi test/node_assert.cmj test/node_path_test.cmi test/node_path_test.cmj test/node_test.cmi test/node_test.cmj test/node_test_util.cmi test/node_test_util.cmj test/obj_literal_ppx.cmi test/obj_literal_ppx.cmj test/obj_literal_ppx_test.cmi test/obj_literal_ppx_test.cmj test/obj_magic_test.cmi test/obj_magic_test.cmj test/obj_type_test.cmi test/obj_type_test.cmj test/offset.cmi test/offset.cmj test/omit_trailing_undefined_in_external_calls.cmi test/omit_trailing_undefined_in_external_calls.cmj test/option_encoding_test.cmi test/option_encoding_test.cmj test/option_repr_test.cmi test/option_repr_test.cmj test/optional_ffi_test.cmi test/optional_ffi_test.cmj test/optional_regression_test.cmi test/optional_regression_test.cmj test/pipe_send_readline.cmi test/pipe_send_readline.cmj test/pipe_syntax.cmi test/pipe_syntax.cmj test/poly_empty_array.cmi test/poly_empty_array.cmj test/poly_variant_test.cmi test/poly_variant_test.cmj test/polymorphic_raw_test.cmi test/polymorphic_raw_test.cmj test/polymorphism_test.cmi test/polymorphism_test.cmj test/polyvar_convert.cmi test/polyvar_convert.cmj test/polyvar_test.cmi test/polyvar_test.cmj test/ppx_apply_test.cmi test/ppx_apply_test.cmj test/pq_test.cmi test/pq_test.cmj test/pr6726.cmi test/pr6726.cmj test/prepend_data_ffi.cmi test/prepend_data_ffi.cmj test/primitive_reg_test.cmi test/primitive_reg_test.cmj test/print_alpha_test.cmi test/print_alpha_test.cmj test/queue_402.cmi test/queue_402.cmj test/queue_test.cmi test/queue_test.cmj test/raw_output_test.cmi test/raw_output_test.cmj test/raw_pure_test.cmi test/raw_pure_test.cmj test/rbset.cmi test/rbset.cmj test/react.cmi test/react.cmj test/reactDOMRe.cmi test/reactDOMRe.cmj test/reactDOMServerRe.cmi test/reactDOMServerRe.cmj test/reactEvent.cmi test/reactEvent.cmj test/reactTestUtils.cmi test/reactTestUtils.cmj test/reasonReact.cmi test/reasonReact.cmj test/reasonReactCompat.cmi test/reasonReactCompat.cmj test/reasonReactOptimizedCreateClass.cmi test/reasonReactOptimizedCreateClass.cmj test/reasonReactRouter.cmi test/reasonReactRouter.cmj test/rebind_module.cmi test/rebind_module.cmj test/rebind_module_test.cmi test/rebind_module_test.cmj test/rec_array_test.cmi test/rec_array_test.cmj test/rec_fun_test.cmi test/rec_fun_test.cmj test/rec_module_opt.cmi test/rec_module_opt.cmj test/rec_module_test.cmi test/rec_module_test.cmj test/recmodule.cmi test/recmodule.cmj test/record_debug_test.cmi test/record_debug_test.cmj test/record_extension_test.cmi test/record_extension_test.cmj test/record_name_test.cmi test/record_name_test.cmj test/record_regression.cmi test/record_regression.cmj test/record_type_spread.cmi test/record_type_spread.cmj test/record_with_test.cmi test/record_with_test.cmj test/recursive_module.cmi test/recursive_module.cmj test/recursive_module_test.cmi test/recursive_module_test.cmj test/recursive_react_component.cmi test/recursive_react_component.cmj test/recursive_records_test.cmi test/recursive_records_test.cmj test/recursive_unbound_module_test.cmi test/recursive_unbound_module_test.cmj test/regression_print.cmi test/regression_print.cmj test/relative_path.cmi test/relative_path.cmj test/res_debug.cmi test/res_debug.cmj test/return_check.cmi test/return_check.cmj test/runtime_encoding_test.cmi test/runtime_encoding_test.cmj test/set_annotation.cmi test/set_annotation.cmj test/set_gen.cmi test/set_gen.cmj test/side_effect.cmi test/side_effect.cmj test/side_effect2.cmi test/side_effect2.cmj test/side_effect_free.cmi test/side_effect_free.cmj test/simplify_lambda_632o.cmi test/simplify_lambda_632o.cmj test/single_module_alias.cmi test/single_module_alias.cmj test/singular_unit_test.cmi test/singular_unit_test.cmj test/small_inline_test.cmi test/small_inline_test.cmj test/splice_test.cmi test/splice_test.cmj test/stack_comp_test.cmi test/stack_comp_test.cmj test/stack_test.cmi test/stack_test.cmj test/string_bound_get_test.cmi test/string_bound_get_test.cmj test/string_constant_compare.cmi test/string_constant_compare.cmj test/string_set.cmi test/string_set.cmj test/string_set_test.cmi test/string_set_test.cmj test/string_unicode_test.cmi test/string_unicode_test.cmj test/stringmatch_test.cmi test/stringmatch_test.cmj test/submodule.cmi test/submodule.cmj test/submodule_call.cmi test/submodule_call.cmj test/switch_case_test.cmi test/switch_case_test.cmj test/switch_string.cmi test/switch_string.cmj test/tagged_template_test.cmi test/tagged_template_test.cmj test/tailcall_inline_test.cmi test/tailcall_inline_test.cmj test/template.cmi test/template.cmj test/test2.cmi test/test2.cmj test/test_alias.cmi test/test_alias.cmj test/test_ari.cmi test/test_ari.cmj test/test_array.cmi test/test_array.cmj test/test_array_append.cmi test/test_array_append.cmj test/test_array_primitive.cmi test/test_array_primitive.cmj test/test_bool_equal.cmi test/test_bool_equal.cmj test/test_bs_this.cmi test/test_bs_this.cmj test/test_case_opt_collision.cmi test/test_case_opt_collision.cmj test/test_case_set.cmi test/test_case_set.cmj test/test_char.cmi test/test_char.cmj test/test_closure.cmi test/test_closure.cmj test/test_common.cmi test/test_common.cmj test/test_const_elim.cmi test/test_const_elim.cmj test/test_const_propogate.cmi test/test_const_propogate.cmj test/test_cpp.cmi test/test_cpp.cmj test/test_cps.cmi test/test_cps.cmj test/test_demo.cmi test/test_demo.cmj test/test_dup_param.cmi test/test_dup_param.cmj test/test_eq.cmi test/test_eq.cmj test/test_exception.cmi test/test_exception.cmj test/test_exception_escape.cmi test/test_exception_escape.cmj test/test_export2.cmi test/test_export2.cmj test/test_external.cmi test/test_external.cmj test/test_external_unit.cmi test/test_external_unit.cmj test/test_ffi.cmi test/test_ffi.cmj test/test_fib.cmi test/test_fib.cmj test/test_for_loop.cmi test/test_for_loop.cmj test/test_for_map.cmi test/test_for_map.cmj test/test_for_map2.cmi test/test_for_map2.cmj test/test_functor_dead_code.cmi test/test_functor_dead_code.cmj test/test_generative_module.cmi test/test_generative_module.cmj test/test_global_print.cmi test/test_global_print.cmj test/test_google_closure.cmi test/test_google_closure.cmj test/test_include.cmi test/test_include.cmj test/test_incomplete.cmi test/test_incomplete.cmj test/test_incr_ref.cmi test/test_incr_ref.cmj test/test_int_map_find.cmi test/test_int_map_find.cmj test/test_is_js.cmi test/test_is_js.cmj test/test_js_ffi.cmi test/test_js_ffi.cmj test/test_let.cmi test/test_let.cmj test/test_list.cmi test/test_list.cmj test/test_literal.cmi test/test_literal.cmj test/test_literals.cmi test/test_literals.cmj test/test_match_exception.cmi test/test_match_exception.cmj test/test_mutliple.cmi test/test_mutliple.cmj test/test_nat64.cmi test/test_nat64.cmj test/test_nested_let.cmi test/test_nested_let.cmj test/test_nested_print.cmi test/test_nested_print.cmj test/test_non_export.cmi test/test_non_export.cmj test/test_nullary.cmi test/test_nullary.cmj test/test_obj.cmi test/test_obj.cmj test/test_order.cmi test/test_order.cmj test/test_order_tailcall.cmi test/test_order_tailcall.cmj test/test_other_exn.cmi test/test_other_exn.cmj test/test_per.cmi test/test_per.cmj test/test_pervasive.cmi test/test_pervasive.cmj test/test_pervasives2.cmi test/test_pervasives2.cmj test/test_pervasives3.cmi test/test_pervasives3.cmj test/test_primitive.cmi test/test_primitive.cmj test/test_ramification.cmi test/test_ramification.cmj test/test_react.cmi test/test_react.cmj test/test_react_case.cmi test/test_react_case.cmj test/test_regex.cmi test/test_regex.cmj test/test_runtime_encoding.cmi test/test_runtime_encoding.cmj test/test_scope.cmi test/test_scope.cmj test/test_seq.cmi test/test_seq.cmj test/test_set.cmi test/test_set.cmj test/test_side_effect_functor.cmi test/test_side_effect_functor.cmj test/test_simple_include.cmi test/test_simple_include.cmj test/test_simple_pattern_match.cmi test/test_simple_pattern_match.cmj test/test_simple_ref.cmi test/test_simple_ref.cmj test/test_simple_tailcall.cmi test/test_simple_tailcall.cmj test/test_small.cmi test/test_small.cmj test/test_stack.cmi test/test_stack.cmj test/test_static_catch_ident.cmi test/test_static_catch_ident.cmj test/test_string.cmi test/test_string.cmj test/test_string_case.cmi test/test_string_case.cmj test/test_string_const.cmi test/test_string_const.cmj test/test_string_map.cmi test/test_string_map.cmj test/test_string_switch.cmi test/test_string_switch.cmj test/test_switch.cmi test/test_switch.cmj test/test_trywith.cmi test/test_trywith.cmj test/test_tuple.cmi test/test_tuple.cmj test/test_tuple_destructring.cmi test/test_tuple_destructring.cmj test/test_type_based_arity.cmi test/test_type_based_arity.cmj test/test_u.cmi test/test_u.cmj test/test_unknown.cmi test/test_unknown.cmj test/test_unsafe_cmp.cmi test/test_unsafe_cmp.cmj test/test_unsafe_obj_ffi.cmi test/test_unsafe_obj_ffi.cmj test/test_unsafe_obj_ffi_ppx.cmi test/test_unsafe_obj_ffi_ppx.cmj test/test_while_closure.cmi test/test_while_closure.cmj test/test_while_side_effect.cmi test/test_while_side_effect.cmj test/test_zero_nullable.cmi test/test_zero_nullable.cmj test/then_mangle_test.cmi test/then_mangle_test.cmj test/ticker.cmi test/ticker.cmj test/to_string_test.cmi test/to_string_test.cmj test/topsort_test.cmi test/topsort_test.cmj test/tramp_fib.cmi test/tramp_fib.cmj test/tuple_alloc.cmi test/tuple_alloc.cmj test/type-coercion-free-vars.cmi test/type-coercion-free-vars.cmj test/type_disambiguate.cmi test/type_disambiguate.cmj test/typeof_test.cmi test/typeof_test.cmj test/unboxed_attribute.cmi test/unboxed_attribute.cmj test/unboxed_attribute_test.cmi test/unboxed_attribute_test.cmj test/unboxed_crash.cmi test/unboxed_crash.cmj test/unboxed_use_case.cmi test/unboxed_use_case.cmj test/uncurried_cast.cmi test/uncurried_cast.cmj test/uncurried_default.args.cmi test/uncurried_default.args.cmj test/uncurried_pipe.cmi test/uncurried_pipe.cmj test/uncurry_external_test.cmi test/uncurry_external_test.cmj test/uncurry_glob_test.cmi test/uncurry_glob_test.cmj test/uncurry_test.cmi test/uncurry_test.cmj test/undef_regression_test.cmi test/undef_regression_test.cmj test/unit_undefined_test.cmi test/unit_undefined_test.cmj test/unsafe_full_apply_primitive.cmi test/unsafe_full_apply_primitive.cmj test/unsafe_ppx_test.cmi test/unsafe_ppx_test.cmj test/update_record_test.cmi test/update_record_test.cmj test/variant.cmi test/variant.cmj test/variantsMatching.cmi test/variantsMatching.cmj test/webpack_config.cmi test/webpack_config.cmj diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js deleted file mode 100644 index c119acaafda..00000000000 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Mt = require("./mt.js"); -let Bytes = require("../../lib/js/bytes.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); - -let suites = { - contents: /* [] */0 -}; - -let test_id = { - contents: 0 -}; - -function eq(loc, param) { - let y = param[1]; - let x = param[0]; - test_id.contents = test_id.contents + 1 | 0; - suites.contents = { - hd: [ - loc + (" id " + test_id.contents.toString()), - () => ({ - TAG: "Eq", - _0: x, - _1: y - }) - ], - tl: suites.contents - }; -} - -let b = [ - 0, - 0, - 0 -]; - -Caml_bytes.set(b, 0, /* 'a' */97); - -Caml_bytes.set(b, 1, /* 'b' */98); - -Caml_bytes.set(b, 2, /* 'c' */99); - -Bytes.blit(b, 0, b, 1, 2); - -let res = Bytes.unsafe_to_string(b); - -console.log(res); - -eq("File \"bytes_split_gpr_743_test.res\", line 20, characters 5-12", [ - "aab", - res -]); - -let b$1 = [ - 0, - 0, - 0 -]; - -Caml_bytes.set(b$1, 0, /* 'a' */97); - -Caml_bytes.set(b$1, 1, /* 'b' */98); - -Caml_bytes.set(b$1, 2, /* 'c' */99); - -Bytes.blit(b$1, 1, b$1, 0, 2); - -let res2 = Bytes.unsafe_to_string(b$1); - -console.log(res2); - -eq("File \"bytes_split_gpr_743_test.res\", line 35, characters 5-12", [ - "bcc", - res2 -]); - -Mt.from_pair_suites("Bytes_split_gpr_743_test", suites.contents); - -exports.suites = suites; -exports.test_id = test_id; -exports.eq = eq; -/* Not a pure module */ diff --git a/jscomp/test/bytes_split_gpr_743_test.res b/jscomp/test/bytes_split_gpr_743_test.res deleted file mode 100644 index bb8a36a3138..00000000000 --- a/jscomp/test/bytes_split_gpr_743_test.res +++ /dev/null @@ -1,38 +0,0 @@ -let suites: ref = ref(list{}) -let test_id = ref(0) -let eq = (loc, (x, y)) => { - incr(test_id) - suites := - list{ - (loc ++ (" id " ++ Js.Int.toString(test_id.contents)), _ => Mt.Eq(x, y)), - ...suites.contents, - } -} - -let () = { - let b = Bytes.create(3) - Bytes.set(b, 0, 'a') - Bytes.set(b, 1, 'b') - Bytes.set(b, 2, 'c') - Bytes.blit(b, 0, b, 1, 2) - let res = Bytes.unsafe_to_string(b) - Js.log(res) /* "aab" */ - eq(__LOC__, ("aab", res)) -} -/* assert('a' = Bytes.get b 0); */ -/* assert('a' = Bytes.get b 1); */ -/* assert('b' = Bytes.get b 2); */ -/* () */ - -let () = { - let b = Bytes.create(3) - Bytes.set(b, 0, 'a') - Bytes.set(b, 1, 'b') - Bytes.set(b, 2, 'c') - Bytes.blit(b, 1, b, 0, 2) - let res2 = Bytes.unsafe_to_string(b) - Js.log(res2) /* "bcc" */ - eq(__LOC__, ("bcc", res2)) -} - -let () = Mt.from_pair_suites(__MODULE__, suites.contents) diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js deleted file mode 100644 index 15a13ed2bce..00000000000 --- a/jscomp/test/complex_if_test.js +++ /dev/null @@ -1,143 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Mt = require("./mt.js"); -let Bytes = require("../../lib/js/bytes.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); - -function fib(x) { - if (x !== 1 && x !== 23) { - return fib(x - 1 | 0) + fib(x - 2 | 0) | 0; - } else { - return 11111123; - } -} - -function escaped(s) { - let n = 0; - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - let match = s[i]; - n = n + ( - match >= 32 ? ( - match > 92 || match < 34 ? ( - match >= 127 ? 4 : 1 - ) : ( - match > 91 || match < 35 ? 2 : 1 - ) - ) : ( - match >= 11 ? ( - match !== 13 ? 4 : 2 - ) : ( - match >= 8 ? 2 : 4 - ) - ) - ) | 0; - } - if (n === s.length) { - return Bytes.copy(s); - } - let s$p = Caml_bytes.create(n); - n = 0; - for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { - let c = s[i$1]; - let exit = 0; - if (c >= 35) { - if (c !== 92) { - if (c >= 127) { - exit = 1; - } else { - s$p[n] = c; - } - } else { - exit = 2; - } - } else if (c >= 32) { - if (c >= 34) { - exit = 2; - } else { - s$p[n] = c; - } - } else if (c >= 14) { - exit = 1; - } else { - switch (c) { - case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; - case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; - case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit = 1; - break; - case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - } - } - switch (exit) { - case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; - case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - } - n = n + 1 | 0; - } - return s$p; -} - -function string_escaped(s) { - return Bytes.to_string(escaped(Bytes.of_string(s))); -} - -let suites_0 = [ - "complete_escape", - param => ({ - TAG: "Eq", - _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), - _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" - }) -]; - -let suites = { - hd: suites_0, - tl: /* [] */0 -}; - -Mt.from_pair_suites("Complex_if_test", suites); - -exports.fib = fib; -exports.escaped = escaped; -exports.string_escaped = string_escaped; -exports.suites = suites; -/* Not a pure module */ diff --git a/jscomp/test/complex_if_test.res b/jscomp/test/complex_if_test.res deleted file mode 100644 index c3e838f8df1..00000000000 --- a/jscomp/test/complex_if_test.res +++ /dev/null @@ -1,82 +0,0 @@ -let rec fib = x => - switch x { - | 1 | 23 => 11111123 - | n => fib(n - 1) + fib(n - 2) - } - -open Bytes -external char_code: char => int = "%identity" -external char_chr: int => char = "%identity" - -let escaped = s => { - let n = ref(0) - for i in 0 to length(s) - 1 { - n := - n.contents + - switch unsafe_get(s, i) { - | '"' | '\\' | '\n' | '\t' | '\r' | '\b' => 2 - | ' ' .. '~' => 1 - | _ => 4 - } - } - if n.contents == length(s) { - copy(s) - } else { - let s' = create(n.contents) - n := 0 - for i in 0 to length(s) - 1 { - switch unsafe_get(s, i) { - | ('"' | '\\') as c => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, c) - | '\n' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'n') - | '\t' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 't') - | '\r' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'r') - | '\b' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'b') - | ' ' .. '~' as c => unsafe_set(s', n.contents, c) - | c => - let a = char_code(c) - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, char_chr(48 + a / 100)) - incr(n) - unsafe_set(s', n.contents, char_chr(48 + mod(a / 10, 10))) - incr(n) - unsafe_set(s', n.contents, char_chr(48 + mod(a, 10))) - } - incr(n) - } - s' - } -} -let string_escaped = s => Bytes.to_string(escaped(Bytes.of_string(s))) - -/* let s = (let v = ref "" in for i = 0 to 255 do v := !v ^ (String.make 1 (Char.chr i)) done ; !v);; */ -let suites = { - open Mt - list{ - ( - "complete_escape", - _ => Eq( - string_escaped( - "\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", - ), - "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255", - ), - ), - } -} -Mt.from_pair_suites(__MODULE__, suites) diff --git a/jscomp/test/equal_exception_test.js b/jscomp/test/equal_exception_test.js index 263778a862c..7eb1dd7cbb1 100644 --- a/jscomp/test/equal_exception_test.js +++ b/jscomp/test/equal_exception_test.js @@ -2,9 +2,7 @@ 'use strict'; let Mt = require("./mt.js"); -let Bytes = require("../../lib/js/bytes.js"); let Caml_obj = require("../../lib/js/caml_obj.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); let Caml_string = require("../../lib/js/caml_string.js"); let Caml_exceptions = require("../../lib/js/caml_exceptions.js"); let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); @@ -12,44 +10,6 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); let v = "gso"; function is_equal() { - if (Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0) !== /* 'a' */97) { - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 4, - 2 - ] - } - }); - } - if (Bytes.make(3, /* 'a' */97)[0] !== /* 'a' */97) { - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 5, - 2 - ] - } - }); - } - let u = Bytes.make(3, /* 'a' */97); - u[0] = /* 'b' */98; - if (u[0] !== /* 'b' */98) { - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 8, - 2 - ] - } - }); - } if (Caml_string.get(v, 0) === /* 'g' */103) { return; } @@ -58,7 +18,7 @@ function is_equal() { RE_EXN_ID: "Assert_failure", _1: [ "equal_exception_test.res", - 9, + 4, 2 ] } @@ -170,7 +130,7 @@ if (Caml_obj.equal(e, { RE_EXN_ID: "Assert_failure", _1: [ "equal_exception_test.res", - 50, + 45, 0 ] } @@ -183,7 +143,7 @@ if (Not_found === "Not_found" !== false) { RE_EXN_ID: "Assert_failure", _1: [ "equal_exception_test.res", - 51, + 46, 0 ] } diff --git a/jscomp/test/equal_exception_test.res b/jscomp/test/equal_exception_test.res index fc214569647..dd7d77e3018 100644 --- a/jscomp/test/equal_exception_test.res +++ b/jscomp/test/equal_exception_test.res @@ -1,11 +1,6 @@ let v = "gso" let is_equal = () => { - assert(Bytes.get(Bytes.make(3, 'a'), 0) == 'a') - assert(Bytes.unsafe_get(Bytes.make(3, 'a'), 0) == 'a') - let u = Bytes.make(3, 'a') - Bytes.unsafe_set(u, 0, 'b') - assert(Bytes.unsafe_get(u, 0) == 'b') assert(String.get(v, 0) == 'g') } diff --git a/jscomp/test/gray_code_test.js b/jscomp/test/gray_code_test.js index 1e3a14edcd4..a07c7bb844f 100644 --- a/jscomp/test/gray_code_test.js +++ b/jscomp/test/gray_code_test.js @@ -1,8 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; -let Bytes = require("../../lib/js/bytes.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); function gray_encode(b) { return b ^ (b >>> 1); @@ -23,25 +21,6 @@ function gray_decode(n) { }; } -function bool_string(len, n) { - let s = Bytes.make(len, /* '0' */48); - let _i = len - 1 | 0; - let _n = n; - while (true) { - let n$1 = _n; - let i = _i; - if ((n$1 & 1) === 1) { - Caml_bytes.set(s, i, /* '1' */49); - } - if (i <= 0) { - return s; - } - _n = (n$1 >>> 1); - _i = i - 1 | 0; - continue; - }; -} - function next_power(v) { let v$1 = v - 1 | 0; let v$2 = (v$1 >>> 1) | v$1; @@ -54,6 +33,5 @@ function next_power(v) { exports.gray_encode = gray_encode; exports.gray_decode = gray_decode; -exports.bool_string = bool_string; exports.next_power = next_power; /* No side effect */ diff --git a/jscomp/test/gray_code_test.res b/jscomp/test/gray_code_test.res index 8131da43457..6f7fa875764 100644 --- a/jscomp/test/gray_code_test.res +++ b/jscomp/test/gray_code_test.res @@ -11,22 +11,6 @@ let gray_decode = n => { aux(n, lsr(n, 1)) } -let bool_string = (len, n) => { - let s = Bytes.make(len, '0') - let rec aux = (i, n) => { - if land(n, 1) == 1 { - Bytes.set(s, i, '1') - } - if i <= 0 { - s - } else { - aux(pred(i), lsr(n, 1)) - } - } - - aux(pred(len), n) -} - let next_power = v => { let v = v - 1 let v = lor(lsr(v, 1), v) diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index aebfabff040..030f6e09e9d 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -2,11 +2,9 @@ 'use strict'; let Mt = require("./mt.js"); -let Char = require("../../lib/js/char.js"); let $$Array = require("../../lib/js/array.js"); let Hashtbl = require("../../lib/js/hashtbl.js"); let Mt_global = require("./mt_global.js"); -let Caml_string = require("../../lib/js/caml_string.js"); let suites = { contents: /* [] */0 @@ -20,7 +18,7 @@ function eq(f, x, y) { Mt_global.collect_eq(test_id, suites, f, x, y); } -let test_strings = $$Array.init(32, i => Caml_string.make(i, Char.chr(i))); +let test_strings = $$Array.init(32, i => String.fromCodePoint(i).repeat(i)); let test_strings_hash_results = [ 0, diff --git a/jscomp/test/hash_test.res b/jscomp/test/hash_test.res index 8771d12a7c5..f71007343f3 100644 --- a/jscomp/test/hash_test.res +++ b/jscomp/test/hash_test.res @@ -2,7 +2,7 @@ let suites: ref = ref(list{}) let test_id = ref(0) let eq = (f, x, y) => Mt_global.collect_eq(test_id, suites, f, x, y) -let test_strings = Array.init(32, i => String.make(i, Char.chr(i))) +let test_strings = Array.init(32, i => Js.String2.fromCodePoint(i)->Js.String2.repeat(i)) let test_strings_hash_results = [ 0, diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 56018ba3091..5d0704d7d20 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -2,7 +2,6 @@ 'use strict'; let Mt = require("./mt.js"); -let $$String = require("../../lib/js/string.js"); let Caml_string = require("../../lib/js/caml_string.js"); function generic_basename(is_dir_sep, current_dir_name, name) { @@ -13,7 +12,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { while (true) { let n = _n; if (n < 0) { - return $$String.sub(name, 0, 1); + return name.substr(0, 1); } if (!is_dir_sep(name, n)) { let _n$1 = n; @@ -21,10 +20,10 @@ function generic_basename(is_dir_sep, current_dir_name, name) { while (true) { let n$1 = _n$1; if (n$1 < 0) { - return $$String.sub(name, 0, p); + return name.substr(0, p); } if (is_dir_sep(name, n$1)) { - return $$String.sub(name, n$1 + 1 | 0, (p - n$1 | 0) - 1 | 0); + return name.substr(n$1 + 1 | 0, (p - n$1 | 0) - 1 | 0); } _n$1 = n$1 - 1 | 0; continue; diff --git a/jscomp/test/inline_regression_test.res b/jscomp/test/inline_regression_test.res index 8c089a49dc3..4b197bf34bc 100644 --- a/jscomp/test/inline_regression_test.res +++ b/jscomp/test/inline_regression_test.res @@ -1,7 +1,7 @@ let generic_basename = (is_dir_sep, current_dir_name, name) => { let rec find_end = n => if n < 0 { - String.sub(name, 0, 1) + Js.String2.substrAtMost(name, ~from=0, ~length=1) } else if is_dir_sep(name, n) { find_end(n - 1) } else { @@ -9,9 +9,9 @@ let generic_basename = (is_dir_sep, current_dir_name, name) => { } and find_beg = (n, p) => if n < 0 { - String.sub(name, 0, p) + Js.String2.substrAtMost(name, ~from=0, ~length=p) } else if is_dir_sep(name, n) { - String.sub(name, n + 1, p - n - 1) + Js.String2.substrAtMost(name, ~from=n + 1, ~length=p - n - 1) } else { find_beg(n - 1, p) } @@ -19,7 +19,7 @@ let generic_basename = (is_dir_sep, current_dir_name, name) => { if name == "" { current_dir_name } else { - find_end(String.length(name) - 1) + find_end(Js.String2.length(name) - 1) } } diff --git a/jscomp/test/string_bound_get_test.js b/jscomp/test/string_bound_get_test.js index 3cb61d01e25..364c34ee46e 100644 --- a/jscomp/test/string_bound_get_test.js +++ b/jscomp/test/string_bound_get_test.js @@ -1,7 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; -let Caml_bytes = require("../../lib/js/caml_bytes.js"); let Caml_string = require("../../lib/js/caml_string.js"); let v = "ghos"; @@ -18,20 +17,9 @@ function u_d() { return Caml_string.get("ghos", -1); } -let u_e = Caml_bytes.create(32); - -let u_f = Caml_bytes.get(u_e, 0); - -function u_g() { - return Caml_bytes.get(u_e, -1); -} - exports.v = v; exports.u_a = u_a; exports.u_b = u_b; exports.u_c = u_c; exports.u_d = u_d; -exports.u_e = u_e; -exports.u_f = u_f; -exports.u_g = u_g; /* No side effect */ diff --git a/jscomp/test/string_bound_get_test.res b/jscomp/test/string_bound_get_test.res index 6a6b5cc2ea9..333ed3dad39 100644 --- a/jscomp/test/string_bound_get_test.res +++ b/jscomp/test/string_bound_get_test.res @@ -6,9 +6,3 @@ let u_b = () => String.get(v, -1) let u_c = String.get("ghos", 0) let u_d = () => String.get("ghos", -1) - -let u_e = Bytes.create(32) - -let u_f = Bytes.get(u_e, 0) - -let u_g = () => Bytes.get(u_e, -1) diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js deleted file mode 100644 index 11516e72254..00000000000 --- a/jscomp/test/string_get_set_test.js +++ /dev/null @@ -1,19 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Mt = require("./mt.js"); -let Caml_string = require("../../lib/js/caml_string.js"); - -Mt.from_pair_suites("string_get_set_test.res", { - hd: [ - "File \"string_get_set_test.res\", line 4, characters 36-43", - () => ({ - TAG: "Eq", - _0: Caml_string.get("h", 0), - _1: /* 'h' */104 - }) - ], - tl: /* [] */0 -}); - -/* Not a pure module */ diff --git a/jscomp/test/string_get_set_test.res b/jscomp/test/string_get_set_test.res deleted file mode 100644 index 3e9b4b076a6..00000000000 --- a/jscomp/test/string_get_set_test.res +++ /dev/null @@ -1,66 +0,0 @@ -@@config({no_export: no_export}) -let \".%()" = (s: string, i) => String.get(s, i) - -Mt.from_pair_suites(__FILE__, list{(__LOC__, _ => Eq(\".%()"("h", 0), 'h'))}) -/* external caml_string_get_16 : string -> int -> int = "%caml_string_get16" -external caml_string_get_32 : string -> int -> int32 = "%caml_string_get32" -external caml_string_get_64 : string -> int -> int64 = "%caml_string_get64" */ - -/* TODO: endian-aware ? */ -/* ;; Mt.from_pair_suites __MODULE__ Mt.[ - __LOC__ , (fun _ -> Eq (caml_string_get_16 "2\000" 0, 50)); - __LOC__ , (fun _ -> Eq (caml_string_get_16 "20" 0, 12338)); - __LOC__, (fun _ -> Eq(caml_string_get_32 "0123" 0, 858927408l)); - __LOC__, (fun _ -> Eq(caml_string_get_32 "0123" 0, 858927408l)); - __LOC__, (fun _ -> Eq(caml_string_get_32 "3210" 0, 808530483l)); - __LOC__, (fun _ -> Eq(caml_string_get_64 "12345678" 0, 4050765991979987505L)); - __LOC__, (fun _ -> Eq(caml_string_get_64 "87654321" 0, 3544952156018063160L)) -] */ - -/* (\** does not make sense under immutable string setting *\) */ -/* external caml_string_set_16 : string -> int -> int -> unit = */ -/* "%caml_string_set16" */ -/* external caml_string_set_32 : string -> int -> int32 -> unit = */ -/* "%caml_string_set32" */ -/* external caml_string_set_64 : string -> int -> int64 -> unit = */ -/* "%caml_string_set64" */ - -/* let s = String.make 10 '\x00' */ -/* let empty_s = "" */ - -/* let assert_bound_check2 f v1 v2 = */ -/* try */ -/* ignore(f v1 v2); */ -/* assert false */ -/* with */ -/* | Invalid_argument("index out of bounds") -> () */ - -/* let assert_bound_check3 f v1 v2 v3 = */ -/* try */ -/* ignore(f v1 v2 v3); */ -/* assert false */ -/* with */ -/* | Invalid_argument("index out of bounds") -> () */ - -/* let f () = */ -/* assert_bound_check2 caml_string_get_16 s (-1); */ -/* assert_bound_check2 caml_string_get_16 s 9; */ -/* assert_bound_check2 caml_string_get_32 s (-1); */ -/* assert_bound_check2 caml_string_get_32 s 7; */ -/* assert_bound_check2 caml_string_get_64 s (-1); */ -/* assert_bound_check2 caml_string_get_64 s 3; */ - -/* assert_bound_check3 caml_string_set_16 s (-1) 0; */ -/* assert_bound_check3 caml_string_set_16 s 9 0; */ -/* assert_bound_check3 caml_string_set_32 s (-1) 0l; */ -/* assert_bound_check3 caml_string_set_32 s 7 0l; */ -/* assert_bound_check3 caml_string_set_64 s (-1) 0L; */ -/* assert_bound_check3 caml_string_set_64 s 3 0L; */ - -/* assert_bound_check2 caml_string_get_16 empty_s 0; */ -/* assert_bound_check2 caml_string_get_32 empty_s 0; */ -/* assert_bound_check2 caml_string_get_64 empty_s 0; */ - -/* assert_bound_check3 caml_string_set_16 empty_s 0 0; */ -/* assert_bound_check3 caml_string_set_32 empty_s 0 0l; */ -/* assert_bound_check3 caml_string_set_64 empty_s 0 0L */ diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js deleted file mode 100644 index 29e44751c31..00000000000 --- a/jscomp/test/string_runtime_test.js +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Mt = require("./mt.js"); -let List = require("../../lib/js/list.js"); -let Bytes = require("../../lib/js/bytes.js"); -let Test_char = require("./test_char.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); - -let suites_0 = [ - "?is_printable", - param => ({ - TAG: "Eq", - _0: Test_char.caml_is_printable(/* 'a' */97), - _1: true - }) -]; - -let suites_1 = { - hd: [ - "?string_of_bytes", - param => { - let match = List.split(List.map(x => { - let b = Caml_bytes.create(x); - Bytes.fill(b, 0, x, /* 'c' */99); - return [ - Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, param => /* 'c' */99)) - ]; - }, { - hd: 1000, - tl: { - hd: 1024, - tl: { - hd: 1025, - tl: { - hd: 4095, - tl: { - hd: 4096, - tl: { - hd: 5000, - tl: { - hd: 10000, - tl: /* [] */0 - } - } - } - } - } - } - })); - return { - TAG: "Eq", - _0: match[0], - _1: match[1] - }; - } - ], - tl: /* [] */0 -}; - -let suites = { - hd: suites_0, - tl: suites_1 -}; - -Mt.from_pair_suites("String_runtime_test", suites); - -let S; - -let B; - -exports.S = S; -exports.B = B; -exports.suites = suites; -/* Not a pure module */ diff --git a/jscomp/test/string_runtime_test.res b/jscomp/test/string_runtime_test.res deleted file mode 100644 index 112b92acbc1..00000000000 --- a/jscomp/test/string_runtime_test.res +++ /dev/null @@ -1,35 +0,0 @@ -module S = Caml_string -/** TODO: performance could be improved, however, - this function is not in critical Path - */ -module B = Caml_bytes - -/** TODO: performance could be improved, however, - this function is not in critical Path - */ -let suites = { - open Mt - list{ - /* "string_of_char_array", (fun _ -> - Eq(S.caml_string_of_char_array [|'a';'b';'c'|], "abc") - ); */ - ("?is_printable", _ => Eq(Test_char.caml_is_printable('a'), true)), - ( - "?string_of_bytes", - _ => { - let f = len => { - let b = Bytes.create(len) - Bytes.fill(b, 0, len, 'c') - (Bytes.to_string(b), String.init(len, _ => 'c')) - } - let (a, b) = \"@@"( - List.split, - List.map(x => f(x), list{1000, 1024, 1025, 4095, 4096, 5000, 10000}), - ) - Eq(a, b) - }, - ), - } -} - -Mt.from_pair_suites(__MODULE__, suites) diff --git a/jscomp/test/test_bug.js b/jscomp/test/test_bug.js deleted file mode 100644 index 47d483ac4e2..00000000000 --- a/jscomp/test/test_bug.js +++ /dev/null @@ -1,109 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Bytes = require("../../lib/js/bytes.js"); -let Test_char = require("./test_char.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); - -function escaped(s) { - let n = 0; - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - let c = s[i]; - let tmp; - let exit = 0; - if (c >= 14) { - if (c !== 34 && c !== 92) { - exit = 1; - } else { - tmp = 2; - } - } else if (c >= 11) { - if (c >= 13) { - tmp = 2; - } else { - exit = 1; - } - } else if (c >= 8) { - tmp = 2; - } else { - exit = 1; - } - if (exit === 1) { - tmp = Test_char.caml_is_printable(c) ? 1 : 4; - } - n = n + tmp | 0; - } - if (n === s.length) { - return Bytes.copy(s); - } - let s$p = Caml_bytes.create(n); - n = 0; - for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { - let c$1 = s[i$1]; - let exit$1 = 0; - if (c$1 > 92 || c$1 < 34) { - if (c$1 >= 14) { - exit$1 = 1; - } else { - switch (c$1) { - case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; - case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; - case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit$1 = 1; - break; - case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - } - } - } else if (c$1 > 91 || c$1 < 35) { - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c$1; - } else { - exit$1 = 1; - } - if (exit$1 === 1) { - if (Test_char.caml_is_printable(c$1)) { - s$p[n] = c$1; - } else { - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c$1 / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c$1 / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c$1 % 10 | 0; - } - } - n = n + 1 | 0; - } - return s$p; -} - -exports.escaped = escaped; -/* No side effect */ diff --git a/jscomp/test/test_bug.res b/jscomp/test/test_bug.res deleted file mode 100644 index c24452d5ebc..00000000000 --- a/jscomp/test/test_bug.res +++ /dev/null @@ -1,67 +0,0 @@ -external string_length: string => int = "%string_length" -external unsafe_blit_string: (string, int, bytes, int, int) => unit = "?blit_string" - -external char_code: char => int = "%identity" -external char_chr: int => char = "%identity" -open Bytes -let escaped = s => { - let n = ref(0) - for i in 0 to length(s) - 1 { - n := - n.contents + - switch unsafe_get(s, i) { - | '"' | '\\' | '\n' | '\t' | '\r' | '\b' => 2 - | c => - if Test_char.caml_is_printable(c) { - 1 - } else { - 4 - } - } - } - if n.contents == length(s) { - copy(s) - } else { - let s' = create(n.contents) - n := 0 - for i in 0 to length(s) - 1 { - switch unsafe_get(s, i) { - | ('"' | '\\') as c => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, c) - | '\n' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'n') - | '\t' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 't') - | '\r' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'r') - | '\b' => - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, 'b') - | c => - if Test_char.caml_is_printable(c) { - unsafe_set(s', n.contents, c) - } else { - let a = char_code(c) - unsafe_set(s', n.contents, '\\') - incr(n) - unsafe_set(s', n.contents, char_chr(48 + a / 100)) - incr(n) - unsafe_set(s', n.contents, char_chr(48 + mod(a / 10, 10))) - incr(n) - unsafe_set(s', n.contents, char_chr(48 + mod(a, 10))) - } - } - incr(n) - } - s' - } -} diff --git a/jscomp/test/test_bytes.js b/jscomp/test/test_bytes.js deleted file mode 100644 index 9d625d0f65c..00000000000 --- a/jscomp/test/test_bytes.js +++ /dev/null @@ -1,12 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE -'use strict'; - -let Bytes = require("../../lib/js/bytes.js"); - -let f = Bytes.unsafe_to_string; - -let ff = Bytes.to_string; - -exports.f = f; -exports.ff = ff; -/* No side effect */ diff --git a/jscomp/test/test_bytes.res b/jscomp/test/test_bytes.res deleted file mode 100644 index b9d8ca2294c..00000000000 --- a/jscomp/test/test_bytes.res +++ /dev/null @@ -1,4 +0,0 @@ -let f = v => Bytes.unsafe_to_string(v) - -external uu: bytes => string = "%bytes_to_string" -let ff = v => uu(v) diff --git a/jscomp/test/test_js_ffi.js b/jscomp/test/test_js_ffi.js index 896eb7957f1..5d16b04b34b 100644 --- a/jscomp/test/test_js_ffi.js +++ b/jscomp/test/test_js_ffi.js @@ -4,9 +4,7 @@ let $$String = require("../../lib/js/string.js"); function v(u) { - t({ - compare: $$String.compare - }); + t($$String); } function u(v) { diff --git a/jscomp/test/test_non_export.res b/jscomp/test/test_non_export.res index 964cbd93da5..c75fd6f29e9 100644 --- a/jscomp/test/test_non_export.res +++ b/jscomp/test/test_non_export.res @@ -3,7 +3,7 @@ include ( module V = String module U = V - let u = U.make + let u = U.get let v = module(U: Set.OrderedType) let pack = h => { diff --git a/jscomp/test/test_per.js b/jscomp/test/test_per.js index eea5830322a..0a48d0b3ef1 100644 --- a/jscomp/test/test_per.js +++ b/jscomp/test/test_per.js @@ -2,7 +2,6 @@ 'use strict'; let Caml_obj = require("../../lib/js/caml_obj.js"); -let Caml_bytes = require("../../lib/js/caml_bytes.js"); let Caml_int64 = require("../../lib/js/caml_int64.js"); let Caml_exceptions = require("../../lib/js/caml_exceptions.js"); @@ -86,15 +85,6 @@ let epsilon_float = Caml_int64.float_of_bits([ 0 ]); -function $caret(s1, s2) { - let l1 = s1.length; - let l2 = s2.length; - let s = Caml_bytes.create(l1 + l2 | 0); - blit_string(s1, 0, s, 0, l1); - blit_string(s2, 0, s, l1, l2); - return s; -} - function char_of_int(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { @@ -124,6 +114,5 @@ exports.nan = nan; exports.max_float = max_float; exports.min_float = min_float; exports.epsilon_float = epsilon_float; -exports.$caret = $caret; exports.char_of_int = char_of_int; /* No side effect */ diff --git a/jscomp/test/test_per.res b/jscomp/test/test_per.res index f7ecd86b2d5..813ab1e4da4 100644 --- a/jscomp/test/test_per.res +++ b/jscomp/test/test_per.res @@ -145,23 +145,7 @@ type fpclass = | FP_nan external classify_float: float => fpclass = "?classify_float" -/* String and byte sequence operations -- more in modules String and Bytes */ - external string_length: string => int = "%string_length" -external bytes_length: bytes => int = "%string_length" -external bytes_create: int => bytes = "?create_bytes" -external string_blit: (string, int, bytes, int, int) => unit = "blit_string" -external bytes_blit: (bytes, int, bytes, int, int) => unit = "blit_string" -external bytes_unsafe_to_string: bytes => string = "%identity" -external bytes_unsafe_of_string: string => bytes = "%identity" - -let \"^" = (s1, s2) => { - let l1 = string_length(s1) and l2 = string_length(s2) - let s = bytes_create(l1 + l2) - string_blit(s1, 0, s, 0, l1) - string_blit(s2, 0, s, l1, l2) - bytes_unsafe_to_string(s) -} /* Character operations -- more in module Char */ diff --git a/jscomp/test/test_string.js b/jscomp/test/test_string.js index 6cda6ae83ea..c156d2b4774 100644 --- a/jscomp/test/test_string.js +++ b/jscomp/test/test_string.js @@ -1,7 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; -let Caml_bytes = require("../../lib/js/caml_bytes.js"); let Caml_string = require("../../lib/js/caml_string.js"); function f(x) { @@ -38,12 +37,8 @@ function c(x, y) { let v = "xx".length; -function h(s, b) { - if (Caml_string.get(s, 0) === /* 'a' */97 && Caml_bytes.get(b, 0) === /* 'b' */98) { - return Caml_string.get(s, 1) === Caml_bytes.get(b, 2); - } else { - return false; - } +function h(s) { + return Caml_string.get(s, 0) === /* 'a' */97; } exports.f = f; diff --git a/jscomp/test/test_string.res b/jscomp/test/test_string.res index bf06d03e992..c458f95f005 100644 --- a/jscomp/test/test_string.res +++ b/jscomp/test/test_string.res @@ -13,5 +13,4 @@ let c = (x, y) => x ++ "hello" ++ ("hi" ++ ("u" ++ ("hi" ++ y))) let v = String.length("xx") -let h = (s: string, b: bytes) => - String.get(s, 0) == 'a' && (Bytes.get(b, 0) == 'b' && String.get(s, 1) == Bytes.get(b, 2)) +let h = (s: string) => String.get(s, 0) == 'a' diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index be4a24bfa16..7e5f10da3f1 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -3,13 +3,11 @@ let Caml = require("../../lib/js/caml.js"); let List = require("../../lib/js/list.js"); -let $$String = require("../../lib/js/string.js"); let Caml_obj = require("../../lib/js/caml_obj.js"); let Belt_Float = require("../../lib/js/belt_Float.js"); let Pervasives = require("../../lib/js/pervasives.js"); let Belt_Option = require("../../lib/js/belt_Option.js"); let Caml_option = require("../../lib/js/caml_option.js"); -let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function split(delim, s) { let len = s.length; @@ -22,22 +20,14 @@ function split(delim, s) { if (x === 0) { return l; } - let i$p; - try { - i$p = $$String.rindex_from(s, x - 1 | 0, delim); - } catch (raw_exn) { - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { - return { - hd: $$String.sub(s, 0, x), - tl: l - }; - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + let i$p = s.lastIndexOf(delim, x - 1 | 0); + if (i$p === -1) { + return { + hd: s.substr(0, x), + tl: l + }; } - let l_0 = $$String.sub(s, i$p + 1 | 0, (x - i$p | 0) - 1 | 0); + let l_0 = s.substr(i$p + 1 | 0, (x - i$p | 0) - 1 | 0); let l$1 = { hd: l_0, tl: l @@ -1242,7 +1232,7 @@ function process_input_line(ticker_map, all_tickers, line) { } }; }; - let tokens = split(/* '|' */124, line); + let tokens = split("|", line); if (tokens) { switch (tokens.hd) { case "Q" : diff --git a/jscomp/test/ticker.res b/jscomp/test/ticker.res index cac926d61a5..c98fabfb035 100644 --- a/jscomp/test/ticker.res +++ b/jscomp/test/ticker.res @@ -6,20 +6,20 @@ module Util = { switch x { | 0 => l | i => - switch String.rindex_from(s, i - 1, delim) { + switch Js.String2.lastIndexOfFrom(s, delim, i - 1) { + | -1 => list{Js.String2.substrAtMost(s, ~from=0, ~length=i), ...l} | i' => - let l = list{String.sub(s, i' + 1, i - i' - 1), ...l} + let l = list{Js.String2.substrAtMost(s, ~from=i' + 1, ~length=i - i' - 1), ...l} let l = if i' == 0 { list{"", ...l} } else { l } loop(l, i') - | exception Not_found => list{String.sub(s, 0, i), ...l} } } - let len = String.length(s) + let len = Js.String2.length(s) switch len { | 0 => list{} | _ => loop(list{}, len) @@ -202,7 +202,7 @@ let process_input_line = (ticker_map, all_tickers, line) => { } } - let tokens = Util.split(~delim='|', line) + let tokens = Util.split(~delim="|", line) let all_tickers = switch tokens { | list{"R", ticker_name, "S"} => ( diff --git a/lib/es6/char.js b/lib/es6/char.js index f9da73cd4f3..7a5702f633b 100644 --- a/lib/es6/char.js +++ b/lib/es6/char.js @@ -1,6 +1,5 @@ -import * as Bytes from "./bytes.js"; function chr(n) { if (n < 0 || n > 255) { @@ -14,64 +13,6 @@ function chr(n) { return n; } -function escaped(param) { - let exit = 0; - if (param >= 40) { - if (param === 92) { - return "\\\\"; - } - exit = param >= 127 ? 1 : 2; - } else if (param >= 32) { - if (param >= 39) { - return "\\'"; - } - exit = 2; - } else if (param >= 14) { - exit = 1; - } else { - switch (param) { - case 8 : - return "\\b"; - case 9 : - return "\\t"; - case 10 : - return "\\n"; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit = 1; - break; - case 13 : - return "\\r"; - } - } - switch (exit) { - case 1 : - let s = [ - 0, - 0, - 0, - 0 - ]; - s[0] = /* '\\' */92; - s[1] = 48 + (param / 100 | 0) | 0; - s[2] = 48 + (param / 10 | 0) % 10 | 0; - s[3] = 48 + param % 10 | 0; - return Bytes.to_string(s); - case 2 : - let s$1 = [0]; - s$1[0] = param; - return Bytes.to_string(s$1); - } -} - function lowercase(c) { if (c >= /* 'A' */65 && c <= /* 'Z' */90 || c >= /* '\192' */192 && c <= /* '\214' */214 || c >= /* '\216' */216 && c <= /* '\222' */222) { return c + 32 | 0; @@ -114,7 +55,6 @@ function equal(c1, c2) { export { chr, - escaped, lowercase, uppercase, lowercase_ascii, diff --git a/lib/es6/stdLabels.js b/lib/es6/stdLabels.js index 0c1119f91d9..5f65b11a770 100644 --- a/lib/es6/stdLabels.js +++ b/lib/es6/stdLabels.js @@ -3,16 +3,10 @@ let $$Array; -let Bytes; - let List; -let $$String; - export { $$Array, - Bytes, List, - $$String, } /* No side effect */ diff --git a/lib/es6/string.js b/lib/es6/string.js index 85e4d17c82a..5d073ae0058 100644 --- a/lib/es6/string.js +++ b/lib/es6/string.js @@ -1,287 +1,6 @@ import * as Caml from "./caml.js"; -import * as $$Array from "./array.js"; -import * as Bytes from "./bytes.js"; -import * as Caml_string from "./caml_string.js"; -import * as Caml_js_exceptions from "./caml_js_exceptions.js"; - -function init(n, f) { - return Bytes.unsafe_to_string(Bytes.init(n, f)); -} - -function sub(s, ofs, len) { - return Bytes.unsafe_to_string(Bytes.sub(Bytes.unsafe_of_string(s), ofs, len)); -} - -function concat(sep, xs) { - return $$Array.of_list(xs).join(sep); -} - -function iter(f, s) { - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - f(s.codePointAt(i)); - } -} - -function iteri(f, s) { - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - f(i, s.codePointAt(i)); - } -} - -function map(f, s) { - return Bytes.unsafe_to_string(Bytes.map(f, Bytes.unsafe_of_string(s))); -} - -function mapi(f, s) { - return Bytes.unsafe_to_string(Bytes.mapi(f, Bytes.unsafe_of_string(s))); -} - -function is_space(param) { - if (param > 13 || param < 9) { - return param === 32; - } else { - return param !== 11; - } -} - -function trim(s) { - if (s === "" || !(is_space(s.codePointAt(0)) || is_space(s.codePointAt(s.length - 1 | 0)))) { - return s; - } else { - return Bytes.unsafe_to_string(Bytes.trim(Bytes.unsafe_of_string(s))); - } -} - -function escaped(s) { - let needs_escape = _i => { - while (true) { - let i = _i; - if (i >= s.length) { - return false; - } - let match = s.codePointAt(i); - if (match < 32) { - return true; - } - if (match > 92 || match < 34) { - if (match >= 127) { - return true; - } - _i = i + 1 | 0; - continue; - } - if (match > 91 || match < 35) { - return true; - } - _i = i + 1 | 0; - continue; - }; - }; - if (needs_escape(0)) { - return Bytes.unsafe_to_string(Bytes.escaped(Bytes.unsafe_of_string(s))); - } else { - return s; - } -} - -function index_rec(s, lim, _i, c) { - while (true) { - let i = _i; - if (i >= lim) { - throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i + 1 | 0; - continue; - }; -} - -function index(s, c) { - return index_rec(s, s.length, 0, c); -} - -function index_rec_opt(s, lim, _i, c) { - while (true) { - let i = _i; - if (i >= lim) { - return; - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i + 1 | 0; - continue; - }; -} - -function index_opt(s, c) { - return index_rec_opt(s, s.length, 0, c); -} - -function index_from(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); - } - return index_rec(s, l, i, c); -} - -function index_from_opt(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); - } - return index_rec_opt(s, l, i, c); -} - -function rindex_rec(s, _i, c) { - while (true) { - let i = _i; - if (i < 0) { - throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i - 1 | 0; - continue; - }; -} - -function rindex(s, c) { - return rindex_rec(s, s.length - 1 | 0, c); -} - -function rindex_from(s, i, c) { - if (i < -1 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); - } - return rindex_rec(s, i, c); -} - -function rindex_rec_opt(s, _i, c) { - while (true) { - let i = _i; - if (i < 0) { - return; - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i - 1 | 0; - continue; - }; -} - -function rindex_opt(s, c) { - return rindex_rec_opt(s, s.length - 1 | 0, c); -} - -function rindex_from_opt(s, i, c) { - if (i < -1 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); - } - return rindex_rec_opt(s, i, c); -} - -function contains_from(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); - } - try { - index_rec(s, l, i, c); - return true; - } catch (raw_exn) { - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { - return false; - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } -} - -function contains(s, c) { - return contains_from(s, 0, c); -} - -function rcontains_from(s, i, c) { - if (i < 0 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); - } - try { - rindex_rec(s, i, c); - return true; - } catch (raw_exn) { - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { - return false; - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } -} - -function uppercase_ascii(s) { - return Bytes.unsafe_to_string(Bytes.uppercase_ascii(Bytes.unsafe_of_string(s))); -} - -function lowercase_ascii(s) { - return Bytes.unsafe_to_string(Bytes.lowercase_ascii(Bytes.unsafe_of_string(s))); -} - -function capitalize_ascii(s) { - return Bytes.unsafe_to_string(Bytes.capitalize_ascii(Bytes.unsafe_of_string(s))); -} - -function uncapitalize_ascii(s) { - return Bytes.unsafe_to_string(Bytes.uncapitalize_ascii(Bytes.unsafe_of_string(s))); -} let compare = Caml.string_compare; @@ -289,58 +8,8 @@ function equal(a, b) { return a === b; } -function split_on_char(sep, s) { - let r = /* [] */0; - let j = s.length; - for (let i = s.length - 1 | 0; i >= 0; --i) { - if (s.codePointAt(i) === sep) { - r = { - hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), - tl: r - }; - j = i; - } - - } - return { - hd: sub(s, 0, j), - tl: r - }; -} - -let make = Caml_string.make; - -let blit = Bytes.blit_string; - export { - make, - init, - sub, - blit, - concat, - iter, - iteri, - map, - mapi, - trim, - escaped, - index, - index_opt, - rindex, - rindex_opt, - index_from, - index_from_opt, - rindex_from, - rindex_from_opt, - contains, - contains_from, - rcontains_from, - uppercase_ascii, - lowercase_ascii, - capitalize_ascii, - uncapitalize_ascii, compare, equal, - split_on_char, } /* No side effect */ diff --git a/lib/js/char.js b/lib/js/char.js index 319b877a5b7..11553e6bf71 100644 --- a/lib/js/char.js +++ b/lib/js/char.js @@ -1,6 +1,5 @@ 'use strict'; -let Bytes = require("./bytes.js"); function chr(n) { if (n < 0 || n > 255) { @@ -14,64 +13,6 @@ function chr(n) { return n; } -function escaped(param) { - let exit = 0; - if (param >= 40) { - if (param === 92) { - return "\\\\"; - } - exit = param >= 127 ? 1 : 2; - } else if (param >= 32) { - if (param >= 39) { - return "\\'"; - } - exit = 2; - } else if (param >= 14) { - exit = 1; - } else { - switch (param) { - case 8 : - return "\\b"; - case 9 : - return "\\t"; - case 10 : - return "\\n"; - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - case 11 : - case 12 : - exit = 1; - break; - case 13 : - return "\\r"; - } - } - switch (exit) { - case 1 : - let s = [ - 0, - 0, - 0, - 0 - ]; - s[0] = /* '\\' */92; - s[1] = 48 + (param / 100 | 0) | 0; - s[2] = 48 + (param / 10 | 0) % 10 | 0; - s[3] = 48 + param % 10 | 0; - return Bytes.to_string(s); - case 2 : - let s$1 = [0]; - s$1[0] = param; - return Bytes.to_string(s$1); - } -} - function lowercase(c) { if (c >= /* 'A' */65 && c <= /* 'Z' */90 || c >= /* '\192' */192 && c <= /* '\214' */214 || c >= /* '\216' */216 && c <= /* '\222' */222) { return c + 32 | 0; @@ -113,7 +54,6 @@ function equal(c1, c2) { } exports.chr = chr; -exports.escaped = escaped; exports.lowercase = lowercase; exports.uppercase = uppercase; exports.lowercase_ascii = lowercase_ascii; diff --git a/lib/js/stdLabels.js b/lib/js/stdLabels.js index b8942f18392..d5c4434c6ff 100644 --- a/lib/js/stdLabels.js +++ b/lib/js/stdLabels.js @@ -3,14 +3,8 @@ let $$Array; -let Bytes; - let List; -let $$String; - exports.$$Array = $$Array; -exports.Bytes = Bytes; exports.List = List; -exports.$$String = $$String; /* No side effect */ diff --git a/lib/js/string.js b/lib/js/string.js index 7a0052196d2..83dae6580e2 100644 --- a/lib/js/string.js +++ b/lib/js/string.js @@ -1,287 +1,6 @@ 'use strict'; let Caml = require("./caml.js"); -let $$Array = require("./array.js"); -let Bytes = require("./bytes.js"); -let Caml_string = require("./caml_string.js"); -let Caml_js_exceptions = require("./caml_js_exceptions.js"); - -function init(n, f) { - return Bytes.unsafe_to_string(Bytes.init(n, f)); -} - -function sub(s, ofs, len) { - return Bytes.unsafe_to_string(Bytes.sub(Bytes.unsafe_of_string(s), ofs, len)); -} - -function concat(sep, xs) { - return $$Array.of_list(xs).join(sep); -} - -function iter(f, s) { - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - f(s.codePointAt(i)); - } -} - -function iteri(f, s) { - for (let i = 0, i_finish = s.length; i < i_finish; ++i) { - f(i, s.codePointAt(i)); - } -} - -function map(f, s) { - return Bytes.unsafe_to_string(Bytes.map(f, Bytes.unsafe_of_string(s))); -} - -function mapi(f, s) { - return Bytes.unsafe_to_string(Bytes.mapi(f, Bytes.unsafe_of_string(s))); -} - -function is_space(param) { - if (param > 13 || param < 9) { - return param === 32; - } else { - return param !== 11; - } -} - -function trim(s) { - if (s === "" || !(is_space(s.codePointAt(0)) || is_space(s.codePointAt(s.length - 1 | 0)))) { - return s; - } else { - return Bytes.unsafe_to_string(Bytes.trim(Bytes.unsafe_of_string(s))); - } -} - -function escaped(s) { - let needs_escape = _i => { - while (true) { - let i = _i; - if (i >= s.length) { - return false; - } - let match = s.codePointAt(i); - if (match < 32) { - return true; - } - if (match > 92 || match < 34) { - if (match >= 127) { - return true; - } - _i = i + 1 | 0; - continue; - } - if (match > 91 || match < 35) { - return true; - } - _i = i + 1 | 0; - continue; - }; - }; - if (needs_escape(0)) { - return Bytes.unsafe_to_string(Bytes.escaped(Bytes.unsafe_of_string(s))); - } else { - return s; - } -} - -function index_rec(s, lim, _i, c) { - while (true) { - let i = _i; - if (i >= lim) { - throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i + 1 | 0; - continue; - }; -} - -function index(s, c) { - return index_rec(s, s.length, 0, c); -} - -function index_rec_opt(s, lim, _i, c) { - while (true) { - let i = _i; - if (i >= lim) { - return; - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i + 1 | 0; - continue; - }; -} - -function index_opt(s, c) { - return index_rec_opt(s, s.length, 0, c); -} - -function index_from(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); - } - return index_rec(s, l, i, c); -} - -function index_from_opt(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); - } - return index_rec_opt(s, l, i, c); -} - -function rindex_rec(s, _i, c) { - while (true) { - let i = _i; - if (i < 0) { - throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i - 1 | 0; - continue; - }; -} - -function rindex(s, c) { - return rindex_rec(s, s.length - 1 | 0, c); -} - -function rindex_from(s, i, c) { - if (i < -1 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); - } - return rindex_rec(s, i, c); -} - -function rindex_rec_opt(s, _i, c) { - while (true) { - let i = _i; - if (i < 0) { - return; - } - if (s.codePointAt(i) === c) { - return i; - } - _i = i - 1 | 0; - continue; - }; -} - -function rindex_opt(s, c) { - return rindex_rec_opt(s, s.length - 1 | 0, c); -} - -function rindex_from_opt(s, i, c) { - if (i < -1 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); - } - return rindex_rec_opt(s, i, c); -} - -function contains_from(s, i, c) { - let l = s.length; - if (i < 0 || i > l) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); - } - try { - index_rec(s, l, i, c); - return true; - } catch (raw_exn) { - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { - return false; - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } -} - -function contains(s, c) { - return contains_from(s, 0, c); -} - -function rcontains_from(s, i, c) { - if (i < 0 || i >= s.length) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); - } - try { - rindex_rec(s, i, c); - return true; - } catch (raw_exn) { - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === "Not_found") { - return false; - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } -} - -function uppercase_ascii(s) { - return Bytes.unsafe_to_string(Bytes.uppercase_ascii(Bytes.unsafe_of_string(s))); -} - -function lowercase_ascii(s) { - return Bytes.unsafe_to_string(Bytes.lowercase_ascii(Bytes.unsafe_of_string(s))); -} - -function capitalize_ascii(s) { - return Bytes.unsafe_to_string(Bytes.capitalize_ascii(Bytes.unsafe_of_string(s))); -} - -function uncapitalize_ascii(s) { - return Bytes.unsafe_to_string(Bytes.uncapitalize_ascii(Bytes.unsafe_of_string(s))); -} let compare = Caml.string_compare; @@ -289,56 +8,6 @@ function equal(a, b) { return a === b; } -function split_on_char(sep, s) { - let r = /* [] */0; - let j = s.length; - for (let i = s.length - 1 | 0; i >= 0; --i) { - if (s.codePointAt(i) === sep) { - r = { - hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), - tl: r - }; - j = i; - } - - } - return { - hd: sub(s, 0, j), - tl: r - }; -} - -let make = Caml_string.make; - -let blit = Bytes.blit_string; - -exports.make = make; -exports.init = init; -exports.sub = sub; -exports.blit = blit; -exports.concat = concat; -exports.iter = iter; -exports.iteri = iteri; -exports.map = map; -exports.mapi = mapi; -exports.trim = trim; -exports.escaped = escaped; -exports.index = index; -exports.index_opt = index_opt; -exports.rindex = rindex; -exports.rindex_opt = rindex_opt; -exports.index_from = index_from; -exports.index_from_opt = index_from_opt; -exports.rindex_from = rindex_from; -exports.rindex_from_opt = rindex_from_opt; -exports.contains = contains; -exports.contains_from = contains_from; -exports.rcontains_from = rcontains_from; -exports.uppercase_ascii = uppercase_ascii; -exports.lowercase_ascii = lowercase_ascii; -exports.capitalize_ascii = capitalize_ascii; -exports.uncapitalize_ascii = uncapitalize_ascii; exports.compare = compare; exports.equal = equal; -exports.split_on_char = split_on_char; /* No side effect */