diff options
author | David Mitchell <davem@iabyn.com> | 2021-03-09 17:03:38 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2021-03-09 17:03:38 +0000 |
commit | cb174a785cca1bace5d049d08be208784028e671 (patch) | |
tree | 6eac94648f574d1a79e3c462212009773b650ace | |
parent | a9bb6a62ae45bb372a5cca98a76d1a79edd89ccb (diff) | |
download | perl-cb174a785cca1bace5d049d08be208784028e671.tar.gz |
Perl_regexec_flags(): fixup code comments
One comment there since 5.000 had become meaningless, so remove it;
add a couple of of other code comments to compensate.
-rw-r--r-- | regexec.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -3753,8 +3753,6 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend, reginfo->info_aux_eval = reginfo->info_aux->info_aux_eval = NULL; } - /* If there is a "must appear" string, look for it. */ - if (PL_curpm && (PM_GETRE(PL_curpm) == rx)) { /* We have to be careful. If the previous successful match was from this regex we don't want a subsequent partially @@ -3779,8 +3777,8 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend, if (prog->recurse_locinput) Zero(prog->recurse_locinput,prog->nparens + 1, char *); - /* Simplest case: anchored match need be tried only once, or with - * MBOL, only at the beginning of each line. + /* Simplest case: anchored match (but not \G) need be tried only once, + * or with MBOL, only at the beginning of each line. * * Note that /.*.../ sets PREGf_IMPLICIT|MBOL, while /.*.../s sets * PREGf_IMPLICIT|SBOL. The idea is that with /.*.../s, if it doesn't @@ -3824,6 +3822,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend, goto phooey; } /* end anchored search */ + /* anchored \G match */ if (prog->intflags & PREGf_ANCH_GPOS) { /* PREGf_ANCH_GPOS should never be true if PREGf_GPOS_SEEN is not true */ @@ -3838,6 +3837,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend, } /* Messy cases: unanchored match. */ + if ((prog->anchored_substr || prog->anchored_utf8) && prog->intflags & PREGf_SKIP) { /* we have /x+whatever/ */ /* it must be a one character string (XXXX Except is_utf8_pat?) */ |