diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2011-07-29 10:32:43 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2011-07-29 10:32:43 +0000 |
commit | 9dc661c3bfa20708442de95b08227529ddf8c941 (patch) | |
tree | 2a81d10cd13b15f5ae67bda6eb7d50ce280b1f39 /ocamldoc/odoc_texi.ml | |
parent | 173c44001c244d819a385475d428857439eaa588 (diff) | |
parent | 852558d482255cde6fa686906ee27d26c2a69603 (diff) | |
download | ocaml-9dc661c3bfa20708442de95b08227529ddf8c941.tar.gz |
merge branches/gadts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_texi.ml')
-rw-r--r-- | ocamldoc/odoc_texi.ml | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml index 55cb972fae..5c75b4fdfa 100644 --- a/ocamldoc/odoc_texi.ml +++ b/ocamldoc/odoc_texi.ml @@ -640,9 +640,13 @@ class texi = Printf.sprintf "(%s) " (String.concat ", " (List.map f l)) - method string_of_type_args = function - | [] -> "" - | args -> " of " ^ (Odoc_info.string_of_type_list " * " args) + method string_of_type_args (args:Types.type_expr list) (ret:Types.type_expr option) = + 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) ^ + " -> " ^ (Odoc_info.string_of_type_expr r) (** Return Texinfo code for a type. *) method texi_of_type ty = @@ -668,11 +672,13 @@ class texi = (List.map (fun constr -> (Raw (" | " ^ constr.vc_name)) :: - (Raw (self#string_of_type_args constr.vc_args)) :: + (Raw (self#string_of_type_args + constr.vc_args constr.vc_ret)) :: (match constr.vc_text with | None -> [ Newline ] | Some t -> - ((Raw (indent 5 "\n(* ")) :: (self#soft_fix_linebreaks 8 t)) @ + (Raw (indent 5 "\n(* ") :: + self#soft_fix_linebreaks 8 t) @ [ Raw " *)" ; Newline ] ) ) l ) ) | Type_record l -> @@ -704,7 +710,7 @@ class texi = [ self#fixedblock ( [ Newline ; minus ; Raw "exception " ; Raw (Name.simple e.ex_name) ; - Raw (self#string_of_type_args e.ex_args) ] @ + Raw (self#string_of_type_args e.ex_args None) ] @ (match e.ex_alias with | None -> [] | Some ea -> [ Raw " = " ; Raw |