Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tool to unroll nested parameter expansions
- X-seq: zsh-users 8268
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Tool to unroll nested parameter expansions
- Date: Sun, 5 Dec 2004 10:09:23 -0800 (PST)
- In-reply-to: <dc507f4a04120401146f1cf2e@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dc507f4a04120401146f1cf2e@xxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author