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

Re: ${(z)} split of unmatched, doubled ((



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