MetaOCaml: the parser.mly change only#13257
Conversation
| | HASH | ||
| | GREATERRBRACKET | ||
| | GREATERRBRACE | ||
| | GREATERDOT |
There was a problem hiding this comment.
Don't we want to abstract the token name since we disagree on the concrete token?
Maybe
META_BRACKET_CLOSEMETA_BRACKET_OPENMETA_ESCAPE
?
There was a problem hiding this comment.
I thought about this, but then I decided that if the goal is to make Oleg's life easier, maybe forcing non-essential renames was not the best approach?
There was a problem hiding this comment.
(I'm happy to do the rename if you thought about this even slightly more and still believe that it's the right approach.)
There was a problem hiding this comment.
This aligns with a suggestion from Oleg (in an email thread), so I did the rename. I used METAOCAML_ instead of META_ as a prefix.
Co-authored-by: Gabriel Scherer <gabriel.scherer@gmail.com> Reviewed-by: Florian Angeletti <florian.angeletti@inria.fr>
7d9a8c1 to
6b7ea6c
Compare
yallop
left a comment
There was a problem hiding this comment.
This looks good to me. (I assume the testsuite changes are also just to ease the MetaOCaml maintenance burden; they don't seem strictly necessary.)
|
Indeed, the testsuite changes are relics of the previous patch which introduced surface-language support (and which conflicted with a couple occurrences of I pushed a Changes entry and will merge when the CI agrees. |
This is a simplified version of #12470 that only includes the parser.mly changes -- no lexing support, and therefore no backward-compatibility questions of any kind (great!) and no ability to test the new code either (meh...).
(what follows is reused from the #12470 description to provide more context)
Context
@Octachron and myself are working with Oleg Kiselyov and @yallop to restart upstreaming parts of the BER MetaOCaml codebase -- thanks to a helpful prompt from @haochenx at ICFP 2022.
The current goal is not to make MetaOCaml features available to all OCaml users, but to reduce the diff between upstream OCaml and the MetaOCaml fork to make it easier for MetaOCaml maintainers (Oleg and @yallop) to port the MetaOCaml patches to newer OCaml versions. We can upstream things gradually in this way, guided by the MetaOCaml maintainers' experience of what parts of the codebase generate more maintenance work than others.
(This approach was suggested by Oleg, who is not in favor of upstreaming all of MetaOCaml, as this is a research project that still evolves in backwards-incompatible way on a regular basis.)
This PR
This PR upstreams the MetaOCaml logic for parsing (but not lexing) MetaOCaml constructs. This was identified as a high-maintenance-cost area by the MetaOCaml maintainers.