Source file ppxlib_with_sexp.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
open! Base
open! Import
include Ppxlib
let sexp_as_pprinted_atom printer data =
ignore (Stdlib.Format.flush_str_formatter () : string);
printer Stdlib.Format.str_formatter data;
Sexp.Atom (Stdlib.Format.flush_str_formatter ())
;;
let sexp_of_constant = Ast_traverse.sexp_of#constant
let sexp_of_expression = sexp_as_pprinted_atom Pprintast.expression
let sexp_of_core_type = sexp_as_pprinted_atom Pprintast.core_type
let sexp_of_loc sexp_of_a { loc = (_ : location); txt } = sexp_of_a txt