Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: spurious 'case' parse error
- X-seq: zsh-workers 41749
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: spurious 'case' parse error
- Date: Sat, 23 Sep 2017 18:16:24 +0100
- 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==
- In-reply-to: <170922084246.ZM22988@torch.brasslantern.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <6fb7e839-48ce-51a4-1d64-bbbf498c5bfb@inlv.org> <170922084246.ZM22988@torch.brasslantern.com>
On Fri, 22 Sep 2017 08:42:46 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author