Open jfrolich opened 2 years ago
you probably can use syntax repo. it emits an executable that prints/parses binary ast.
Nice. I'll probably do that, but I would need to vendor it because I want to have 0 (OCaml) dependencies. So I still would rather have this functionality as part of the rescript compiler.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Currently, it's not possible to emit a binary AST or accept a binary AST using the
rescript format
command line tool. I am working on a more tightly integrated version ofgraphql-ppx
and it is now dependent onrefmt
for this (and thus is in ReasonML instead of ReScript). This is necessary for snapshot testing. To properly test the ppx I need to go fromsource code -> binary AST -> ppx -> binary AST -> source code
. An example on how this can be achieved withrefmt
is the following command:Other solutions are also welcome, but without snapshot testing, it's really hard to know if a ppx is behaving correctly.
Are you open for a PR to achieve this? (even if it's undocumented that would be fine)