From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13888 invoked from network); 7 Oct 2002 10:59:48 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Oct 2002 10:59:48 -0000 Received: (qmail 22123 invoked by alias); 7 Oct 2002 10:59:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17785 Received: (qmail 22105 invoked from network); 7 Oct 2002 10:59:37 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH Re: [doogie@brainfood.com: Bug#163237: zsh barfs on valid shell] In-reply-to: ""Bart Schaefer""'s message of "Fri, 04 Oct 2002 03:57:21 -0000." <1021004035721.ZM2643@candle.brasslantern.com> Date: Mon, 07 Oct 2002 11:59:09 +0100 Message-ID: <7302.1033988349@csr.com> From: Peter Stephenson "Bart Schaefer" wrote: > On Oct 3, 4:43pm, Clint Adams wrote: > } Subject: [doogie@brainfood.com: Bug#163237: zsh barfs on valid shell] > } > } This happens under emulate -R sh as well. > } > } ----- Forwarded message from Adam Heath ----- > } > } case foo in (foo)echo foo;;(bar)echo bar;;esac > } zsh:zsh: parse error near `foo' > > This is because "(foo)echo" is being parsed as a file pattern [equivalent > to "(foo|foo)echo" for those who don't immediately see why it's being > parsed that way]. > > This is an inherent ambiguity in using parens for pattern grouping and is > going to have to stay the way it is when not in emulation mode. An option `case_balance_parens' would be a possibility. The reasoning for this would be (1) balancing the parentheses is neater anyway, so having a test to force better syntax is useful (2) inside $(...), balancing is essential, so using the option makes it consistent. It couldn't be on by default, though, so you wouldn't get it with `emulate zsh', which makes it less useful. The SH_GLOB test is definitely better for Bourne-style use. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************