toplevel emits round trip pprint of ast to console.

This commit is contained in:
cqc
2023-03-03 18:47:24 -06:00
parent 272778ad7b
commit ab91e5dee0
4 changed files with 99 additions and 24 deletions

View File

@ -28,9 +28,25 @@ module Graphics_support = struct
let init elt = Graphics_js.open_canvas elt
end
open Log_js
module Ppx_support = struct
let init () =
Ast_mapper.register "js_of_ocaml" (fun _ -> Ppx_js.mapper)
Ppx_graph.init ();
Ast_mapper.register "js_of_ocaml" (fun _ -> Ppx_js.mapper);
Ast_mapper.register "ppxlib" (fun _ ->
Log.info (fun m -> m "Ppxlib.mapper");
{
Ast_mapper.default_mapper with
structure =
(fun _ ->
Log.info (fun m -> m "Ppxlib.Driver.map_structure");
Ppxlib.Driver.map_structure);
signature =
(fun _ ->
Log.info (fun m -> m "Ppxlib.Driver.map_signature");
Ppxlib.Driver.map_signature);
})
end
module Colorize = struct