This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Note the Devel::Peek upgrade in perldelta
[perl5.git] / regcomp.c
index 1a2d2b2..560696e 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -7680,9 +7680,6 @@ S_reg_namedseq(pTHX_ RExC_state_t *pRExC_state, UV *valuep, I32 *flagp, U32 dept
 {
     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;
@@ -8006,27 +8003,6 @@ tryagain:
        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
 
@@ -8041,10 +8017,6 @@ tryagain:
           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++;
@@ -8465,7 +8437,6 @@ tryagain:
        /* FALL THROUGH */
 
     default:
-        outer_default:
 
             parse_start = RExC_parse - 1;
 
@@ -8473,13 +8444,14 @@ tryagain:
 
        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;
@@ -8512,11 +8484,6 @@ tryagain:
                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 '.':
@@ -8541,11 +8508,6 @@ tryagain:
 
                    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! */
@@ -8745,7 +8707,7 @@ tryagain:
                     * 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':
@@ -8791,7 +8753,7 @@ tryagain:
                                         * 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;
                                        }
@@ -8803,7 +8765,7 @@ tryagain:
 
                            /* 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 */
@@ -8814,7 +8776,7 @@ tryagain:
                                }
                            }
                            else {
-                               latest_char_state = 0;
+                               latest_char_state = generic_char;
                            }
                            break;
                        case 0x03B9:    /* First char in iota series */
@@ -8826,7 +8788,7 @@ tryagain:
                                }
                            }
                            else {
-                               latest_char_state = 0;
+                               latest_char_state = generic_char;
                            }
                            break;
                        case 0x0308:
@@ -8837,7 +8799,7 @@ tryagain:
                                latest_char_state = iota_2;
                            }
                            else {
-                               latest_char_state = 0;
+                               latest_char_state = generic_char;
                            }
                            break;
                        case 0x301:
@@ -8849,7 +8811,7 @@ tryagain:
                                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
@@ -8887,8 +8849,8 @@ tryagain:
                                *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;
                            }