zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Cannot use (#i) flag in [[ ]] explicit glib
Date: Wed, 11 Sep 2019 13:11:39 -0700	[thread overview]
Message-ID: <CAH+w=7bC6FC-rebWYLrKJtEdD-E1wZtJtkCLWuULZyLZGR6V3w@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVBmUH=mK3q_=um+hmJTrch86SeoZgOsiNNdv4nAxmp-xg@mail.gmail.com>

On Tue, Sep 10, 2019 at 7:50 PM Sebastian Gniazdowski
<sgniazdowski@gmail.com> 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.

      reply	other threads:[~2019-09-11 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  2:49 Sebastian Gniazdowski
2019-09-11 20:11 ` Bart Schaefer [this message]

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='CAH+w=7bC6FC-rebWYLrKJtEdD-E1wZtJtkCLWuULZyLZGR6V3w@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=sgniazdowski@gmail.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).