zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: REMATCH_PCRE with zsh built without pcre support
Date: Mon, 3 Apr 2017 19:43:43 -0700	[thread overview]
Message-ID: <170403194343.ZM13808@torch.brasslantern.com> (raw)
In-Reply-To: <20170404003649.GA6581@fujitsu.shahaf.local2>

On Apr 4, 12:36am, Daniel Shahaf wrote:
}
} The question is just what should the failure mode be when
} zsh/pcre _should_ have been loaded, but [due to a bug in the user's
} script] hadn't been.  Should errflag be set once REMATCH_PCRE is set,
} or at the first affected use of =~ ?

You're correct that this is the question posed at the start of this
thread, but it's not the question I want to answer.

The question I want to answer is:  Given that the only reasonable time
to set errflag is at the first affected use of =~ , does that make the
present behavior (i.e., no error) of setopt REMATCH_PCRE so egregiously
wrong that we should get rid of the option itself?

My own answer is "no," but I'm willing to entertain counter-assertions.

I'm also willing to entertain "oh, well, who cares if we muck up the
code a bit more with a module-specfic hack in options.c, let's have
an error at an unreasonable time." I don't think it's a good idea, but
there have been worse ones.

} That's not a trivial question, but the point I was trying to make in my
} previous post is that, while both of us might prefer [for different
} reasons] that REMATCH_PCRE had never been added, we can't just remove it

Certainly one approach would be to always use pcre when it is loaded, and
always use regex when it is not, and only throw an error when neither of
them is available.  That would only introduce a problem if someone is
expecting regex semantics out of a pattern that is valid in both cases
but means something else in pcre semantics.  I'm not going to give myself
a headache trying to construct an example.

} Apologies if I've tested your patience, that wasn't my intention.

*You* are not who/what's testing my patience, and it wasn't my intent to
give you that impression.

If we go with the module-specific hack in options.c, we should also have
an option-specific hack in Modules/pcre.c so "zmodload -u zsh/pcre" is
an error when REMATCH_PCRE is set.  Enforced dependence cuts both ways.


  reply	other threads:[~2017-04-04  2:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 19:09 Eric Cook
2017-04-01 21:53 ` Bart Schaefer
2017-04-03  1:12   ` Phil Pennock
2017-04-03  7:13     ` Bart Schaefer
2017-04-03 11:26       ` Daniel Shahaf
2017-04-03 18:00         ` Bart Schaefer
2017-04-04  0:36           ` Daniel Shahaf
2017-04-04  2:43             ` Bart Schaefer [this message]
2017-04-04 12:27               ` Eric Cook
2017-04-05 13:08                 ` Daniel Shahaf
2017-04-04 15:22               ` Ray Andrews
2017-04-04 23:00                 ` Bart Schaefer
2017-04-05 13:42               ` Peter Stephenson
2017-04-05 22:28                 ` 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=170403194343.ZM13808@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).