Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parse error (lack thereof) on incomplete loops
- X-seq: zsh-workers 43614
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: Parse error (lack thereof) on incomplete loops
- Date: Sat, 6 Oct 2018 19:21:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1538850066; bh=hYlcpyWzjU4QQ0IfpCP3l93yCvZpSRPgUsyz50gEmfE=; h=Date:From:To:Subject:In-Reply-To:References; b=VRk8wW+xQokeRUepRcp4E2TunAx1J9sjhfxU5MQGlR8G4N/WQ6Aq3mWKO2MTyIAOp +Rh+ka5sLVw0kYlGtH6Ck53fTfb+P3XeKpxHn48rXoll3Rsn/lkJ3ceoj7HpRLPBGu HpExyyP9jtuQolC1YgKoR5v6NzKR8FM1a2cGUF2t/ToShZo04sJMTU1NsiG/gSUj4N 1xNgY7AfYtT4P3PKEDP/FucYj3jZqhRf9kH3HjHJy772XS1mUJ6q6Lesymn6YU4cT6 iinMmDFAZgh6bm4ZgGBJtPRuoAXmgTb/R5MqESPeAsuEyYgyRNlXjpBdMUm0ZMIlNl WwVJCDN+9XTSQ==
- In-reply-to: <CAH+w=7auLdphdcLBsKFsEqyRE0Ug6o+13TYOVx-KO3g9Z2QP2Q@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20181004154947epcas4p2441e109a2c4e060bf39f0f6925e98241@epcas4p2.samsung.com> <CAH+w=7awbwDuX2RXcB7pK6Hhbi8fjs=NvwkTAEGmY7gvNpLCqA@mail.gmail.com> <20181004163158eucas1p234a045be013b5463d8db44314ed217dc~adN28lJmq0822408224eucas1p2F@eucas1p2.samsung.com> <CAH+w=7ZLJ5iiph8jpsSiLKdhkozqH+o_kJk7=zfK3DLBegft8g@mail.gmail.com> <20181005091435eucas1p26edaafb362de339b01c3cb5780fbd108~aq5QQQ6pF1496014960eucas1p2g@eucas1p2.samsung.com> <CAH+w=7auLdphdcLBsKFsEqyRE0Ug6o+13TYOVx-KO3g9Z2QP2Q@mail.gmail.com>
On Fri, 5 Oct 2018 18:47:01 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> For the if, while and until commands, in both these cases the test part
> of the loop must also be suitably delimited, such as by `[[ ... ]]' or
> `(( ... )), else the end of the test will not be recognized.
Looked at this a bit more and I have fairly major doubts about the
documentation (although I don't mean about the intention suggested by
Bart which does seem reaonsble).
The short versions below only work if var(sublist) is of the form `tt({)
var(list) tt(})' or if the tt(SHORT_LOOPS) option is set.
For while and until, we only have
while list { list }
An alternative form of while. Note the limitations on the form of
list mentioned above.
until list { list }
An alternative form of until. Note the limitations on the form of
list mentioned above.
No sublist. The shortloops version of this does work:
while [[ -o shortloops ]] print yes
so maybe that "{ list }" should really be "sublist"?
It's also not clearly (or at all? I can't se it) documented that you
only get the SHORT_LOOPS effect if there's no delimiter --- if you stick
one in it looks like a normal command list which it'll just go on parsing.
So actually I think the documentation here is defective even for the
cases of SHORT_LOOPS that *are* supposd to work.
Perhapse someone who may have to be Bart (I can't say I consider myself
an expert in this having only just found out what's going on and I can't
say anyone else is likely to, either) should suggest some words of
wisdom to document SHORT_LOOPS as separate text rather than as part of
the variant syntax section? I don't mind writing this up.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author