diff options
author | Maxence Guesdon <maxence.guesdon@inria.fr> | 2002-04-02 15:16:31 +0000 |
---|---|---|
committer | Maxence Guesdon <maxence.guesdon@inria.fr> | 2002-04-02 15:16:31 +0000 |
commit | 786b610e5db3c48e145a25f54237a22f48845977 (patch) | |
tree | 554551b48c1c1ba63383f49210dcf509f969c1c5 /ocamldoc/odoc_misc.ml | |
parent | e3c3f8b66a3c7ed28253f11b348b706d988306af (diff) |
affichage des types de classes, ajout des labels pour les paramètres (pour les classes seulement pour l'instant)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4577 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocamldoc/odoc_misc.ml')
-rw-r--r-- | ocamldoc/odoc_misc.ml | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/ocamldoc/odoc_misc.ml b/ocamldoc/odoc_misc.ml index c2e739117..38fc6e3fe 100644 --- a/ocamldoc/odoc_misc.ml +++ b/ocamldoc/odoc_misc.ml @@ -76,7 +76,8 @@ let string_of_module_type t = let s = Format.flush_str_formatter () in s -let string_of_class_type t = +let string_of_class_type t = + (* A VOIR : ma propre version de Printtyp.class_type pour ne pas faire reset_names *) Printtyp.class_type Format.str_formatter t; let s = Format.flush_str_formatter () in s @@ -340,3 +341,30 @@ let create_index_lists elements string_of_ele = f current (acc0 @ [ele]) acc1 acc2 q in f '_' [] [] [] elements + + +let remove_option typ = + let rec iter t = + match t with + | Types.Tconstr (p,tlist,_) -> + ( + match p with + Path.Pident id when Ident.name id = "option" -> + ( + match tlist with + [t2] -> t2.Types.desc + | _ -> t + ) + | _ -> t + ) + | Types.Tvar + | Types.Tarrow _ + | Types.Ttuple _ + | Types.Tobject _ + | Types.Tfield _ + | Types.Tnil + | Types.Tvariant _ -> t + | Types.Tlink t2 + | Types.Tsubst t2 -> iter t2.Types.desc + in + { typ with Types.desc = iter typ.Types.desc } |