This macro defines two flag bits:
#define PREGf_ANCH_SINGLE (PREGf_ANCH_SBOL|PREGf_ANCH_GPOS)
but is only used twice in core (and not on CPAN),
don't really add any value, but increases cognitive complexity.
r->check_substr = r->anchored_substr;
r->check_utf8 = r->anchored_utf8;
r->check_offset_min = r->check_offset_max = r->anchored_offset;
- if (r->intflags & PREGf_ANCH_SINGLE)
+ if (r->intflags & (PREGf_ANCH_SBOL|PREGf_ANCH_GPOS))
r->intflags |= PREGf_NOSCAN;
}
else {
#define PREGf_ANCH_SBOL 0x00001000
#define PREGf_ANCH_GPOS 0x00002000
-#define PREGf_ANCH_SINGLE ( PREGf_ANCH_SBOL | PREGf_ANCH_GPOS )
-#define PREGf_ANCH ( PREGf_ANCH_SINGLE | PREGf_ANCH_MBOL | PREGf_ANCH_BOL )
+#define PREGf_ANCH (PREGf_ANCH_SBOL | PREGf_ANCH_GPOS | \
+ PREGf_ANCH_MBOL | PREGf_ANCH_BOL )
/* this is where the old regcomp.h started */
check = prog->check_substr;
}
if (prog->intflags & PREGf_ANCH) { /* Match at \G, beg-of-str or after \n */
- ml_anch = !( (prog->intflags & PREGf_ANCH_SINGLE)
+ ml_anch = !( (prog->intflags & (PREGf_ANCH_SBOL|PREGf_ANCH_GPOS))
|| ( (prog->intflags & PREGf_ANCH_BOL)
&& !multiline ) ); /* Check after \n? */