zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: [^ax-y] doesn't work but [^x-ya] does
Date: Thu, 02 Mar 2017 10:47:10 +0000	[thread overview]
Message-ID: <20170302104710.6eed8ece@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <1488440005.4187177.897775384.2538F781@webmail.messagingengine.com>

Isn't the same problem showing up here?  Watch closely, I may be missing
the point...

  foo=a
  value=ac

  % print ${value//[${foo}]/x}
  xc

That's OK, only the a is replaced by an x.

  % print ${value//[b-z]/x}
  ax

That's OK, only the c is replace by an x.

  % print ${value//[${foo}b-z]/x}
  xc

Oops, should be a combination of the above effects, giving xx, which is
what you get if you expand the ${foo} by hand...

  % print ${value//[ab-z]/x}
  xx

To show it really is the dash...

  % value=ab
  % print ${value//[${foo}b-z]/x}
  xx

Unfortunately tracking down where this came in isn't much help as we
need to be able to get the correct overall effect of either Dash or
literal '-' in all cases, rather than just moving the problem around.

I wonder, however, if we're close to the point where we simply tokenise
it when it's not quoted and try to track down all the places where we
need to untokenise it.  There have been more fixes to
untokenisation since the previous attempt to guess where we need to
tokenise went in.

pws


  parent reply	other threads:[~2017-03-02 10:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170302073436epcas2p1ee2d6d723bc7b0865e11243777a08417@epcas2p1.samsung.com>
2017-03-02  7:33 ` Sebastian Gniazdowski
2017-03-02  8:36   ` Sebastian Gniazdowski
2017-03-02 10:47   ` Peter Stephenson [this message]
2017-03-02 11:22     ` Sebastian Gniazdowski
2017-03-02 11:53       ` Peter Stephenson
2017-03-04 23:21         ` Bart Schaefer
2017-03-06 11:28           ` Peter Stephenson
2017-03-07 10:51             ` Peter Stephenson
2017-03-08 19:12               ` Martijn Dekker
2017-03-09  5:18                 ` Bart Schaefer
2017-03-09 10:29                   ` Peter Stephenson
2017-02-24 20:38 Sebastian Gniazdowski
2017-02-25  7:32 ` Bart Schaefer
2017-02-25  8:21   ` Sebastian Gniazdowski

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=20170302104710.6eed8ece@pwslap01u.europe.root.pri \
    --to=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).