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 09:37:38 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Sun, 10 Apr 2016 15:11:05 -0700
Bart Schaefer <[email-masked]> wrote:

> On Apr 10, 10:36pm, Mikael Magnusson wrote:
> }
> } /path/(to/file|or/another/file) # nope, too hard
> } (/path/to/a/dir/*|/path/to/some/other/files/*) # can we allow this?
> 
> My gut feeling is that this is close to impossible.

The problem's not the parsing, it's the fact that you don't have
appropriate chunks corresponding to directories for the scanner to loop
over once pattern matching has parsed it.

The only way I can see is effectively to parse it first in the globbing
code to treat a complete set of parentheses specially.  But this is
going to be inconsistent with pattern matching one way or another.  So a
different syntax would be more sensible.

> } If not, would it be possible to invent some new syntax to "paste" two
> } or more globs together so that a single set of glob
> } quals/sorts/flags/subscripts could apply to it?

I think Bart's answered this.

pws