From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12153 invoked by alias); 23 Sep 2017 22:17:12 -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: X-Seq: 41749 Received: (qmail 27231 invoked by uid 1010); 23 Sep 2017 22:17:12 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-8.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.72):SA:0(-4.7/5.0):. Processed in 1.267359 secs); 23 Sep 2017 22:17:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [86.21.219.59] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.1 cv=APW+KdU1 c=1 sm=1 tr=0 a=utowdAHh8RITBM/6U1BPxA==:117 a=utowdAHh8RITBM/6U1BPxA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=q2GGsy2AAAAA:8 a=DyhstOT6jtK2p1oEiVAA:9 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 Date: Sat, 23 Sep 2017 18:16:24 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: spurious 'case' parse error Message-ID: <20170923181624.0f58dcde@ntlworld.com> In-Reply-To: <170922084246.ZM22988@torch.brasslantern.com> References: <6fb7e839-48ce-51a4-1d64-bbbf498c5bfb@inlv.org> <170922084246.ZM22988@torch.brasslantern.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1506186985; bh=STVtoTMz5TwGLZST3bD1sbvmTLlpJdq0VOxvxcNm4G8=; h=Date:From:To:Subject:In-Reply-To:References; b=Le26LSI4P1gD98QtOAAz4hseRMx+kqua+qZOIticGZrEEeXBU3YWygh8EAVZtjRtf 4Pjwnb00l5Ek/YOINBcerN/UEeJir+4ntKJORUDw97gbEwFpcaMi8XYYOZ5WwSulym 0eyBPG8K+OhNJHn3QhvluKxbR+OOsQxHXOMkGFFl/+TQCqsPXgv5Fso30DKzsWJ7AE MPSrO1pjuA05KCWA9eGXrZUZ8YZXuifdKJ1Oc0UyKLqscQH4TZW0FO6G4gjbxH+tbb MONrK+T6u8a5js5Hdj9Upi4S989U4Ra9O85bfpX/IB1b5YyAehL2u7Wy3CMziDeDXV oohpIr0pdwOsg== On Fri, 22 Sep 2017 08:42:46 -0700 Bart Schaefer wrote: > That's almost certainly happening because > > case xecho in > (x|y)echo)echo ok;; > esac > > is valid syntax for zsh, so (x)echo is being parsed as a pattern and then > the closing paren is found to be missing. Yes, without way too much look ahead we couldn't do anything different in native mode, but nobody's screaming for that anyway. > The space is optional when in sh emulation where grouping syntax is not > allowed in patterns: > > Src/zsh --emulate sh > $ case x in > > (x|y)echo ok;; > > esac > echo ok > $ Yes, this got fixed up a couple of years ago for increased sh case compatibility which appears to be doing the right thing so far. So nothing to do. pws