From: Sebastian Gniazdowski <psprint2@fastmail.com>
To: zsh-workers@zsh.org
Subject: Re: Feature request (#b)...(...)<not empty>
Date: Sat, 25 Feb 2017 09:24:40 -0800 [thread overview]
Message-ID: <1488043480.2342625.892680080.72CB632E@webmail.messagingengine.com> (raw)
In-Reply-To: <170225084736.ZM22286@torch.brasslantern.com>
On Sat, Feb 25, 2017, at 08:47 AM, Bart Schaefer wrote:
> On Feb 25, 12:37am, Sebastian Gniazdowski wrote:
> (...) or it must remember
> everything it did up to that point and re-evaluate that after the
> second "fg" is scanned.
I thought that ((a|)(b|)(c|)) could be left as it is. So after it scans
"bold" (a), it normally proceeds to scan "fg" (i.e. b), etc. until it
finishes the outer parenthesis. No change here. Different order, e.g.
ba, isn't accepted, i.e. first "fg" then "bold" – the say API is
restricted, order is: bold, foreground, background (lacking any of them
but of course not all).
> (...) This is different from simply failing to match what is
> coming up next and backtracking the whole process.
This matches what (#n) would do. Reject empty result of parentheses, so
indeed... I was thinking in terms of parentheses.
((a|)(b|)(c|))<HERE>(#n) <- in this place we're somewhat at "current"
node. First recently finished. Expected some nodes to be there, grouping
elements of parentheses. And typical rejection of nodes to be already in
place.
> ([all-except-fg-or-bg]|[fg]|[bg])#([fgbg]|[bgfg]|[fg]|[bg])
>
> Zsh's scanner will always take the left branch of an alternation if both
> branches will succeed, so arranging this with longest matches first will
> accomplish what you need, I think; but I suspect everything might be a
> bit oversimplified here.
I'm in good position because it's API. User is required not to do
restricted things, it's like e.g. not accepting NULLs in C, so I can
leave it as it is.
--
Sebastian Gniazdowski
psprint2@fastmail.com
next prev parent reply other threads:[~2017-02-25 17:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-25 8:37 Sebastian Gniazdowski
2017-02-25 15:13 ` Daniel Shahaf
2017-02-25 15:36 ` Sebastian Gniazdowski
2017-02-25 16:47 ` Bart Schaefer
2017-02-25 17:24 ` Sebastian Gniazdowski [this message]
2017-02-25 17:54 ` Daniel Shahaf
2017-02-25 20:38 ` Bart Schaefer
2017-02-25 17:54 ` Sebastian Gniazdowski
2017-02-25 21:05 ` Bart Schaefer
2017-02-25 22:52 ` Daniel Shahaf
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=1488043480.2342625.892680080.72CB632E@webmail.messagingengine.com \
--to=psprint2@fastmail.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).