zsh-workers
 help / color / mirror / code / Atom feed
* ${(z)} split of unmatched, doubled ((
@ 2015-09-27  1:23 Daniel Shahaf
  2015-09-27 16:00 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Shahaf @ 2015-09-27  1:23 UTC (permalink / raw)
  To: zsh-workers

Consider:

% print -rl - ${(z):-'(( e'}
 e
%

Shouldn't it output the parentheses as well?  I realise it can't know yet
whether it's an arithmetic evaluation or two subshells, but pretending the
parentheses don't exist will never be the right parse...

Other unfinished constructs don't seem to exhibit this behaviour:

% print -rl - ${(z):-'( e'}
(
e
% print -rl - ${(z):-'( ( e'}
(
(
e
% print -rl - ${(z):-'echo "hello w'}   
echo
"hello w

I ran into this in zsh-syntax-highlighting when BUFFER='(( 42 ', with
the closing-double-paren not having been typed yet.  For that use-case,
I don't care whether I get a single '((' token or two '(' tokens; either
would be fine.

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-28  3:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-27  1:23 ${(z)} split of unmatched, doubled (( Daniel Shahaf
2015-09-27 16:00 ` Bart Schaefer
2015-09-27 23:51   ` Daniel Shahaf
2015-09-28  0:59     ` Bart Schaefer
2015-09-28  1:55       ` Daniel Shahaf
2015-09-28  3:30         ` Bart Schaefer

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).