diff options
author | Alain Frisch <alain@frisch.fr> | 2014-10-14 15:51:30 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2014-10-14 15:51:30 +0000 |
commit | e3ad818fb5f8ddc7b477779a6da69ccac0f00f4f (patch) | |
tree | 9016f709d251804278be1a75f518787aa571904b /ocamldoc/odoc_texi.ml | |
parent | a4e637ea622cf33b4c0870a98c6b1db0090f8e38 (diff) | |
parent | 8da19ea098b270230a9f1e1d252350bd69cbf8ee (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_texi.ml')
-rw-r--r-- | ocamldoc/odoc_texi.ml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml index 10d45c1c8..afa4d49f7 100644 --- a/ocamldoc/odoc_texi.ml +++ b/ocamldoc/odoc_texi.ml @@ -638,12 +638,16 @@ class texi = Printf.sprintf "(%s) " (String.concat ", " (List.map f l)) - method string_of_type_args (args:Types.type_expr list) (ret:Types.type_expr option) = + method string_of_type_args (args:constructor_args) (ret:Types.type_expr option) = + let f = function + | Cstr_tuple l -> Odoc_info.string_of_type_list " * " l + | Cstr_record l -> Odoc_info.string_of_record l + in match args, ret with - | [], None -> "" - | args, None -> " of " ^ (Odoc_info.string_of_type_list " * " args) - | [], Some r -> " : " ^ (Odoc_info.string_of_type_expr r) - | args, Some r -> " : " ^ (Odoc_info.string_of_type_list " * " args) ^ + | Cstr_tuple [], None -> "" + | args, None -> " of " ^ (f args) + | Cstr_tuple [], Some r -> " : " ^ (Odoc_info.string_of_type_expr r) + | args, Some r -> " : " ^ (f args) ^ " -> " ^ (Odoc_info.string_of_type_expr r) (** Return Texinfo code for a type. *) |