summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-03-08 09:08:20 +0100
committerYves Orton <demerphq@gmail.com>2023-03-18 21:00:54 +0800
commit71e49ade7b75dfc7d9e1cd013ddd9558a739e722 (patch)
tree28996cfdfd159bca95fa602d819c963c3cf2ea1c
parent25676a74796a9afdbb6efe609bbfc7e223921fae (diff)
downloadperl-71e49ade7b75dfc7d9e1cd013ddd9558a739e722.tar.gz
warnings.pm - add deprecated::delimiter_will_be_paired category
Some delimiters are considered deprecated because in the future they will be used as part of a paired delimiter. This adds a new category for these cases.
-rw-r--r--lib/warnings.pm37
-rw-r--r--pod/perldiag.pod13
-rw-r--r--regen/warnings.pl1
-rw-r--r--toke.c2
-rw-r--r--warnings.h11
5 files changed, 39 insertions, 25 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm
index e91a820364..5ca9a087d8 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -116,14 +116,17 @@ our %Offsets = (
'experimental::for_list' => 144,
'scalar' => 146,
+ # Warnings Categories added in Perl 5.03501
+ 'deprecated::delimiter_will_be_paired'=> 148,
+
# Warnings Categories added in Perl 5.037
- 'experimental::class' => 148,
+ 'experimental::class' => 150,
# Warnings Categories added in Perl 5.037009
- 'deprecated::apostrophe_as_package_separator'=> 150,
+ 'deprecated::apostrophe_as_package_separator'=> 152,
# Warnings Categories added in Perl 5.03701
- 'deprecated::smartmatch' => 152,
+ 'deprecated::smartmatch' => 154,
);
our %Bits = (
@@ -133,18 +136,19 @@ our %Bits = (
'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
- 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x10\x00\x00\x40\x01", # [2,48,62,75,76]
- 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [75]
+ 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x10\x00\x00\x10\x05", # [2,48,62,74,76,77]
+ 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [76]
+ 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [74]
'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [62]
- 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [76]
+ 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [77]
'deprecated::unicode_property_name' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [48]
'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x05\x04\x55\x55\x11\x00", # [52,53,55..57,61,64..72,74]
+ 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x45\x05\x04\x55\x55\x41\x00", # [52,53,55..57,61,64..72,75]
'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [68]
'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [69]
- 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [74]
+ 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [75]
'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [55]
'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [61]
'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [70]
@@ -213,18 +217,19 @@ our %DeadBits = (
'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
- 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x20\x00\x00\x80\x02", # [2,48,62,75,76]
- 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [75]
+ 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x20\x00\x00\x20\x0a", # [2,48,62,74,76,77]
+ 'deprecated::apostrophe_as_package_separator'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [76]
+ 'deprecated::delimiter_will_be_paired'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [74]
'deprecated::dot_in_inc' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [62]
- 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [76]
+ 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [77]
'deprecated::unicode_property_name' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [48]
'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
- 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x0a\x08\xaa\xaa\x22\x00", # [52,53,55..57,61,64..72,74]
+ 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8a\x0a\x08\xaa\xaa\x82\x00", # [52,53,55..57,61,64..72,75]
'experimental::args_array_with_signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [68]
'experimental::builtin' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [69]
- 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [74]
+ 'experimental::class' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [75]
'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [55]
'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [61]
'experimental::defer' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [70]
@@ -299,8 +304,8 @@ our %NoOp = (
# These are used by various things, including our own tests
our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x15\x14\x55\x55\x51\x01"; # [2,4,22,23,25,48,55..58,61,62,64..72,74..76]
-our $LAST_BIT = 154 ;
+our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x01\x40\x15\x14\x55\x55\x51\x05"; # [2,4,22,23,25,48,55..58,61,62,64..72,74..77]
+our $LAST_BIT = 156 ;
our $BYTES = 20 ;
sub Croaker
@@ -905,6 +910,8 @@ The current hierarchy is:
| |
| +- deprecated::apostrophe_as_package_separator
| |
+ | +- deprecated::delimiter_will_be_paired
+ | |
| +- deprecated::dot_in_inc
| |
| +- deprecated::smartmatch
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 760d45548a..1734a2e7b4 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -7618,12 +7618,13 @@ only C. This usually means there's a better way to do it in Perl.
=item Use of '%s' is deprecated as a string delimiter
-(D deprecated) You used the given character as a starting delimiter of a
-string outside the scope of S<C<use feature 'extra_paired_delimiters'>>.
-This character is the mirror image of another Unicode character; within
-the scope of that feature, the two are considered a pair for delimitting
-strings. It is planned to make that feature the default, at which point
-this usage would become illegal; hence this warning.
+(D deprecated::delimiter_will_be_paired) You used the given character as
+a starting delimiter of a string outside the scope of
+S<C<use feature 'extra_paired_delimiters'>>. This character is the
+mirror image of another Unicode character; within the scope of that
+feature, the two are considered a pair for delimitting strings. It is
+planned to make that feature the default, at which point this usage
+would become illegal; hence this warning.
For now, you may live with this warning, or turn it off, but this code
will no longer compile in a future version of Perl. Or you can turn on
diff --git a/regen/warnings.pl b/regen/warnings.pl
index 4e2507c556..45cf34ec66 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -79,6 +79,7 @@ my $TREE = {
'deprecated::dot_in_inc' => [ 5.025011, DEFAULT_ON],
'deprecated::unicode_property_name' => [ 5.011003, DEFAULT_ON],
'deprecated::apostrophe_as_package_separator' => [ 5.037009, DEFAULT_ON],
+ 'deprecated::delimiter_will_be_paired' => [ 5.035010, DEFAULT_ON],
}],
'void' => [ 5.008, DEFAULT_OFF],
'recursion' => [ 5.008, DEFAULT_OFF],
diff --git a/toke.c b/toke.c
index 33f595992c..4fc99e8849 100644
--- a/toke.c
+++ b/toke.c
@@ -11653,7 +11653,7 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
if (ninstr(deprecated_opening_delims, deprecated_delims_end,
open_delim_str, open_delim_str + delim_byte_len))
{
- Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED),
"Use of '%" UTF8f "' is deprecated as a string delimiter",
UTF8fARG(UTF, delim_byte_len, open_delim_str));
}
diff --git a/warnings.h b/warnings.h
index 8ce75b1fe3..39639d82f1 100644
--- a/warnings.h
+++ b/warnings.h
@@ -139,17 +139,21 @@
#define WARN_EXPERIMENTAL__FOR_LIST 72
#define WARN_SCALAR 73
+/* Warnings Categories added in Perl 5.03501 */
+
+#define WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED 74
+
/* Warnings Categories added in Perl 5.037 */
-#define WARN_EXPERIMENTAL__CLASS 74
+#define WARN_EXPERIMENTAL__CLASS 75
/* Warnings Categories added in Perl 5.037009 */
-#define WARN_DEPRECATED__APOSTROPHE_AS_PACKAGE_SEPARATOR 75
+#define WARN_DEPRECATED__APOSTROPHE_AS_PACKAGE_SEPARATOR 76
/* Warnings Categories added in Perl 5.03701 */
-#define WARN_DEPRECATED__SMARTMATCH 76
+#define WARN_DEPRECATED__SMARTMATCH 77
#define WARNsize 20
#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125"
#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
@@ -338,6 +342,7 @@ category parameters passed.
=for apidoc Amnh||WARN_EXPERIMENTAL__EXTRA_PAIRED_DELIMITERS
=for apidoc Amnh||WARN_EXPERIMENTAL__FOR_LIST
=for apidoc Amnh||WARN_SCALAR
+=for apidoc Amnh||WARN_DEPRECATED__DELIMITER_WILL_BE_PAIRED
=for apidoc Amnh||WARN_EXPERIMENTAL__CLASS
=for apidoc Amnh||WARN_DEPRECATED__APOSTROPHE_AS_PACKAGE_SEPARATOR
=for apidoc Amnh||WARN_DEPRECATED__SMARTMATCH