if (RX_ISTAINTED(regex))
sv_catpv(desc, ",TAINTED");
if (RX_CHECK_SUBSTR(regex)) {
- if (!(RX_EXTFLAGS(regex) & RXf_NOSCAN))
+ if (!(RX_INTFLAGS(regex) & PREGf_NOSCAN))
sv_catpv(desc, ",SCANFIRST");
if (RX_EXTFLAGS(regex) & RXf_CHECK_ALL)
sv_catpv(desc, ",ALL");
{GVf_IMPORTED_CV, " CV"},
};
-const struct flag_to_name regexp_flags_names[] = {
+const struct flag_to_name regexp_extflags_names[] = {
{RXf_PMf_MULTILINE, "PMf_MULTILINE,"},
{RXf_PMf_SINGLELINE, "PMf_SINGLELINE,"},
{RXf_PMf_FOLD, "PMf_FOLD,"},
{RXf_NO_INPLACE_SUBST, "NO_INPLACE_SUBST,"},
{RXf_EVAL_SEEN, "EVAL_SEEN,"},
{RXf_CANY_SEEN, "CANY_SEEN,"},
- {RXf_NOSCAN, "NOSCAN,"},
{RXf_CHECK_ALL, "CHECK_ALL,"},
{RXf_MATCH_UTF8, "MATCH_UTF8,"},
{RXf_USE_INTUIT_NOML, "USE_INTUIT_NOML,"},
{RXf_NULL, "NULL,"},
};
+const struct flag_to_name regexp_core_intflags_names[] = {
+ {PREGf_SKIP, "SKIP,"},
+ {PREGf_IMPLICIT, "IMPLICIT,"},
+ {PREGf_NAUGHTY, "NAUGHTY,"},
+ {PREGf_VERBARG_SEEN, "VERBARG_SEEN,"},
+ {PREGf_CUTGROUP_SEEN, "CUTGROUP_SEEN,"},
+ {PREGf_USE_RE_EVAL, "USE_RE_EVAL,"},
+ {PREGf_NOSCAN, "NOSCAN,"},
+};
+
void
Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bool dumpops, STRLEN pvlim)
{
dumpregexp:
{
struct regexp * const r = ReANY((REGEXP*)sv);
-#define SV_SET_STRINGIFY_REGEXP_FLAGS(d,flags) STMT_START { \
+
+#define SV_SET_STRINGIFY_REGEXP_FLAGS(d,flags,names) STMT_START { \
sv_setpv(d,""); \
- append_flags(d, flags, regexp_flags_names); \
+ append_flags(d, flags, names); \
if (SvCUR(d) > 0 && *(SvEND(d) - 1) == ',') { \
SvCUR_set(d, SvCUR(d) - 1); \
SvPVX(d)[SvCUR(d)] = '\0'; \
} \
} STMT_END
- SV_SET_STRINGIFY_REGEXP_FLAGS(d,r->compflags);
+ SV_SET_STRINGIFY_REGEXP_FLAGS(d,r->compflags,regexp_extflags_names);
Perl_dump_indent(aTHX_ level, file, " COMPFLAGS = 0x%"UVxf" (%s)\n",
(UV)(r->compflags), SvPVX_const(d));
- SV_SET_STRINGIFY_REGEXP_FLAGS(d,r->extflags);
+ SV_SET_STRINGIFY_REGEXP_FLAGS(d,r->extflags,regexp_extflags_names);
Perl_dump_indent(aTHX_ level, file, " EXTFLAGS = 0x%"UVxf" (%s)\n",
(UV)(r->extflags), SvPVX_const(d));
-#undef SV_SET_STRINGIFY_REGEXP_FLAGS
- Perl_dump_indent(aTHX_ level, file, " INTFLAGS = 0x%"UVxf"\n",
+ Perl_dump_indent(aTHX_ level, file, " ENGINE = 0x%"UVxf" (%s)\n",
+ PTR2UV(r->engine), (r->engine == &PL_core_reg_engine) ? "STANDARD" : "PLUG-IN" );
+ if (r->engine == &PL_core_reg_engine) {
+ SV_SET_STRINGIFY_REGEXP_FLAGS(d,r->intflags,regexp_core_intflags_names);
+ Perl_dump_indent(aTHX_ level, file, " INTFLAGS = 0x%"UVxf" (%s)\n",
+ (UV)(r->intflags), SvPVX_const(d));
+ } else {
+ Perl_dump_indent(aTHX_ level, file, " INTFLAGS = 0x%"UVxf"\n",
(UV)(r->intflags));
+ }
+#undef SV_SET_STRINGIFY_REGEXP_FLAGS
Perl_dump_indent(aTHX_ level, file, " NPARENS = %"UVuf"\n",
(UV)(r->nparens));
Perl_dump_indent(aTHX_ level, file, " LASTPAREN = %"UVuf"\n",
pv_display(d, r->subbeg, r->sublen, 50, pvlim));
else
Perl_dump_indent(aTHX_ level, file, " SUBBEG = 0x0\n");
- Perl_dump_indent(aTHX_ level, file, " ENGINE = 0x%"UVxf"\n",
- PTR2UV(r->engine));
Perl_dump_indent(aTHX_ level, file, " MOTHER_RE = 0x%"UVxf"\n",
PTR2UV(r->mother_re));
if (nest < maxnest && r->mother_re)
OUTSIDE = $ADDR \\(MAIN\\)');
if ($] >= 5.011) {
+# note the conditionals on ENGINE and INTFLAGS were introduced in 5.19.9
do_test('reference to regexp',
qr(tic),
'SV = $RV\\($ADDR\\) at $ADDR
'
COMPFLAGS = 0x0 \(\)
EXTFLAGS = 0x680000 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
- INTFLAGS = 0x0
+(?: ENGINE = $ADDR \(STANDARD\)
+)? INTFLAGS = 0x0(?: \(\))?
NPARENS = 0
LASTPAREN = 0
LASTCLOSEPAREN = 0
SUBOFFSET = 0
SUBCOFFSET = 0
SUBBEG = 0x0
- ENGINE = $ADDR
- MOTHER_RE = $ADDR'
+(?: ENGINE = $ADDR
+)? MOTHER_RE = $ADDR'
. ($] < 5.019003 ? '' : '
SV = REGEXP\($ADDR\) at $ADDR
REFCNT = 2
CUR = 8
COMPFLAGS = 0x0 \(\)
EXTFLAGS = 0x680000 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
- INTFLAGS = 0x0
+(?: ENGINE = $ADDR \(STANDARD\)
+)? INTFLAGS = 0x0(?: \(\))?
NPARENS = 0
LASTPAREN = 0
LASTCLOSEPAREN = 0
SUBOFFSET = 0
SUBCOFFSET = 0
SUBBEG = 0x0
- ENGINE = $ADDR
- MOTHER_RE = 0x0
+(?: ENGINE = $ADDR
+)? MOTHER_RE = 0x0
PAREN_NAMES = 0x0
SUBSTRS = $ADDR
PPRIVATE = $ADDR
pass "no crash with DeadCode";
close OUT;
}
-
+# note the conditionals on ENGINE and INTFLAGS were introduced in 5.19.9
do_test('UTF-8 in a regular expression',
qr/\x{100}/,
'SV = IV\($ADDR\) at $ADDR
STASH = $ADDR "Regexp"
COMPFLAGS = 0x0 \(\)
EXTFLAGS = 0x680040 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
- INTFLAGS = 0x0
+(?: ENGINE = $ADDR \(STANDARD\)
+)? INTFLAGS = 0x0(?: \(\))?
NPARENS = 0
LASTPAREN = 0
LASTCLOSEPAREN = 0
SUBOFFSET = 0
SUBCOFFSET = 0
SUBBEG = 0x0
- ENGINE = $ADDR
- MOTHER_RE = $ADDR'
+(?: ENGINE = $ADDR
+)? MOTHER_RE = $ADDR'
. ($] < 5.019003 ? '' : '
SV = REGEXP\($ADDR\) at $ADDR
REFCNT = 2
CUR = 13
COMPFLAGS = 0x0 \(\)
EXTFLAGS = 0x680040 \(CHECK_ALL,USE_INTUIT_NOML,USE_INTUIT_ML\)
- INTFLAGS = 0x0
+(?: ENGINE = $ADDR \(STANDARD\)
+)? INTFLAGS = 0x0(?: \(\))?
NPARENS = 0
LASTPAREN = 0
LASTCLOSEPAREN = 0
SUBOFFSET = 0
SUBCOFFSET = 0
SUBBEG = 0x0
- ENGINE = $ADDR
- MOTHER_RE = 0x0
+(?: ENGINE = $ADDR
+)? MOTHER_RE = 0x0
PAREN_NAMES = 0x0
SUBSTRS = $ADDR
PPRIVATE = $ADDR