From 7993d50d0d1dd029b34745e1ee089d9cf7c5ffbd Mon Sep 17 00:00:00 2001 From: aspiwack Date: Fri, 24 Aug 2012 17:36:36 +0000 Subject: Experimental support for a comment in the files' preamble in extraction. Scheme comments are output on a single line because Ocaml's Format module which serves as a backend to Pp has an integer, rather than a string as identation value, so we cannot make it so that each new line in the comment starts with ";; ". I've tried something with Pp.ifb but it was hackish at best and had somewhat strange results. Known bug: as Pp.std_ppcmds is non-persistent, the comment is actually printed only once per Extraction command, even if it outputs several files. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15763 85f007b7-540e-0410-9357-904b9bb8a0f7 --- plugins/extraction/scheme.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/extraction/scheme.ml') diff --git a/plugins/extraction/scheme.ml b/plugins/extraction/scheme.ml index 03a7c20062..27529258ba 100644 --- a/plugins/extraction/scheme.ml +++ b/plugins/extraction/scheme.ml @@ -28,7 +28,10 @@ let keywords = "error"; "delay"; "force"; "_"; "__"] Idset.empty -let preamble _ _ usf = +let pp_comment s = str";; "++h 0 s++fnl () + +let preamble _ comment _ usf = + pp_comment comment ++ fnl () ++ str ";; This extracted scheme code relies on some additional macros\n" ++ str ";; available at http://www.pps.jussieu.fr/~letouzey/scheme\n" ++ str "(load \"macros_extr.scm\")\n\n" ++ @@ -223,7 +226,7 @@ let scheme_descr = { preamble = preamble; pp_struct = pp_struct; sig_suffix = None; - sig_preamble = (fun _ _ _ -> mt ()); + sig_preamble = (fun _ s _ _ -> pp_comment s ++ fnl () ++ fnl ()); pp_sig = (fun _ -> mt ()); pp_decl = pp_decl; } -- cgit v1.2.3