zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Tool to unroll nested parameter expansions
Date: Sun, 5 Dec 2004 10:09:23 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0412050956290.30902@toltec.zanshin.com> (raw)
In-Reply-To: <dc507f4a04120401146f1cf2e@mail.gmail.com>

On Sat, 4 Dec 2004, Felix Rosencrantz wrote:

> Anyone have a tool that can take a nested parameter expression [...] and
> break it down into simpler substeps, so it is easier to read.

Unfortunately a tool to do this has to contain the equivalent of the 
entire shell parser, because a parameter expansion can contain $(...)
which can in turn contain arbitrary shell code (including other parameter
expansions, which would confuse any attempt to simplify the parse).

The "obvious" thing would be to instrument paramsubst() so you could see 
the dissection as the shell parses it (perhaps when both VERBOSE and 
XTRACE are set, or some such) but paramsubst() is already 1900 lines of 
subst.c, so that prospect is not appealing.


      reply	other threads:[~2004-12-05 18:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-04  9:14 Felix Rosencrantz
2004-12-05 18:09 ` Bart Schaefer [this message]

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=Pine.LNX.4.61.0412050956290.30902@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).