zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: ${(z)} split of unmatched, doubled ((
Date: Sun, 27 Sep 2015 09:00:48 -0700	[thread overview]
Message-ID: <150927090048.ZM25706@torch.brasslantern.com> (raw)
In-Reply-To: <20150927012337.GD1989@tarsus.local2>

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.


  reply	other threads:[~2015-09-27 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27  1:23 Daniel Shahaf
2015-09-27 16:00 ` Bart Schaefer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150927090048.ZM25706@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).