This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH: [gh #17185] Improper 'unescaped lbrace' msg
authorKarl Williamson <khw@cpan.org>
Tue, 12 Nov 2019 04:48:46 +0000 (21:48 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 12 Nov 2019 05:02:45 +0000 (22:02 -0700)
This warning is simply deleted.  The possible places where an unescaped
left brace is illegal has been scaled back to avoid breaking more
existing code, and this context will remain legal.

regcomp.c
t/re/reg_mesg.t

index 06d0c17..076ea35 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11938,16 +11938,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
                 goto parse_rest;
             } /* end switch */
        }
-       else {
-            if (*RExC_parse == '{') {
-                ckWARNregdep(RExC_parse + 1,
-                            "Unescaped left brace in regex is "
-                            "deprecated here (and will be fatal "
-                            "in Perl 5.32), passed through");
-            }
-            /* Not bothering to indent here, as the above 'else' is temporary
-             * */
-        if (!(RExC_flags & RXf_PMf_NOCAPTURE)) {   /* (...) */
+        else if (!(RExC_flags & RXf_PMf_NOCAPTURE)) {   /* (...) */
          capturing_parens:
            parno = RExC_npar;
            RExC_npar++;
@@ -12014,7 +12005,6 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp, U32 depth)
             /* with RXf_PMf_NOCAPTURE treat (...) as (?:...) */
             paren = ':';
            ret = 0;
-       }
         }
     }
     else                        /* ! paren */
index 6136f6a..aa7e455 100644 (file)
@@ -701,7 +701,6 @@ my @deprecated = (
  '/^{/'          => "",
  '/foo|{/'       => "",
  '/foo|^{/'      => "",
- '/foo({bar)/'   => 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through {#} m/foo({{#}bar)/',
  '/foo(:?{bar)/' => "",
  '/\s*{/'        => "",
  '/a{3,4}{/'     => "",