ret = reg_node(pRExC_state, CLUMP);
*flagp |= HASWIDTH;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_mark)
- is_utf8_mark((U8*)"~"); /* preload table */
break;
case 'w':
ret = reg_node(pRExC_state, LOC ? ALNUML : ALNUM);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_alnum)
- is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'W':
ret = reg_node(pRExC_state, LOC ? NALNUML : NALNUM);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_alnum)
- is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'b':
RExC_seen_zerolen++;
ret = reg_node(pRExC_state, LOC ? BOUNDL : BOUND);
*flagp |= SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_alnum)
- is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'B':
RExC_seen_zerolen++;
ret = reg_node(pRExC_state, LOC ? NBOUNDL : NBOUND);
*flagp |= SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_alnum)
- is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 's':
ret = reg_node(pRExC_state, LOC ? SPACEL : SPACE);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_space)
- is_utf8_space((U8*)" "); /* preload table */
break;
case 'S':
ret = reg_node(pRExC_state, LOC ? NSPACEL : NSPACE);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_space)
- is_utf8_space((U8*)" "); /* preload table */
break;
case 'd':
ret = reg_node(pRExC_state, DIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_digit)
- is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'D':
ret = reg_node(pRExC_state, NDIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar(pRExC_state);
- if (UTF && !PL_utf8_digit)
- is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'p':
case 'P':
#define HOP3c(pos,off,lim) ((char*)HOP3(pos,off,lim))
#define HOPMAYBE3c(pos,off,lim) ((char*)HOPMAYBE3(pos,off,lim))
-static void restore_pos(pTHXo_ void *arg);
+#define LOAD_UTF8_CHARCLASS(a,b) STMT_START { if (!CAT2(PL_utf8_,a)) (void)CAT2(is_utf8_, a)((U8*)b); } STMT_END
+static void restore_pos(pTHXo_ void *arg);
STATIC CHECKPOINT
S_regcppush(pTHX_ I32 parenfloor)
}
tmp = ((OP(c) == BOUND ?
isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp))) != 0);
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (s < strend) {
if (tmp == !(OP(c) == BOUND ?
swash_fetch(PL_utf8_alnum, (U8*)s) :
}
tmp = ((OP(c) == NBOUND ?
isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp))) != 0);
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (s < strend) {
if (tmp == !(OP(c) == NBOUND ?
swash_fetch(PL_utf8_alnum, (U8*)s) :
break;
case ALNUM:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (s < strend) {
if (swash_fetch(PL_utf8_alnum, (U8*)s)) {
if (tmp && (norun || regtry(prog, s)))
break;
case NALNUM:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (s < strend) {
if (!swash_fetch(PL_utf8_alnum, (U8*)s)) {
if (tmp && (norun || regtry(prog, s)))
break;
case SPACE:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(space," ");
while (s < strend) {
if (*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s)) {
if (tmp && (norun || regtry(prog, s)))
break;
case NSPACE:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(space," ");
while (s < strend) {
if (!(*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s))) {
if (tmp && (norun || regtry(prog, s)))
break;
case DIGIT:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(digit,"0");
while (s < strend) {
if (swash_fetch(PL_utf8_digit,(U8*)s)) {
if (tmp && (norun || regtry(prog, s)))
break;
case NDIGIT:
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(digit,"0");
while (s < strend) {
if (!swash_fetch(PL_utf8_digit,(U8*)s)) {
if (tmp && (norun || regtry(prog, s)))
if (!nextchr && locinput >= PL_regeol)
sayNO;
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(alnum,"a");
if (OP(scan) == NALNUM
? swash_fetch(PL_utf8_alnum, (U8*)locinput)
: isALNUM_LC_utf8((U8*)locinput))
}
if (OP(scan) == BOUND || OP(scan) == NBOUND) {
ln = isALNUM_uni(ln);
+ LOAD_UTF8_CHARCLASS(alnum,"a");
n = swash_fetch(PL_utf8_alnum, (U8*)locinput);
}
else {
sayNO;
if (do_utf8) {
if (UTF8_IS_CONTINUED(nextchr)) {
+ LOAD_UTF8_CHARCLASS(space," ");
if (!(OP(scan) == SPACE
? swash_fetch(PL_utf8_space, (U8*)locinput)
: isSPACE_LC_utf8((U8*)locinput)))
if (!nextchr && locinput >= PL_regeol)
sayNO;
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(space," ");
if (OP(scan) == NSPACE
? swash_fetch(PL_utf8_space, (U8*)locinput)
: isSPACE_LC_utf8((U8*)locinput))
if (!nextchr)
sayNO;
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(digit,"0");
if (!(OP(scan) == DIGIT
? swash_fetch(PL_utf8_digit, (U8*)locinput)
: isDIGIT_LC_utf8((U8*)locinput)))
if (!nextchr && locinput >= PL_regeol)
sayNO;
if (do_utf8) {
+ LOAD_UTF8_CHARCLASS(digit,"0");
if (OP(scan) == NDIGIT
? swash_fetch(PL_utf8_digit, (U8*)locinput)
: isDIGIT_LC_utf8((U8*)locinput))
nextchr = UCHARAT(++locinput);
break;
case CLUMP:
+ LOAD_UTF8_CHARCLASS(mark,"~");
if (locinput >= PL_regeol || swash_fetch(PL_utf8_mark,(U8*)locinput))
sayNO;
locinput += PL_utf8skip[nextchr];
case ALNUM:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (hardcount < max && scan < loceol &&
swash_fetch(PL_utf8_alnum, (U8*)scan)) {
scan += UTF8SKIP(scan);
case NALNUM:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(alnum,"a");
while (hardcount < max && scan < loceol &&
!swash_fetch(PL_utf8_alnum, (U8*)scan)) {
scan += UTF8SKIP(scan);
case SPACE:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(space," ");
while (hardcount < max && scan < loceol &&
(*scan == ' ' || swash_fetch(PL_utf8_space,(U8*)scan))) {
scan += UTF8SKIP(scan);
case NSPACE:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(space," ");
while (hardcount < max && scan < loceol &&
!(*scan == ' ' || swash_fetch(PL_utf8_space,(U8*)scan))) {
scan += UTF8SKIP(scan);
case DIGIT:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(digit,"0");
while (hardcount < max && scan < loceol &&
swash_fetch(PL_utf8_digit,(U8*)scan)) {
scan += UTF8SKIP(scan);
case NDIGIT:
if (do_utf8) {
loceol = PL_regeol;
+ LOAD_UTF8_CHARCLASS(digit,"0");
while (hardcount < max && scan < loceol &&
!swash_fetch(PL_utf8_digit,(U8*)scan)) {
scan += UTF8SKIP(scan);