zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Comment behaviour
Date: Sun, 6 Aug 2017 19:15:31 +0100	[thread overview]
Message-ID: <20170806191531.15dfad23@ntlworld.com> (raw)
In-Reply-To: <CA+rB6G+=EDHGU0_Jw8trcixGTpoV5y5im22a_5xhLX_qWdp17A@mail.gmail.com>

On Fri, 4 Aug 2017 13:21:13 -0500
Jim <linux.tech.guy@gmail.com> 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


  reply	other threads:[~2017-08-06 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 18:21 Jim
2017-08-06 18:15 ` Peter Stephenson [this message]
2017-08-06 18:59   ` Bart Schaefer
2017-08-06 19:17     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170806191531.15dfad23@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).