zsh-workers
 help / color / mirror / code / Atom feed
* (z) flag little crazy when '((' closed with *single* ')'
@ 2018-05-28 14:43 Sebastian Gniazdowski
  2018-05-28 17:02 ` Jun T.
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-05-28 14:43 UTC (permalink / raw)
  To: Zsh hackers list

Hello,
so how is (( ... )) splitted by (z)?

~ buf='(( i = 1, i <= size, ++ i ))'; printf "|%s|\n" "${(z)buf}"
|(( i = 1, i <= size, ++ i ))|

~ buf='(( i = 1, i <= size, ++ i'; printf "|%s|\n" "${(z)buf}"
|(( i = 1, i <= size, ++ i|

OK, but look what happens when there is single ')', not 0, not 2, but
1 closing parenthesis:

~ buf='(( i = 1, i <= size, ++ i )'; printf "|%s|\n" "${(z)buf}"
|(|
|(|
|i|
|=|
|1,|
|i|
|<|
|=|
|size,|
|++|
|i|
|)|

It splits almost char by char. I wonder if this couldn't be fixed? So
that (z) would split this as:

|(( i = 1, i <= size, ++ i )|

-- 
Best regards,
Sebastian Gniazdowski


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

end of thread, other threads:[~2018-05-29  0:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 14:43 (z) flag little crazy when '((' closed with *single* ')' Sebastian Gniazdowski
2018-05-28 17:02 ` Jun T.
2018-05-29  0:08   ` 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).