-
Notifications
You must be signed in to change notification settings - Fork 31
Ppxlib 5.2 AST bump #181
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
Ppxlib 5.2 AST bump #181
Conversation
|
The CI probably needs to be rerun, looks like ocaml-ppx/ppxlib@108ae3a is contained in ppxlib 0.36.0. I don't see a rerun button in the CI though, I'm adding an empty commit to trigger the CI. |
|
I can try adding a >= 0.36.0 dependency on ppxlib, but then opam fails to find a solution on 4.14.2 due to Async: Everything is fine on OCaml 5.3. So it looks like to merge this PR we would need to either:
Currently the XAPI project is still on OCaml 4.14.2 for production releases (there is an experimental branch for OCaml 5.x), so I wouldn't drop 4.14.2 support just yet. AFAICT there are no users of A compromise could be to make |
actions/cache@v2 shows an error that it is deprecated Signed-off-by: Edwin Török <edwin@etorok.net>
ppx_deriving_rpc now requires ppxlib >= 0.36.0. It still works on both OCaml 4.14.x and 5.x. rpclib-async fails to install on OCaml 4.14.x, because dependencies of Async are not compatible with the new ppxlib. However on OCaml 5.3 the solver finds a solution, so restrict rpclib-async to be available only on OCaml 5.3+ Signed-off-by: Edwin Török <edwin@etorok.net>
edwintorok
left a comment
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.
CI passes now.
rpclib (except async) retains compatibility with both OCaml 4.14.2 and 5.x.
rpclib-async is restricted to OCaml 5.3+.
|
I am away and won’t be able to make a release any time soon, feel free to do it |
This PR is a patch for an upcoming release of ppxlib where the internal AST is bumped from 4.14 to 5.2. Until that is merged and released, there is no reason to merge this PR.
To test these changes, you can use the following opam-based workflow. I've made releases of most of these patches to an opam-repository overlay.
The following describes the most notable changes to the AST.
Functions
Currently
In the parsetree currently, functions like:
Are represented roughly as
Functions like:
Are represented roughly as
Since 5.2
All of these functions now map to a single AST node
Pexp_function(note, this is the same name as the old cases function). The first argument is a list of parameters meaning:Now looks like:
Pexp_function([x; y; z], _constraint, body)And the
bodyis where we can either have more expressions (Pfunction_body _) or cases (Pfunction_cases _). That means:Has an empty list of parameters:
Local Module Opens for Types
Another feature added in 5.2 was the ability to locally open modules in type definitions.
This has a
Ptyp_open (module_identifier, core_type)AST node. Just like normal module opens this does create some syntactic ambiguity about where things come from inside the parentheses. The approach of these patches is to locally open the same module in any code that is generated.This PR assumes
ppxlib.0.35.0will be the ppxlib that contains the 5.2 AST bump.ppxlib.0.34.0will likely be the stable release of ppxlib with 5.3 support.