From a14e4c0670eda14686a6fcf24b909f9fc3e1e3d3 Mon Sep 17 00:00:00 2001 From: letouzey Date: Tue, 30 Oct 2012 14:16:06 +0000 Subject: Extraction: avoid initial strange empty comments after Arnaud's hack git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15942 85f007b7-540e-0410-9357-904b9bb8a0f7 --- plugins/extraction/ocaml.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/extraction/ocaml.ml') diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml index 826dcec02..7640416fd 100644 --- a/plugins/extraction/ocaml.ml +++ b/plugins/extraction/ocaml.ml @@ -63,8 +63,12 @@ let pp_open mp = str ("open "^ string_of_modfile mp ^"\n") let pp_comment s = str "(* " ++ hov 0 s ++ str " *)" +let pp_header_comment = function + | None -> mt () + | Some com -> pp_comment com ++ fnl () ++ fnl () + let preamble _ comment used_modules usf = - pp_comment comment ++ fnl () ++ fnl () ++ + pp_header_comment comment ++ prlist pp_open used_modules ++ (if used_modules = [] then mt () else fnl ()) ++ (if usf.tdummy || usf.tunknown then str "type __ = Obj.t\n" else mt()) ++ @@ -74,7 +78,7 @@ let preamble _ comment used_modules usf = (if usf.tdummy || usf.tunknown || usf.mldummy then fnl () else mt ()) let sig_preamble _ comment used_modules usf = - pp_comment comment ++ fnl () ++ fnl () ++ + pp_header_comment comment ++ fnl () ++ fnl () ++ prlist pp_open used_modules ++ (if used_modules = [] then mt () else fnl ()) ++ (if usf.tdummy || usf.tunknown then str "type __ = Obj.t\n\n" else mt()) -- cgit v1.2.3