Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Block comments ala Ray



On Sun, Feb 14, 2021 at 4:36 PM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> How about the "'' " prefix (two single quotes followed by a space)

Not very visually distinctive, especially for two single quotes then
space then newline.

Also as I mentioned, it's significantly more work if the introducer is
more than two characters, because of the need to back up and re-lex if
it turns out not to be a comment.  It's easy to peek one character
ahead of "!" and unget the peek if it isn't "#".  To use more than two
characters means turning the whole thing into a real lexical token
rather than just something thrown away during lexing (as happens with
comments at present).

Hm, what about paren then ampersand?  Doesn't conflict with ksh
pattern-list syntax, is currently a syntax error, etc.  The problem
being that the reverse (ampersand paren) could appear in valid code,
so the end marker would have to be asymmetric to remove that
objection.




Messages sorted by: Reverse Date, Date, Thread, Author