summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perldebguts.pod2
-rw-r--r--regcomp.c6
-rw-r--r--regcomp.sym3
-rw-r--r--regexec.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod
index 9eafdbd26e..fee1d6900e 100644
--- a/pod/perldebguts.pod
+++ b/pod/perldebguts.pod
@@ -611,10 +611,12 @@ will be lost.
ANYOFPOSIXL sv Like ANYOFL, but matches [[:posix:]]
charclass_ classes
posixl
+
ANYOFH sv 1 Like ANYOF, but only has "High" matches,
none in the bitmap;
ANYOFHb sv 1 Like ANYOFH, but all matches share the same
UTF-8 start byte, given in the flags field
+
ANYOFM byte 1 Like ANYOF, but matches an invariant byte
as determined by the mask and arg
NANYOFM byte 1 complement of ANYOFM
diff --git a/regcomp.c b/regcomp.c
index d2267742ab..e54bc1976b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1635,7 +1635,7 @@ S_get_ANYOF_cp_list_for_ssc(pTHX_ const RExC_state_t *pRExC_state,
}
/* Add in the points from the bit map */
- if (OP(node) != ANYOFH && OP(node) != ANYOFHb) {
+ if (! inRANGE(OP(node), ANYOFH, ANYOFHb)) {
for (i = 0; i < NUM_ANYOF_CODE_POINTS; i++) {
if (ANYOF_BITMAP_TEST(node, i)) {
unsigned int start = i++;
@@ -14788,7 +14788,7 @@ S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr)
assert(PL_regkind[OP(node)] == ANYOF);
/* There is no bitmap for this node type */
- if (OP(node) == ANYOFH || OP(node) == ANYOFHb) {
+ if (inRANGE(OP(node), ANYOFH, ANYOFHb)) {
return;
}
@@ -20404,7 +20404,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o, const regmatch_
/* Ready to start outputting. First, the initial left bracket */
Perl_sv_catpvf(aTHX_ sv, "[%s", PL_colors[0]);
- if (OP(o) != ANYOFH && OP(o) != ANYOFHb) {
+ if (! inRANGE(OP(o), ANYOFH, ANYOFHb)) {
/* Then all the things that could fit in the bitmap */
do_sep = put_charclass_bitmap_innards(sv,
ANYOF_BITMAP(o),
diff --git a/regcomp.sym b/regcomp.sym
index e432ae5cd1..4b8885d0b3 100644
--- a/regcomp.sym
+++ b/regcomp.sym
@@ -62,8 +62,11 @@ ANYOF ANYOF, sv charclass S ; Match character in (or not in) this
ANYOFD ANYOF, sv charclass S ; Like ANYOF, but /d is in effect
ANYOFL ANYOF, sv charclass S ; Like ANYOF, but /l is in effect
ANYOFPOSIXL ANYOF, sv charclass_posixl S ; Like ANYOFL, but matches [[:posix:]] classes
+
+# Must be sequential
ANYOFH ANYOF, sv 1 S ; Like ANYOF, but only has "High" matches, none in the bitmap;
ANYOFHb ANYOF, sv 1 S ; Like ANYOFH, but all matches share the same UTF-8 start byte, given in the flags field
+
ANYOFM ANYOFM byte 1 S ; Like ANYOF, but matches an invariant byte as determined by the mask and arg
NANYOFM ANYOFM byte 1 S ; complement of ANYOFM
diff --git a/regexec.c b/regexec.c
index eaaef94881..6eec9c2400 100644
--- a/regexec.c
+++ b/regexec.c
@@ -9886,7 +9886,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const
}
/* If this character is potentially in the bitmap, check it */
- if (c < NUM_ANYOF_CODE_POINTS && OP(n) != ANYOFH && OP(n) != ANYOFHb) {
+ if (c < NUM_ANYOF_CODE_POINTS && ! inRANGE(OP(n), ANYOFH, ANYOFHb)) {
if (ANYOF_BITMAP_TEST(n, c))
match = TRUE;
else if ((flags