From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7799 invoked by alias); 28 May 2018 17:36:33 -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: List-Unsubscribe: X-Seq: 42872 Received: (qmail 24977 invoked by uid 1010); 28 May 2018 17:36:33 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.3):SA:0(-2.6/5.0):. Processed in 0.974147 secs); 28 May 2018 17:36:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: (z) flag little crazy when '((' closed with *single* ')' Date: Tue, 29 May 2018 02:02:18 +0900 References: To: zsh-workers@zsh.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) X-Biglobe-Spnum: 62299 > 2018/05/28 23:43, Sebastian Gniazdowski wrote: > > ~ buf='(( i = 1, i <= size, ++ i )'; printf "|%s|\n" "${(z)buf}" > |(| > |(| (snip) > |)| > > 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 )| If the lexer can't find the closing '))' on the command line, it tries to interpret the opening '((' as '( (', i.e., nested subshells. zsh% ((echo foo) ) foo zsh% ((echo foo); echo bar) foo bar zsh% ((echo foo) subsh> ${(z)...} uses the same lexter, and even if it is OK to make it behave differently from the command line, we may need to modify the lexer ...