Thursday, April 14, 2016

Re: RFE: support POSIX standard and developing RE's

On Tue, Apr 12, 2016 at 09:15:24PM +0200, Christian Brabandt wrote:

> On Di, 12 Apr 2016, L. A. Walsh wrote:
>
> > Christian Brabandt wrote:
> > >There is https://github.com/vim/vim/issues/99
> > >You might want to check, if this works for you.
> > ----
> > If vim supported posix extended RE's, then, like, say grep,
> > it could also support Perl RE's, from the PCRE library. Perl supports
> > the "/x" to ignore whitespace for readability. I.e. the author was saying
> > they wanted to implement some flavor of PCRE's, but really wanted the "/x"
> > feature, which would have been alot easier to do from Vim's current
> > feature set.
>
> The thing is, Vims RE support atoms, that other RE engines do not
> support. Think about e.g. \_. \< \%l \%'m
>
> That makes adding another RE engine hard.

It sounded to me like the request wasn't for a new RE engine, but a new RE
syntax, and one that would only be turned on explicitly by a flag.

Perhaps this conflicts with existing syntax, I'm not sure, but you could
say something like "/<ERE>/SE", which would search for the ERE "<ERE>",
because the Syntax flag was set to Extended regular expression. Similarly,
"/<PCRE>/SP". Those regular expressions would be handed off to the
appropriate engine (if support were available), and if those syntaxes
didn't support all the features of Vim's regular expression language, no
problem, no problem. The person writing those expressions would know their
limitations, and not use features not available in those languages.

That's vastly different than the recent change to the new engine, where it
needed to support the same features as the old one. And much more
tractable, I'd think. More a matter of defining the interface and setting
appropriate expectations with regard to availability and differences from
"normal" vim regexes.

Danek

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment