summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_dep.ml
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2014-10-14 15:51:30 +0000
committerAlain Frisch <alain@frisch.fr>2014-10-14 15:51:30 +0000
commite3ad818fb5f8ddc7b477779a6da69ccac0f00f4f (patch)
tree9016f709d251804278be1a75f518787aa571904b /ocamldoc/odoc_dep.ml
parenta4e637ea622cf33b4c0870a98c6b1db0090f8e38 (diff)
parent8da19ea098b270230a9f1e1d252350bd69cbf8ee (diff)
Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_dep.ml')
-rw-r--r--ocamldoc/odoc_dep.ml30
1 files changed, 10 insertions, 20 deletions
diff --git a/ocamldoc/odoc_dep.ml b/ocamldoc/odoc_dep.ml
index c2949d733..b0393fe86 100644
--- a/ocamldoc/odoc_dep.ml
+++ b/ocamldoc/odoc_dep.ml
@@ -147,41 +147,31 @@ let type_deps t =
l := s2 :: !l ;
s2
in
+ let ty t =
+ let s = Odoc_print.string_of_type_expr t in
+ ignore (Str.global_substitute re f s)
+ in
(match t.T.ty_kind with
T.Type_abstract -> ()
| T.Type_variant cl ->
List.iter
(fun c ->
- List.iter
- (fun e ->
- let s = Odoc_print.string_of_type_expr e in
- ignore (Str.global_substitute re f s)
- )
- c.T.vc_args
+ match c.T.vc_args with
+ | T.Cstr_tuple l -> List.iter ty l
+ | T.Cstr_record l -> List.iter (fun r -> ty r.T.rf_type) l
)
cl
| T.Type_record rl ->
- List.iter
- (fun r ->
- let s = Odoc_print.string_of_type_expr r.T.rf_type in
- ignore (Str.global_substitute re f s)
- )
- rl
+ List.iter (fun r -> ty r.T.rf_type) rl
| T.Type_open -> ()
);
(match t.T.ty_manifest with
None -> ()
| Some (T.Object_type fields) ->
- List.iter
- (fun r ->
- let s = Odoc_print.string_of_type_expr r.T.of_type in
- ignore (Str.global_substitute re f s)
- )
- fields
+ List.iter (fun r -> ty r.T.of_type) fields
| Some (T.Other e) ->
- let s = Odoc_print.string_of_type_expr e in
- ignore (Str.global_substitute re f s)
+ ty e
);
!l