From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43614-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 92ddcb0d for ; Sat, 6 Oct 2018 18:21:33 +0000 (UTC) Received: (qmail 5762 invoked by alias); 6 Oct 2018 18:21:13 -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: 43614 Received: (qmail 24445 invoked by uid 1010); 6 Oct 2018 18:21:13 -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 2.641227 secs); 06 Oct 2018 18:21:13 -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=ySR07o89c14DxSu8Xs0A:9 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 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== Date: Sat, 6 Oct 2018 19:21:04 +0100 From: Peter Stephenson To: "zsh-workers@zsh.org" Subject: Re: Parse error (lack thereof) on incomplete loops Message-ID: <20181006192104.4a66da1a@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: MS4wfAMRArn/5+enTANoCDaMcDL0BGroycInGGIAzOtnLJ9lsjrPoiSKnKwZbrwyyuaGCw23lOA7hRgUOrY8HLrp3hEG9jlF4saHL7C/2KXzKoxmZVWqPmlv WCR9P9LfFd9lDD3Rk8xCGkvANrEX3hhDq9MaQDebiRCz2wqk1B2MjvpLDVOKS6+lH/VT5KXyuraaMw== On Fri, 5 Oct 2018 18:47:01 -0700 Bart Schaefer 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