summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-03-06 13:10:12 -0700
committerKarl Williamson <khw@cpan.org>2022-03-19 12:49:28 -0600
commit737a7c2c21f154d6bef1c3665a841788a91f8660 (patch)
tree8b0a03176b29e230c8afb1ac23a8ef6d761e0c56
parentf3b9d183e48ac2bea3a55de469c56ca0e57884ce (diff)
downloadperl-737a7c2c21f154d6bef1c3665a841788a91f8660.tar.gz
Remove use of experimental regex sets warnings
These warnings are no longer generated; so simplify the core by not trying to turn them off. The warning is preserved so that other code need not change, but this commit also turns the default generation of it off.
-rw-r--r--lib/meta_notation.pm1
-rw-r--r--lib/perl5db.pl3
-rw-r--r--lib/warnings.pm2
-rw-r--r--pod/perldiag.pod12
-rw-r--r--pod/perlre.pod3
-rw-r--r--pod/perlrecharclass.pod6
-rw-r--r--pod/perlunicode.pod1
-rw-r--r--regen/warnings.pl2
-rw-r--r--t/lib/warnings/regcomp15
-rw-r--r--t/lib/warnings/regexec6
-rw-r--r--t/re/reg_email.t1
-rw-r--r--t/re/regex_sets.t17
-rw-r--r--t/re/regexp.t2
13 files changed, 22 insertions, 49 deletions
diff --git a/lib/meta_notation.pm b/lib/meta_notation.pm
index eea85875c9..e856bb950f 100644
--- a/lib/meta_notation.pm
+++ b/lib/meta_notation.pm
@@ -42,7 +42,6 @@ sub _meta_notation ($) {
$string =~ s/([\240-\377])/sprintf("M-%c" ,ord($1)&0177)/eg;
}
else {
- no warnings 'experimental::regex_sets';
# Leave alone things above \xff
$string =~ s/( (?[ [\x00-\xFF] & [:^print:]])) /
sprintf("\\x{%X}", ord($1))/xaeg;
diff --git a/lib/perl5db.pl b/lib/perl5db.pl
index 8ece5151cb..c4186ccd2e 100644
--- a/lib/perl5db.pl
+++ b/lib/perl5db.pl
@@ -532,7 +532,7 @@ BEGIN {
use vars qw($VERSION $header);
# bump to X.XX in blead, only use X.XX_XX in maint
-$VERSION = '1.70';
+$VERSION = '1.71';
$header = "perl5db.pl version $VERSION";
@@ -7614,7 +7614,6 @@ sub set_list {
for my $i ( 0 .. $#list ) {
$val = $list[$i];
$val =~ s/\\/\\\\/g;
- no warnings 'experimental::regex_sets';
$val =~ s/ ( (?[ [\000-\xFF] & [:^print:] ]) ) /
"\\0x" . unpack('H2',$1)/xaeg;
$ENV{"${stem}_$i"} = $val;
diff --git a/lib/warnings.pm b/lib/warnings.pm
index d81497fd5f..9068860e14 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -286,7 +286,7 @@ our %DeadBits = (
# 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\x00\x55\x51\x15\x54\x54\x55\x05"; # [2,4,22,23,25,52..56,58..62,65..67,69..77]
+our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x51\x51\x15\x54\x54\x55\x05"; # [2,4,22,23,25,52,54..56,58..62,65..67,69..77]
our $LAST_BIT = 158 ;
our $BYTES = 20 ;
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 9f5b74ec63..039630b869 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -6198,18 +6198,6 @@ according to the probings of Configure.
(S experimental::private_use) This feature is actually a hook for future
use.
-=item The regex_sets feature is experimental
-
-(S experimental::regex_sets) This warning is emitted if you
-use the syntax S<C<(?[ ])>> in a regular expression.
-The details of this feature are subject to change.
-If you want to use it, but know that in doing so you
-are taking the risk of using an experimental feature which may
-change in a future Perl version, you can do this to silence the
-warning:
-
- no warnings "experimental::regex_sets";
-
=item The stat preceding %s wasn't an lstat
(F) It makes no sense to test the current stat buffer for symbolic
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 29eafd4ef0..5661d3dc69 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -2403,8 +2403,7 @@ does not.
See L<perlrecharclass/Extended Bracketed Character Classes>.
-Note that this feature is currently L<experimental|perlpolicy/experimental>;
-using it yields a warning in the C<experimental::regex_sets> category.
+Note that this feature is currently L<experimental|perlpolicy/experimental>.
=back
diff --git a/pod/perlrecharclass.pod b/pod/perlrecharclass.pod
index a2df2dfbeb..12be24eed3 100644
--- a/pod/perlrecharclass.pod
+++ b/pod/perlrecharclass.pod
@@ -1036,11 +1036,7 @@ such as intersection. An example is
This will match all the digit characters that are in the Thai script.
-This is an experimental feature available starting in 5.18, and is
-subject to change as we gain field experience with it. Any attempt to
-use it will raise a warning, unless disabled via
-
- no warnings "experimental::regex_sets";
+This is an experimental feature available starting in 5.18.
Comments on this feature are welcome; send email to
C<perl5-porters@perl.org>.
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index 810f8ab0ea..e21ac9af66 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@@ -1124,7 +1124,6 @@ Nor is the C<@I<unicode_property>@> form implemented.
Here's a complete example of matching IPV4 internet protocol addresses
in any (single) script
- no warnings 'experimental::regex_sets';
no warnings 'experimental::uniprop_wildcards';
# Can match a substring, so this intermediate regex needs to have
diff --git a/regen/warnings.pl b/regen/warnings.pl
index d27e7453d8..8bbe124aa7 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -88,7 +88,7 @@ my $tree = {
'experimental::lexical_subs' =>
[ 5.017, DEFAULT_ON ],
'experimental::regex_sets' =>
- [ 5.017, DEFAULT_ON ],
+ [ 5.017, DEFAULT_OFF ],
'experimental::smartmatch' =>
[ 5.017, DEFAULT_ON ],
'experimental::postderef' =>
diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp
index 50b85fdd45..bef201e0a2 100644
--- a/t/lib/warnings/regcomp
+++ b/t/lib/warnings/regcomp
@@ -57,29 +57,26 @@ Unmatched [ in regex; marked by <-- HERE in m/abc[ <-- HERE fi[.00./ at - line
# NAME perl qr/(?[[[:word]]])/ XXX Why is 'syntax' lc?
# OPTION fatal
use warnings;
-no warnings 'experimental::regex_sets';
qr/(?[[[:word]]])/;
EXPECT
-Assuming NOT a POSIX class since there is no terminating ':' in regex; marked by <-- HERE in m/(?[[[:word <-- HERE ]]])/ at - line 4.
-Unexpected ']' with no following ')' in (?[... in regex; marked by <-- HERE in m/(?[[[:word]] <-- HERE ])/ at - line 4.
+Assuming NOT a POSIX class since there is no terminating ':' in regex; marked by <-- HERE in m/(?[[[:word <-- HERE ]]])/ at - line 3.
+Unexpected ']' with no following ')' in (?[... in regex; marked by <-- HERE in m/(?[[[:word]] <-- HERE ])/ at - line 3.
########
# NAME qr/(?[ [[:digit: ])/
# OPTION fatal
use warnings;
-no warnings 'experimental::regex_sets';
qr/(?[[[:digit: ])/;
EXPECT
-Assuming NOT a POSIX class since no blanks are allowed in one in regex; marked by <-- HERE in m/(?[[[:digit: ] <-- HERE )/ at - line 4.
-syntax error in (?[...]) in regex; marked by <-- HERE in m/(?[[[:digit: ]) <-- HERE / at - line 4.
+Assuming NOT a POSIX class since no blanks are allowed in one in regex; marked by <-- HERE in m/(?[[[:digit: ] <-- HERE )/ at - line 3.
+syntax error in (?[...]) in regex; marked by <-- HERE in m/(?[[[:digit: ]) <-- HERE / at - line 3.
########
# NAME qr/(?[ [:digit: ])/
# OPTION fatal
use warnings;
-no warnings 'experimental::regex_sets';
qr/(?[[:digit: ])/
EXPECT
-Assuming NOT a POSIX class since no blanks are allowed in one in regex; marked by <-- HERE in m/(?[[:digit: ] <-- HERE )/ at - line 4.
-syntax error in (?[...]) in regex; marked by <-- HERE in m/(?[[:digit: ]) <-- HERE / at - line 4.
+Assuming NOT a POSIX class since no blanks are allowed in one in regex; marked by <-- HERE in m/(?[[:digit: ] <-- HERE )/ at - line 3.
+syntax error in (?[...]) in regex; marked by <-- HERE in m/(?[[:digit: ]) <-- HERE / at - line 3.
########
# NAME [perl #126141]
# OPTION fatal
diff --git a/t/lib/warnings/regexec b/t/lib/warnings/regexec
index b9e53c9808..7d45f3b193 100644
--- a/t/lib/warnings/regexec
+++ b/t/lib/warnings/regexec
@@ -223,7 +223,6 @@ eval { require POSIX; POSIX->import("locale_h") };
if ($@) {
print("SKIPPED\n# no POSIX\n"),exit;
}
-no warnings 'experimental::regex_sets';
use warnings 'locale';
use locale;
setlocale(&POSIX::LC_CTYPE, "C");
@@ -233,14 +232,14 @@ setlocale(&POSIX::LC_CTYPE, "C");
":" =~ /(?[ \: ])/;
no warnings 'locale';
EXPECT
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12.
+Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 12.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 13.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 14.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15.
Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 15.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16.
-Use of (?[ ]) for non-UTF-8 locale is wrong. Assuming a UTF-8 locale at - line 16.
########
# NAME (?[ ]) in UTF-8 locale
require '../loc_tools.pl';
@@ -255,7 +254,6 @@ my $utf8_locale = find_utf8_ctype_locale();
unless ($utf8_locale) {
print("SKIPPED\n# No UTF-8 locale available\n"),exit;
}
-no warnings 'experimental::regex_sets';
use warnings 'locale';
use locale;
setlocale(&POSIX::LC_CTYPE, $utf8_locale);
diff --git a/t/re/reg_email.t b/t/re/reg_email.t
index 7a57b66d3f..65b086a081 100644
--- a/t/re/reg_email.t
+++ b/t/re/reg_email.t
@@ -10,7 +10,6 @@ BEGIN {
}
use strict;
-no warnings 'experimental::regex_sets';
my $email = qr {
(?(DEFINE)
diff --git a/t/re/regex_sets.t b/t/re/regex_sets.t
index 21d7a09a79..69800264e2 100644
--- a/t/re/regex_sets.t
+++ b/t/re/regex_sets.t
@@ -21,7 +21,6 @@ use warnings;
$| = 1;
use utf8;
-no warnings 'experimental::regex_sets';
like("a", qr/(?[ [a] # This is a comment
])/, 'Can ignore a comment');
@@ -173,13 +172,13 @@ for my $char ("٠", "٥", "٩") {
# RT #126481 !! with syntax error panics
{
- fresh_perl_like('no warnings "experimental::regex_sets"; qr/(?[ ! ! (\w])/',
+ fresh_perl_like('qr/(?[ ! ! (\w])/',
qr/^Unmatched \(/, {},
'qr/(?[ ! ! (\w])/ doesnt panic');
# The following didn't panic before, but easy to add this here with a
# paren between the !!
- fresh_perl_like('no warnings "experimental::regex_sets";qr/(?[ ! ( ! (\w)])/',
+ fresh_perl_like('qr/(?[ ! ( ! (\w)])/',
qr/^Unmatched \(/, {},
'qr/qr/(?[ ! ( ! (\w)])/');
}
@@ -205,19 +204,19 @@ for my $char ("٠", "٥", "٩") {
}
{ # [perl #132167]
- fresh_perl_is('no warnings "experimental::regex_sets";
- print "c" =~ qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ])/;',
+ fresh_perl_is(
+ 'print "c" =~ qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ])/;',
1, {},
'qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ]) compiles and properly matches');
- fresh_perl_is('no warnings "experimental::regex_sets";
- print "b" =~ qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ])/;',
+ fresh_perl_is(
+ 'print "b" =~ qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ])/;',
"", {},
'qr/(?[ ( \p{Uppercase} ) + (\p{Lowercase} - ([a] + [b])) ]) compiles and properly matches');
}
{ # [perl #133889] Caused assertion failure
- fresh_perl_like('no warnings "experimental::regex_sets";
- qr/(?[\P{Is0}])/', qr/\QUnknown user-defined property name "Is0"/, {}, "[perl #133889]");
+ fresh_perl_like(
+ 'qr/(?[\P{Is0}])/', qr/\QUnknown user-defined property name "Is0"/, {}, "[perl #133889]");
}
{
diff --git a/t/re/regexp.t b/t/re/regexp.t
index fee1a48c88..03a7178157 100644
--- a/t/re/regexp.t
+++ b/t/re/regexp.t
@@ -474,7 +474,7 @@ EOFCODE
\$got = "$repl";
EOFCODE
}
- $code = "no warnings 'experimental::regex_sets';$code" if $regex_sets;
+ $code = "$code" if $regex_sets;
#$code.=qq[\n\$expect="$expect";\n];
#use Devel::Peek;
#die Dump($code) if $pat=~/\\h/ and $subject=~/\x{A0}/;