diff options
| author | Gabriel Kerneis | 2014-05-15 14:10:24 +0100 |
|---|---|---|
| committer | Gabriel Kerneis | 2014-05-15 14:10:24 +0100 |
| commit | 952038a6be7a267fb8440d055e2f2ff299f782e4 (patch) | |
| tree | bb8205c56a23f1b306ba96aabf1bcd26c73a307e /src | |
| parent | 98a61ad83f968d856d4f86ca32fcca8010a44f6f (diff) | |
Pretty-print to stdout rather than Format.stdout_formatter
PPrint.ToFormatter is either broken, or I do not know how to use
it properly. Switching to ToChannel solves the issue nicely.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pretty_print.ml | 3 | ||||
| -rw-r--r-- | src/pretty_print.mli | 5 | ||||
| -rw-r--r-- | src/sail.ml | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/pretty_print.ml b/src/pretty_print.ml index 2296dded..bc438eb2 100644 --- a/src/pretty_print.ml +++ b/src/pretty_print.ml @@ -1252,8 +1252,7 @@ let doc_def = function let doc_defs (Defs(defs)) = separate_map hardline doc_def defs -let print ?(len=80) formatter doc = - ToFormatter.pretty 1.0 len formatter doc +let print ?(len=80) channel doc = ToChannel.pretty 1. len channel doc let pp_defs f d = print f (doc_defs d) let pp_exp f e = print f (doc_exp e) diff --git a/src/pretty_print.mli b/src/pretty_print.mli index bf32a805..49c4af27 100644 --- a/src/pretty_print.mli +++ b/src/pretty_print.mli @@ -1,10 +1,9 @@ open Ast open Type_internal -open Format (* Prints on formatter the defs following source syntax *) -val pp_defs : Format.formatter -> tannot defs -> unit -val pp_exp : Format.formatter -> exp -> unit +val pp_defs : out_channel -> tannot defs -> unit +val pp_exp : out_channel -> exp -> unit (* Prints on formatter the defs as Lem Ast nodes *) val pp_lem_defs : Format.formatter -> tannot defs -> unit diff --git a/src/sail.ml b/src/sail.ml index b0957f91..a3a52c1b 100644 --- a/src/sail.ml +++ b/src/sail.ml @@ -399,7 +399,7 @@ let main() = let chkedasts = (List.map (fun (f,(ast,kenv)) -> (f,check_ast ast kenv)) asts) in begin (if !(opt_print_verbose) - then ((Pretty_print.pp_defs Format.std_formatter) (snd (List.hd chkedasts))) + then ((Pretty_print.pp_defs stdout) (snd (List.hd chkedasts))) else ()); (if !(opt_print_lem) then output "" Lem_ast_out chkedasts |
