diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-06 11:03:06 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-08 13:03:01 +0800 |
commit | 5f5c35d3ce139755d02fa07de26229cd08d3c8cd (patch) | |
tree | 2b2d1fb07166852b9fde43dd3cc2c927c88971ae /regexec.c | |
parent | 4202141d20ddfa0501f385cf923860bcf7511398 (diff) | |
download | perl-5f5c35d3ce139755d02fa07de26229cd08d3c8cd.tar.gz |
regcomp.c - remove (**{ ... }) from the regex engine
Dave M pointed out that this idea was flawed, and after some testing I have
come to agree with him. This removes it. It was only available for 5.37.8,
so no deprecation cycle involved.
The point of (**{ ... }) was to have a postponed eval that does not disable
optimizations. But some of the optimizations are disabled because if they
are not we do not match correctly as the optimizations will make unwarranted
assumptions about the pattern, assumptions which can be incorrect depending
on what pattern is returned from the codeblock. The original idea was
proposed because (?{ ... }) was treated as though it was (??{ ... }) and
disabled many optimizations, when in fact it doesn't interact with
optimizations at all. When I added (*{ ... }) as the optimistic version of
(?{ ... }) I used "completeness" as the justification for also adding
(**{ ... }) when it does not make sense to do so.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -8237,7 +8237,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) PL_op = NULL; re_sv = NULL; - if (logical == 0) { /* (?{})/ */ + if (logical == 0) { /* /(?{ ... })/ and /(*{ ... })/ */ SV *replsv = save_scalar(PL_replgv); sv_setsv(replsv, ret); /* $^R */ SvSETMAGIC(replsv); @@ -8246,7 +8246,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) sw = cBOOL(SvTRUE_NN(ret)); logical = 0; } - else { /* /(??{}) */ + else { /* /(??{ ... }) */ /* if its overloaded, let the regex compiler handle * it; otherwise extract regex, or stringify */ if (SvGMAGICAL(ret)) @@ -8289,7 +8289,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) } } - /* only /(??{})/ from now on */ + /* only /(??{ ... })/ from now on */ logical = 0; { /* extract RE object from returned value; compiling if |