Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: spurious 'case' parse error



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