Permalink
Browse files

regcomp.sym: Add node type ANYOF_POSIXL

This is like ANYOFL, but has runtime matches of /[[:posix:]]/ in it,
which requires extra space.  Adding this will allow a future commit to
simplify handling for ANYOF nodes.
  • Loading branch information...
khwilliamson committed Sep 20, 2018
1 parent 0142fb7 commit 22ab13d984a38db04bb34083d76806f1b2e5e7d0
Showing with 176 additions and 161 deletions.
  1. +2 −0 pod/perldebguts.pod
  2. +1 −0 regcomp.sym
  3. +7 −1 regexec.c
  4. +166 −160 regnodes.h
View
@@ -605,6 +605,8 @@ will be lost.
single char match only
ANYOFD sv 1 Like ANYOF, but /d is in effect
ANYOFL sv 1 Like ANYOF, but /l is in effect
ANYOFPOSIXL sv 1 Like ANYOFL, but matches [[:posix:]]
classes
ANYOFM byte 1 Like ANYOF, but matches an invariant byte
as determined by the mask and arg
View
@@ -59,6 +59,7 @@ SANY REG_ANY, no 0 S ; Match any one character.
ANYOF ANYOF, sv 1 S ; Match character in (or not in) this class, single char match only
ANYOFD ANYOF, sv 1 S ; Like ANYOF, but /d is in effect
ANYOFL ANYOF, sv 1 S ; Like ANYOF, but /l is in effect
ANYOFPOSIXL ANYOF, sv 1 S ; Like ANYOFL, but matches [[:posix:]] classes
ANYOFM ANYOFM byte 1 S ; Like ANYOF, but matches an invariant byte as determined by the mask and arg
#* POSIX Character Classes:
View
@@ -2233,6 +2233,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
/* We know what class it must start with. */
switch (OP(c)) {
case ANYOFPOSIXL:
case ANYOFL:
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
@@ -6707,6 +6708,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
}
break;
case ANYOFPOSIXL:
case ANYOFL: /* /[abc]/l */
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
@@ -9351,6 +9353,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
}
break;
}
case ANYOFPOSIXL:
case ANYOFL:
_CHECK_AND_WARN_PROBLEMATIC_LOCALE;
@@ -9698,7 +9701,10 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const
1 /* 1 means die */ );
NOT_REACHED; /* NOTREACHED */
}
if (c > 255 && OP(n) == ANYOFL && ! ANYOFL_UTF8_LOCALE_REQD(flags)) {
if ( c > 255
&& (OP(n) == ANYOFL || OP(n) == ANYOFPOSIXL)
&& ! ANYOFL_UTF8_LOCALE_REQD(flags))
{
_CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(c);
}
}
Oops, something went wrong.

0 comments on commit 22ab13d

Please sign in to comment.