Make a literal "{" fatal after \b and \B in regexes
authorKarl Williamson <public@khwilliamson.com>
Thu, 6 Feb 2014 05:06:02 +0000 (22:06 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 6 Feb 2014 05:17:56 +0000 (22:17 -0700)
These have been deprecated since v5.14.

dquote_static.c
pod/perldiag.pod
regcomp.c
t/re/reg_mesg.t

index 4eaa4b1..bb1bd4a 100644 (file)
@@ -63,6 +63,8 @@ S_grok_bslash_c(pTHX_ const char source, const bool output_warning)
     }
     else if (source == '{') {
         assert(isPRINT_A(toCTRL('{')));
+
+        /* diag_listed_as: Use "%s" instead of "%s" */
         Perl_croak(aTHX_ "Use \"%c\" instead of \"\\c{\"", toCTRL('{'));
     }
 
index d913fa6..29f1703 100644 (file)
@@ -6162,12 +6162,10 @@ you can write it as C<push(@tied_array,())> to avoid this warning.
 (F) The "use" keyword is recognized and executed at compile time, and
 returns no useful value.  See L<perlmod>.
 
-=item Use "%c" instead of "\c{"
+=item Use "%s" instead of "%s"
 
-(F) The C<\cI<X>> construct is intended to be a way to specify
-non-printable characters.  You used it with a C<"{"> which evaluates to
-C<";">, which is printable.  On ASCII platforms, just use a semi-colon
-or a backslash-semi-colon without the C<"\c">.
+(F) The second listed construct is no longer legal.  Use the first one
+instead.
 
 =item Use of assignment to $[ is deprecated
 
index 919035d..499a366 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11277,7 +11277,8 @@ tryagain:
            FLAGS(ret) = get_regex_charset(RExC_flags);
            *flagp |= SIMPLE;
            if (! SIZE_ONLY && (U8) *(RExC_parse + 1) == '{') {
-               ckWARNdep(RExC_parse, "\"\\b{\" is deprecated; use \"\\b\\{\" or \"\\b[{]\" instead");
+                /* diag_listed_as: Use "%s" instead of "%s" */
+               vFAIL("Use \"\\b\\{\" instead of \"\\b{\"");
            }
            goto finish_meta_pat;
        case 'B':
@@ -11291,7 +11292,8 @@ tryagain:
            FLAGS(ret) = get_regex_charset(RExC_flags);
            *flagp |= SIMPLE;
            if (! SIZE_ONLY && (U8) *(RExC_parse + 1) == '{') {
-               ckWARNdep(RExC_parse, "\"\\B{\" is deprecated; use \"\\B\\{\" or \"\\B[{]\" instead");
+                /* diag_listed_as: Use "%s" instead of "%s" */
+               vFAIL("Use \"\\B\\{\" instead of \"\\B{\"");
            }
            goto finish_meta_pat;
 
index bf4735f..55eda18 100644 (file)
@@ -119,6 +119,8 @@ my @death =
 '/(?lil:foo)/' => 'Regexp modifier "l" may not appear twice {#} m/(?lil{#}:foo)/',
 '/(?aaia:foo)/' => 'Regexp modifier "a" may appear a maximum of twice {#} m/(?aaia{#}:foo)/',
 '/(?i-l:foo)/' => 'Regexp modifier "l" may not appear after the "-" {#} m/(?i-l{#}:foo)/',
+'/a\b{cde/' => 'Use "\b\{" instead of "\b{" {#} m/a\{#}b{cde/',
+'/a\B{cde/' => 'Use "\B\{" instead of "\B{" {#} m/a\{#}B{cde/',
 
  '/((x)/' => 'Unmatched ( {#} m/({#}(x)/',
 
@@ -412,8 +414,6 @@ my @experimental_regex_sets = (
 );
 
 my @deprecated = (
-    '/a\b{cde/' => '"\b{" is deprecated; use "\b\{" or "\b[{]" instead {#} m/a\{#}b{cde/',
-    '/a\B{cde/' => '"\B{" is deprecated; use "\B\{" or "\B[{]" instead {#} m/a\{#}B{cde/',
     "/(?x)latin1\\\x{85}\x{85}\\\x{85}/" => 'Escape literal pattern white space under /x {#} ' . "m/(?x)latin1\\\x{85}\x{85}{#}\\\x{85}/",
     'use utf8; /(?x)utf8\\85\85\\85/' => 'Escape literal pattern white space under /x {#} ' . "m/(?x)utf8\\\N{NEXT LINE}\N{NEXT LINE}{#}\\\N{NEXT LINE}/",
     '/((?# This is a comment in the middle of a token)?:foo)/' => 'In \'(?...)\', splitting the initial \'(?\' is deprecated {#} m/((?# This is a comment in the middle of a token)?{#}:foo)/',