Quoted extensions in comments, ocamllex and ocamlyacc#9166
Quoted extensions in comments, ocamllex and ocamlyacc#9166Octachron merged 10 commits intoocaml:trunkfrom
Conversation
Drup
left a comment
There was a problem hiding this comment.
Thanks a lot, this looks great. The tests look pretty convincing, I just have small comments. There are also a bunch of lines that are over 80columns:
./lex/lexer.mll:296.81: [long-line] line is over 80 columns
./lex/lexer.mll:324.81: [long-line] line is over 80 columns
lex/lexer.mll
Outdated
| reset_string_buffer(); | ||
| comment lexbuf } | ||
| | '{' (['a'-'z' '_'] * as delim) '|' | ||
| | '{' ('%' '%'? identstart identbody* ('.' identstart identbody*)* [' ' '\009' '\012']*)? (['a'-'z' '_']* as delim) "|" |
There was a problem hiding this comment.
Could you use/copy the regexes for identifier and whitespaces from the OCaml lexer instead ? It should use the exact same one, so that it's easier to check.
Drup
left a comment
There was a problem hiding this comment.
Excellent, let's merge when CI is happy.
|
Should I add a new changes entry, or add this PR number to the entry of #8820? |
|
Adding to the existing entry would be fine, but then please add yourself as an extra author. |
|
Somehow, this slipped between the cracks. Can we merge it now ? :) |
|
I will leave this potential action in the hands of @Octachron (if it was me, I would want to have a quick look at the code again, and I don't have time right now; also I would wonder about backporting to 4.10 and it looks like a not-so-easy decision.) |
|
Quoted extensions are a 4.11 feature, so there is no backporting decision to make here. |
|
I reread the C part, it looks good now. @314eter , do you wish to clean-up the history before merging? Otherwise, I will squash all commits. |
|
I don't have immediate access to my pc to clean up the history, so maybe squashing is easier. |
|
As you wish, but there is no urgency (this is a bugfix for 4.11), so we can wait few weeks if you prefer. |
|
You don't have to wait. |
|
Merged, thanks! |
As mentioned in #8820 (comment), quoted extensions should be handled in comments the same way quoted strings are.
I added support for quoted extensions in ocamllex and ocamlyacc too, but can move this to separate PR's if necessary.
The last commit fixes a bug introduced in #1932, that caused
(* comments like this *)to be copied as(* c l t *).