}
}
else if (flags & SCF_DO_STCLASS_AND) {
- cl_and(data->start_class, &accum);
- if (min1)
+ if (min1) {
+ cl_and(data->start_class, &accum);
flags &= ~SCF_DO_STCLASS;
+ }
+ else {
+ /* Switch to OR mode: cache the old value of
+ * data->start_class */
+ StructCopy(data->start_class, &and_with,
+ struct regnode_charclass_class);
+ flags &= ~SCF_DO_STCLASS_AND;
+ StructCopy(&accum, data->start_class,
+ struct regnode_charclass_class);
+ flags |= SCF_DO_STCLASS_OR;
+ data->start_class->flags |= ANYOF_EOS;
+ }
}
}
else if (code == BRANCHJ) /* single branch is optimized. */
r->reganch &= ~ROPT_SKIP; /* Used in find_byclass(). */
DEBUG_r((sv = sv_newmortal(),
regprop(sv, (regnode*)data.start_class),
- PerlIO_printf(Perl_debug_log, "synthetic stclass.\n",
+ PerlIO_printf(Perl_debug_log, "synthetic stclass `%s'.\n",
SvPVX(sv))));
}
r->reganch &= ~ROPT_SKIP; /* Used in find_byclass(). */
DEBUG_r((sv = sv_newmortal(),
regprop(sv, (regnode*)data.start_class),
- PerlIO_printf(Perl_debug_log, "synthetic stclass.\n",
+ PerlIO_printf(Perl_debug_log, "synthetic stclass `%s'.\n",
SvPVX(sv))));
}
}
p++;
break;
case 'e':
- ender = '\033';
+#ifdef ASCIIish
+ ender = '\033';
+#else
+ ender = '\047';
+#endif
p++;
break;
case 'a':
- ender = '\007';
+#ifdef ASCIIish
+ ender = '\007';
+#else
+ ender = '\057';
+#endif
p++;
break;
case 'x':
case 't': value = '\t'; break;
case 'f': value = '\f'; break;
case 'b': value = '\b'; break;
+#ifdef ASCIIish
case 'e': value = '\033'; break;
case 'a': value = '\007'; break;
+#else
+ case 'e': value = '\047'; break;
+ case 'a': value = '\057'; break;
+#endif
case 'x':
value = (UV)scan_hex(PL_regcomp_parse, 2, &numlen);
PL_regcomp_parse += numlen;
if (!SIZE_ONLY) {
if (value == 'p')
Perl_sv_catpvf(aTHX_ listsv,
- "+utf8::%.*s\n", n, PL_regcomp_parse);
+ "+utf8::%.*s\n", (int)n, PL_regcomp_parse);
else
Perl_sv_catpvf(aTHX_ listsv,
- "!utf8::%.*s\n", n, PL_regcomp_parse);
+ "!utf8::%.*s\n", (int)n, PL_regcomp_parse);
}
PL_regcomp_parse = e + 1;
lastvalue = OOB_UTF8;
case 't': value = '\t'; break;
case 'f': value = '\f'; break;
case 'b': value = '\b'; break;
+#ifdef ASCIIish
case 'e': value = '\033'; break;
case 'a': value = '\007'; break;
+#else
+ case 'e': value = '\047'; break;
+ case 'a': value = '\057'; break;
+#endif
case 'x':
if (*PL_regcomp_parse == '{') {
e = strchr(PL_regcomp_parse++, '}');
else if (k == WHILEM && o->flags) /* Ordinal/of */
Perl_sv_catpvf(aTHX_ sv, "[%d/%d]", o->flags & 0xf, o->flags>>4);
else if (k == REF || k == OPEN || k == CLOSE || k == GROUPP )
- Perl_sv_catpvf(aTHX_ sv, "%d", ARG(o)); /* Parenth number */
+ Perl_sv_catpvf(aTHX_ sv, "%d", (int)ARG(o)); /* Parenth number */
else if (k == LOGICAL)
Perl_sv_catpvf(aTHX_ sv, "[%d]", o->flags); /* 2: embedded, otherwise 1 */
else if (k == ANYOF) {