Skip to content

Commit

Permalink
switch removal: remove the feature from feature.pm
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed Jul 18, 2024
1 parent fb7c6d7 commit 93961e2
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 83 deletions.
26 changes: 3 additions & 23 deletions feature.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/B/Deparse.t
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ say 'foo';
use feature ':5.10';
say 'foo';
>>>>
use feature 'say', 'state', 'switch';
use feature 'say', 'state';
say 'foo';
####
# SKIP ?$] < 5.010 && "say not implemented on this Perl version"
Expand Down Expand Up @@ -1010,7 +1010,7 @@ __SUB__;
use feature ':5.15';
__SUB__;
>>>>
use feature 'current_sub', 'evalbytes', 'fc', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval';
use feature 'current_sub', 'evalbytes', 'fc', 'say', 'state', 'unicode_strings', 'unicode_eval';
__SUB__;
####
# SKIP ?$] < 5.015 && "__SUB__ not implemented on this Perl version"
Expand Down
61 changes: 23 additions & 38 deletions lib/feature.pm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 6 additions & 19 deletions regen/feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ BEGIN
my %feature = (
say => 'say',
state => 'state',
switch => 'switch',
bitwise => 'bitwise',
evalbytes => 'evalbytes',
current_sub => '__SUB__',
Expand Down Expand Up @@ -55,14 +54,13 @@ BEGIN
# 5.odd implies the next 5.even, but an explicit 5.even can override it.

# features bundles
use constant V5_9_5 => sort qw{say state switch indirect multidimensional bareword_filehandles};
use constant V5_9_5 => sort qw{say state indirect multidimensional bareword_filehandles};
use constant V5_11 => sort ( +V5_9_5, qw{unicode_strings} );
use constant V5_15 => sort ( +V5_11, qw{unicode_eval evalbytes current_sub fc} );
use constant V5_23 => sort ( +V5_15, qw{postderef_qq} );
use constant V5_27 => sort ( +V5_23, qw{bitwise} );

use constant V5_35 => sort grep {; $_ ne 'switch'
&& $_ ne 'indirect'
use constant V5_35 => sort grep {; $_ ne 'indirect'
&& $_ ne 'multidimensional' } +V5_27, qw{isa signatures};

use constant V5_37 => sort grep {; $_ ne 'bareword_filehandles' } +V5_35, qw{module_true};
Expand Down Expand Up @@ -106,7 +104,7 @@ BEGIN
);

my @noops = qw( postderef lexical_subs );
my @removed = qw( array_base );
my @removed = qw( array_base switch );


###########################################################################
Expand Down Expand Up @@ -544,7 +542,7 @@ sub longest {

__END__
package feature;
our $VERSION = '1.90';
our $VERSION = '1.91';
FEATURES
Expand Down Expand Up @@ -636,21 +634,10 @@ =head2 The 'state' feature
=head2 The 'switch' feature
B<WARNING>: This feature is still experimental and the implementation may
change or be removed in future versions of Perl. For this reason, Perl will
warn when you use the feature, unless you have explicitly disabled the warning:
no warnings "experimental::smartmatch";
C<use feature 'switch'> tells the compiler to enable the Raku
C<use feature 'switch'> told the compiler to enable the Raku
given/when construct.
See L<perlsyn/"Switch Statements"> for details.
This feature is available starting with Perl 5.10.
It is deprecated starting with Perl 5.38, and using
C<given>, C<when> or smartmatch will throw a warning.
It will be removed in Perl 5.42.
This feature was removed in Perl 5.42.
=head2 The 'unicode_strings' feature
Expand Down
2 changes: 1 addition & 1 deletion t/lib/feature/api
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ EXPECT
default: bareword_filehandles indirect multidimensional
unicode_strings is not enabled
bundle: default
5.12: bareword_filehandles indirect multidimensional say state switch unicode_strings
5.12: bareword_filehandles indirect multidimensional say state unicode_strings
unicode_strings is enabled
bundle: 5.11
########
Expand Down
9 changes: 9 additions & 0 deletions t/lib/feature/removed
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ OPTIONS regex
########
no feature "array_base";
EXPECT
########
# NAME switch feature removed
use feature "switch";
EXPECT
OPTIONS regex
^Feature "switch" is not supported by Perl [v0-9.]+ at - line 1.
########
no feature "switch";
EXPECT

0 comments on commit 93961e2

Please sign in to comment.