summaryrefslogtreecommitdiff
path: root/parsing/depend.ml
diff options
context:
space:
mode:
authoroctachron <octa@polychoron.fr>2017-09-28 12:25:49 +0200
committerGabriel Scherer <gabriel.scherer@gmail.com>2017-10-19 14:40:15 +0200
commitcbf40e64ac2e4880caa28cfa75b064796f036e4d (patch)
tree269b3abfd43d0d6084745f3f3642c2e198b3a116 /parsing/depend.ml
parentbbfc908eb86cc011011f8c6adc8871169e984f56 (diff)
downloadocaml-cbf40e64ac2e4880caa28cfa75b064796f036e4d.tar.gz
MPR#7643, ocamldep: fix nested structure blowup
Diffstat (limited to 'parsing/depend.ml')
-rw-r--r--parsing/depend.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/parsing/depend.ml b/parsing/depend.ml
index e0851d7610..7a4ce16637 100644
--- a/parsing/depend.ml
+++ b/parsing/depend.ml
@@ -324,16 +324,16 @@ and add_module_alias bv l =
| _ -> addmodule bv l; bound (* cannot delay *)
and add_modtype_binding bv mty =
- if not !Clflags.transparent_modules then add_modtype bv mty;
match mty.pmty_desc with
Pmty_alias l ->
+ if not !Clflags.transparent_modules then addmodule bv l;
add_module_alias bv l
| Pmty_signature s ->
make_node (add_signature_binding bv s)
| Pmty_typeof modl ->
add_module_binding bv modl
| _ ->
- if !Clflags.transparent_modules then add_modtype bv mty; bound
+ add_modtype bv mty; bound
and add_signature bv sg =
ignore (add_signature_binding bv sg)
@@ -386,9 +386,9 @@ and add_sig_item (bv, m) item =
(bv, m)
and add_module_binding bv modl =
- if not !Clflags.transparent_modules then add_module bv modl;
match modl.pmod_desc with
Pmod_ident l ->
+ if not !Clflags.transparent_modules then addmodule bv l;
begin try
add_parent bv l;
lookup_map l.txt bv
@@ -398,9 +398,10 @@ and add_module_binding bv modl =
| _ -> addmodule bv l; bound
end
| Pmod_structure s ->
- make_node (snd (add_structure_binding bv s))
- | _ ->
- if !Clflags.transparent_modules then add_module bv modl; bound
+ let n = make_node (snd @@ add_structure_binding bv s) in
+ if not !Clflags.transparent_modules then add_names (collect_free n);
+ n
+ | _ -> add_module bv modl; bound
and add_module bv modl =
match modl.pmod_desc with