From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43612-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1b7fc6fc for ; Sat, 6 Oct 2018 11:27:23 +0000 (UTC) Received: (qmail 465 invoked by alias); 6 Oct 2018 11:27:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43612 Received: (qmail 19116 invoked by uid 1010); 6 Oct 2018 11:27:07 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-3.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(80.0.253.67):SA:0(-1.9/5.0):. Processed in 4.093614 secs); 06 Oct 2018 11:27:07 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=QvlwI26d c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=q2GGsy2AAAAA:8 a=Q3jkQH1EpZ37UICe1IAA:9 a=neO5EheycnJJUCmx:21 a=tR4z7MNGkLWpWTRA:21 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1538824522; bh=b0mz7s9GdLPMLDTeGYdrR8Up51/+pbMeWViaaZorR90=; h=Date:From:To:Subject:In-Reply-To:References; b=qtKXWyc5jMHHoITN5O6u/IbAUWONzP/8kUK263dwp1LGCWFrJTwfJwhCzM4zhuh+V 3TTdLsIGwCR/7b6zdGcQx5vepsYdbSIvM6K2/+T1FTshgLuAPdQiVTKdogapOAv1Aq Hp7atrW7o0MM6Dqdg/etAencZrEuHoj2dmBt/T70+pgBvBMsa+E0TO/3sQss+9PDwy bl5LetLQ8/kjkCeCXRtX51Tnfc15AmsC2Xk2JU4yb1o2ArUaYZq9ybKUNYBc8tgQ0V sQicutNjX3fphj3VBKETXNQQJI8cskipnkV45j5PDu71DwvqTyWhZqXNvZSgrfp6BZ OoxsPWLfvGq9g== Date: Sat, 6 Oct 2018 12:15:19 +0100 From: Peter Stephenson To: "zsh-workers@zsh.org" Subject: Re: Parse error (lack thereof) on incomplete loops Message-ID: <20181006121519.2c006383@pws-HP.localdomain> In-Reply-To: References: <20181004163158eucas1p234a045be013b5463d8db44314ed217dc~adN28lJmq0822408224eucas1p2F@eucas1p2.samsung.com> <20181005091435eucas1p26edaafb362de339b01c3cb5780fbd108~aq5QQQ6pF1496014960eucas1p2g@eucas1p2.samsung.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfJdtT2zd5DA0BiyRNmJYnsn3HI0WweTpzKxPrLrGXYYq6o2FS1dmXXJ1rM4OVYUQSOKE+X9HhCa8cnx8Fuo92agw48yhvVpJA8rffy8eHTTlAZXeA8HL pVGi7TH7iGtlKHOAgmQtnBgehzWtUyJxNbUYhYt57av6BaFgIZLawvwfHbbuQPVISvcDAfUczYyiVA== On Fri, 5 Oct 2018 18:47:01 -0700 Bart Schaefer wrote: > > Without a "do" while doesn't know where the expression ends. That's > > fundamental to how SHORT_LOOPS works > > No it isn't. The documentation explicitly says: > > 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. > > "Both these cases" refers to: > #1 - sublist is of the form `{ list }' > #2 - the SHORT_LOOPS option is set > > So you don't get to claim that SHORT_LOOPS is intended to except you > from that restriction. The "]]" or "))" tell while where the > expression ends. > > In none of the examples given in this thread so far has the test > expression been delimited that way. But that's not what's implemented --- it just calls the code to parse what the shell refers to as a "sublist", which is a component of the normal parse tree. There's never been any special short-loops code, despite what the doc claims. Hence there's no question, in general, of throwing a syntax error if it isn't in the above form (unless SHORT_LOOPS is unset). I think the above is close to what Daniel is looking for --- a statement of what does work, with anything else being left to the user's peril. It seems quite clear I should leave well alone. If anyone thinks they can write code that tightens it up in the above fashion, feel free. pws