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. LeonThread Previous | Thread Next