-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Replace camlp5 with ppx_parser #11860
Conversation
ppx_parser's default message is "Parse error."
This previously did not have a match expression and it is not necessary
@yuxiaomao Could you check if this works with your codebases? And if it does, could you check the |
All projects compile (except one but it's already failing with development), and I can't notice significant performance change compared to development 5174e89 . |
Note that when testing the compilation with one project (without compilation server), the first compilation is significant slower than usual (+50% total time, from 30s to 45s). Can't reproduce and difficult to say if it's related to this PR or not x) |
I'm trying to do my local setup for this and will log everything I come across. With
Edit: Right, as Yuxiao had already told me I need to run |
@kLabz Could you check if this works for you as well? I'm pretty eager to merge this quickly, which may or may not be because I nuked my local camlp5 setup and now can't compile Haxe on any other branch anymore... |
Can do that in 1~2 hours |
I've removed most of the |
I'll go ahead and merge this now so that we can move forward. There might be some adjustments to make, but we can always do that later. Thank you SO MUCH for looking into this, getting rid of camlp5 has been on my bucket list for a while now. |
|
that has been done already |
We've had issues with camlp5 on windows as it doesn't get much maintenance anymore (and still relies on Unix configure/makefiles rather than dune).
This PR is an attempt to port our parser to ppx_parser, which is a reimplementation of camlp-stream parsers with ppxlib preprocessors which are much better maintained. It was missing a couple features but I've manged to upstream these:
We also need this patch to allow it to install with ocaml 4.08, so for now I've set it to build with my fork:
ppx_parser is based on camlp4 which, unlike camlp5, did not perform automatic left-factorization. We've avoided this problem with manual refactoring: #11859.
Another minor difference is that when clauses are not supported within rules, only outside of them, so the clause can only include variables bound in the first element of the rule. This is not a big issue after the refactoring that was already required.
Other differences are purely syntactic.