zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Command substitution parsing issues (not really Re: completion)
Date: Sun, 18 Jan 2015 17:31:57 +0000	[thread overview]
Message-ID: <20150118173157.184e385f@ntlworld.com> (raw)
In-Reply-To: <150116185732.ZM30791@torch.brasslantern.com>

On Fri, 16 Jan 2015 18:57:32 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> I still get:
> 
> schaefer<501> echo ÿÿÿÿÿÿÿÿ$(ls)
> Completing all expansions
> ÿÿÿÿÿÿÿÿ$(ls)
> Completing original
> $(ls)

I've narrowed this down (note no completion in the following repro,
hurrah):

% alias foo='echo poop'
% echo ${(e):-'$(foo)'}
ÿÿÿÿÿÿÿÿ$(foo)

This comes from the call from subst_parse_str() to parsestr() and
parsestrnoerr(), which make unwarranted and undocumented assumptions
about the way the lexer works, in particular that if it passes in a
variable s then any parsing happens within that string --- a pretty
stupid assumption.  The interface needs fixing up, which
ought to be easy enough just by ensuring parsestrnoerr() passes back a
reference to tokstr --- however, I see parsestr is called all over
the place so I'm not going to have time to look now.

We also need to ensure and document that the string parsed in comes from
the heap --- I think that's already a requirement, just nobody got
around to writing it down.  In fact parsestrnoerr() appears to be doing
all sorts of hair-raising things without documentation --- why set the
input string and then immediately after set the lexical buffer to the
original string?

This is nothing fundamentally to do with the rest of the change.  If
anyone else has time, go ahead --- this is killing off my free time at
the moment.

pws


  parent reply	other threads:[~2015-01-18 17:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-17  0:19 completion Ray Andrews
2015-01-17  2:57 ` Command substitution parsing issues (not really Re: completion) Bart Schaefer
2015-01-17  3:29   ` Ray Andrews
2015-01-17 13:25     ` Vin Shelton
2015-01-19 10:29     ` Peter Stephenson
2015-01-19 10:39       ` Peter Stephenson
2015-01-22  0:34       ` make check problem Ray Andrews
2015-01-22  8:49         ` Peter Stephenson
2015-01-22 16:00           ` Ray Andrews
2015-01-22 16:40         ` Jun T.
2015-01-22 17:38           ` Ray Andrews
2015-01-22 17:56             ` Bart Schaefer
2015-01-22 18:24               ` Ray Andrews
2015-01-23  4:02                 ` Bart Schaefer
2015-01-23  4:48                   ` Ray Andrews
2015-01-22 19:04               ` --enable-pcre and regex comparison (Was: make check problem) Lawrence Velázquez
2015-01-23  4:04                 ` Bart Schaefer
2015-01-18 16:36   ` Command substitution parsing issues (not really Re: completion) Peter Stephenson
2015-01-18 17:31   ` Peter Stephenson [this message]
2015-01-18 22:34     ` 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=20150118173157.184e385f@ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).