summaryrefslogtreecommitdiffstats
path: root/ocamldoc/odoc_str.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2004-08-20 17:04:35 +0000
committerDamien Doligez <damien.doligez-inria.fr>2004-08-20 17:04:35 +0000
commitc3a39fc8c84698aa4985c779e16493c2409a0285 (patch)
tree0454ddf1543d0f6a78f9b6d6fff79ae8080f48e1 /ocamldoc/odoc_str.ml
parent8030a20089b6ed8a7b654c189f00a6f3693f8bce (diff)
Fusion des modifs de la branche release308 entre 3.08.0 et 3.08.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_str.ml')
-rw-r--r--ocamldoc/odoc_str.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/ocamldoc/odoc_str.ml b/ocamldoc/odoc_str.ml
index de82a9e46..c36d4b957 100644
--- a/ocamldoc/odoc_str.ml
+++ b/ocamldoc/odoc_str.ml
@@ -115,6 +115,30 @@ let string_of_class_type_param_list l =
)
(if par then "]" else "")
+let string_of_class_params c =
+ let b = Buffer.create 256 in
+ let rec iter = function
+ Types.Tcty_fun (label, t, ctype) ->
+ Printf.bprintf b "%s%s -> "
+ (
+ match label with
+ "" -> ""
+ | s -> s^":"
+ )
+ (Odoc_print.string_of_type_expr
+ (if Odoc_misc.is_optional label then
+ Odoc_misc.remove_option t
+ else
+ t
+ )
+ );
+ iter ctype
+ | Types.Tcty_signature _
+ | Types.Tcty_constr _ -> ()
+ in
+ iter c.Odoc_class.cl_type;
+ Buffer.contents b
+
let string_of_type t =
let module M = Odoc_type in
"type "^