From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27603 invoked by alias); 27 Sep 2015 16:00:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36658 Received: (qmail 12018 invoked from network); 27 Sep 2015 16:00:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=hdjI91yyeQafA8RzQCXAED4ej5+9/uoVtXlPSSUc6Sw=; b=Fz0d9I/OaMIrNNQ2u8jGJVRqZi62nug9EPE/ogbGydDtIC+yiARZEXACe+m/TMGiIO liz4S2sRNO2y7IQl5kCToakBQMVps4mUuJeaHBvBZ+Syi2OyV1oTqziDyaQQIwiS66an lz54H6D9P8VGDzb4RAAW5EhMGHeQTwCdoo6542g/TfxzUPOqMGv9v9NZFzu/0nhfanP7 7XOsFn+CMGpkg8L1fZitlDqzuSTpFebNQiS7YEur61RJ7Ilyb8PWkWrylULynN78cjjf 8wjL+aZnRQu5idyKAg4D+Wyo7PbasHAGJ8fmO5HuHeY4lSgvX9oP/bwdkpnCxBuQEtXi WA7A== X-Gm-Message-State: ALoCoQkKOExO0A2lcnITcGh/KwJ3j694Vtc4RUBkzyI2b+uibSNB6JomMIJzSfjq/NgLWLnSyAUz X-Received: by 10.182.240.167 with SMTP id wb7mr979392obc.55.1443369651662; Sun, 27 Sep 2015 09:00:51 -0700 (PDT) From: Bart Schaefer Message-Id: <150927090048.ZM25706@torch.brasslantern.com> Date: Sun, 27 Sep 2015 09:00:48 -0700 In-Reply-To: <20150927012337.GD1989@tarsus.local2> Comments: In reply to Daniel Shahaf "${(z)} split of unmatched, doubled ((" (Sep 27, 1:23am) References: <20150927012337.GD1989@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: ${(z)} split of unmatched, doubled (( MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.