summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-09-26 21:38:46 -0600
committerKarl Williamson <khw@cpan.org>2019-09-29 11:46:26 -0600
commit3363c7035ff1df0c3ffeae0cd18bb86cc39d62e4 (patch)
treed535e39518c3b979528eccec4c0eb0c2083c71ea /regexec.c
parentae06e581c6e9944620eed4980fe89a3749886ed0 (diff)
downloadperl-3363c7035ff1df0c3ffeae0cd18bb86cc39d62e4.tar.gz
regex: Create and handle LEXACT nodes
See the previous commit for info on these. I am not changing trie code to recognize these at this time.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 23ef50d538..973b9e93a1 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4237,6 +4237,7 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p,
U8 folded[UTF8_MAX_FOLD_CHAR_EXPAND * UTF8_MAXBYTES_CASE + 1] = { '\0' };
if ( OP(text_node) == EXACT
+ || OP(text_node) == LEXACT
|| OP(text_node) == EXACT_ONLY8
|| OP(text_node) == EXACTL)
{
@@ -6274,9 +6275,14 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
}
#undef ST
+ case LEXACT:
{
char *s;
+ s = STRINGl(scan);
+ ln = STR_LENl(scan);
+ goto join_short_long_exact;
+
case EXACTL: /* /abc/l */
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
@@ -6300,6 +6306,8 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
do_exact:
s = STRINGs(scan);
ln = STR_LENs(scan);
+
+ join_short_long_exact:
if (utf8_target != is_utf8_pat) {
/* The target and the pattern have differing utf8ness. */
char *l = locinput;
@@ -9367,10 +9375,15 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
scan = this_eol;
break;
+ case LEXACT:
{
U8 * string;
Size_t str_len;
+ string = (U8 *) STRINGl(p);
+ str_len = STR_LENl(p);
+ goto join_short_long_exact;
+
case EXACTL:
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
if (utf8_target && UTF8_IS_ABOVE_LATIN1(*scan)) {
@@ -9387,6 +9400,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
do_exact:
string = (U8 *) STRINGs(p);
str_len = STR_LENs(p);
+
+ join_short_long_exact:
assert(str_len == reginfo->is_utf8_pat ? UTF8SKIP(string) : 1);
c = *string;