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

Re: parsing empty alternatives: case foo|) :;;



On Mon, 7 Aug 2017 13:55:59 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> % case '' in (foo|) echo yes;; esac
> yes
> % case '' in foo|) echo yes;; esac
> zsh: parse error near `)'
> 
> Why does the second case fail to parse?  We (IRC) don't see any ambiguity
> in it.

I haven't checked, but I think it looks like a pipe --- at that point we
haven't gone further down the case-specific code so that it parses the
line specially.

pws



Messages sorted by: Reverse Date, Date, Thread, Author