resolve module aliases

Ignore-this: 9b0c0f2de27ba128bfa3916a7db8631d

darcs-hash:20110727220954-c41ad-849890db65365f2ce3e0cb69f10882e6efa78661
This commit is contained in:
Jeremie Dimino 2011-07-28 00:09:54 +02:00
parent f7e913a26f
commit f171e7ec80
1 changed files with 32 additions and 22 deletions

View File

@ -131,16 +131,7 @@ let add_names_of_type decl acc =
| Type_abstract ->
acc
(* List all names of the module with path [path] *)
let get_names_of_module path =
try
match
match path with
| Path path ->
Env.find_module path !Toploop.toplevel_env
| Longident ident ->
snd (Env.lookup_module ident !Toploop.toplevel_env)
with
let rec get_names_of_module_type = function
| Tmty_signature decls ->
List.fold_left
(fun acc decl -> match decl with
@ -154,10 +145,29 @@ let get_names_of_module path =
| Tsig_type(id, decl, _) ->
add_names_of_type decl (add (Ident.name id) acc))
String_set.empty decls
| Tmty_ident path -> begin
match try Some (Env.find_modtype path !Toploop.toplevel_env) with Not_found -> None with
| Some Tmodtype_abstract -> String_set.empty
| Some Tmodtype_manifest module_type -> get_names_of_module_type module_type
| None -> String_set.empty
end
| _ ->
String_set.empty
(* List all names of the module with path [path] *)
let get_names_of_module path =
match
try
match path with
| Path path ->
Some (Env.find_module path !Toploop.toplevel_env)
| Longident ident ->
Some (snd (Env.lookup_module ident !Toploop.toplevel_env))
with Not_found ->
String_set.empty
None
with
| Some module_type -> get_names_of_module_type module_type
| None -> String_set.empty
let names_of_module path =
try