develooper Front page | perl.perl5.porters | Postings from July 2013

Re: refactoring of regex execution / calling

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
July 31, 2013 08:45
Subject:
Re: refactoring of regex execution / calling
Message ID:
CAHhgV8hAgteh6eURWPyUQTctru33=RegDuihDcu0u0MDxGWsVg@mail.gmail.com
On Tue, Jul 30, 2013 at 10:20 PM, Dave Mitchell <davem@iabyn.com> wrote:
>     [MERGE] refactor pp_match(), pp_subst(), regexec()
>
>     Notionally the regexec engine has a well-defined API.
>     In practice, the caller of regexec() (typically pp_match() or pp_subst()),
>     is required to do a lot of set-up before calling regexec(), and some
>     post-processing afterwards; in particular to handle \G, to handle intuit,
>     and to set up $& correctly after an intuit-only match.
>
>     The series of commits in this branch refactors the code around these three
>     functions so that all the regex "knowledge"  is now contained within
>     regexec() rather than in the calling pp functions. At the same, time the
>     pp functions have been heavily cleaned up and simplified where possible.
>     This reduces the LOC in pp_match() from 305 to 186.

I'm very happy to hear that. I remember trying to use the regexp
engine from an embedded perspective some 4-5 years ago and getting
stuck in having to reuse half of pp_match/pp_subst.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About