Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parse error (lack thereof) on incomplete loops
- X-seq: zsh-workers 43625
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: Parse error (lack thereof) on incomplete loops
- Date: Mon, 8 Oct 2018 11:07:37 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181008100739euoutp02a8cc8ac5ae695193aad69f40e4619529~bmjc6oIJN0452404524euoutp02L
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538993259; bh=iGRvpfyrdukeUD7TB2JcCxOKsqB2wGcqItYvj6a9aqk=; h=Subject:From:To:Date:In-Reply-To:References:From; b=ZiSrBjSbi0WNxiDwUIkxUDIKIg8Sbn/J9EZ92BZ0eObC/K0C372dMpn88lnZ6Nucx QOsH9J3tgJ9I7PrNHom+x6HM5f3whiImgWPs9HSAyxPqSI+3xQw/SqDBuJVw3uc2EY T2NXDsjcynkIY43k8hd70TkQxDA9XP94i19HoQjM=
- In-reply-to: <CAH+w=7b_fi822eQvXe1cQbw4DYXPR=ZPbjWK_S6sZjFQLY8KpQ@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> <20181006192104.4a66da1a@pws-HP.localdomain> <CAH+w=7b_fi822eQvXe1cQbw4DYXPR=ZPbjWK_S6sZjFQLY8KpQ@mail.gmail.com>
On Sat, 2018-10-06 at 20:51 -0700, Bart Schaefer wrote:
> So ... I've been looking through the git history of Doc/Zsh/grammar.yo ...
> > It's also not clearly (or at all? I can't see 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.
>
> True that this is not called out, but implicitly from the grammar:
> var(list) var(sep) var(sublist) matches a production yielding
> var(list), so if there is a var(sep) then the var(list) isn't done
> yet. You have to have a grammatically concluded var(list) as the
> conditional before you can tack on a var(sublist) as the body.
Probably superfluous to say this now, since we can certainly improve
the documentation without dwelling on the details, but the definition of
a list is given as
A em(list) is a sequence of zero or more sublists, in which each sublist
is terminated by `tt(;)', `tt(&)', `tt(&|)', `tt(&!)', or a newline.
So while I agree about the logical implications, if you don't have a
degree in comupter science it might be thoroughly unclear what's
actually going on here.
I'm vaguely moving to the opinion that we should list the SHORT_LOOPS
forms separately with examples rather than by implication, which I
suspect is at the root of why I've always found this bit of the manual
unhelpful.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author