ligo/src/passes/01-parser/formatter.ml

14 lines
348 B
OCaml
Raw Normal View History

open Display
let ppx_ppformat ~display_format f (buf,_) =
match display_format with
| Human_readable | Dev -> Format.fprintf f "%s\n" (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;
}