Minimal support for inlined records for the texi backend.

git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record5@15554 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Alain Frisch 2014-10-14 15:35:31 +00:00
parent c5ef8ad49d
commit 5a8fd350ca
1 changed files with 6 additions and 3 deletions

View File

@ -639,13 +639,16 @@ class texi =
(String.concat ", " (List.map f l))
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
| Cstr_tuple [], None -> ""
| Cstr_tuple args, None -> " of " ^ (Odoc_info.string_of_type_list " * " args)
| args, None -> " of " ^ (f args)
| Cstr_tuple [], Some r -> " : " ^ (Odoc_info.string_of_type_expr r)
| Cstr_tuple args, Some r -> " : " ^ (Odoc_info.string_of_type_list " * " args) ^
| args, Some r -> " : " ^ (f args) ^
" -> " ^ (Odoc_info.string_of_type_expr r)
| Cstr_record _, _ -> assert false
(** Return Texinfo code for a type. *)
method texi_of_type ty =