Octal character literals and identifiers in comments#4
Conversation
| ; note: this is only to go faster than one character at a time | ||
| (defconst caml-font-other-comment-re | ||
| "[^{(*\"'\012\015]+" | ||
| "[^A-Za-z_\300-\326\330-\366\370-\377{(*\"'\012\015]+" |
There was a problem hiding this comment.
I do not understand: A–Z are not special, why are they excluded (^)?
There was a problem hiding this comment.
Otherwise in (* f' '"' *) the f will be matched as caml-font-other-comment-re, then ' ' as a character, and the rest as an unclosed string. With this change, f' is matched as caml-font-ident-re and '"' as a character.
| ((looking-at caml-font-newline-re) | ||
| (goto-char (match-end 0)) | ||
| (setq continue (caml-font-put-state (match-end 0) (cons nil depth)))) | ||
| ((caml-font-looking-at caml-font-ident-re) |
There was a problem hiding this comment.
Is this useful? Won't the caml-font-looking-at caml-font-ident-or-num-re above already catch this case?
There was a problem hiding this comment.
The caml-font-ident-or-num-re above is in another state (outside comments).
There was a problem hiding this comment.
Thanks — did not see that when glancing at it in github.
|
Maybe it was a bit early to merge this since ocaml/ocaml#1901 is not merged yet. |
|
Well, the outlook seems rather positive — and Tuareg already handles it the same way! ☺ |
This is a companion PR for ocaml/ocaml#1901.