Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Block comments ala Ray
- X-seq: zsh-workers 48052
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Block comments ala Ray
- Date: Mon, 15 Feb 2021 02:38:57 +0100
- Archived-at: <https://zsh.org/workers/48052>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/20210215013857.GE2302738%40zira.vinc17.org>
- In-reply-to: <CAH+w=7be19YunhcKo+-juw4Tm0jz5EbWZqNDaXjzK-vdd4zqUw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- References: <CAH+w=7YZREq7FbJCCoWoJ-vQ7+P5Z=_mKB-aStoMiBRupqD_wA@mail.gmail.com> <20210213083521.kv3y3qzfnaffflfh@chazelas.org> <CAH+w=7Yydsx6QMhmKj5V_TX6-0sLKo9nNm3t07fsnhd5SKGj8Q@mail.gmail.com> <20210215003628.GC2302738@zira.vinc17.org> <CAH+w=7be19YunhcKo+-juw4Tm0jz5EbWZqNDaXjzK-vdd4zqUw@mail.gmail.com>
On 2021-02-14 17:07:23 -0800, Bart Schaefer wrote:
> 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.
Note that this is only a prefix. You can decide what you want to
write after it.
> 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.
Can't this be shared with the usual parsing and decide after reading
the first word? Here, this would normally correspond to an "empty"
command.
> 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).
But here, the 3rd character is just a word delimiter, so that I would
think that this is simpler.
> 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.
Could you give an example of valid code with "&)" at the beginning
of a line?
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author