Skip to content

Commit

Permalink
Added environments to structure items
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiphaine Turpin authored and Tiphaine Turpin committed Jul 6, 2011
1 parent 6917724 commit 447b255
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Binary file modified boot/ocamlc
Binary file not shown.
13 changes: 4 additions & 9 deletions ocamlwizard/refactor/findName.ml
Expand Up @@ -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 ->
Expand All @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions typing/typedtree.ml
Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions typing/typedtree.mli
Expand Up @@ -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 =
Expand Down
5 changes: 3 additions & 2 deletions typing/typemod.ml
Expand Up @@ -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

Expand Down Expand Up @@ -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
[] ->
Expand Down

0 comments on commit 447b255

Please sign in to comment.