Change 30083 by [EMAIL PROTECTED] on 2007/01/31 09:51:48

        Subject: [PATCH] regcomp.c: remove some gotos that cause compiler 
consternation.
        From: demerphq <[EMAIL PROTECTED]>
        Date: Wed, 31 Jan 2007 10:28:34 +0100

Affected files ...

... //depot/perl/regcomp.c#548 edit

Differences ...

==== //depot/perl/regcomp.c#548 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#547~30082~   2007-01-30 23:49:12.000000000 -0800
+++ perl/regcomp.c      2007-01-31 01:51:48.000000000 -0800
@@ -5075,8 +5075,10 @@
                     nextchar(pRExC_state);
                     return ret;
                 }
-                goto unknown;
-           case '<':           /* (?<...) */
+                RExC_parse++;
+               vFAIL3("Sequence (%.*s...) not recognized", 
RExC_parse-seqstart, seqstart);
+               /*NOTREACHED*/
+            case '<':           /* (?<...) */
                if (*RExC_parse == '!')
                    paren = ',';
                else if (*RExC_parse != '=') 
@@ -5091,8 +5093,11 @@
                        SIZE_ONLY ?  /* reverse test from the others */
                        REG_RSN_RETURN_NAME : 
                        REG_RSN_RETURN_NULL);
-                   if (RExC_parse == name_start)
-                       goto unknown;
+                   if (RExC_parse == name_start) {
+                       RExC_parse++;
+                       vFAIL3("Sequence (%.*s...) not recognized", 
RExC_parse-seqstart, seqstart);
+                       /*NOTREACHED*/
+                    }
                    if (*RExC_parse != paren)
                        vFAIL2("Sequence (?%c... not terminated",
                            paren=='>' ? '<' : paren);
@@ -5261,8 +5266,11 @@
                /* FALL THROUGH*/
            case '?':           /* (??...) */
                is_logical = 1;
-               if (*RExC_parse != '{')
-                   goto unknown;
+               if (*RExC_parse != '{') {
+                   RExC_parse++;
+                   vFAIL3("Sequence (%.*s...) not recognized", 
RExC_parse-seqstart, seqstart);
+                   /*NOTREACHED*/
+               }
                paren = *RExC_parse++;
                /* FALL THROUGH */
            case '{':           /* (?{...}) */
@@ -5508,8 +5516,11 @@
                         }
                        break;
                     case '-':
-                        if (flagsp == &negflags)
-                            goto unknown;
+                        if (flagsp == &negflags) {
+                            RExC_parse++;
+                           vFAIL3("Sequence (%.*s...) not recognized", 
RExC_parse-seqstart, seqstart);
+                           /*NOTREACHED*/
+                       }
                        flagsp = &negflags;
                        wastedflags = 0;  /* reset so (?g-c) warns twice */
                        break;
@@ -5529,7 +5540,6 @@
                        }
                        /*NOTREACHED*/
                     default:
-                    unknown:
                        RExC_parse++;
                        vFAIL3("Sequence (%.*s...) not recognized", 
RExC_parse-seqstart, seqstart);
                        /*NOTREACHED*/
End of Patch.

Reply via email to