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

Re: Allow slash in alternation patterns in limited cases?

On Mon, Apr 11, 2016 at 2:31 PM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Mon, 11 Apr 2016 14:06:10 +0200
> Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> On Mon, Apr 11, 2016 at 1:07 PM, Peter Stephenson
>> <p.stephenson@xxxxxxxxxxx> 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 tell the pattern
> matcher whether or not it should stop if it sees a "/".

Ah, that explains it :). Thanks.

Mikael Magnusson

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