Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace -dparsetree sexp output with a pretty-printed AST #530

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading