{RXf_ANCH_MBOL, "ANCH_MBOL,"},
{RXf_ANCH_SBOL, "ANCH_SBOL,"},
{RXf_ANCH_GPOS, "ANCH_GPOS,"},
- {RXf_GPOS_SEEN, "GPOS_SEEN,"},
- {RXf_GPOS_FLOAT, "GPOS_FLOAT,"},
{RXf_NO_INPLACE_SUBST, "NO_INPLACE_SUBST,"},
{RXf_EVAL_SEEN, "EVAL_SEEN,"},
{RXf_CHECK_ALL, "CHECK_ALL,"},
{PREGf_USE_RE_EVAL, "USE_RE_EVAL,"},
{PREGf_NOSCAN, "NOSCAN,"},
{PREGf_CANY_SEEN, "CANY_SEEN,"},
+ {PREGf_GPOS_SEEN, "GPOS_SEEN,"},
+ {PREGf_GPOS_FLOAT, "GPOS_FLOAT,"},
};
void
flags &= ~SCF_DO_STCLASS;
}
else if (OP(scan) == GPOS) {
- if (!(RExC_rx->extflags & RXf_GPOS_FLOAT) &&
+ if (!(RExC_rx->intflags & PREGf_GPOS_FLOAT) &&
!(delta || is_inf || (data && data->pos_delta)))
{
if (!(RExC_rx->extflags & RXf_ANCH) && (flags & SCF_DO_SUBSTR))
if (RExC_rx->gofs < (STRLEN)min)
RExC_rx->gofs = min;
} else {
- RExC_rx->extflags |= RXf_GPOS_FLOAT;
+ RExC_rx->intflags |= PREGf_GPOS_FLOAT;
RExC_rx->gofs = 0;
}
}
r->minlen = minlen;
if (RExC_seen & REG_SEEN_GPOS)
- r->extflags |= RXf_GPOS_SEEN;
+ r->intflags |= PREGf_GPOS_SEEN;
if (RExC_seen & REG_SEEN_LOOKBEHIND)
r->extflags |= RXf_NO_INPLACE_SUBST; /* inplace might break the
lookbehind */
PerlIO_printf(Perl_debug_log, "(GPOS)");
PerlIO_putc(Perl_debug_log, ' ');
}
- if (r->extflags & RXf_GPOS_SEEN)
+ if (r->intflags & PREGf_GPOS_SEEN)
PerlIO_printf(Perl_debug_log, "GPOS:%"UVuf" ", (UV)r->gofs);
if (r->intflags & PREGf_SKIP)
PerlIO_printf(Perl_debug_log, "plus ");
#define PREGf_USE_RE_EVAL 0x00000020 /* compiled with "use re 'eval'" */
/* these used to be extflags, but are now intflags */
#define PREGf_NOSCAN 0x00000040
-#define PREGf_CANY_SEEN 0x00000080
+#define PREGf_CANY_SEEN 0x00000080
+#define PREGf_GPOS_SEEN 0x00000100
+#define PREGf_GPOS_FLOAT 0x00000200
/* this is where the old regcomp.h started */
startpos = stringarg;
- if (prog->extflags & RXf_GPOS_SEEN) {
+ if (prog->intflags & PREGf_GPOS_SEEN) {
MAGIC *mg;
/* set reginfo->ganch, the position where \G can match */
else
startpos -= prog->gofs;
}
- else if (prog->extflags & RXf_GPOS_FLOAT)
+ else if (prog->intflags & PREGf_GPOS_FLOAT)
startpos = strbeg;
}
&& (s < stringarg))
{
/* this should only be possible under \G */
- assert(prog->extflags & RXf_GPOS_SEEN);
+ assert(prog->intflags & PREGf_GPOS_SEEN);
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log,
"matched, but failing for REXEC_FAIL_ON_UNDERFLOW\n"));
goto phooey;
} /* end search for newline */
} /* end anchored/multiline check string search */
goto phooey;
- } else if (RXf_GPOS_CHECK == (prog->extflags & RXf_GPOS_CHECK))
+ } else if ((prog->intflags & PREGf_GPOS_SEEN) && (prog->extflags & RXf_ANCH_GPOS))
{
+ /* XXX: Why do we check both PREGf_GPOS_SEEN && RXf_ANCH_GPOS the
+ * latter can't be true unless the former is too as far as I know.
+ * Needs further investigation - Yves */
/* For anchored \G, the only position it can match from is
* (ganch-gofs); we already set startpos to this above; if intuit
* moved us on from there, we can't possibly succeed */
&& (prog->offs[0].start < stringarg - strbeg))
{
/* this should only be possible under \G */
- assert(prog->extflags & RXf_GPOS_SEEN);
+ assert(prog->intflags & PREGf_GPOS_SEEN);
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log,
"matched, but failing for REXEC_FAIL_ON_UNDERFLOW\n"));
goto phooey;
#define RXf_ANCH_MBOL (1<<(RXf_BASE_SHIFT+1))
#define RXf_ANCH_SBOL (1<<(RXf_BASE_SHIFT+2))
#define RXf_ANCH_GPOS (1<<(RXf_BASE_SHIFT+3))
-#define RXf_GPOS_SEEN (1<<(RXf_BASE_SHIFT+4))
-#define RXf_GPOS_FLOAT (1<<(RXf_BASE_SHIFT+5))
+#define RXf_UNUSED1 (1<<(RXf_BASE_SHIFT+4))
+#define RXf_UNUSED2 (1<<(RXf_BASE_SHIFT+5))
/* two bits here */
#define RXf_ANCH (RXf_ANCH_BOL|RXf_ANCH_MBOL|RXf_ANCH_GPOS|RXf_ANCH_SBOL)
-#define RXf_GPOS_CHECK (RXf_GPOS_SEEN|RXf_ANCH_GPOS)
#define RXf_ANCH_SINGLE (RXf_ANCH_SBOL|RXf_ANCH_GPOS)
/* What we have seen */
#define RXf_NO_INPLACE_SUBST (1<<(RXf_BASE_SHIFT+6))
#define RXf_EVAL_SEEN (1<<(RXf_BASE_SHIFT+7))
-#define RXf_UNUSED1 (1<<(RXf_BASE_SHIFT+8))
+#define RXf_UNUSED3 (1<<(RXf_BASE_SHIFT+8))
/* Special */
-#define RXf_UNUSED2 (1<<(RXf_BASE_SHIFT+9))
+#define RXf_UNUSED4 (1<<(RXf_BASE_SHIFT+9))
#define RXf_CHECK_ALL (1<<(RXf_BASE_SHIFT+10))
/* UTF8 related */
"ANCH_MBOL", /* 0x00000400 */
"ANCH_SBOL", /* 0x00000800 */
"ANCH_GPOS", /* 0x00001000 */
- "GPOS_SEEN", /* 0x00002000 */
- "GPOS_FLOAT", /* 0x00004000 */
+ "UNUSED1", /* 0x00002000 */
+ "UNUSED2", /* 0x00004000 */
"NO_INPLACE_SUBST", /* 0x00008000 */
"EVAL_SEEN", /* 0x00010000 */
- "UNUSED1", /* 0x00020000 */
- "UNUSED2", /* 0x00040000 */
+ "UNUSED3", /* 0x00020000 */
+ "UNUSED4", /* 0x00040000 */
"CHECK_ALL", /* 0x00080000 */
"MATCH_UTF8", /* 0x00100000 */
"USE_INTUIT_NOML", /* 0x00200000 */
"VERBARG_SEEN", /* 0x00000008 - PREGf_VERBARG_SEEN */
"CUTGROUP_SEEN", /* 0x00000010 - PREGf_CUTGROUP_SEEN */
"USE_RE_EVAL", /* 0x00000020 - PREGf_USE_RE_EVAL - compiled with "use re 'eval'" */
- "NOSCAN", /* 0x00000040 - PREGf_NOSCAN */
- "CANY_SEEN", /* 0x00000080 - PREGf_CANY_SEEN */
+ "NOSCAN", /* 0x00000040 - PREGf_NOSCAN */
+ "CANY_SEEN", /* 0x00000080 - PREGf_CANY_SEEN */
+ "GPOS_SEEN", /* 0x00000100 - PREGf_GPOS_SEEN */
+ "GPOS_FLOAT", /* 0x00000200 - PREGf_GPOS_FLOAT */
};
#endif /* DOINIT */