Original bug ID: 7232 Reporter: antron Assigned to:@damiendoligez Status: closed (set by @damiendoligez on 2016-04-19T12:42:37Z) Resolution: fixed Priority: normal Severity: minor Target version: 4.03.0+dev / +beta1 Fixed in version: 4.03.0+dev / +beta1 Category: ~DO NOT USE (was: OCaml general) Monitored by:@hcarty
Printing an AST produced by ppx_deriving.show with Pprintast results in different spacing than entering the same source code directly and printing that. I haven't fully diagnosed the issue due to a lack of time, but I suppose ppx_deriving.show is programmatically generating some AST construct that hasn't received as much attention as constructs generated by the OCaml parser for the literal code.
.PHONY : test
ocamlfind ppx_tools/rewriter -ppx '$(PPX)' foo.ml
This results in the output:
type a =
| Foo [@@deriving show]
let rec (pp_a : Format.formatter -> a -> Ppx_deriving_runtime.unit) =
((let open! Ppx_deriving_runtime in
fun fmt -> function | Foo -> Format.pp_print_string fmt "Foo.Foo")
and show_a : a -> Ppx_deriving_runtime.string=
fun x -> Format.asprintf "%a" pp_a x
However, parsing and re-printing the let rec ... and ... definitions directly results in a space before the "=" character on the line with "and".
The text was updated successfully, but these errors were encountered: