ppxlib icon indicating copy to clipboard operation
ppxlib copied to clipboard

Add json mapper for pp_ast

Open pedrobslisboa opened this issue 5 months ago • 1 comments

Description

Add json mapper on pp_ast to improve usage in tools such as AST Explorer. The idea is to increment the @NathanReb PR https://github.com/ocaml-ppx/ppxlib/pull/517

@NathanReb, your opinion on how to structure it better is very welcome. @jchavarri @davesnx thank you for the help.

How

To use it, we just need to pass --json to ppxlib-pp-ast. It works with all other flags, such as --show-attrs and --show-loc.

How to test

  • In this branch build the project
  • Create a test.ml on the root and add some content
  • Run ppxlib-pp-ast test.ml and check the result
  • Run ppxlib-pp-ast --json test.ml and check the result
  • Use others flags to see the result with --json

pedrobslisboa avatar Sep 24 '24 20:09 pedrobslisboa