Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Inconsistency with SHWORDSPLIT and leading spaces



On Sat, 7 Nov 2015 11:43:14 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Nov 7,  5:42pm, Peter Stephenson wrote:
> }
> } +/*
> } + * Bit flags passed back from multsub() to paramsubst().
> } + */
> 
> Maybe now that we're doing this, we could have a bit flag passed in the
> other (and back?) direction for whether the (P) flag is in effect, and
> thereby fix the ${${(P)hash}[index]} thing?

It's a bit more complicated than that, though maybe doable.

If:

- we spot on the way down this is a multsub when we reached the nested
paramsubst() (we could do that with a pf_flags bit)

- we return a name of a parameter and a flag saying what we're doing on
noticing this

- we pass this up to the to paramsubst() regardless of what else is going
on in the prefork() and the multsub() --- this is the bit I a little scared
of, but (P) is so explicit in what it's doing maybe that's OK

- in the upper paramsubst we use the flag to retrieve a Value based on
the return, i.e. it now really is just a name for use up above as you
might have been entitled to think it always was --- this is surely doable
but I bet it's messier than you'd expect

does that do it?

pws



Messages sorted by: Reverse Date, Date, Thread, Author