From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19508 invoked by alias); 25 Feb 2017 17:24:45 -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: 40635 Received: (qmail 19038 invoked from network); 25 Feb 2017 17:24:45 -0000 X-Qmail-Scanner-Diagnostics: from new1-smtp.messagingengine.com 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(66.111.4.221):SA:0(-0.4/5.0):. Processed in 1.054151 secs); 25 Feb 2017 17:24:45 -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=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint2@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.221 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=vUU4XyTPQFgrhJudM4R2WOFStQ c=; b=1FR1YqrXWx4RbtORrfVCjPqWHe8UfsBdT/hKUPvpOMFg2OSS3FF2d+Q+Xp UEZFC1LbWmeM/f9a9//02+IYMqFEqfMrF0XUwqQXR9Wxi9+/tWL6cIvv3yOG5yo6 qj4pBhG2jEn4SU1bRepAx6PVjKduQeDhMeUYmRSr3uHFaDemo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=smtpout; bh=vU U4XyTPQFgrhJudM4R2WOFStQc=; b=V1HK/Wtvz+H38KpH95qDvjXBR4CxBfVHTf /oUrh7i0GjmTXHmyIAt3il0uB2x7vhfO4oRn9k8L3UvfosKPScTRLopuIVWkXo1o G3TsVhhqoCpMZQv685AfcTkBCQIw4D63eri9SN6jYAgf8SFzZHa/WAcnXPp//LMI tnApLUTlM= X-ME-Sender: Message-Id: <1488043480.2342625.892680080.72CB632E@webmail.messagingengine.com> From: Sebastian Gniazdowski To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-715c2c0c References: <1488011830.2241447.892433784.52D183B6@webmail.messagingengine.com> <20170225151315.GA4424@fujitsu.shahaf.local2> <1488037019.2320483.892622496.169D8730@webmail.messagingengine.com> <170225084736.ZM22286@torch.brasslantern.com> Date: Sat, 25 Feb 2017 09:24:40 -0800 Subject: Re: Feature request (#b)...(...) 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" =E2=80=93 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.=20 This matches what (#n) would do. Reject empty result of parentheses, so indeed... I was thinking in terms of parentheses. ((a|)(b|)(c|))(#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. =20 > ([all-except-fg-or-bg]|[fg]|[bg])#([fgbg]|[bgfg]|[fg]|[bg]) >=20 > 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. --=20 Sebastian Gniazdowski psprint2@fastmail.com