Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
${(z)} split of unmatched, doubled ((
- X-seq: zsh-workers 36652
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: ${(z)} split of unmatched, doubled ((
- Date: Sun, 27 Sep 2015 01:23:37 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Gd9 YmkNZTNAjNkAB1wkqYsOc/kE=; b=h+NzPEB7eJK3eGGWl86Au8R0Wtk+tHnpYL8 6E5MTXmNKlj1GhfOVzubEMpUg82X+5MgiDGr6KxpYvHfiMkHXf57+3CeX5jnTw+u e61W1lxt6Jfhnvt3rlJopEzhhQ7PgV6Hrf+4dbRccF5CWIaE+MWvHDss7PWWyMu+ FvLAZYtg=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Gd 9YmkNZTNAjNkAB1wkqYsOc/kE=; b=gXczIsQ4cFJ7cB23LRd80FIjfSms4efZem qitX7IIAc3HROx9LidEXAUxHnbNJtxCCraT0rMo1aZ+zCKdwjYMu7O8bC+nfP3PZ 9SWgU022YZzOFP0U8gkSM1jZ5nPMAZ8n/gfKNQWFaYWt3B4q9AkiAgZUCe+W1ab5 c8MUrobP4=
- 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
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author