This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Reorder two switch cases
authorKarl Williamson <khw@cpan.org>
Thu, 31 Jul 2014 22:46:14 +0000 (16:46 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 22 Jan 2015 05:47:29 +0000 (22:47 -0700)
This is in preparation for combining them into common code.  No other
changes are made, except for an additional blank line.

regcomp.c

index c325e9e..f38ed9c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11781,38 +11781,39 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
             arg = ANYOF_WORDCHAR;
             goto join_posix;
 
-       case 'b':
+       case 'B':
            RExC_seen_zerolen++;
             RExC_seen |= REG_LOOKBEHIND_SEEN;
-           op = BOUND + get_regex_charset(RExC_flags);
-            if (op > BOUNDA) {  /* /aa is same as /a */
-                op = BOUNDA;
+           op = NBOUND + get_regex_charset(RExC_flags);
+            if (op > NBOUNDA) { /* /aa is same as /a */
+                op = NBOUNDA;
             }
-            else if (op == BOUNDL) {
+            else if (op == NBOUNDL) {
                 RExC_contains_locale = 1;
             }
            ret = reg_node(pRExC_state, op);
            *flagp |= SIMPLE;
            if ((U8) *(RExC_parse + 1) == '{') {
                 /* diag_listed_as: Use "%s" instead of "%s" */
-               vFAIL("Use \"\\b\\{\" instead of \"\\b{\"");
+               vFAIL("Use \"\\B\\{\" instead of \"\\B{\"");
            }
            goto finish_meta_pat;
-       case 'B':
+
+       case 'b':
            RExC_seen_zerolen++;
             RExC_seen |= REG_LOOKBEHIND_SEEN;
-           op = NBOUND + get_regex_charset(RExC_flags);
-            if (op > NBOUNDA) { /* /aa is same as /a */
-                op = NBOUNDA;
+           op = BOUND + get_regex_charset(RExC_flags);
+            if (op > BOUNDA) {  /* /aa is same as /a */
+                op = BOUNDA;
             }
-            else if (op == NBOUNDL) {
+            else if (op == BOUNDL) {
                 RExC_contains_locale = 1;
             }
            ret = reg_node(pRExC_state, op);
            *flagp |= SIMPLE;
            if ((U8) *(RExC_parse + 1) == '{') {
                 /* diag_listed_as: Use "%s" instead of "%s" */
-               vFAIL("Use \"\\B\\{\" instead of \"\\B{\"");
+               vFAIL("Use \"\\b\\{\" instead of \"\\b{\"");
            }
            goto finish_meta_pat;