In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/61fa1f010887f7318c062b65afdd45fb6f30d5a5?hp=14b9bbbc5b192cd6b85fd4ab2aff99bb6471fb0c>
- Log ----------------------------------------------------------------- commit 61fa1f010887f7318c062b65afdd45fb6f30d5a5 Merge: 14b9bbbc5b d4360efa03 Author: Sawyer X <[email protected]> Date: Sun Feb 12 12:52:12 2017 +0200 Merge branch 'sawyerx/undeprecate-backslash-c' into blead commit d4360efa03060f769618abf1b433a49d3dab9774 Author: Sawyer X <[email protected]> Date: Wed Feb 8 14:00:37 2017 +0100 Revert "Deprecating the use of C<< \cI<X> >> to specify a printable character." This reverts commit bfdc8cd3d5a81ab176f7d530d2e692897463c97d. M dquote.c M pod/perldeprecation.pod M pod/perldiag.pod M regcomp.c M t/lib/warnings/regcomp M t/lib/warnings/toke M t/re/reg_mesg.t commit 583bfb0c6976d1378e7acc1e4ff3b9c014d163da Author: Sawyer X <[email protected]> Date: Wed Feb 8 13:34:31 2017 +0100 Revert "Avoid triggering a deprecation warnings." This reverts commit 5ad2a0b67cdf1d90b67b991ae8708d3b9d57bad9. We have decided to undeprecate \c. Please see: http://www.nntp.perl.org/group/perl.perl5.porters/2017/01/msg242693.html M t/re/regex_sets.t ----------------------------------------------------------------------- Summary of changes: dquote.c | 8 ++++---- pod/perldeprecation.pod | 19 ------------------- pod/perldiag.pod | 22 ++++++++++------------ regcomp.c | 21 ++++++--------------- t/lib/warnings/regcomp | 6 +++--- t/lib/warnings/toke | 6 +++--- t/re/reg_mesg.t | 16 ++++++++-------- t/re/regex_sets.t | 8 +------- 8 files changed, 35 insertions(+), 71 deletions(-) diff --git a/dquote.c b/dquote.c index ef030468c0..e02308e7ac 100644 --- a/dquote.c +++ b/dquote.c @@ -46,10 +46,10 @@ Perl_grok_bslash_c(pTHX_ const char source, const bool output_warning) clearer[i++] = result; clearer[i++] = '\0'; - Perl_ck_warner_d(aTHX_ packWARN2(WARN_SYNTAX,WARN_DEPRECATED), - "\"\\c%c\" is more clearly written simply as \"%s\". " - "This will be a fatal error in Perl 5.28", - source, clearer); + Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX), + "\"\\c%c\" is more clearly written simply as \"%s\"", + source, + clearer); } return result; diff --git a/pod/perldeprecation.pod b/pod/perldeprecation.pod index 0a135044d3..1401bfbecd 100644 --- a/pod/perldeprecation.pod +++ b/pod/perldeprecation.pod @@ -340,25 +340,6 @@ C<use AutoLoader 'AUTOLOAD';>. This feature was deprecated in Perl 5.004, and will be fatal in Perl 5.28. -=head3 Use of C<< \cI<X> >> to specify a printable character. - -In a double quoted context, Perl has the C<< \c >> construct to write -control characters in a readable way. For instance, the tab character -can be written as C<< \cI >> (I<< control-I >>), and the escape -character can be written as C<< \c[ >>. - -Due to implementation details, the C<< \c >> construct can be used -to create regular, printable, characters as well. For instance, -C<< \c >> maps a C<< , >> to C<< l >>; that is C<< \c, >> is an -obscure way of writing C<< l >>. And not only that, it's also not -portable between ASCII and EBCDIC platforms. - -Using the C<< \c >> construct with an argument which maps to a -printable character was deprecated in Perl 5.14, and will be a fatal -error in Perl 5.28. You're recommended to just write the intended -character instead. - - =head3 Use of code points over 0xFF in string bitwise operators The string bitwise operators, C<&>, C<|>, C<^>, and C<~>, treat diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 0ac367b8a2..c2408f047d 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1546,7 +1546,7 @@ Perhaps you need to copy the value to a temporary, and repeat that. Note that ASCII characters that don't map to control characters are discouraged, and will generate the warning (when enabled) -L</""\c%c" is more clearly written simply as "%s". This will be a fatal error in Perl 5.28">. +L</""\c%c" is more clearly written simply as "%s"">. =item Character following \%c must be '{' or a single-character Unicode property name in regex; marked by <-- HERE in m/%s/ @@ -1653,15 +1653,13 @@ See L<charnames/CUSTOM ALIASES>. (W unopened) You tried chdir() on a filehandle that was never opened. -=item "\c%c" is more clearly written simply as "%s". This will be a fatal error in Perl 5.28 +=item "\c%c" is more clearly written simply as "%s" -(D deprecated, syntax) The C<\cI<X>> construct is intended to be a -way to specify non-printable characters. You used it for a printable -one, which is better written as simply itself, perhaps preceded by -a backslash for non-word characters. Doing it the way you did is -not portable between ASCII and EBCDIC platforms. - -This usage is going to result in a fatal error in Perl 5.28. +(W syntax) The C<\cI<X>> construct is intended to be a way to specify +non-printable characters. You used it for a printable one, which +is better written as simply itself, perhaps preceded by a backslash +for non-word characters. Doing it the way you did is not portable +between ASCII and EBCDIC platforms. =item Cloning substitution context is unimplemented @@ -3140,13 +3138,13 @@ code. In Perl 5.30, it will no longer be possible to use sysread(), recv(), syswrite() or send() to read or send bytes from/to :utf8 handles. -=item "%s" is more clearly written simply as "%s" in regex. This will be a fatal error in Perl 5.28; marked by S<<-- HERE> in m/%s/ +=item "%s" is more clearly written simply as "%s" in regex; marked by S<<-- HERE> in m/%s/ -(W deprecated, regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>) +(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>) You specified a character that has the given plainer way of writing it, and which is also portable to platforms running with different character -sets. This usage is deprecated, and will be a fatal error in Perl 5.28. +sets. =item $* is no longer supported. Its use will be fatal in Perl 5.30 diff --git a/regcomp.c b/regcomp.c index f199e1215f..ec7fa3bb94 100644 --- a/regcomp.c +++ b/regcomp.c @@ -818,13 +818,6 @@ static const scan_data_t zero_scan_data = REPORT_LOCATION_ARGS(loc)); \ } STMT_END -#define vWARN4dep(loc, m, a1, a2, a3) STMT_START { \ - __ASSERT_(PASS2) Perl_warner(aTHX_ packWARN2(WARN_REGEXP,WARN_DEPRECATED), \ - m REPORT_LOCATION, \ - a1, a2, a3, \ - REPORT_LOCATION_ARGS(loc)); \ -} STMT_END - #define ckWARN4reg(loc, m, a1, a2, a3) STMT_START { \ __ASSERT_(PASS2) Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP), \ m REPORT_LOCATION, \ @@ -16933,22 +16926,20 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, literal[d++] = (char) value; literal[d++] = '\0'; - vWARN4dep(RExC_parse, - "\"%.*s\" is more clearly written simply as \"%s\". " - "This will be a fatal error in Perl 5.28", + vWARN4(RExC_parse, + "\"%.*s\" is more clearly written simply as \"%s\"", (int) (RExC_parse - rangebegin), rangebegin, literal - ); + ); } else if isMNEMONIC_CNTRL(value) { - vWARN4dep(RExC_parse, - "\"%.*s\" is more clearly written simply as \"%s\". " - "This will be a fatal error in Perl 5.28", + vWARN4(RExC_parse, + "\"%.*s\" is more clearly written simply as \"%s\"", (int) (RExC_parse - rangebegin), rangebegin, cntrl_to_mnemonic((U8) value) - ); + ); } } } diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp index 44ef5c3e4e..2b084c59b0 100644 --- a/t/lib/warnings/regcomp +++ b/t/lib/warnings/regcomp @@ -31,12 +31,12 @@ BEGIN { use warnings; $a = qr/\c,/; $a = qr/[\c,]/; -no warnings 'syntax', 'deprecated'; +no warnings 'syntax'; $a = qr/\c,/; $a = qr/[\c,]/; EXPECT -"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 9. -"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 10. +"\c," is more clearly written simply as "l" at - line 9. +"\c," is more clearly written simply as "l" at - line 10. ######## # This is because currently a different error is output under # use re 'strict', so can't go in reg_mesg.t diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index c97abafecd..fc51d9f09f 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -1385,12 +1385,12 @@ BEGIN { use warnings; $a = "\c,"; $a = "\c`"; -no warnings 'syntax', 'deprecated'; +no warnings 'syntax'; $a = "\c,"; $a = "\c`"; EXPECT -"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 9. -"\c`" is more clearly written simply as "\ ". This will be a fatal error in Perl 5.28 at - line 10. +"\c," is more clearly written simply as "l" at - line 9. +"\c`" is more clearly written simply as "\ " at - line 10. ######## # toke.c BEGIN { diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t index 22711d5f62..597df92d5b 100644 --- a/t/re/reg_mesg.t +++ b/t/re/reg_mesg.t @@ -532,10 +532,10 @@ my @warning = ( ], '/a{1,1}?\x{100}/' => 'Useless use of greediness modifier \'?\' {#} m/a{1,1}?{#}\x{100}/', "/(?[ [ % - % ] ])/" => "", - "/(?[ [ : - \\x$colon_hex ] ])\\x{100}/" => "\": - \\x$colon_hex \" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ : - \\x$colon_hex {#}] ])\\x{100}/ ... [2 chars truncated] - "/(?[ [ \\x$colon_hex - : ] ])\\x{100}/" => "\"\\x$colon_hex\ - : \" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\x$colon_hex - : {#}] ])\\x{100} ... [3 chars truncated] - "/(?[ [ \\t - \\x$tab_hex ] ])\\x{100}/" => "\"\\t - \\x$tab_hex \" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\t - \\x$tab_hex {#}] ])\\x{100 ... [4 chars truncated] - "/(?[ [ \\x$tab_hex - \\t ] ])\\x{100}/" => "\"\\x$tab_hex\ - \\t \" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\x$tab_hex - \\t {#}] ])\\x{10 ... [5 chars truncated] + "/(?[ [ : - \\x$colon_hex ] ])\\x{100}/" => "\": - \\x$colon_hex \" is more clearly written simply as \":\" {#} m/(?[ [ : - \\x$colon_hex {#}] ])\\x{100}/", + "/(?[ [ \\x$colon_hex - : ] ])\\x{100}/" => "\"\\x$colon_hex\ - : \" is more clearly written simply as \":\" {#} m/(?[ [ \\x$colon_hex - : {#}] ])\\x{100}/", + "/(?[ [ \\t - \\x$tab_hex ] ])\\x{100}/" => "\"\\t - \\x$tab_hex \" is more clearly written simply as \"\\t\" {#} m/(?[ [ \\t - \\x$tab_hex {#}] ])\\x{100}/", + "/(?[ [ \\x$tab_hex - \\t ] ])\\x{100}/" => "\"\\x$tab_hex\ - \\t \" is more clearly written simply as \"\\t\" {#} m/(?[ [ \\x$tab_hex - \\t {#}] ])\\x{100}/", "/(?[ [ $B_hex - C ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ $B_hex - C {#}] ])/", "/(?[ [ A - $B_hex ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ A - $B_hex {#}] ])/", "/(?[ [ $low_mixed_alpha - $high_mixed_alpha ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ $low_mixed_alpha - $high_mixed_alpha {#}] ])/" ... [1 chars truncated] @@ -611,10 +611,10 @@ my @warning_only_under_strict = ( '/[\N{U+FF}-\x{100}]/' => 'Both or neither range ends should be Unicode {#} m/[\N{U+FF}-\x{100}{#}]/', '/[\N{U+100}-\x{101}]/' => "", "/[%-%]/" => "", - "/[:-\\x$colon_hex]\\x{100}/" => "\":-\\x$colon_hex\" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/[:-\\x$colon_hex\{#}]\\x{100}/", - "/[\\x$colon_hex-:]\\x{100}/" => "\"\\x$colon_hex-:\" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/[\\x$colon_hex\-:{#}]\\x{100}/", - "/[\\t-\\x$tab_hex]\\x{100}/" => "\"\\t-\\x$tab_hex\" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/[\\t-\\x$tab_hex\{#}]\\x{100}/", - "/[\\x$tab_hex-\\t]\\x{100}/" => "\"\\x$tab_hex-\\t\" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/[\\x$tab_hex\-\\t{#}]\\x{100}/", + "/[:-\\x$colon_hex]\\x{100}/" => "\":-\\x$colon_hex\" is more clearly written simply as \":\" {#} m/[:-\\x$colon_hex\{#}]\\x{100}/", + "/[\\x$colon_hex-:]\\x{100}/" => "\"\\x$colon_hex-:\" is more clearly written simply as \":\" {#} m/[\\x$colon_hex\-:{#}]\\x{100}/", + "/[\\t-\\x$tab_hex]\\x{100}/" => "\"\\t-\\x$tab_hex\" is more clearly written simply as \"\\t\" {#} m/[\\t-\\x$tab_hex\{#}]\\x{100}/", + "/[\\x$tab_hex-\\t]\\x{100}/" => "\"\\x$tab_hex-\\t\" is more clearly written simply as \"\\t\" {#} m/[\\x$tab_hex\-\\t{#}]\\x{100}/", "/[$B_hex-C]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[$B_hex-C{#}]/", "/[A-$B_hex]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[A-$B_hex\{#}]/", "/[$low_mixed_alpha-$high_mixed_alpha]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[$low_mixed_alpha-$high_mixed_alpha\{#}]/", diff --git a/t/re/regex_sets.t b/t/re/regex_sets.t index 994d0a28c8..6a79f9d692 100644 --- a/t/re/regex_sets.t +++ b/t/re/regex_sets.t @@ -165,13 +165,7 @@ for my $char ("Ù ", "Ù¥", "Ù©") { like($@, qr/^Syntax error/, '/(?[(\c]) ]\b/ should be a syntax error'); eval { $_ = '(?[\c[]](])'; qr/$_/ }; like($@, qr/^Syntax error/, '/(?[\c[]](])/ should be a syntax error'); - { - # This block needs to go after 5.26, as it will be - # fatal in 5.28. But it's not fatal yet, so we ought - # to test it. - no warnings 'deprecated'; - like("\c#", qr/(?[\c#])/, '\c# should match itself'); - } + like("\c#", qr/(?[\c#])/, '\c# should match itself'); like("\c[", qr/(?[\c[])/, '\c[ should match itself'); like("\c\ ", qr/(?[\c\])/, '\c\ should match itself'); like("\c]", qr/(?[\c]])/, '\c] should match itself'); -- Perl5 Master Repository
