{
char * endbrace; /* '}' following the name */
regnode *ret = NULL;
-#ifdef DEBUGGING
- char* parse_start = RExC_parse - 2; /* points to the '\N' */
-#endif
char* p;
GET_RE_DEBUG_FLAGS_DECL;
RExC_parse++;
vFAIL("Quantifier follows nothing");
break;
- case LATIN_SMALL_LETTER_SHARP_S:
- case UTF8_TWO_BYTE_HI_nocast(LATIN_SMALL_LETTER_SHARP_S):
- case UTF8_TWO_BYTE_HI_nocast(IOTA_D_T):
-#if UTF8_TWO_BYTE_HI_nocast(UPSILON_D_T) != UTF8_TWO_BYTE_HI_nocast(IOTA_D_T)
-#error The beginning utf8 byte of IOTA_D_T and UPSILON_D_T unexpectedly differ. Other instances in this code should have the case statement below.
- case UTF8_TWO_BYTE_HI_nocast(UPSILON_D_T):
-#endif
- do_foldchar:
- if (!LOC && FOLD) {
- U32 len,cp;
- len=0; /* silence a spurious compiler warning */
- if ((cp = what_len_TRICKYFOLD_safe(RExC_parse,RExC_end,UTF,len))) {
- *flagp |= HASWIDTH; /* could be SIMPLE too, but needs a handler in regexec.regrepeat */
- RExC_parse+=len-1; /* we get one from nextchar() as well. :-( */
- ret = reganode(pRExC_state, FOLDCHAR, cp);
- Set_Node_Length(ret, 1); /* MJD */
- nextchar(pRExC_state); /* kill whitespace under /x */
- return ret;
- }
- }
- goto outer_default;
case '\\':
/* Special Escapes
literal text handling code.
*/
switch ((U8)*++RExC_parse) {
- case LATIN_SMALL_LETTER_SHARP_S:
- case UTF8_TWO_BYTE_HI_nocast(LATIN_SMALL_LETTER_SHARP_S):
- case UTF8_TWO_BYTE_HI_nocast(IOTA_D_T):
- goto do_foldchar;
/* Special Escapes */
case 'A':
RExC_seen_zerolen++;
/* FALL THROUGH */
default:
- outer_default:
parse_start = RExC_parse - 1;
defchar: {
typedef enum {
- char_s = 1,
+ generic_char = 0,
+ char_s,
upsilon_1,
upsilon_2,
iota_1,
iota_2,
} char_state;
- char_state latest_char_state = 0;
+ char_state latest_char_state = generic_char;
register STRLEN len;
register UV ender;
register char *p;
if (RExC_flags & RXf_PMf_EXTENDED)
p = regwhite( pRExC_state, p );
switch ((U8)*p) {
- case LATIN_SMALL_LETTER_SHARP_S:
- case UTF8_TWO_BYTE_HI_nocast(LATIN_SMALL_LETTER_SHARP_S):
- case UTF8_TWO_BYTE_HI_nocast(IOTA_D_T):
- if (LOC || !FOLD || !is_TRICKYFOLD_safe(p,RExC_end,UTF))
- goto normal_default;
case '^':
case '$':
case '.':
switch ((U8)*++p) {
/* These are all the special escapes. */
- case LATIN_SMALL_LETTER_SHARP_S:
- case UTF8_TWO_BYTE_HI_nocast(LATIN_SMALL_LETTER_SHARP_S):
- case UTF8_TWO_BYTE_HI_nocast(IOTA_D_T):
- if (LOC || !FOLD || !is_TRICKYFOLD_safe(p,RExC_end,UTF))
- goto normal_default;
case 'A': /* Start assertion */
case 'b': case 'B': /* Word-boundary assertion*/
case 'C': /* Single char !DANGEROUS! */
* save time by ruling-out some false alarms */
switch (ender) {
default:
- latest_char_state = 0;
+ latest_char_state = generic_char;
break;
case 's':
case 'S':
* here, set the state so know that the
* previous char was an 's' */
if (len != 0) {
- latest_char_state = 0;
+ latest_char_state = generic_char;
p = oldp;
goto loopdone;
}
/* Here, can't be an 'ss' sequence, or at least not
* one that could fold to/from the sharp ss */
- latest_char_state = 0;
+ latest_char_state = generic_char;
break;
case 0x03C5: /* First char in upsilon series */
if (p < RExC_end - 4) { /* Need >= 4 bytes left */
}
}
else {
- latest_char_state = 0;
+ latest_char_state = generic_char;
}
break;
case 0x03B9: /* First char in iota series */
}
}
else {
- latest_char_state = 0;
+ latest_char_state = generic_char;
}
break;
case 0x0308:
latest_char_state = iota_2;
}
else {
- latest_char_state = 0;
+ latest_char_state = generic_char;
}
break;
case 0x301:
ender = GREEK_SMALL_LETTER_IOTA_WITH_DIALYTIKA_AND_TONOS;
goto do_tricky;
}
- latest_char_state = 0;
+ latest_char_state = generic_char;
break;
/* These are the tricky fold characters. Flush any
*d = '\0';
RExC_end = (char *) d;
}
- else {
- tmpbuf[0] = ender;
+ else { /* ender above 255 already excluded */
+ tmpbuf[0] = (U8) ender;
tmpbuf[1] = '\0';
RExC_end = RExC_parse + 1;
}