Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parse error (lack thereof) on incomplete loops
- X-seq: zsh-workers 43609
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: Parse error (lack thereof) on incomplete loops
- Date: Fri, 5 Oct 2018 13:47:57 +0000
- Accept-language: en-GB, en-US
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181005134801euoutp02d464fc6a3760727770499e0605a13ee2~aun--P49D1664716647euoutp02v
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1538747281; bh=ZFfoWYgsuUI0MYdU0olpHo2rRG02F8CdcBiHb1adIUw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vjd6pe1TAoRUMFUgrU8DOKEWobB4yTMknbi9ksc2MtV37/PmcczGmQ/9Z/9vttDgB xPUpvfjjX5N+AaBy+DT66Mzj+vYf0v5Q2PAl+d1o2hvnQiSF5vJOkp1SbYlHf5uTIu RlDY8wEZOtalUP95pnfJF9Md9F9UFN2mTH2LrciY=
- In-reply-to: <1538745992.2833942.1531910952.26C1157A@webmail.messagingengine.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> <1538745992.2833942.1531910952.26C1157A@webmail.messagingengine.com>
- Thread-index: AQHUXK8H/bu+ZjnlKkWm0jP9ozjy9qUQmemA
- Thread-topic: Parse error (lack thereof) on incomplete loops
On Fri, 2018-10-05 at 13:26 +0000, Daniel Shahaf wrote:
> Can we come up with a one-sided parsing rule for syntactically valid cases?
> That is, a rule that says guarantees that some constructs are syntactically
> valid, but doesn't necessarily say anything about other constructs.
That's pretty much what the the parser in practice does. If you look at
the code, it's got tests that read...
- If SHORTLOOPS isn't set panic at this point.
- Otherwise go on and see if we can get anything sensible out of what
we did find.
So for example the while loop code has...
} else if (unset(SHORTLOOPS)) {
YYERRORV(oecused);
} else
par_save_list1(cmplx);
The case that brought this up is that we don't check the return value
from par_save_list1() (actually a macro at the moment).
For more explicit rules it's a question of decoding the tests above (if
we got a "do" then blah, else if we got a "{" then etc. etc.).
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author