Subject: Re: Allow slash in alternation patterns in limited cases?
From: Peter Stephenson <[email-masked]>
To: zsh workers <[email-masked]>
Date: Mon, 11 Apr 2016 13:31:45 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Mon, 11 Apr 2016 14:06:10 +0200
Mikael Magnusson <[email-masked]> wrote:

> On Mon, Apr 11, 2016 at 1:07 PM, Peter Stephenson
> <[email-masked]> wrote:
> > The point is that, unlike the ~ case which is just a flag passed in to
> > the pattern match parser, it would longer done by pattern matching at
> > all.  It would be done in the glob code.  The pattern match code would
> > see the foo, bar, baz, bong, and it would it be reassembled higher up.
> > So it's not so much incompatible as something utterly different.
> 
> This is already the same difference we have between (foo|bar) in
> globbing and pattern matching though. If it's a glob, it's handled
> recursively by scanner() and if it's pattern, it's somewhere else (I
> don't even know where the general pattern matching code is by heart).

No, expressions like (foo|bar) are *only* handled by the pattern
matcher.  The scanner's sole responsibility is to till the pattern
matcher whether or not it should stop if it sees a "/".

pws