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

Re: Comment behaviour



On Fri, 4 Aug 2017 13:21:13 -0500
Jim <linux.tech.guy@xxxxxxxxx> wrote:
> ZSH_VERSION: 5.3.1-test-2
> 
> Example code produced the following output:
>   /home/user/.zshrc:<number of last line>: parse error near `\n'
> 
> [ -f /bin/zsh ] && {
>   # code
> }# A comment.   <<<--- point of error(no space after brace)
> IF
> } # A comment.   <<<--- no error(space after brace)
> 
> Also checked "(#", ")#", and "{#" with no errors. FWIW
> 
> BUG or did I miss something in the man page? # after a brace in
> a nested statement would be valid, but didn't expect it here.

Generally, you can't rely on being able to put a "#" after a command
argument with no space and have it treated as starting a quote, so
whether it's a bug or not is somewhat philosophical.

I'll have a closer look after the release if this particular case can be
treated differently, however --- it's clearly not useful to have it
treated as a parse error if it's easy to do it otherwise.

pws



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