Remove Jane Syntax for n-ary functions#2780
Merged
ncik-roberts merged 7 commits intomainfrom Jul 29, 2024
Merged
Conversation
freemagma
approved these changes
Jul 15, 2024
Contributor
Author
|
I've deleted the "build Jane Syntax with upstream" CI check — I added this originally for a reason that no longer applies, now that we're modifying the parsetree. |
17d6f1a to
63126cf
Compare
Merged
…syntax-for-n-ary-functions
ncik-roberts
added a commit
that referenced
this pull request
Jul 25, 2024
Contributor
Author
|
@freemagma The last commit probably should be reviewed (I noticed the issue in testing) |
ncik-roberts
added a commit
that referenced
this pull request
Jul 26, 2024
freemagma
reviewed
Jul 26, 2024
lukemaurer
pushed a commit
that referenced
this pull request
Oct 23, 2024
* Remove Jane Syntax for n-ary functions * Delete now-unnecessary coercions * Remove unintentional space * Add unintentionally dropped comment * Remove no-longer-useful Jane Syntax check * Rework pprintast to differentiate pexp_newtype from pexp_function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Start using a direct encoding of n-ary functions in the parsetree. Delete the Jane Syntax encoding for n-ary functions.
We've changed the function AST beyond the making it n-ary. We also track mode and jkind annotations. So, this PR is not a straightforward backport; we need to tack on our extensions to the code from upstream.
There are a few broad classes of diff in this feature:
ast_helper.ml,ast_invariants.ml. Here, we just take the code from upstream.printast.ml. Here, we can mostly take the code from upstream. In some cases, I move some code around in a file (e.g.ast_mapper.ml) to get it to match more closely where it lives upstream and thus to reduce drift.expr : Mode_expr.Const.t :> _ Location.loc(and same for jkinds). That's because the parsetree type is no longer private (the parsetree is an mli-only file). I could have minted a new file to keep these types private, but I judged it to not be worth the trouble. The private-ness here was just about making it less likely to mix up strings — it doesn't guard any invariants.ocaml/testsuite/tests/typing-gadts/pr7269.ml(this one matches upstream). Another example:ocaml/testsuite/tests/parsetree/modes_ast_mapper.reference(this one is just fine; we've changed the location of the mode annotation in a way that seems more accurate anyway).When I say that a code is a "backport", I encourage you to compare against the code in https://github.com/ocaml/ocaml.
Please let @ncik-roberts merge this! This implies some work in ppxes, and I'd like to be sure we're in a good spot to do that work before committing ourselves to doing it.
Reviewer: We're discussing internally.