Skip to content

Commit

Permalink
Replace -dparsetree sexp output with a pretty-printed AST
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rebours <[email protected]>
  • Loading branch information
NathanReb committed Sep 26, 2024
1 parent ac7fcfc commit e9f306b
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 1,115 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ details.
a `ppxlib-pp-ast` executable in a new separate `ppxlib-tools` package
(#517, @NathanReb)

- Change `-dparsetree` from a sexp output to a pretty printed AST, closer
to what the compiler's `-dparsetree` is.
(#530, @NathanReb)

0.33.0 (2024-07-22)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions src/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ let process_file (kind : Kind.t) fn ~input_name ~relocate ~output_mode
let ppf = Stdlib.Format.formatter_of_out_channel oc in
let ast = add_cookies ast in
(match ast with
| Intf ast -> Sexp.pp_hum ppf (Ast_traverse.sexp_of#signature ast)
| Impl ast -> Sexp.pp_hum ppf (Ast_traverse.sexp_of#structure ast));
| Intf ast -> Pp_ast.signature ppf ast
| Impl ast -> Pp_ast.structure ppf ast);
Stdlib.Format.pp_print_newline ppf ())
| Reconcile mode ->
Reconcile.reconcile !replacements
Expand Down
Loading

0 comments on commit e9f306b

Please sign in to comment.