Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Cannot use (#i) flag in [[ ]] explicit glib
- X-seq: zsh-workers 44753
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: [BUG] Cannot use (#i) flag in [[ ]] explicit glib
- Date: Wed, 11 Sep 2019 13:11:39 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4yDKvQ4elcjpzRDlzUyAvmktH52mx1bVVFGARKM1s1U=; b=YdlCa74LkVRBA3/78hvQpzRzvqTAzT1LubuplM3bZBRtjgWgi/8QKb7PxcL99Vsj5p JDS2rTkVLbBgD4jsHqJ/xGRZm7nWse8JH/epDaFRcea+awK4AP6z7vUCSyoH69GPOsAA Mc2eK+EsP9+KoCtRcQzDBXlAZ67DkCUVeEi63v4geNuvFeYrvPFGxPa7tWC9jNK1CgAc NIuJvFlxdE0jzmzgay8mbIgRXSuES8AM4WwxAq1ATb+VvQ8ljDM0zZ+QV2t4+U0BZ9ev oT8xkxRpbtjieXqo0FgF7/dlFNIc6Ql4YsBRgiBPagBsaBXjRvSxYpdXxPXKvtTnI+MN vBCA==
- In-reply-to: <CAKc7PVBmUH=mK3q_=um+hmJTrch86SeoZgOsiNNdv4nAxmp-xg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBmUH=mK3q_=um+hmJTrch86SeoZgOsiNNdv4nAxmp-xg@mail.gmail.com>
On Tue, Sep 10, 2019 at 7:50 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> if [[ -f (#i)$dir/README.md(#qN[1]) ]]; then echo true; fi
>
> Output:
> zsh: parse error near `('
That's not exactly a bug, it's because a parenthesized sub-expression
is valid syntax inside [[ ]]. The parser can't tell why the open
paren is there. It might be possible to special-case the operators
that accept file patterns as arguments, but right now except for "-t"
(which has special handling for ksh compatibility) the parser doesn't
use any such context dependence; that is, the operators are not
tokens, they're just one in a list of strings, a property which is
made use of by the module system for defining new condition operators.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author