Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${(z)} split of unmatched, doubled ((
- X-seq: zsh-workers 36658
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: ${(z)} split of unmatched, doubled ((
- Date: Sun, 27 Sep 2015 09:00:48 -0700
- In-reply-to: <20150927012337.GD1989@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150927012337.GD1989@tarsus.local2>
On Sep 27, 1:23am, Daniel Shahaf wrote:
}
} % print -rl - ${(z):-'(( e'}
} e
} %
}
} Shouldn't it output the parentheses as well?
This has always been broken. The '((' parse doesn't have a tokstr
value (cf. comments about parsing "for (( ... ))" in bufferwords()
[hist.c]). Prior to recent fixes to backtrack this properly, the
error was even worse:
torch% print $ZSH_VERSION
4.2.0
torch% print -rl - ${(z):-'(( e x y'}
e x y
(
e
x
y
torch%
There's also an issue of how to treat "e" in this example. If the
double parens are taken as math context, then "e" is a single double-
quoted token, otherwise it has to be decomposed into shell words. As
you can see, 4.2.0 parses it BOTH ways (eek).
I don't have an answer for where the right place to "output" the parens
would be; the backtracking makes this ugly.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author