From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16573 invoked by alias); 13 May 2014 09:10:47 -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: 32610 Received: (qmail 24912 invoked from network); 13 May 2014 09:10:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7fb36d000006ff7-b3-5371e1883257 Date: Tue, 13 May 2014 10:10:32 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [PATCH] Re: Parser issues and and [[ $var ]] Message-id: <20140513101032.5d2377f8@pwslap01u.europe.root.pri> In-reply-to: <140512220112.ZM20283@torch.brasslantern.com> References: <140416102727.ZM19090@torch.brasslantern.com> <534FE710.3020601@eastlink.ca> <140417123722.ZM22179@torch.brasslantern.com> <20140423165024.1480528a@pws-pc.ntlworld.com> <20140425172112.7bf50606@pwslap01u.europe.root.pri> <140426133019.ZM29630@torch.brasslantern.com> <140510140932.ZM32668@torch.brasslantern.com> <140510180144.ZM26488@torch.brasslantern.com> <20140511180148.3b614054@pws-pc.ntlworld.com> <140511111200.ZM20625@torch.brasslantern.com> <140512220112.ZM20283@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Fd2Oh4XBBtcuWFocbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujK89D1kKVnFULJ21m72B8QpbFyMnh4SAicSH3a+ZIWwxiQv3 1gPFuTiEBJYySnx7coQdwlnOJDH94Esgh4ODRUBVYsJ+AZAGNgFDiambZjOC2CIC4hJn155n AbGFBSwlDi84zg5i8wrYS2y7+4AJxOYUsJK48HIjC8TMl2wSk9fcAtvML6AvcfXvJyaIK+wl Zl45wwjRLCjxY/I9sKHMAloSm7c1sULY8hKb17xlnsAoMAtJ2SwkZbOQlC1gZF7FKJpamlxQ nJSea6hXnJhbXJqXrpecn7uJERKEX3YwLj5mdYhRgINRiYc3gKsgWIg1say4MvcQowQHs5II 76GrhcFCvCmJlVWpRfnxRaU5qcWHGJk4OKUaGP25d9RtDJMISF20rd9g05OfJ1Y/sOyO/XPw rcvXF09b3i9jzN6WyXRWarb0fSHf4FP58TqRXg+mZjcWiiXNfW/n9KZjgeyRrrhFihZ7dt8t 3pVduGiD/o83N43fxO9h7Psb7Zl1zfz958X13Zy/Z896EXT+8DVFll+ZYnN6T1SxKGUol/77 H6/EUpyRaKjFXFScCAC6E7FjIAIAAA== On Mon, 12 May 2014 22:01:12 -0700 Bart Schaefer wrote: > This problem already exists -- infix operators that aren't tokens like > && and || are already lower prececence than prefix operators. E.g.: > > zsh% [[ -n 1 -eq 1 ]] > zsh: unknown condition: -n > > So I don't think the patch below changes any of that. While this sort of thing and the problems with modular conditions are a real headache for parsing, I don't think the actual practical problems are anything like as bad. Almost always real tests use parameters or quoted expressions (you don't need to know if the literal string -n has non-zero length), and since [[, unlike [, is parsed before expansion such tests work fine. About the only likely exception I can think of is where someone's used an eval to get an extra level of expansion --- but that's always a bit hairy. So having addressed the compatibility issues, perhaps we should restrict ourselves to tweaking the documentation to mention the problems and how to keep them at bay. pws