From bf5866e8be3cf42455a6763ce967e690e8115f46 Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 12 Jun 2003 21:20:42 +0000 Subject: fin de l'affichage des signatures de modules dans les *.ml git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4142 85f007b7-540e-0410-9357-904b9bb8a0f7 --- contrib/extraction/ocaml.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/extraction/ocaml.ml b/contrib/extraction/ocaml.ml index 6d718f9b6c..dbc3518698 100644 --- a/contrib/extraction/ocaml.ml +++ b/contrib/extraction/ocaml.ml @@ -568,14 +568,18 @@ and pp_module_type mpl ol = function v 1 (str " " ++ prlist_with_sep fnl2 identity l) ++ fnl () ++ str "end" +let is_short = function MEident _ | MEapply _ -> true | _ -> false + let rec pp_structure_elem mpl = function | (_,SEdecl d) -> pp_decl mpl d | (l,SEmodule m) -> hov 1 (str "module " ++ P.pp_short_module (id_of_label l) ++ - str " :" ++ fnl () ++ - pp_module_type mpl None m.ml_mod_type ++ fnl () ++ - str "= " ++ fnl () ++ + (* if you want signatures everywhere: *) + (*i str " :" ++ fnl () ++ i*) + (*i pp_module_type mpl None m.ml_mod_type ++ fnl () ++ i*) + str " = " ++ + (if (is_short m.ml_mod_expr) then mt () else fnl ()) ++ pp_module_expr mpl (Some l) m.ml_mod_expr) | (l,SEmodtype m) -> hov 1 -- cgit v1.2.3