ligo/src/passes/01-parsing/formatter.ml
Pierre-Emmanuel Wulfman aa849f6dcb renaming of passes
2020-06-23 16:35:28 +02:00

14 lines
346 B
OCaml

open Display
let ppx_ppformat ~display_format f (buf,_) =
match display_format with
| Human_readable | Dev -> Format.fprintf f "%s" (Buffer.contents buf)
let ppx_jsonformat (buf,_) : json =
let s = Format.asprintf "%s" (Buffer.contents buf) in
`String s
let ppx_format : 'a format = {
pp = ppx_ppformat;
to_json = ppx_jsonformat;
}