diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-10-30 14:16:06 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-10-30 14:16:06 +0000 |
commit | a14e4c0670eda14686a6fcf24b909f9fc3e1e3d3 (patch) | |
tree | 893b2e601fd9b1f04ae17e3d79c69eff91213b42 /plugins/extraction/ocaml.ml | |
parent | 6cd21c58557309919083610caff4a0b65a5c041f (diff) |
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
Diffstat (limited to 'plugins/extraction/ocaml.ml')
-rw-r--r-- | plugins/extraction/ocaml.ml | 8 |
1 files changed, 6 insertions, 2 deletions
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()) |