-
Notifications
You must be signed in to change notification settings - Fork 455
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
Modernise ast #7185
Modernise ast #7185
Conversation
There's `Parsetree`, the current parse tree, and `Parsetree0`, the legacy parse tree. Module `Parsetree.Legacy` contains functions to map to the legacy parse tree.
532e88b
to
f04c857
Compare
When a ppx is applied: 1 Parsetree is converted to Parsetree0 2 the ppx is run 3 the result is converted to Parsetree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Let's get the AST cleanup started! 🎉
I'll merge as soon as it's tested on some ppx. |
If nobody gets to it before me I'll test it on one of my PPXes, but it might be a day or so before I get time. |
I have added a simple ppx test, which will be useful as sanity check to extend when changing the ast more. |
Parsetree0
.Parsetree
can now be changed and modernised.Ast_mapper_to0
andAst_mapper_from0
added to convert both ways and maintained wheneverParsetree
changes.Parsetree
is converted to legacyParsetree0
, then the ppx is run, then the result is converted back toParsetree
.