regnode *scan;
I32 flags;
I32 minlen = 0;
+
+ /* these are all flags - maybe they should be turned
+ * into a single int with different bit masks */
+ I32 sawlookahead = 0;
I32 sawplus = 0;
I32 sawopen = 0;
+
U8 jump_ret = 0;
dJMPENV;
scan_data_t data;
}
reStudy:
- r->minlen = minlen = sawplus = sawopen = 0;
+ r->minlen = minlen = sawlookahead = sawplus = sawopen = 0;
Zero(r->substrs, 1, struct reg_substr_data);
#ifdef TRIE_STUDY_OPT
I32 last_close = 0; /* pointed to by data */
regnode *first= scan;
regnode *first_next= regnext(first);
-
/*
* Skip introductions and multiplicators >= 1
* so that we can extract the 'meat' of the pattern that must
/* An OR of *one* alternative - should not happen now. */
(OP(first) == BRANCH && OP(first_next) != BRANCH) ||
/* for now we can't handle lookbehind IFMATCH*/
- (OP(first) == IFMATCH && !first->flags) ||
+ (OP(first) == IFMATCH && !first->flags && (sawlookahead = 1)) ||
(OP(first) == PLUS) ||
(OP(first) == MINMOD) ||
/* An {n,m} with n>0 */
first = NEXTOPER(first);
goto again;
}
- if (sawplus && (!sawopen || !RExC_sawback)
+ if (sawplus && !sawlookahead && (!sawopen || !RExC_sawback)
&& !(RExC_seen & REG_SEEN_EVAL)) /* May examine pos and $& */
/* x+ must match at the 1st pos of run of x's */
r->intflags |= PREGf_SKIP;
}
-plan tests => 2511; # Update this when adding/deleting tests.
+plan tests => 2512; # Update this when adding/deleting tests.
run_tests() unless caller;
iseq($w,undef);
}
+ {
+ local $BugId = 68564; # minimal CURLYM limited to 32767 matches
+ local $Message = "stclass optimisation does not break + inside (?=)";
+ iseq join("-", " abc def " =~ /(?=(\S+))/g),
+ "abc-bc-c-def-ef-f",
+ }
+
} # End of sub run_tests
1;