From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6138 invoked from network); 4 May 2000 16:15:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 May 2000 16:15:15 -0000 Received: (qmail 11645 invoked by alias); 4 May 2000 16:15:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11161 Received: (qmail 11603 invoked from network); 4 May 2000 16:15:04 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: Completing for "find" and _regex_arguments (Re: PATCH: Re: sudo completion problem) References: <000601bfb599$a9219f80$21c9ca95@mow.siemens.ru> <200005041340.PAA08620@beta.informatik.hu-berlin.de> <1000504151422.ZM22851@candle.brasslantern.com> MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 05 May 2000 01:16:09 +0900 In-Reply-To: <1000504151422.ZM22851@candle.brasslantern.com> (Bart Schaefer's message of "Thu, 4 May 2000 15:14:22 +0000") Message-ID: User-Agent: T-gnus/6.14.1 (based on Gnus v5.8.3) (revision 16) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.6 (i686-pc-linux-gnu) MULE/4.0 (HANANOEN) In article <1000504151422.ZM22851@candle.brasslantern.com>, "Bart Schaefer" 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