5.2 ast bump#110
Conversation
| recursive ~lib var.txt inner) | ||
| else derive_core c | ||
| | Ptyp_object _ | Ptyp_class _ -> invalid_arg "unsupported" | ||
| | Ptyp_object _ | Ptyp_class _ | Ptyp_open _ -> invalid_arg "unsupported" |
There was a problem hiding this comment.
As the derive_cor function is independent of the typing environment, I think it would be better to traverse the Ptyp_open _ node.
|
Ah! We're actually going to have to hold off until ocaml-ppx/ppxlib#588 |
|
any news on that? |
|
@patricoferris is this ready to go now? |
|
Still waiting for the PR I mentioned (being released as we speak ocaml/opam-repository#28610!) |
Co-authored-by: Florian Angeletti <florian.angeletti@inria.fr>
ebeeae1 to
1aaa58c
Compare
444a0ca to
777dd92
Compare
|
I have updated this PR (and removed the ocamlformat change to make it easier to read). We're in a bit of an annoying position where our (ppxlib) |
|
@patricoferris would you be able to update the PR? |
|
ah nevermind it's ready but ocaml-ci hasn't updated with the full 0.37.0 release |
|
@patricoferris -- do you mind rebasing the PR to pick up the latest releases? |
|
@samoht i believe the PR doesn't need rebasing. ocaml/opam-repository#28686 hasn't been merged yet actually |
|
This, if the CI agrees, should be good to go. I have pushed three new commits to deal with the tests not working:
|
|
For extra clarification, the roundtripping is a known limitation in ppxlib: https://github.com/ocaml-ppx/ppxlib/blob/22778658345fce526e6146da188cdc2d6d2e5286/test/501_migrations/reverse_migrations.t#L142 It is not totally apparent to me just yet if that limitation should exist or not. |
* [new release] repr (4 packages) (0.8.0) CHANGES: - Bump ppxlib to `>=0.36.2` (mirage/repr#110, @patricoferris) - Update to ocamlformat 0.28.1 (mirage/repr#110, @patricoferris) - Fix `short_hash` signature for ppx_repr deriver (mirage/repr#109, @mattiasdrp) * Apply suggestion from @patricoferris * Update packages/ppx_repr/ppx_repr.0.8.0/opam Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk> * Update packages/repr-fuzz/repr-fuzz.0.8.0/opam Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk> * Update packages/repr/repr.0.8.0/opam Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk> * Update packages/repr-bench/repr-bench.0.8.0/opam Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk> --------- Co-authored-by: Jan Midtgaard <mail@janmidtgaard.dk>
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.
Note: no update has been made of the
opamfile, butppxlibwill likely need a lower-bound before merging/releasing.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.