if (data)
data->flags |= SF_HAS_EVAL;
}
+ else if (OP(scan) == LOGICAL && scan->flags == 2) { /* Embedded */
+ if (flags & SCF_DO_SUBSTR) {
+ scan_commit(data);
+ data->longest = &(data->longest_float);
+ }
+ is_inf = is_inf_internal = 1;
+ }
/* Else: zero-length, ignore. */
scan = regnext(scan);
}
PL_reg_flags = 0;
PL_regprecomp = savepvn(exp, xend - exp);
- DEBUG_r(PerlIO_printf(Perl_debug_log, "compiling RE `%*s'\n",
- xend - exp, PL_regprecomp));
+ DEBUG_r(
+ if (!PL_colorset) {
+ int i = 0;
+ char *s = PerlEnv_getenv("PERL_RE_COLORS");
+
+ if (s) {
+ PL_colors[0] = s = savepv(s);
+ while (++i < 6) {
+ s = strchr(s, '\t');
+ if (s) {
+ *s = '\0';
+ PL_colors[i] = ++s;
+ }
+ else
+ PL_colors[i] = "";
+ }
+ } else {
+ while (i < 6)
+ PL_colors[i++] = "";
+ }
+ PL_colorset = 1;
+ }
+ );
+ DEBUG_r(PerlIO_printf(Perl_debug_log, "%sCompiling%s RE `%s%*s%s'\n",
+ PL_colors[4],PL_colors[5],PL_colors[0],
+ xend - exp, PL_regprecomp, PL_colors[1]));
PL_regflags = pm->op_pmflags;
PL_regsawback = 0;
}
DEBUG_r(PerlIO_printf(Perl_debug_log, "size %d ", PL_regsize));
- DEBUG_r(
- if (!PL_colorset) {
- int i = 0;
- char *s = PerlEnv_getenv("TERMCAP_COLORS");
-
- PL_colorset = 1;
- if (s) {
- PL_colors[0] = s = savepv(s);
- while (++i < 4) {
- s = strchr(s, '\t');
- if (!s)
- FAIL("Not enough TABs in TERMCAP_COLORS");
- *s = '\0';
- PL_colors[i] = ++s;
- }
- }
- else {
- while (i < 4)
- PL_colors[i++] = "";
- }
- /* Reset colors: */
- PerlIO_printf(Perl_debug_log, "%s%s%s%s",
- PL_colors[0],PL_colors[1],PL_colors[2],PL_colors[3]);
- }
- );
-
/* Small enough for pointer-storage convention?
If extralen==0, this means that we will not need long jumps. */
if (PL_regsize >= 0x10000L && PL_extralen)
if (*PL_regcomp_parse == '?') {
U16 posflags = 0, negflags = 0;
U16 *flagsp = &posflags;
+ int logical = 0;
PL_regcomp_parse++;
paren = *PL_regcomp_parse++;
nextchar();
*flagp = TRYAGAIN;
return NULL;
+ case 'p':
+ logical = 1;
+ paren = *PL_regcomp_parse++;
+ /* FALL THROUGH */
case '{':
{
dTHR;
}
nextchar();
+ if (logical) {
+ ret = reg_node(LOGICAL);
+ if (!SIZE_ONLY)
+ ret->flags = 2;
+ regtail(ret, reganode(EVAL, n));
+ return ret;
+ }
return reganode(EVAL, n);
}
case '(':
I32 flag;
ret = reg_node(LOGICAL);
+ if (!SIZE_ONLY)
+ ret->flags = 1;
regtail(ret, reg(1, &flag));
goto insert_if;
}
}
}
if (!SIZE_ONLY) {
- for ( ; lastvalue <= value; lastvalue++)
- ANYOF_SET(opnd, lastvalue);
- }
+#ifndef ASCIIish
+ if ((isLOWER(lastvalue) && isLOWER(value)) ||
+ (isUPPER(lastvalue) && isUPPER(value))) {
+ if (isLOWER(lastvalue)) {
+ for (i = lastvalue; i <= value; i++)
+ if (isLOWER(i))
+ ANYOF_SET(opnd, i);
+ } else {
+ for (i = lastvalue; i <= value; i++)
+ if (isUPPER(i))
+ ANYOF_SET(opnd, i);
+ }
+ }
+ else
+#endif
+ for ( ; lastvalue <= value; lastvalue++)
+ ANYOF_SET(opnd, lastvalue);
+ }
lastvalue = value;
}
/* optimize case-insensitive simple patterns (e.g. /[a-z]/i) */
sv_catpvf(sv, "GROUPP%d", ARG(o));
break;
case LOGICAL:
- p = "LOGICAL";
+ sv_catpvf(sv, "LOGICAL[%d]", o->flags);
break;
case SUSPEND:
p = "SUSPEND";