This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Reorder two switch cases
[perl5.git] / 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;