From f09fc91feadd58481402c940a728bdda84aecb14 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Thu, 15 May 2014 16:46:31 +0100 Subject: Make pp_exp export to buffer --- src/pretty_print.ml | 3 ++- src/pretty_print.mli | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pretty_print.ml b/src/pretty_print.ml index 9d435e1d..a3a0d61a 100644 --- a/src/pretty_print.ml +++ b/src/pretty_print.ml @@ -1286,6 +1286,7 @@ let doc_defs (Defs(defs)) = separate_map hardline doc_def defs let print ?(len=80) channel doc = ToChannel.pretty 1. len channel doc +let to_buf ?(len=80) buf doc = ToBuffer.pretty 1. len buf doc let pp_defs f d = print f (doc_defs d) -let pp_exp f e = print f (doc_exp e) +let pp_exp b e = to_buf b (doc_exp e) diff --git a/src/pretty_print.mli b/src/pretty_print.mli index 49c4af27..3fdf7841 100644 --- a/src/pretty_print.mli +++ b/src/pretty_print.mli @@ -1,9 +1,9 @@ open Ast open Type_internal -(* Prints on formatter the defs following source syntax *) +(* Prints the defs following source syntax *) val pp_defs : out_channel -> tannot defs -> unit -val pp_exp : out_channel -> exp -> unit +val pp_exp : Buffer.t -> exp -> unit (* Prints on formatter the defs as Lem Ast nodes *) val pp_lem_defs : Format.formatter -> tannot defs -> unit -- cgit v1.2.3