diff options
author | Pierre Weis <Pierre.Weis@inria.fr> | 2007-10-09 10:29:37 +0000 |
---|---|---|
committer | Pierre Weis <Pierre.Weis@inria.fr> | 2007-10-09 10:29:37 +0000 |
commit | 59e0723455fc8b847a1303bfc73db5968d666eee (patch) | |
tree | 29b21992d5428948131f66b950ec4e8ed48f0166 /ocamldoc/odoc_str.ml | |
parent | 00f4865bad9838add05d832a05b19fb68da47043 (diff) |
It works: compilers and camlp4 are fully bootstrapped. The ast magic number is not yet changed.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8418 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_str.ml')
-rw-r--r-- | ocamldoc/odoc_str.ml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ocamldoc/odoc_str.ml b/ocamldoc/odoc_str.ml index fb1d2b31d..3fafb9622 100644 --- a/ocamldoc/odoc_str.ml +++ b/ocamldoc/odoc_str.ml @@ -150,6 +150,10 @@ let string_of_class_params c = iter c.Odoc_class.cl_type; Buffer.contents b +let bool_of_private = function + | Asttypes.Private -> true + | _ -> false + let string_of_type t = let module M = Odoc_type in "type "^ @@ -162,15 +166,18 @@ let string_of_type t = t.M.ty_parameters ) )^ + let priv = bool_of_private (t.M.ty_private) in (Name.simple t.M.ty_name)^" "^ (match t.M.ty_manifest with None -> "" - | Some typ -> "= "^(Odoc_print.string_of_type_expr typ)^" " + | Some typ -> + "= " ^ (if priv then "private " else "" ) ^ + (Odoc_print.string_of_type_expr typ)^" " )^ (match t.M.ty_kind with M.Type_abstract -> "" - | M.Type_variant (l, priv) -> + | M.Type_variant l -> "="^(if priv then " private" else "")^"\n"^ (String.concat "" (List.map @@ -192,7 +199,7 @@ let string_of_type t = l ) ) - | M.Type_record (l, priv) -> + | M.Type_record l -> "= "^(if priv then "private " else "")^"{\n"^ (String.concat "" (List.map |