Permalink
Browse files

Added environments to structure items

  • Loading branch information...
1 parent 6917724 commit 447b255ed7fd8e4af41cd820b237506b420d7158 Tiphaine Turpin committed Jul 6, 2011
Showing with 9 additions and 11 deletions.
  1. BIN boot/ocamlc
  2. +4 −9 ocamlwizard/refactor/findName.ml
  3. +1 −0 typing/typedtree.ml
  4. +1 −0 typing/typedtree.mli
  5. +3 −2 typing/typemod.ml
View
BIN boot/ocamlc
Binary file not shown.
View
13 ocamlwizard/refactor/findName.ml
@@ -95,13 +95,11 @@ let find_all_occurrences idents tree =
| Texp_instvar (_self, var)
| Texp_setinstvar (_self, var, _) -> None
| Texp_override (_self, modifs) -> None
-
| _ -> None)
| `module_expr m ->
(match m.mod_desc with
| Tmod_ident _ -> found m.mod_loc m.mod_env `mod_ident
-
| _ -> None)
| `module_type t ->
@@ -126,13 +124,10 @@ let find_all_occurrences idents tree =
found (assert false) (assert false) (assert false)
*)
- (* needed for modules
- | `structure_item i =
- match i.str_desc with
- | Tstr_open _ -> found i.str_loc (assert false) `str_open
-
- | _ -> ()
- *)
+ | `structure_item i ->
+ (match i.str_desc with
+ | Tstr_open _ -> found i.str_loc i.str_env `str_open
+ | _ -> None)
(* needed for modules
| `module_type t =
View
1 typing/typedtree.ml
@@ -167,6 +167,7 @@ and structure = {
and structure_item =
{ str_desc : structure_item_desc;
str_loc : Location.t;
+ str_env : Env.t
}
and structure_item_desc =
View
1 typing/typedtree.mli
@@ -173,6 +173,7 @@ and structure = {
and structure_item =
{ str_desc : structure_item_desc;
str_loc : Location.t;
+ str_env : Env.t
}
and structure_item_desc =
View
5 typing/typemod.ml
@@ -756,8 +756,8 @@ let wrap_constraint env arg mty explicit =
(* Type a module value expression *)
-let mkstr desc loc =
- let str = { str_desc = desc; str_loc = loc } in
+let mkstr desc loc env =
+ let str = { str_desc = desc; str_loc = loc; str_env = env } in
Typedtree.add_saved_type (Saved_structure_item str);
str
@@ -858,6 +858,7 @@ and type_structure funct_body anchor env sstr scope =
and module_names = ref StringSet.empty
and modtype_names = ref StringSet.empty in
let rec type_struct env sstr =
+ let mkstr desc loc = mkstr desc loc env in
Ctype.init_def(Ident.current_time());
match sstr with
[] ->

0 comments on commit 447b255

Please sign in to comment.