From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Empty sublist in "if"
Date: Sun, 12 Feb 2017 10:30:09 -0800 [thread overview]
Message-ID: <170212103009.ZM1505@torch.brasslantern.com> (raw)
In-Reply-To: <20170212061455.GA4267@fujitsu.shahaf.local2>
On Feb 12, 6:14am, Daniel Shahaf wrote:
}
} % if false; then if true; fi
} % setopt noshortloops
} % if false; then if true; fi
} zsh: parse error near `fi'
}
} I'm guessing the second 'if' is parsed using the SHORT_LOOPS syntax,
} with an empty sublist. I'm not sure whether that's a bug: is the
} sublist in the SHORT_LOOPS syntax allowed to be null?
Hrm.
if true; then fi
works, so yes, the sublist is allowed to be empty. Still, the original
example seems a pretty questionable special case, and e.g. bash does
not allow an empty sublist there.
Of course zsh also allows empty braces and empty subshell parens, so ...
parent reply other threads:[~2017-02-12 18:29 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20170212061455.GA4267@fujitsu.shahaf.local2>]
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=170212103009.ZM1505@torch.brasslantern.com \
--to=schaefer@brasslantern.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).