From 4acbc3f82ab58b6b088c97fb2f6c95aa3d9ea576 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 4 Sep 2024 21:02:19 +0200 Subject: [PATCH 1/2] Remove dead modules --- jscomp/bsb/bsb_file.ml | 73 --- jscomp/bsb/bsb_file.mli | 26 -- jscomp/bsb_helper/bsb_helper_extract.ml | 36 -- jscomp/bsb_helper/bsb_helper_extract.mli | 26 -- jscomp/core/js_of_lam_module.ml | 28 -- jscomp/core/js_of_lam_module.mli | 25 - jscomp/core/js_of_lam_tuple.ml | 28 -- jscomp/core/js_of_lam_tuple.mli | 27 -- jscomp/core/lam_group_pass.ml | 59 --- jscomp/ext/ext_cmp.ml | 37 -- jscomp/ext/ext_cmp.mli | 24 - jscomp/ext/ext_format.ml | 103 ----- jscomp/ext/ext_format.mli | 66 --- jscomp/ext/misc.ml | 174 ------- jscomp/ext/misc.mli | 67 --- jscomp/frontend/ppx_driver.ml | 56 --- jscomp/frontend/ppx_driver.mli | 28 -- jscomp/ml/ast_invariants.ml | 157 ------- jscomp/ml/ast_invariants.mli | 18 - jscomp/ml/envaux.ml | 92 ---- jscomp/ml/envaux.mli | 36 -- jscomp/ml/rec_check.ml | 7 +- jscomp/ml/terminfo.ml | 26 -- jscomp/ml/terminfo.mli | 26 -- jscomp/ml/typedtreeMap.ml | 556 ----------------------- jscomp/ml/typedtreeMap.mli | 73 --- 26 files changed, 6 insertions(+), 1868 deletions(-) delete mode 100644 jscomp/bsb/bsb_file.ml delete mode 100644 jscomp/bsb/bsb_file.mli delete mode 100644 jscomp/bsb_helper/bsb_helper_extract.ml delete mode 100644 jscomp/bsb_helper/bsb_helper_extract.mli delete mode 100644 jscomp/core/js_of_lam_module.ml delete mode 100644 jscomp/core/js_of_lam_module.mli delete mode 100644 jscomp/core/js_of_lam_tuple.ml delete mode 100644 jscomp/core/js_of_lam_tuple.mli delete mode 100644 jscomp/core/lam_group_pass.ml delete mode 100644 jscomp/ext/ext_cmp.ml delete mode 100644 jscomp/ext/ext_cmp.mli delete mode 100644 jscomp/ext/ext_format.ml delete mode 100644 jscomp/ext/ext_format.mli delete mode 100644 jscomp/frontend/ppx_driver.ml delete mode 100644 jscomp/frontend/ppx_driver.mli delete mode 100644 jscomp/ml/ast_invariants.ml delete mode 100644 jscomp/ml/ast_invariants.mli delete mode 100644 jscomp/ml/envaux.ml delete mode 100644 jscomp/ml/envaux.mli delete mode 100644 jscomp/ml/terminfo.ml delete mode 100644 jscomp/ml/terminfo.mli delete mode 100644 jscomp/ml/typedtreeMap.ml delete mode 100644 jscomp/ml/typedtreeMap.mli diff --git a/jscomp/bsb/bsb_file.ml b/jscomp/bsb/bsb_file.ml deleted file mode 100644 index ebc696c79c..0000000000 --- a/jscomp/bsb/bsb_file.ml +++ /dev/null @@ -1,73 +0,0 @@ -(* Copyright (C) 2018 - Hongbo Zhang, Authors of ReScript - * - * 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. *) - -(** it is not necessary to call [chown] since it is within the same user - and {!Unix.chown} is not implemented under Windows -*) -let set_infos filename (infos : Unix.stats) = - Unix.utimes filename infos.st_atime infos.st_mtime; - Unix.chmod filename infos.st_perm - -(* - try - Unix.chown filename infos.st_uid infos.st_gid - with Unix_error(EPERM,_,_) -> () -*) - -let buffer_size = 8192 - -let buffer = Bytes.create buffer_size - -let file_copy input_name output_name = - let fd_in = Unix.openfile input_name [ O_RDONLY ] 0 in - let fd_out = Unix.openfile output_name [ O_WRONLY; O_CREAT; O_TRUNC ] 0o666 in - let rec copy_loop () = - match Unix.read fd_in buffer 0 buffer_size with - | 0 -> () - | r -> - ignore (Unix.write fd_out buffer 0 r); - copy_loop () - in - copy_loop (); - Unix.close fd_in; - Unix.close fd_out - -let copy_with_permission input_name output_name = - file_copy input_name output_name; - set_infos output_name (Unix.lstat input_name) - -let install_if_exists ~destdir input_name = - if Sys.file_exists input_name then ( - let output_name = Filename.concat destdir (Filename.basename input_name) in - match (Unix.stat output_name, Unix.stat input_name) with - | { st_mtime = output_stamp; _ }, { st_mtime = input_stamp; _ } - when input_stamp <= output_stamp -> - false - | _ -> - copy_with_permission input_name output_name; - true - | exception _ -> - copy_with_permission input_name output_name; - true) - else false diff --git a/jscomp/bsb/bsb_file.mli b/jscomp/bsb/bsb_file.mli deleted file mode 100644 index 3bd2113fdb..0000000000 --- a/jscomp/bsb/bsb_file.mli +++ /dev/null @@ -1,26 +0,0 @@ -(* Copyright (C) 2018 - Hongbo Zhang, Authors of ReScript - * - * 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. *) - -val install_if_exists : destdir:string -> string -> bool -(** return [true] if copied *) diff --git a/jscomp/bsb_helper/bsb_helper_extract.ml b/jscomp/bsb_helper/bsb_helper_extract.ml deleted file mode 100644 index 91882e0cef..0000000000 --- a/jscomp/bsb_helper/bsb_helper_extract.ml +++ /dev/null @@ -1,36 +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 read_dependency_graph_from_mlast_file fn = - let ic = open_in_bin fn in - try - let dep_size = input_binary_int ic in - let dep_data = really_input_string ic dep_size in - let splitted_data = Ext_string.split dep_data '\n' in - let set = Set_string.of_list splitted_data in - close_in ic; - set - with exn -> - close_in ic; - raise exn diff --git a/jscomp/bsb_helper/bsb_helper_extract.mli b/jscomp/bsb_helper/bsb_helper_extract.mli deleted file mode 100644 index 5538fa04a8..0000000000 --- a/jscomp/bsb_helper/bsb_helper_extract.mli +++ /dev/null @@ -1,26 +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. *) - -(* This reads the header part of the mlast file, which simply encodes a set that indicates all of the deps of the current library. *) -val read_dependency_graph_from_mlast_file : string -> Set_string.t diff --git a/jscomp/core/js_of_lam_module.ml b/jscomp/core/js_of_lam_module.ml deleted file mode 100644 index ba59509c17..0000000000 --- a/jscomp/core/js_of_lam_module.ml +++ /dev/null @@ -1,28 +0,0 @@ -(* Copyright (C) 2015-2016 Bloomberg Finance L.P. - * Copyright (C) 2017 - Hongbo Zhang, Authors of ReScript - * 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. *) - -module E = Js_exp_make - -let make ?comment names (args : J.expression list) = - E.make_block ?comment E.zero_int_literal (Blk_module names) args Immutable diff --git a/jscomp/core/js_of_lam_module.mli b/jscomp/core/js_of_lam_module.mli deleted file mode 100644 index 9fabfaddd5..0000000000 --- a/jscomp/core/js_of_lam_module.mli +++ /dev/null @@ -1,25 +0,0 @@ -(* Copyright (C) 2015-2016 Bloomberg Finance L.P. - * Copyright (C) 2017 - Hongbo Zhang, Authors of ReScript - * 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. *) - -val make : ?comment:string -> string list -> J.expression list -> J.expression diff --git a/jscomp/core/js_of_lam_tuple.ml b/jscomp/core/js_of_lam_tuple.ml deleted file mode 100644 index fe56bcf024..0000000000 --- a/jscomp/core/js_of_lam_tuple.ml +++ /dev/null @@ -1,28 +0,0 @@ -(* Copyright (C) 2015-2016 Bloomberg Finance L.P. - * Copyright (C) 2017 - Hongbo Zhang, Authors of ReScript - * 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. *) - -module E = Js_exp_make - -let make (args : J.expression list) = - E.make_block E.zero_int_literal Blk_tuple args Immutable diff --git a/jscomp/core/js_of_lam_tuple.mli b/jscomp/core/js_of_lam_tuple.mli deleted file mode 100644 index e567a4e3fe..0000000000 --- a/jscomp/core/js_of_lam_tuple.mli +++ /dev/null @@ -1,27 +0,0 @@ -(* Copyright (C) 2015 - 2016 Bloomberg Finance L.P. - * Copyright (C) 2017 - Hongbo Zhang, Authors of ReScript - * 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. *) - -(** Utilities for compiling lambda tuple into JS IR *) - -val make : J.expression list -> J.expression diff --git a/jscomp/core/lam_group_pass.ml b/jscomp/core/lam_group_pass.ml deleted file mode 100644 index e4fbf62396..0000000000 --- a/jscomp/core/lam_group_pass.ml +++ /dev/null @@ -1,59 +0,0 @@ -(* Copyright (C) 2015 - 2016 Bloomberg Finance L.P. - * Copyright (C) 2017 - Hongbo Zhang, Authors of ReScript - * 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. *) - -(*type bindings = (Ident.t * Lam.t) list - let scc (groups : bindings) - (lam : Lam.t) - (body : Lam.t) - (cont : bindings -> Lam.t-> Lam.t) = - let domain = Ordered_hash_map.create 3 in - List.iter (fun (x,lam) -> Ordered_hash_map.add domain x lam) groups ; - let int_mapping = Ordered_hash_map.to_sorted_array domain in - let node_vec = Array.make (Array.length int_mapping) (Vec_int.empty ()) in - Ordered_hash_map.iter ( fun id lam key_index -> - let base_key = node_vec.(key_index) in - let free_vars = Lam_util.free_variables lam in - Set_ident.iter (fun x -> - let key = Ordered_hash_map.find domain x in - if key >= 0 then - Vec_int.push key base_key - ) free_vars - ) domain; - let clusters = Ext_scc.graph node_vec in - if Int_vec_vec.length clusters <= 1 then lam - else - Int_vec_vec.fold_right (fun (v : Vec_int.t) acc -> - cont (Vec_int.map_into_list (fun i -> - let id = int_mapping.(i) in - let lam = Ordered_hash_map.find_value domain id in - (id,lam) - ) v ) acc - ) clusters body -*) - -let rec scc_pass (lam : Lam.t) = - let lam = Lam.inner_map lam scc_pass in - match lam with - | Lletrec (bindings, body) -> Lam_scc.scc bindings lam body - | _ -> lam diff --git a/jscomp/ext/ext_cmp.ml b/jscomp/ext/ext_cmp.ml deleted file mode 100644 index 86e966e152..0000000000 --- a/jscomp/ext/ext_cmp.ml +++ /dev/null @@ -1,37 +0,0 @@ -type 'a compare = 'a -> 'a -> int - -type ('a, 'id) cmp = 'a compare - -external get_cmp : ('a, 'id) cmp -> 'a compare = "%identity" - -module type S = sig - type id - - type t - - val cmp : (t, id) cmp -end - -type ('key, 'id) t = (module S with type t = 'key and type id = 'id) - -module Make (M : sig - type t - - val cmp : (t -> t -> int[@bs]) -end) = -struct - type id - - type t = M.t - - let cmp = M.cmp -end - -let make (type key) (cmp : (key -> key -> int[@bs])) = - let module M = struct - type t = key - - let cmp = cmp - end in - let module N = Make (M) in - (module N : S with type t = key) diff --git a/jscomp/ext/ext_cmp.mli b/jscomp/ext/ext_cmp.mli deleted file mode 100644 index 18fc84654b..0000000000 --- a/jscomp/ext/ext_cmp.mli +++ /dev/null @@ -1,24 +0,0 @@ -type 'a compare = 'a -> 'a -> int - -type ('a, 'id) cmp - -external get_cmp : ('a, 'id) cmp -> 'a compare = "%identity" -(** only used for data structures, not exported for client usage *) - -module type S = sig - type id - - type t - - val cmp : (t, id) cmp -end - -type ('key, 'id) t = (module S with type t = 'key and type id = 'id) - -module Make (M : sig - type t - - val cmp : t compare -end) : S with type t = M.t - -val make : ('a -> 'a -> int) -> (module S with type t = 'a) diff --git a/jscomp/ext/ext_format.ml b/jscomp/ext/ext_format.ml deleted file mode 100644 index c6924a234e..0000000000 --- a/jscomp/ext/ext_format.ml +++ /dev/null @@ -1,103 +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. *) - -open Format - -type t = formatter - -(* let string = pp_print_string *) - -(* let break = fun fmt -> pp_print_break fmt 0 0 - - let break1 = - fun fmt -> pp_print_break fmt 0 1 - - let space fmt = - pp_print_break fmt 1 0 -*) -(* let vgroup fmt indent u = - pp_open_vbox fmt indent; - let v = u () in - pp_close_box fmt (); - v - - let group fmt indent u = - pp_open_hovbox fmt indent; - let v = u () in - pp_close_box fmt (); - v - - let paren fmt u = - string fmt "("; - let v = u () in - string fmt ")"; - v - - let brace fmt u = - string fmt "{"; - (* break1 fmt ; *) - let v = u () in - string fmt "}"; - v - - let bracket fmt u = - string fmt "["; - let v = u () in - string fmt "]"; - v *) - -(* let paren_group st n action = - group st n (fun _ -> paren st action) - - let brace_group st n action = - group st n (fun _ -> brace st action ) - - let brace_vgroup st n action = - vgroup st n (fun _ -> - string st "{"; - pp_print_break st 0 2; - let v = vgroup st 0 action in - pp_print_break st 0 0; - string st "}"; - v - ) - let bracket_group st n action = - group st n (fun _ -> bracket st action) - - let newline fmt = pp_print_newline fmt () - - let to_out_channel = formatter_of_out_channel - - (* let non_breaking_space fmt = string fmt " " *) - (* let set_needed_space_function _ _ = () *) - let flush = pp_print_flush -*) -(* let list = pp_print_list *) - -let pp_print_queue ?(pp_sep = pp_print_cut) pp_v ppf q = - Queue.iter - (fun q -> - pp_v ppf q; - pp_sep ppf ()) - q diff --git a/jscomp/ext/ext_format.mli b/jscomp/ext/ext_format.mli deleted file mode 100644 index f921110f42..0000000000 --- a/jscomp/ext/ext_format.mli +++ /dev/null @@ -1,66 +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. *) - -(** Simplified wrapper module for the standard library [Format] module. -*) - -type t = private Format.formatter - -(* val string : t -> string -> unit - - val break : t -> unit - - val break1 : t -> unit - - val space : t -> unit - - val group : t -> int -> (unit -> 'a) -> 'a - (** [group] will record current indentation - and indent futher - *) - - val vgroup : t -> int -> (unit -> 'a) -> 'a - - val paren : t -> (unit -> 'a) -> 'a - - val paren_group : t -> int -> (unit -> 'a) -> 'a - - val brace_group : t -> int -> (unit -> 'a) -> 'a - - val brace_vgroup : t -> int -> (unit -> 'a) -> 'a - - val bracket_group : t -> int -> (unit -> 'a) -> 'a - - val newline : t -> unit - - val to_out_channel : out_channel -> t - - val flush : t -> unit -> unit *) - -val pp_print_queue : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - Format.formatter -> - 'a Queue.t -> - unit diff --git a/jscomp/ext/misc.ml b/jscomp/ext/misc.ml index 33ca3eee56..1568d14def 100644 --- a/jscomp/ext/misc.ml +++ b/jscomp/ext/misc.ml @@ -75,109 +75,6 @@ let rec split_last = function let (lst, last) = split_last tl in (hd :: lst, last) -module Stdlib = struct - module List = struct - type 'a t = 'a list - - let rec compare cmp l1 l2 = - match l1, l2 with - | [], [] -> 0 - | [], _::_ -> -1 - | _::_, [] -> 1 - | h1::t1, h2::t2 -> - let c = cmp h1 h2 in - if c <> 0 then c - else compare cmp t1 t2 - - let rec equal eq l1 l2 = - match l1, l2 with - | ([], []) -> true - | (hd1 :: tl1, hd2 :: tl2) -> eq hd1 hd2 && equal eq tl1 tl2 - | (_, _) -> false - - let filter_map f l = - let rec aux acc l = - match l with - | [] -> List.rev acc - | h :: t -> - match f h with - | None -> aux acc t - | Some v -> aux (v :: acc) t - in - aux [] l - - let map2_prefix f l1 l2 = - let rec aux acc l1 l2 = - match l1, l2 with - | [], _ -> (List.rev acc, l2) - | _ :: _, [] -> raise (Invalid_argument "map2_prefix") - | h1::t1, h2::t2 -> - let h = f h1 h2 in - aux (h :: acc) t1 t2 - in - aux [] l1 l2 - - let some_if_all_elements_are_some l = - let rec aux acc l = - match l with - | [] -> Some (List.rev acc) - | None :: _ -> None - | Some h :: t -> aux (h :: acc) t - in - aux [] l - - let split_at n l = - let rec aux n acc l = - if n = 0 - then List.rev acc, l - else - match l with - | [] -> raise (Invalid_argument "split_at") - | t::q -> aux (n-1) (t::acc) q - in - aux n [] l - end - - module Option = struct - type 'a t = 'a option - - let equal eq o1 o2 = - match o1, o2 with - | None, None -> true - | Some e1, Some e2 -> eq e1 e2 - | _, _ -> false - - let iter f = function - | Some x -> f x - | None -> () - - let map f = function - | Some x -> Some (f x) - | None -> None - - let fold f a b = - match a with - | None -> b - | Some a -> f a b - - let value_default f ~default a = - match a with - | None -> default - | Some a -> f a - end - - module Array = struct - let exists2 p a1 a2 = - let n = Array.length a1 in - if Array.length a2 <> n then invalid_arg "Misc.Stdlib.Array.exists2"; - let rec loop i = - if i = n then false - else if p (Array.unsafe_get a1 i) (Array.unsafe_get a2 i) then true - else loop (succ i) in - loop 0 - end -end - let may = Stdlib.Option.iter let may_map = Stdlib.Option.map @@ -392,52 +289,6 @@ let snd4 (_,x,_, _) = x let thd4 (_,_,x,_) = x let for4 (_,_,_,x) = x - -module LongString = struct - type t = bytes array - - let create str_size = - let tbl_size = str_size / Sys.max_string_length + 1 in - let tbl = Array.make tbl_size Bytes.empty in - for i = 0 to tbl_size - 2 do - tbl.(i) <- Bytes.create Sys.max_string_length; - done; - tbl.(tbl_size - 1) <- Bytes.create (str_size mod Sys.max_string_length); - tbl - - let length tbl = - let tbl_size = Array.length tbl in - Sys.max_string_length * (tbl_size - 1) + Bytes.length tbl.(tbl_size - 1) - - let get tbl ind = - Bytes.get tbl.(ind / Sys.max_string_length) (ind mod Sys.max_string_length) - - let set tbl ind c = - Bytes.set tbl.(ind / Sys.max_string_length) (ind mod Sys.max_string_length) - c - - let blit src srcoff dst dstoff len = - for i = 0 to len - 1 do - set dst (dstoff + i) (get src (srcoff + i)) - done - - let output oc tbl pos len = - for i = pos to pos + len - 1 do - output_char oc (get tbl i) - done - - let unsafe_blit_to_bytes src srcoff dst dstoff len = - for i = 0 to len - 1 do - Bytes.unsafe_set dst (dstoff + i) (get src (srcoff + i)) - done - - let input_bytes ic len = - let tbl = create len in - Array.iter (fun str -> really_input ic str 0 (Bytes.length str)) tbl; - tbl -end - - let edit_distance a b cutoff = let la, lb = String.length a, String.length b in let cutoff = @@ -713,34 +564,9 @@ exception HookExn of exn let raise_direct_hook_exn e = raise (HookExn e) -let fold_hooks list hook_info ast = - List.fold_left (fun ast (hook_name,f) -> - try - f hook_info ast - with - | HookExn e -> raise e - | error -> raise (HookExnWrapper {error; hook_name; hook_info}) - (* when explicit reraise with backtrace will be available, - it should be used here *) - - ) ast (List.sort compare list) - module type HookSig = sig type t val add_hook : string -> (hook_info -> t -> t) -> unit val apply_hooks : hook_info -> t -> t end - -module MakeHooks(M: sig - type t - end) : HookSig with type t = M.t -= struct - - type t = M.t - - let hooks = ref [] - let add_hook name f = hooks := (name, f) :: !hooks - let apply_hooks sourcefile intf = - fold_hooks !hooks sourcefile intf -end diff --git a/jscomp/ext/misc.mli b/jscomp/ext/misc.mli index 33878bb1d2..b9163e3568 100644 --- a/jscomp/ext/misc.mli +++ b/jscomp/ext/misc.mli @@ -48,58 +48,6 @@ val protect_refs : ref_and_value list -> (unit -> 'a) -> 'a while executing [f]. The previous contents of the references is restored even if [f] raises an exception. *) -module Stdlib : sig - module List : sig - type 'a t = 'a list - - val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int - (** The lexicographic order supported by the provided order. - There is no constraint on the relative lengths of the lists. *) - - val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool - (** Returns [true] iff the given lists have the same length and content - with respect to the given equality function. *) - - val filter_map : ('a -> 'b option) -> 'a t -> 'b t - (** [filter_map f l] applies [f] to every element of [l], filters - out the [None] elements and returns the list of the arguments of - the [Some] elements. *) - - val some_if_all_elements_are_some : 'a option t -> 'a t option - (** If all elements of the given list are [Some _] then [Some xs] - is returned with the [xs] being the contents of those [Some]s, with - order preserved. Otherwise return [None]. *) - - val map2_prefix : ('a -> 'b -> 'c) -> 'a t -> 'b t -> ('c t * 'b t) - (** [let r1, r2 = map2_prefix f l1 l2] - If [l1] is of length n and [l2 = h2 @ t2] with h2 of length n, - r1 is [List.map2 f l1 h1] and r2 is t2. *) - - val split_at : int -> 'a t -> 'a t * 'a t - (** [split_at n l] returns the pair [before, after] where [before] is - the [n] first elements of [l] and [after] the remaining ones. - If [l] has less than [n] elements, raises Invalid_argument. *) - end - - module Option : sig - type 'a t = 'a option - - val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool - - val iter : ('a -> unit) -> 'a t -> unit - val map : ('a -> 'b) -> 'a t -> 'b t - val fold : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b - val value_default : ('a -> 'b) -> default:'b -> 'a t -> 'b - end - - module Array : sig - val exists2 : ('a -> 'b -> bool) -> 'a array -> 'b array -> bool - (* Same as [Array.exists], but for a two-argument predicate. Raise - Invalid_argument if the two arrays are determined to have - different lengths. *) - end -end - val find_in_path: string list -> string -> string (* Search a file in a list of directories. *) val find_in_path_rel: string list -> string -> string @@ -201,19 +149,6 @@ val snd4: 'a * 'b * 'c * 'd -> 'b val thd4: 'a * 'b * 'c * 'd -> 'c val for4: 'a * 'b * 'c * 'd -> 'd -module LongString : - sig - type t = bytes array - val create : int -> t - val length : t -> int - val get : t -> int -> char - val set : t -> int -> char -> unit - val blit : t -> int -> t -> int -> int -> unit - val output : out_channel -> t -> int -> int -> unit - val unsafe_blit_to_bytes : t -> int -> bytes -> int -> int -> unit - val input_bytes : in_channel -> int -> t - end - val edit_distance : string -> string -> int -> int option (** [edit_distance a b cutoff] computes the edit distance between strings [a] and [b]. To help efficiency, it uses a cutoff: if the @@ -350,5 +285,3 @@ module type HookSig = sig val add_hook : string -> (hook_info -> t -> t) -> unit val apply_hooks : hook_info -> t -> t end - -module MakeHooks : functor (M : sig type t end) -> HookSig with type t = M.t diff --git a/jscomp/frontend/ppx_driver.ml b/jscomp/frontend/ppx_driver.ml deleted file mode 100644 index cb47900d01..0000000000 --- a/jscomp/frontend/ppx_driver.ml +++ /dev/null @@ -1,56 +0,0 @@ -(* Copyright (C) 2019- Hongbo Zhang, Authors of ReScript - * - * 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 usage = "Usage: [prog] [extra_args] \n%!" - -let main impl intf = - try - let a = Sys.argv in - let n = Array.length a in - if n > 2 then ( - Arg.parse_argv - (Array.sub Sys.argv 0 (n - 2)) - [ - ( "-bs-jsx", - Arg.Int - (fun i -> Js_config.jsx_version := Js_config.jsx_version_of_int i), - " Set jsx version" ); - ( "-bs-jsx-module", - Arg.String - (fun i -> - Js_config.jsx_module := Js_config.jsx_module_of_string i), - " Set jsx module" ); - ( "-bs-jsx-mode", - Arg.String - (fun i -> Js_config.jsx_mode := Js_config.jsx_mode_of_string i), - " Set jsx mode" ); - ] - ignore usage; - Ppx_apply.apply_lazy ~source:a.(n - 2) ~target:a.(n - 1) impl intf) - else ( - Printf.eprintf "%s" usage; - exit 2) - with exn -> - Location.report_exception Format.err_formatter exn; - exit 2 diff --git a/jscomp/frontend/ppx_driver.mli b/jscomp/frontend/ppx_driver.mli deleted file mode 100644 index 03930a46eb..0000000000 --- a/jscomp/frontend/ppx_driver.mli +++ /dev/null @@ -1,28 +0,0 @@ -(* Copyright (C) 2019- Authors of ReScript - * - * 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. *) - -val main : - (Parsetree.structure -> Parsetree.structure) -> - (Parsetree.signature -> Parsetree.signature) -> - unit diff --git a/jscomp/ml/ast_invariants.ml b/jscomp/ml/ast_invariants.ml deleted file mode 100644 index b6418e3504..0000000000 --- a/jscomp/ml/ast_invariants.ml +++ /dev/null @@ -1,157 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Jeremie Dimino, Jane Street Europe *) -(* *) -(* Copyright 2015 Jane Street Group LLC *) -(* *) -(* All rights reserved. This file is distributed under the terms of *) -(* the GNU Lesser General Public License version 2.1, with the *) -(* special exception on linking described in the file LICENSE. *) -(* *) -(**************************************************************************) - -open Asttypes -open Parsetree -open Ast_iterator - -let err = Syntaxerr.ill_formed_ast - -let empty_record loc = err loc "Records cannot be empty." -let empty_variant loc = err loc "Variant types cannot be empty." -let invalid_tuple loc = err loc "Tuples must have at least 2 components." -let no_args loc = err loc "Function application with no argument." -let empty_let loc = err loc "Let with no bindings." -let empty_type loc = err loc "Type declarations cannot be empty." -let complex_id loc = err loc "Functor application not allowed here." - -let simple_longident id = - let rec is_simple = function - | Longident.Lident _ -> true - | Longident.Ldot (id, _) -> is_simple id - | Longident.Lapply _ -> false - in - if not (is_simple id.txt) then complex_id id.loc - -let iterator = - let super = Ast_iterator.default_iterator in - let type_declaration self td = - super.type_declaration self td; - let loc = td.ptype_loc in - match td.ptype_kind with - | Ptype_record [] -> empty_record loc - | Ptype_variant [] -> empty_variant loc - | _ -> () - in - let typ self ty = - super.typ self ty; - let loc = ty.ptyp_loc in - match ty.ptyp_desc with - | Ptyp_tuple ([] | [_]) -> invalid_tuple loc - | Ptyp_class () -> () - | Ptyp_package (_, cstrs) -> - List.iter (fun (id, _) -> simple_longident id) cstrs - | _ -> () - in - let pat self pat = - begin match pat.ppat_desc with - | Ppat_construct (_, Some ({ppat_desc = Ppat_tuple _} as p)) - when Builtin_attributes.explicit_arity pat.ppat_attributes -> - super.pat self p (* allow unary tuple, see GPR#523. *) - | _ -> - super.pat self pat - end; - let loc = pat.ppat_loc in - match pat.ppat_desc with - | Ppat_tuple ([] | [_]) -> invalid_tuple loc - | Ppat_record ([], _) -> empty_record loc - | Ppat_construct (id, _) -> simple_longident id - | Ppat_record (fields, _) -> - List.iter (fun (id, _) -> simple_longident id) fields - | _ -> () - in - let expr self exp = - begin match exp.pexp_desc with - | Pexp_construct (_, Some ({pexp_desc = Pexp_tuple _} as e)) - when Builtin_attributes.explicit_arity exp.pexp_attributes -> - super.expr self e (* allow unary tuple, see GPR#523. *) - | _ -> - super.expr self exp - end; - let loc = exp.pexp_loc in - match exp.pexp_desc with - | Pexp_tuple ([] | [_]) -> invalid_tuple loc - | Pexp_record ([], _) -> empty_record loc - | Pexp_apply (_, []) -> no_args loc - | Pexp_let (_, [], _) -> empty_let loc - | Pexp_ident id - | Pexp_construct (id, _) - | Pexp_field (_, id) - | Pexp_setfield (_, id, _) - | Pexp_new id - | Pexp_open (_, id, _) -> simple_longident id - | Pexp_record (fields, _) -> - List.iter (fun (id, _) -> simple_longident id) fields - | _ -> () - in - let extension_constructor self ec = - super.extension_constructor self ec; - match ec.pext_kind with - | Pext_rebind id -> simple_longident id - | _ -> () - in - let module_type self mty = - super.module_type self mty; - match mty.pmty_desc with - | Pmty_alias id -> simple_longident id - | _ -> () - in - let open_description self opn = - super.open_description self opn; - simple_longident opn.popen_lid - in - let with_constraint self wc = - super.with_constraint self wc; - match wc with - | Pwith_type (id, _) - | Pwith_module (id, _) -> simple_longident id - | _ -> () - in - let module_expr self me = - super.module_expr self me; - match me.pmod_desc with - | Pmod_ident id -> simple_longident id - | _ -> () - in - let structure_item self st = - super.structure_item self st; - let loc = st.pstr_loc in - match st.pstr_desc with - | Pstr_type (_, []) -> empty_type loc - | Pstr_value (_, []) -> empty_let loc - | _ -> () - in - let signature_item self sg = - super.signature_item self sg; - let loc = sg.psig_loc in - match sg.psig_desc with - | Psig_type (_, []) -> empty_type loc - | _ -> () - in - { super with - type_declaration - ; typ - ; pat - ; expr - ; extension_constructor - ; module_expr - ; module_type - ; open_description - ; with_constraint - ; structure_item - ; signature_item - } - -let structure st = iterator.structure iterator st -let signature sg = iterator.signature iterator sg diff --git a/jscomp/ml/ast_invariants.mli b/jscomp/ml/ast_invariants.mli deleted file mode 100644 index 51d3f9de97..0000000000 --- a/jscomp/ml/ast_invariants.mli +++ /dev/null @@ -1,18 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Jeremie Dimino, Jane Street Europe *) -(* *) -(* Copyright 2015 Jane Street Group LLC *) -(* *) -(* All rights reserved. This file is distributed under the terms of *) -(* the GNU Lesser General Public License version 2.1, with the *) -(* special exception on linking described in the file LICENSE. *) -(* *) -(**************************************************************************) - -(** Check AST invariants *) - -val structure : Parsetree.structure -> unit -val signature : Parsetree.signature -> unit diff --git a/jscomp/ml/envaux.ml b/jscomp/ml/envaux.ml deleted file mode 100644 index 51818b5003..0000000000 --- a/jscomp/ml/envaux.ml +++ /dev/null @@ -1,92 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *) -(* OCaml port by John Malecki and Xavier Leroy *) -(* *) -(* 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. *) -(* *) -(**************************************************************************) - -open Env - -type error = - Module_not_found of Path.t - -exception Error of error - -let env_cache = - (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t) - -let reset_cache () = - Hashtbl.clear env_cache; - Env.reset_cache() - -let rec env_from_summary sum subst = - try - Hashtbl.find env_cache (sum, subst) - with Not_found -> - let env = - match sum with - Env_empty -> - Env.empty - | Env_value(s, id, desc) -> - Env.add_value id (Subst.value_description subst desc) - (env_from_summary s subst) - | Env_type(s, id, desc) -> - Env.add_type ~check:false id - (Subst.type_declaration subst desc) - (env_from_summary s subst) - | Env_extension(s, id, desc) -> - Env.add_extension ~check:false id - (Subst.extension_constructor subst desc) - (env_from_summary s subst) - | Env_module(s, id, desc) -> - Env.add_module_declaration ~check:false id - (Subst.module_declaration subst desc) - (env_from_summary s subst) - | Env_modtype(s, id, desc) -> - Env.add_modtype id (Subst.modtype_declaration subst desc) - (env_from_summary s subst) - | Env_cltype () -> assert false - | Env_open(s, path) -> - let env = env_from_summary s subst in - let path' = Subst.module_path subst path in - begin match Env.open_signature Asttypes.Override path' env with - | Some env -> env - | None -> assert false - end - | Env_functor_arg(Env_module(s, id, desc), id') when Ident.same id id' -> - Env.add_module_declaration ~check:false - id (Subst.module_declaration subst desc) - ~arg:true (env_from_summary s subst) - | Env_class _ - | Env_functor_arg _ -> assert false - | Env_constraints(s, map) -> - PathMap.fold - (fun path info -> - Env.add_local_type (Subst.type_path subst path) - (Subst.type_declaration subst info)) - map (env_from_summary s subst) - | Env_copy_types (s, sl) -> - Env.copy_types sl (env_from_summary s subst) - in - Hashtbl.add env_cache (sum, subst) env; - env - -let env_of_only_summary env = - Env.env_of_only_summary env_from_summary env - -(* Error report *) - -open Format - -let report_error ppf = function - | Module_not_found p -> - fprintf ppf "@[Cannot find module %a@].@." Printtyp.path p diff --git a/jscomp/ml/envaux.mli b/jscomp/ml/envaux.mli deleted file mode 100644 index 2869890a14..0000000000 --- a/jscomp/ml/envaux.mli +++ /dev/null @@ -1,36 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *) -(* OCaml port by John Malecki and Xavier Leroy *) -(* *) -(* 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. *) -(* *) -(**************************************************************************) - -open Format - -(* Convert environment summaries to environments *) - -val env_from_summary : Env.summary -> Subst.t -> Env.t - -(* Empty the environment caches. To be called when load_path changes. *) - -val reset_cache: unit -> unit - -val env_of_only_summary : Env.t -> Env.t - -(* Error report *) - -type error = - Module_not_found of Path.t - -exception Error of error - -val report_error: formatter -> error -> unit diff --git a/jscomp/ml/rec_check.ml b/jscomp/ml/rec_check.ml index a31f7f555a..6ec2ddde2f 100644 --- a/jscomp/ml/rec_check.ml +++ b/jscomp/ml/rec_check.ml @@ -180,6 +180,11 @@ let is_ref : Types.value_description -> bool = function type sd = Static | Dynamic +let value_default f ~default a = + match a with + | None -> default + | Some a -> f a + let rec classify_expression : Typedtree.expression -> sd = fun exp -> match exp.exp_desc with @@ -300,7 +305,7 @@ let rec expression : Env.env -> Typedtree.expression -> Use.t = | Texp_extension_constructor _ -> Use.empty and option : 'a. (Env.env -> 'a -> Use.t) -> Env.env -> 'a option -> Use.t = - fun f env -> Misc.Stdlib.Option.value_default (f env) ~default:Use.empty + fun f env -> value_default (f env) ~default:Use.empty and list : 'a. (Env.env -> 'a -> Use.t) -> Env.env -> 'a list -> Use.t = fun f env -> diff --git a/jscomp/ml/terminfo.ml b/jscomp/ml/terminfo.ml deleted file mode 100644 index 5ed4bb5bcc..0000000000 --- a/jscomp/ml/terminfo.ml +++ /dev/null @@ -1,26 +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. *) -(* *) -(**************************************************************************) - -(* Basic interface to the terminfo database *) - -type status = - | Uninitialised - | Bad_term - | Good_term of int -;; -external setup : out_channel -> status = "caml_terminfo_setup";; -external backup : int -> unit = "caml_terminfo_backup";; -external standout : bool -> unit = "caml_terminfo_standout";; -external resume : int -> unit = "caml_terminfo_resume";; diff --git a/jscomp/ml/terminfo.mli b/jscomp/ml/terminfo.mli deleted file mode 100644 index 92af80f9b1..0000000000 --- a/jscomp/ml/terminfo.mli +++ /dev/null @@ -1,26 +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. *) -(* *) -(**************************************************************************) - -(* Basic interface to the terminfo database *) - -type status = - | Uninitialised - | Bad_term - | Good_term of int (* number of lines of the terminal *) -;; -external setup : out_channel -> status = "caml_terminfo_setup";; -external backup : int -> unit = "caml_terminfo_backup";; -external standout : bool -> unit = "caml_terminfo_standout";; -external resume : int -> unit = "caml_terminfo_resume";; diff --git a/jscomp/ml/typedtreeMap.ml b/jscomp/ml/typedtreeMap.ml deleted file mode 100644 index 9899275b97..0000000000 --- a/jscomp/ml/typedtreeMap.ml +++ /dev/null @@ -1,556 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Fabrice Le Fessant, INRIA Saclay *) -(* *) -(* Copyright 2012 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. *) -(* *) -(**************************************************************************) - -open Typedtree - -module type MapArgument = sig - val enter_structure : structure -> structure - val enter_value_description : value_description -> value_description - val enter_type_declaration : type_declaration -> type_declaration - val enter_type_extension : type_extension -> type_extension - val enter_extension_constructor : - extension_constructor -> extension_constructor - val enter_pattern : pattern -> pattern - val enter_expression : expression -> expression - val enter_package_type : package_type -> package_type - val enter_signature : signature -> signature - val enter_signature_item : signature_item -> signature_item - val enter_module_type_declaration : - module_type_declaration -> module_type_declaration - val enter_module_type : module_type -> module_type - val enter_module_expr : module_expr -> module_expr - val enter_with_constraint : with_constraint -> with_constraint - - val enter_core_type : core_type -> core_type - val enter_structure_item : structure_item -> structure_item - - val leave_structure : structure -> structure - val leave_value_description : value_description -> value_description - val leave_type_declaration : type_declaration -> type_declaration - val leave_type_extension : type_extension -> type_extension - val leave_extension_constructor : - extension_constructor -> extension_constructor - val leave_pattern : pattern -> pattern - val leave_expression : expression -> expression - val leave_package_type : package_type -> package_type - val leave_signature : signature -> signature - val leave_signature_item : signature_item -> signature_item - val leave_module_type_declaration : - module_type_declaration -> module_type_declaration - val leave_module_type : module_type -> module_type - val leave_module_expr : module_expr -> module_expr - val leave_with_constraint : with_constraint -> with_constraint - - val leave_core_type : core_type -> core_type - val leave_structure_item : structure_item -> structure_item - -end - - -module MakeMap(Map : MapArgument) = struct - - open Misc - - let rec map_structure str = - let str = Map.enter_structure str in - let str_items = List.map map_structure_item str.str_items in - Map.leave_structure { str with str_items = str_items } - - and map_binding vb = - { - vb_pat = map_pattern vb.vb_pat; - vb_expr = map_expression vb.vb_expr; - vb_attributes = vb.vb_attributes; - vb_loc = vb.vb_loc; - } - - and map_bindings list = - List.map map_binding list - - and map_case {c_lhs; c_guard; c_rhs} = - { - c_lhs = map_pattern c_lhs; - c_guard = may_map map_expression c_guard; - c_rhs = map_expression c_rhs; - } - - and map_cases list = - List.map map_case list - - and map_structure_item item = - let item = Map.enter_structure_item item in - let str_desc = - match item.str_desc with - Tstr_eval (exp, attrs) -> Tstr_eval (map_expression exp, attrs) - | Tstr_value (rec_flag, list) -> - Tstr_value (rec_flag, map_bindings list) - | Tstr_primitive vd -> - Tstr_primitive (map_value_description vd) - | Tstr_type (rf, list) -> - Tstr_type (rf, List.map map_type_declaration list) - | Tstr_typext tyext -> - Tstr_typext (map_type_extension tyext) - | Tstr_exception ext -> - Tstr_exception (map_extension_constructor ext) - | Tstr_module x -> - Tstr_module (map_module_binding x) - | Tstr_recmodule list -> - let list = List.map map_module_binding list in - Tstr_recmodule list - | Tstr_modtype mtd -> - Tstr_modtype (map_module_type_declaration mtd) - | Tstr_open od -> Tstr_open od - | Tstr_class () -> assert false - | Tstr_class_type () -> assert false - | Tstr_include incl -> - Tstr_include {incl with incl_mod = map_module_expr incl.incl_mod} - | Tstr_attribute x -> Tstr_attribute x - in - Map.leave_structure_item { item with str_desc = str_desc} - - and map_module_binding x = - {x with mb_expr = map_module_expr x.mb_expr} - - and map_value_description v = - let v = Map.enter_value_description v in - let val_desc = map_core_type v.val_desc in - Map.leave_value_description { v with val_desc = val_desc } - - and map_type_declaration decl = - let decl = Map.enter_type_declaration decl in - let typ_params = List.map map_type_parameter decl.typ_params in - let typ_cstrs = List.map (fun (ct1, ct2, loc) -> - (map_core_type ct1, - map_core_type ct2, - loc) - ) decl.typ_cstrs in - let typ_kind = match decl.typ_kind with - Ttype_abstract -> Ttype_abstract - | Ttype_variant list -> - let list = List.map map_constructor_declaration list in - Ttype_variant list - | Ttype_record list -> - let list = - List.map - (fun ld -> - {ld with ld_type = map_core_type ld.ld_type} - ) list - in - Ttype_record list - | Ttype_open -> Ttype_open - in - let typ_manifest = may_map map_core_type decl.typ_manifest in - Map.leave_type_declaration { decl with typ_params = typ_params; - typ_cstrs = typ_cstrs; typ_kind = typ_kind; typ_manifest = typ_manifest } - - and map_type_parameter (ct, v) = (map_core_type ct, v) - - and map_constructor_arguments = function - | Cstr_tuple l -> - Cstr_tuple (List.map map_core_type l) - | Cstr_record l -> - Cstr_record - (List.map (fun ld -> {ld with ld_type = map_core_type ld.ld_type}) - l) - - and map_constructor_declaration cd = - let cd_args = map_constructor_arguments cd.cd_args in - {cd with cd_args; - cd_res = may_map map_core_type cd.cd_res - } - - and map_type_extension tyext = - let tyext = Map.enter_type_extension tyext in - let tyext_params = List.map map_type_parameter tyext.tyext_params in - let tyext_constructors = - List.map map_extension_constructor tyext.tyext_constructors - in - Map.leave_type_extension { tyext with tyext_params = tyext_params; - tyext_constructors = tyext_constructors } - - and map_extension_constructor ext = - let ext = Map.enter_extension_constructor ext in - let ext_kind = match ext.ext_kind with - Text_decl(args, ret) -> - let args = map_constructor_arguments args in - let ret = may_map map_core_type ret in - Text_decl(args, ret) - | Text_rebind(p, lid) -> Text_rebind(p, lid) - in - Map.leave_extension_constructor {ext with ext_kind = ext_kind} - - and map_pattern pat = - let pat = Map.enter_pattern pat in - let pat_desc = - match pat.pat_desc with - | Tpat_alias (pat1, p, text) -> - let pat1 = map_pattern pat1 in - Tpat_alias (pat1, p, text) - | Tpat_tuple list -> Tpat_tuple (List.map map_pattern list) - | Tpat_construct (lid, cstr_decl, args) -> - Tpat_construct (lid, cstr_decl, - List.map map_pattern args) - | Tpat_variant (label, pato, rowo) -> - let pato = match pato with - None -> pato - | Some pat -> Some (map_pattern pat) - in - Tpat_variant (label, pato, rowo) - | Tpat_record (list, closed) -> - Tpat_record (List.map (fun (lid, lab_desc, pat) -> - (lid, lab_desc, map_pattern pat) ) list, closed) - | Tpat_array list -> Tpat_array (List.map map_pattern list) - | Tpat_or (p1, p2, rowo) -> - Tpat_or (map_pattern p1, map_pattern p2, rowo) - | Tpat_lazy p -> Tpat_lazy (map_pattern p) - | Tpat_constant _ - | Tpat_any - | Tpat_var _ -> pat.pat_desc - - in - let pat_extra = List.map map_pat_extra pat.pat_extra in - Map.leave_pattern { pat with pat_desc = pat_desc; pat_extra = pat_extra } - - and map_pat_extra pat_extra = - match pat_extra with - | Tpat_constraint ct, loc, attrs -> - (Tpat_constraint (map_core_type ct), loc, attrs) - | (Tpat_type _ | Tpat_unpack | Tpat_open _ ), _, _ -> pat_extra - - and map_expression exp = - let exp = Map.enter_expression exp in - let exp_desc = - match exp.exp_desc with - Texp_ident (_, _, _) - | Texp_constant _ -> exp.exp_desc - | Texp_let (rec_flag, list, exp) -> - Texp_let (rec_flag, - map_bindings list, - map_expression exp) - | Texp_function { arg_label; param; cases; partial; } -> - Texp_function { arg_label; param; cases = map_cases cases; partial; } - | Texp_apply (exp, list) -> - Texp_apply (map_expression exp, - List.map (fun (label, expo) -> - let expo = - match expo with - None -> expo - | Some exp -> Some (map_expression exp) - in - (label, expo) - ) list ) - | Texp_match (exp, list1, list2, partial) -> - Texp_match ( - map_expression exp, - map_cases list1, - map_cases list2, - partial - ) - | Texp_try (exp, list) -> - Texp_try ( - map_expression exp, - map_cases list - ) - | Texp_tuple list -> - Texp_tuple (List.map map_expression list) - | Texp_construct (lid, cstr_desc, args) -> - Texp_construct (lid, cstr_desc, - List.map map_expression args ) - | Texp_variant (label, expo) -> - let expo =match expo with - None -> expo - | Some exp -> Some (map_expression exp) - in - Texp_variant (label, expo) - | Texp_record { fields; representation; extended_expression } -> - let fields = - Array.map (function - | label, Kept t -> label, Kept t - | label, Overridden (lid, exp) -> - label, Overridden (lid, map_expression exp)) - fields - in - let extended_expression = match extended_expression with - None -> extended_expression - | Some exp -> Some (map_expression exp) - in - Texp_record { fields; representation; extended_expression } - | Texp_field (exp, lid, label) -> - Texp_field (map_expression exp, lid, label) - | Texp_setfield (exp1, lid, label, exp2) -> - Texp_setfield ( - map_expression exp1, - lid, - label, - map_expression exp2) - | Texp_array list -> - Texp_array (List.map map_expression list) - | Texp_ifthenelse (exp1, exp2, expo) -> - Texp_ifthenelse ( - map_expression exp1, - map_expression exp2, - match expo with - None -> expo - | Some exp -> Some (map_expression exp) - ) - | Texp_sequence (exp1, exp2) -> - Texp_sequence ( - map_expression exp1, - map_expression exp2 - ) - | Texp_while (exp1, exp2) -> - Texp_while ( - map_expression exp1, - map_expression exp2 - ) - | Texp_for (id, name, exp1, exp2, dir, exp3) -> - Texp_for ( - id, name, - map_expression exp1, - map_expression exp2, - dir, - map_expression exp3 - ) - | Texp_send (exp, meth, expo) -> - Texp_send (map_expression exp, meth, may_map map_expression expo) - | Texp_new _ - | Texp_instvar _ - | Texp_setinstvar _ - | Texp_override _ -> - assert false - | Texp_letmodule (id, name, mexpr, exp) -> - Texp_letmodule ( - id, name, - map_module_expr mexpr, - map_expression exp - ) - | Texp_letexception (cd, exp) -> - Texp_letexception ( - map_extension_constructor cd, - map_expression exp - ) - | Texp_assert exp -> Texp_assert (map_expression exp) - | Texp_lazy exp -> Texp_lazy (map_expression exp) - | Texp_object () -> - Texp_object () - | Texp_pack (mexpr) -> - Texp_pack (map_module_expr mexpr) - | Texp_unreachable -> - Texp_unreachable - | Texp_extension_constructor _ as e -> - e - in - let exp_extra = List.map map_exp_extra exp.exp_extra in - Map.leave_expression { - exp with - exp_desc = exp_desc; - exp_extra = exp_extra; } - - and map_exp_extra ((desc, loc, attrs) as exp_extra) = - match desc with - | Texp_constraint ct -> - Texp_constraint (map_core_type ct), loc, attrs - | Texp_coerce ((), ct) -> - Texp_coerce ((), map_core_type ct), loc, attrs - | Texp_poly (Some ct) -> - Texp_poly (Some ( map_core_type ct )), loc, attrs - | Texp_newtype _ - | Texp_open _ - | Texp_poly None -> exp_extra - - - and map_package_type pack = - let pack = Map.enter_package_type pack in - let pack_fields = List.map ( - fun (s, ct) -> (s, map_core_type ct) ) pack.pack_fields in - Map.leave_package_type { pack with pack_fields = pack_fields } - - and map_signature sg = - let sg = Map.enter_signature sg in - let sig_items = List.map map_signature_item sg.sig_items in - Map.leave_signature { sg with sig_items = sig_items } - - and map_signature_item item = - let item = Map.enter_signature_item item in - let sig_desc = - match item.sig_desc with - Tsig_value vd -> - Tsig_value (map_value_description vd) - | Tsig_type (rf, list) -> - Tsig_type (rf, List.map map_type_declaration list) - | Tsig_typext tyext -> - Tsig_typext (map_type_extension tyext) - | Tsig_exception ext -> - Tsig_exception (map_extension_constructor ext) - | Tsig_module md -> - Tsig_module {md with md_type = map_module_type md.md_type} - | Tsig_recmodule list -> - Tsig_recmodule - (List.map - (fun md -> {md with md_type = map_module_type md.md_type}) - list - ) - | Tsig_modtype mtd -> - Tsig_modtype (map_module_type_declaration mtd) - | Tsig_open _ -> item.sig_desc - | Tsig_include incl -> - Tsig_include {incl with incl_mod = map_module_type incl.incl_mod} - | Tsig_class () -> Tsig_class () - | Tsig_class_type () -> Tsig_class_type () - | Tsig_attribute _ as x -> x - in - Map.leave_signature_item { item with sig_desc = sig_desc } - - and map_module_type_declaration mtd = - let mtd = Map.enter_module_type_declaration mtd in - let mtd = {mtd with mtd_type = may_map map_module_type mtd.mtd_type} in - Map.leave_module_type_declaration mtd - - - and map_module_type mty = - let mty = Map.enter_module_type mty in - let mty_desc = - match mty.mty_desc with - Tmty_ident _ -> mty.mty_desc - | Tmty_alias _ -> mty.mty_desc - | Tmty_signature sg -> Tmty_signature (map_signature sg) - | Tmty_functor (id, name, mtype1, mtype2) -> - Tmty_functor (id, name, Misc.may_map map_module_type mtype1, - map_module_type mtype2) - | Tmty_with (mtype, list) -> - Tmty_with (map_module_type mtype, - List.map (fun (path, lid, withc) -> - (path, lid, map_with_constraint withc) - ) list) - | Tmty_typeof mexpr -> - Tmty_typeof (map_module_expr mexpr) - in - Map.leave_module_type { mty with mty_desc = mty_desc} - - and map_with_constraint cstr = - let cstr = Map.enter_with_constraint cstr in - let cstr = - match cstr with - Twith_type decl -> Twith_type (map_type_declaration decl) - | Twith_typesubst decl -> Twith_typesubst (map_type_declaration decl) - | Twith_module _ -> cstr - | Twith_modsubst _ -> cstr - in - Map.leave_with_constraint cstr - - and map_module_expr mexpr = - let mexpr = Map.enter_module_expr mexpr in - let mod_desc = - match mexpr.mod_desc with - Tmod_ident _ -> mexpr.mod_desc - | Tmod_structure st -> Tmod_structure (map_structure st) - | Tmod_functor (id, name, mtype, mexpr) -> - Tmod_functor (id, name, Misc.may_map map_module_type mtype, - map_module_expr mexpr) - | Tmod_apply (mexp1, mexp2, coercion) -> - Tmod_apply (map_module_expr mexp1, map_module_expr mexp2, coercion) - | Tmod_constraint (mexpr, mod_type, Tmodtype_implicit, coercion ) -> - Tmod_constraint (map_module_expr mexpr, mod_type, - Tmodtype_implicit, coercion) - | Tmod_constraint (mexpr, mod_type, - Tmodtype_explicit mtype, coercion) -> - Tmod_constraint (map_module_expr mexpr, mod_type, - Tmodtype_explicit (map_module_type mtype), - coercion) - | Tmod_unpack (exp, mod_type) -> - Tmod_unpack (map_expression exp, mod_type) - in - Map.leave_module_expr { mexpr with mod_desc = mod_desc } - - - and map_core_type ct = - let ct = Map.enter_core_type ct in - let ctyp_desc = - match ct.ctyp_desc with - Ttyp_any - | Ttyp_var _ -> ct.ctyp_desc - | Ttyp_arrow (label, ct1, ct2) -> - Ttyp_arrow (label, map_core_type ct1, map_core_type ct2) - | Ttyp_tuple list -> Ttyp_tuple (List.map map_core_type list) - | Ttyp_constr (path, lid, list) -> - Ttyp_constr (path, lid, List.map map_core_type list) - | Ttyp_object (list, o) -> - Ttyp_object - (List.map map_object_field list, o) - | Ttyp_class () -> - Ttyp_class () - | Ttyp_alias (ct, s) -> Ttyp_alias (map_core_type ct, s) - | Ttyp_variant (list, bool, labels) -> - Ttyp_variant (List.map map_row_field list, bool, labels) - | Ttyp_poly (list, ct) -> Ttyp_poly (list, map_core_type ct) - | Ttyp_package pack -> Ttyp_package (map_package_type pack) - in - Map.leave_core_type { ct with ctyp_desc = ctyp_desc } - - and map_row_field rf = - match rf with - Ttag (label, attrs, bool, list) -> - Ttag (label, attrs, bool, List.map map_core_type list) - | Tinherit ct -> Tinherit (map_core_type ct) - - and map_object_field ofield = - match ofield with - OTtag (label, attrs, ct) -> - OTtag (label, attrs, map_core_type ct) - | OTinherit ct -> OTinherit (map_core_type ct) - -end - - -module DefaultMapArgument = struct - - let enter_structure t = t - let enter_value_description t = t - let enter_type_declaration t = t - let enter_type_extension t = t - let enter_extension_constructor t = t - let enter_pattern t = t - let enter_expression t = t - let enter_package_type t = t - let enter_signature t = t - let enter_signature_item t = t - let enter_module_type_declaration t = t - let enter_module_type t = t - let enter_module_expr t = t - let enter_with_constraint t = t - - let enter_core_type t = t - let enter_structure_item t = t - - - let leave_structure t = t - let leave_value_description t = t - let leave_type_declaration t = t - let leave_type_extension t = t - let leave_extension_constructor t = t - let leave_pattern t = t - let leave_expression t = t - let leave_package_type t = t - let leave_signature t = t - let leave_signature_item t = t - let leave_module_type_declaration t = t - let leave_module_type t = t - let leave_module_expr t = t - let leave_with_constraint t = t - - let leave_core_type t = t - let leave_structure_item t = t - -end diff --git a/jscomp/ml/typedtreeMap.mli b/jscomp/ml/typedtreeMap.mli deleted file mode 100644 index 911d898ea8..0000000000 --- a/jscomp/ml/typedtreeMap.mli +++ /dev/null @@ -1,73 +0,0 @@ -(**************************************************************************) -(* *) -(* OCaml *) -(* *) -(* Fabrice Le Fessant, INRIA Saclay *) -(* *) -(* Copyright 2012 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. *) -(* *) -(**************************************************************************) - -open Typedtree - -module type MapArgument = sig - val enter_structure : structure -> structure - val enter_value_description : value_description -> value_description - val enter_type_declaration : type_declaration -> type_declaration - val enter_type_extension : type_extension -> type_extension - val enter_extension_constructor : - extension_constructor -> extension_constructor - val enter_pattern : pattern -> pattern - val enter_expression : expression -> expression - val enter_package_type : package_type -> package_type - val enter_signature : signature -> signature - val enter_signature_item : signature_item -> signature_item - val enter_module_type_declaration : - module_type_declaration -> module_type_declaration - val enter_module_type : module_type -> module_type - val enter_module_expr : module_expr -> module_expr - val enter_with_constraint : with_constraint -> with_constraint - val enter_core_type : core_type -> core_type - val enter_structure_item : structure_item -> structure_item - - val leave_structure : structure -> structure - val leave_value_description : value_description -> value_description - val leave_type_declaration : type_declaration -> type_declaration - val leave_type_extension : type_extension -> type_extension - val leave_extension_constructor : - extension_constructor -> extension_constructor - val leave_pattern : pattern -> pattern - val leave_expression : expression -> expression - val leave_package_type : package_type -> package_type - val leave_signature : signature -> signature - val leave_signature_item : signature_item -> signature_item - val leave_module_type_declaration : - module_type_declaration -> module_type_declaration - val leave_module_type : module_type -> module_type - val leave_module_expr : module_expr -> module_expr - val leave_with_constraint : with_constraint -> with_constraint - val leave_core_type : core_type -> core_type - val leave_structure_item : structure_item -> structure_item - -end - -module MakeMap : - functor - (Iter : MapArgument) -> -sig - val map_structure : structure -> structure - val map_pattern : pattern -> pattern - val map_structure_item : structure_item -> structure_item - val map_expression : expression -> expression - - val map_signature : signature -> signature - val map_signature_item : signature_item -> signature_item - val map_module_type : module_type -> module_type -end - -module DefaultMapArgument : MapArgument From 98eebe61b8bb2146943836a5d039c362ff4f437e Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 4 Sep 2024 21:21:18 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f9b819540..0d95e14360 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ - Add dev container. https://github.com/rescript-lang/rescript-compiler/pull/6962 - Convert more tests to the node test runner. https://github.com/rescript-lang/rescript-compiler/pull/6956 - Remove attribute "internal.arity". https://github.com/rescript-lang/rescript-compiler/pull/7004 +- Remove dead modules. https://github.com/rescript-lang/rescript-compiler/pull/7008 # 12.0.0-alpha.1