zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Allow slash in alternation patterns in limited cases?
Date: Mon, 11 Apr 2016 14:06:10 +0200	[thread overview]
Message-ID: <CAHYJk3Qc8WsRAxav6wT8MmoEKj-hDByAA3ZCWHHbTt=+CaUQxQ@mail.gmail.com> (raw)
In-Reply-To: <20160411120716.06a6d1c9@pwslap01u.europe.root.pri>

On Mon, Apr 11, 2016 at 1:07 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Mon, 11 Apr 2016 12:47:21 +0200
> Mikael Magnusson <mikachu@gmail.com> wrote:
>> Maybe I misunderstood your original point. I thought you meant making
>> (foo/bar|baz/bong) work in a glob would make it more incompatible with
>> pattern matching, but it already works there.
>
> 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).
Maybe this is just exactly what you're saying, and I read some
objection where there was just a statement about how things are. I
don't see how any additional inconsistensies with the pattern matching
code arises from the end-users's perspective though (see separate
patch). Well, things like (#i) don't carry across from one pattern to
the next... I suppose that's somewhat major.

-- 
Mikael Magnusson


  reply	other threads:[~2016-04-11 12:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 20:36 Mikael Magnusson
2016-04-10 22:11 ` Bart Schaefer
2016-04-11  8:37   ` Peter Stephenson
2016-04-11 10:22     ` Mikael Magnusson
2016-04-11 10:29       ` Peter Stephenson
2016-04-11 10:47         ` Mikael Magnusson
2016-04-11 11:07           ` Peter Stephenson
2016-04-11 12:06             ` Mikael Magnusson [this message]
2016-04-11 12:31               ` Peter Stephenson
2016-04-11 13:45                 ` Mikael Magnusson
2016-04-11 13:50                   ` Peter Stephenson
2016-04-11 12:06       ` PATCH: Allow / in full pattern alternations Mikael Magnusson
2016-04-11 13:47         ` Peter Stephenson
2016-04-11 14:46           ` Bart Schaefer
2016-04-11 14:44         ` Bart Schaefer
2016-04-11 14:50       ` Allow slash in alternation patterns in limited cases? Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Qc8WsRAxav6wT8MmoEKj-hDByAA3ZCWHHbTt=+CaUQxQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).