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

Re: Block comments ala Ray



On Sat, Feb 13, 2021 at 12:53 AM Stephane Chazelas
<stephane@xxxxxxxxxxxx> wrote:
>
> 2021-02-13 08:35:21 +0000, Stephane Chazelas:
> [...]
> > - alternatively: <<#EOC .. EOC (or <<#{...} <<#[...] and the
> >   usual pairs) to make nesting easier.
>
> That one could allow [...]
>
> for a (pod head{1..4} over item back begin end for encoding)
>   aliases[=$a]='<<#=cut'

It's a lot more difficult to do the lexical analysis if the comment
introducer is more than 2 characters long, because if it turns out NOT
to be a comment you have to be able to "unget" what has been read and
re-lex it.  It's not impossible, but it's ugly; compare all the
messiness trying to determine whether $(( is introducing a math
expression vs. a command substitution starting with a subshell.

My intent is to introduce something similar to /* ... */, not an #if
... #endif equivalent.  For the latter (or poddish) we really would
have to introduce new here-document syntax, and just discard the
document instead of wordcoding it.




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