Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(z) flag little crazy when '((' closed with *single* ')'
- X-seq: zsh-workers 42871
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: (z) flag little crazy when '((' closed with *single* ')'
- Date: Mon, 28 May 2018 16:43:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hHcZa43Ga55nEKre18pM9UVHZsQl973xQAqwUPQr5QA=; b=KaTyhp7jwgh1daPDRIdMLH893GpBBxp5AlX1CsefaYwdByX+A7IUiNMXKWmLzGGquK hi4bsopeHuc/go7NCN9Eq0qkAawr+a8sn0Kgorzf/IrPyEKW9aVTHe5n8t02ssn4syrm agAsq8YFAevH0r/9G+vbGP3ZURf2Lu/MI6G64y0QBVyC9M07wHLzBRlLYuT5NEZSHNhc ID8W/wbJwXogfAGT2y+hz+3W/F1cxff9MHDo5wEM8PioI0g8IGLIGeG2pOogY0k5C+V5 XsnvHYyPHmpzAKALogX99zcIa6cbEpH+OzzFHhC2E5rLXFVqQNVbOKKNUEt55vUgZbhq ADEQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author