Support 'raw identifier' syntax (new version)#12323
Conversation
gasche
left a comment
There was a problem hiding this comment.
Thanks! I think that the implementation is now in a good shape. There are some minor things that feel a bit not-just-right, but this could take ages and it is in a part of the codebase that is already in a partly-inconsistent state, so we cannot hope for a perfect result. I propose to be productive by declaring victory and merging. It is a nice feature, designed for compatibility: the sooner the better.
|
Is this considered for inclusion into 5.2? Asking more out of curiosity than anything else. |
|
I think it is already included: https://github.com/ocaml/ocaml/blob/5.2/Changes#L25-L26 |
|
Oh ok! Since it wasn’t in https://github.com/ocaml/ocaml/milestone/44 I assumed it wasn’t in. |
|
Olivier Nicole (2024/01/18 07:31 -0800):
Oh ok! Since it wasn’t in https://github.com/ocaml/ocaml/milestone/44
I assumed it wasn’t in.
I think we put in the milestone only the things that are not merged and
we want to make sure to cherry-pick after the feature freeze.
|
|
Thank you for the explanation. |
|
More precisely, we (I?) are mostly using the milestones for PRs and issues that are on the fence in term of inclusion in the milestoned OCaml version in order to be sure to track their status during the various stages of the release process. Consequently, items that are merged in the middle of the release cycle don't appear in the milestone but only in the Changes file. |
|
Is this feature documented in the manual somewhere? I went for the "Language extensions" chapter and for the "Lexical conventions" subchapter and did not find it mentioned anywhere. |
|
It doesn’t seem to be. I’ll add on my todo-list to add some docs. |
This is a resubmit of @stedolan’s PR #11252. I rebased it on trunk and took into account @gasche’s comments on the original PR. Below is the original PR message.
This PR implements part of ocaml/RFCs#27 by adding support for 'raw identifiers'
\#foo. The syntax\#foomeans the same thing asfoo, but is always an identifier even whenfoois a keyword. This allows future versions of the language to introduce new keywords in a backwards-compatible way (see the RFC for full details).The important part of this patch is the small patch to
lexer.mllwhich adds the new concrete syntax. The entire rest of the patch is changes to various pretty-printers, to ensure that keywords are printed in appropriately escaped form should they ever occur as variable names, in types, in error messages, and the like.