This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Swap 'else' clauses.
authorKarl Williamson <khw@cpan.org>
Sat, 9 Aug 2014 23:47:02 +0000 (17:47 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 21 Aug 2014 20:49:46 +0000 (14:49 -0600)
It's easier to comprehend a tiny else clause followed by a large one and
vice-versa.  This is in preparation for further changes in future
commits.

regcomp.c

index 3f11d71..2a0350c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13484,7 +13484,13 @@ parseit:
         {
             namedclass = regpposixcc(pRExC_state, value, strict);
         }
-        else if (value == '\\') {
+        else if (value != '\\') {
+#ifdef EBCDIC
+            literal_endpoint++;
+#endif
+        }
+        else {
+            /* Is a backslash; get the code point of the char after it */
            if (UTF) {
                value = utf8n_to_uvchr((U8*)RExC_parse,
                                   RExC_end - RExC_parse,
@@ -13815,10 +13821,6 @@ parseit:
                break;
            }   /* End of switch on char following backslash */
        } /* end of handling backslash escape sequences */
-#ifdef EBCDIC
-        else
-            literal_endpoint++;
-#endif
 
         /* Here, we have the current token in 'value' */