zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@m17n.org>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completing for "find" and _regex_arguments (Re: PATCH: Re: sudo completion problem)
Date: 05 May 2000 01:16:09 +0900	[thread overview]
Message-ID: <hvon1m6p9yu.fsf@serein.m17n.org> (raw)
In-Reply-To: <1000504151422.ZM22851@candle.brasslantern.com> (Bart Schaefer's message of "Thu, 4 May 2000 15:14:22 +0000")

In article <1000504151422.ZM22851@candle.brasslantern.com>,
  "Bart Schaefer" <schaefer@candle.brasslantern.com> writes:

> Is there any chance that it could now be rewritten using extendedglob
> patterns, rather than parsing its own RE syntax?

Hm.  _regex_arguments handles two kind of RE.  Inner RE is just
extendedglob pattern: /RE/.  Outer RE is RE which contains elements as
inner REs instead of characters.  Outer RE has also lookaheads, guards,
and actions and they are corresponds to inner REs.  A lookahead is
also just extendedglob pattern but it doesn't consume arguments
string.  This corresponds to a zero-width positive look-ahead
assertion in perl5: `(?=pattern)'.  A guard is zsh code to test
something which cannot represent as RE.  This corresponds to (??{
(code) ? "[^\000-\377]" : "" }) in perl5.6.  However, currently I
don't use this as real test.  I used this as recording option use
etc. and always report a test is succeed.  So (?{ code }) in perl5.6
is enough to implement my use.  A action is zsh code for completion.
They are evaluated when whole outer RE is failed to match.  When it is
failed, actions corresponding to inner REs which are last candidates
to match.  There is no direct correspondences in RE constructs.  But I
think this can be implemented as (?{ code }) which set some variables.

Note that outer RE of _regex_arguments is not real RE because it
doesn't backtrack.  But if it is implemented by real RE engine, it can
backtrack...

So, if extendedglob patterns have enough RE constructs in perl5.6, 
it can be used to unify inner and outer RE in _regex_arguments.
Maybe.
-- 
Tanaka Akira


  reply	other threads:[~2000-05-04 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-03 14:42 PATCH: Re: sudo completion problem Sven Wischnowsky
2000-05-03 14:56 ` Andrej Borsenkow
2000-05-03 15:09   ` Zefram
2000-05-04  7:23     ` Andrej Borsenkow
2000-05-04 12:02       ` Tanaka Akira
2000-05-04 13:40         ` Sven Wischnowsky
2000-05-04 15:14           ` Completing for "find" and _regex_arguments (Re: PATCH: Re: sudo completion problem) Bart Schaefer
2000-05-04 16:16             ` Tanaka Akira [this message]
2000-05-04 20:12           ` PATCH: Re: sudo completion problem Tanaka Akira
2000-05-04 20:40             ` Tanaka Akira
2000-05-06  6:56 ` Andrej Borsenkow
2000-05-06  7:40   ` Tanaka Akira
2000-05-06  7:51     ` Andrej Borsenkow
2000-05-06  8:19   ` Zefram

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=hvon1m6p9yu.fsf@serein.m17n.org \
    --to=akr@m17n.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).