zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: Bug in alias expansion
Date: Wed, 18 Nov 2015 16:14:31 +0000	[thread overview]
Message-ID: <20151118161431.360006a5@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <151118075246.ZM28042@torch.brasslantern.com>

On Wed, 18 Nov 2015 07:52:46 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Nov 18,  2:13pm, Peter Stephenson wrote:
> } Currently we expand both when parsing the entrails of the $(...)
> } and executing it, but should possibly only do so in the latter case.
> } I haven't look to see if this affects any tests.
> 
> Would not-expanding affect cmd_or_math() adversely?  Is that why we
> expand and then backtrack?

I can't offhand think of a case.  The crucial thing about cmd_or_math()
is to get the parentheses right.  Being affected by this change implies
it's currently propagating the effect to some outer layer of expansion,
which we're in the process of deciding is probably a bad thing.  If this
is correct it applies recursively, so nested expansions aren't an issue.
Did you have some vague pointers in mind?

I don't believe there's ever a case where we won't do the alias
expansion when we finally execute the inside of a $(...), because it's
always reparsed for execution (considered a bug up to now but getting us
out of the present hole), and $((...)) is equivalent to math eval in
double quotes, so no global aliases, if that's what you mean.

Come to think of it, the name of the function dquote_parse() kind of
implies we're not expanding aliases, but then it was named before we
started handling $(...) better, so that's not a great pointer.

Anyway, there are some pretty hairy tests, so if we change it we should
find out quickly.

pws


  reply	other threads:[~2015-11-18 16:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 18:03 Kynn Jones
2015-11-14  1:03 ` Bart Schaefer
2015-11-14 18:57   ` Kynn Jones
2015-11-14 19:03     ` Bart Schaefer
2015-11-14 19:19       ` Kynn Jones
2015-11-14 21:40         ` Bart Schaefer
2015-11-14 22:20           ` Kynn Jones
2015-11-15 20:03 ` Peter Stephenson
2015-11-15 21:52   ` Bart Schaefer
2015-11-15 22:26     ` Bart Schaefer
2015-11-15 22:48   ` Bart Schaefer
2015-11-16  0:50     ` Mikael Magnusson
2015-11-16  3:24       ` Bart Schaefer
2015-11-16  5:42         ` Mikael Magnusson
2015-11-18 10:42     ` Peter Stephenson
2015-11-18 14:13       ` Peter Stephenson
2015-11-18 15:52         ` Bart Schaefer
2015-11-18 16:14           ` Peter Stephenson [this message]
2015-11-18 18:09             ` Bart Schaefer
2015-11-17 17:29   ` Peter Stephenson
2015-11-18  4:55     ` Bart Schaefer
2015-11-18 10:30       ` Peter Stephenson

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=20151118161431.360006a5@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).