Skip to content

Commit

Permalink
Rename Tmod_hole to Tmod_typed_hole
Browse files Browse the repository at this point in the history
  • Loading branch information
liam923 committed Jan 16, 2025
1 parent 0f371cc commit 40393be
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/frontend/query_commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ let dispatch pipeline (type a) : a Query_protocol.t -> a = function
let structures = Mbrowse.enclosing pos [ Mbrowse.of_typedtree typedtree ] in
begin
match structures with
| (_, (Browse_raw.Module_expr { mod_desc = Tmod_hole; _ } as node_for_loc))
| (_, (Browse_raw.Module_expr { mod_desc = Tmod_typed_hole; _ } as node_for_loc))
:: (_, node)
:: _parents ->
let loc = Mbrowse.node_loc node_for_loc in
Expand Down
4 changes: 2 additions & 2 deletions src/ocaml/merlin_specific/browse_raw.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ and of_module_expr_desc = function
| Tmod_constraint (me, _, mtc, _) ->
of_module_expr me ** app (Module_type_constraint mtc)
| Tmod_unpack (e, _) -> of_expression e
| Tmod_hole -> id_fold
| Tmod_typed_hole -> id_fold

and of_structure_item_desc = function
| Tstr_eval (e, _) -> of_expression e
Expand Down Expand Up @@ -935,7 +935,7 @@ let all_holes (env, node) =
match node with
| Expression { exp_desc = Texp_typed_hole; exp_loc; exp_type; exp_env; _ } ->
(exp_loc, exp_env, `Exp exp_type) :: acc
| Module_expr { mod_desc = Tmod_hole; mod_loc; mod_type; mod_env; _ } ->
| Module_expr { mod_desc = Tmod_typed_hole; mod_loc; mod_type; mod_env; _ } ->
(mod_loc, mod_env, `Mod mod_type) :: acc
| _ -> aux acc (env, node)
in
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/cmt_format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ let iter_on_occurrences
(match mod_desc with
| Tmod_ident (path, lid) -> f ~namespace:Module mod_env path lid
| Tmod_structure _ | Tmod_functor _ | Tmod_apply _ | Tmod_apply_unit _
| Tmod_constraint _ | Tmod_unpack _ | Tmod_hole -> ());
| Tmod_constraint _ | Tmod_unpack _ | Tmod_typed_hole -> ());
default_iterator.module_expr sub me);

open_description =
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/printtyped.ml
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ and module_expr i ppf x =
let i = i+1 in
match x.mod_desc with
| Tmod_ident (li,_) -> line i ppf "Tmod_ident %a\n" fmt_path li;
| Tmod_hole -> line i ppf "Tmod_hole\n";
| Tmod_typed_hole -> line i ppf "Tmod_typed_hole\n";
| Tmod_structure (s) ->
line i ppf "Tmod_structure\n";
structure i ppf s;
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/tast_iterator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ let module_expr sub {mod_loc; mod_desc; mod_env; mod_attributes; _} =
sub.attributes sub mod_attributes;
sub.env sub mod_env;
match mod_desc with
| Tmod_hole -> ()
| Tmod_typed_hole -> ()
| Tmod_ident (_, lid) -> iter_loc sub lid
| Tmod_structure st -> sub.structure sub st
| Tmod_functor (arg, mexpr) ->
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/tast_mapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ let module_expr sub x =
let mod_desc =
match x.mod_desc with
| Tmod_ident (path, lid) -> Tmod_ident (path, map_loc sub lid)
| Tmod_hole -> Tmod_hole
| Tmod_typed_hole -> Tmod_typed_hole
| Tmod_structure st -> Tmod_structure (sub.structure sub st)
| Tmod_functor (arg, mexpr) ->
Tmod_functor (functor_parameter sub arg, sub.module_expr sub mexpr)
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,7 @@ and is_nonexpansive_mod mexp =
match mexp.mod_desc with
| Tmod_ident _
| Tmod_functor _
| Tmod_hole -> true
| Tmod_typed_hole -> true
| Tmod_unpack (e, _) -> is_nonexpansive e
| Tmod_constraint (m, _, _, _) -> is_nonexpansive_mod m
| Tmod_structure str ->
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/typedtree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ and module_expr_desc =
| Tmod_constraint of
module_expr * Types.module_type * module_type_constraint * module_coercion
| Tmod_unpack of expression * Types.module_type
| Tmod_hole
| Tmod_typed_hole

and structure = {
str_items : structure_item list;
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/typedtree.mli
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ and module_expr_desc =
(ME : MT) (constraint = Tmodtype_explicit MT)
*)
| Tmod_unpack of expression * Types.module_type
| Tmod_hole
| Tmod_typed_hole

and structure = {
str_items : structure_item list;
Expand Down
6 changes: 3 additions & 3 deletions src/ocaml/typing/typemod.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ let rec path_of_module mexp =
| Tmod_constraint (mexp, _, _, _) ->
path_of_module mexp
| (Tmod_structure _ | Tmod_functor _ | Tmod_apply_unit _ | Tmod_unpack _ |
Tmod_apply _ | Tmod_hole) ->
Tmod_apply _ | Tmod_typed_hole) ->
raise Not_a_path

let path_of_module mexp =
Expand Down Expand Up @@ -2382,7 +2382,7 @@ and type_module_aux ~alias sttn funct_body anchor env smod =
| Pmod_extension ({ txt; _ }, _) when txt = Ast_helper.hole_txt ->
Msupport.raise_error exn;
{
mod_desc = Tmod_hole;
mod_desc = Tmod_typed_hole;
mod_type = Mty_for_hole;
mod_loc = sarg.pmod_loc;
mod_env = env;
Expand Down Expand Up @@ -2424,7 +2424,7 @@ and type_module_aux ~alias sttn funct_body anchor env smod =
mod_loc = smod.pmod_loc },
Shape.leaf_for_unpack
| Pmod_extension ({ txt; _ }, _) when txt = Ast_helper.hole_txt ->
{ mod_desc = Tmod_hole;
{ mod_desc = Tmod_typed_hole;
mod_type = Mty_for_hole;
mod_env = env;
mod_attributes = smod.pmod_attributes;
Expand Down
2 changes: 1 addition & 1 deletion src/ocaml/typing/untypeast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ let module_expr (sub : mapper) mexpr =
| Tmod_unpack (exp, _pack) ->
Pmod_unpack (sub.expr sub exp)
(* TODO , sub.package_type sub pack) *)
| Tmod_hole ->
| Tmod_typed_hole ->
let id = Location.mkloc hole_txt loc in
Pmod_extension (id, PStr [])
in
Expand Down
4 changes: 2 additions & 2 deletions src/ocaml/typing/value_rec_check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ let classify_expression : Typedtree.expression -> sd =
Dynamic
and classify_module_expression env mexp : sd =
match mexp.mod_desc with
| Tmod_hole ->
| Tmod_typed_hole ->
Dynamic
| Tmod_ident (path, _) ->
classify_path env path
Expand Down Expand Up @@ -1041,7 +1041,7 @@ and modexp : Typedtree.module_expr -> term_judg =
coercion coe (fun m -> modexp mexp << m)
| Tmod_unpack (e, _) ->
expression e
| Tmod_hole -> fun _ -> Env.empty
| Tmod_typed_hole -> fun _ -> Env.empty


(* G |- pth : m *)
Expand Down

0 comments on commit 40393be

Please sign in to comment.