diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-09-29 22:39:37 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-30 00:01:26 -0700 |
commit | f1d34ca8c42df1cea97652592d84d9a587312c74 (patch) | |
tree | df0c93b60f39f6124adc5e0abd9a4459c4d23b38 | |
parent | f6abc0d6b4abeb6a99d7f5da7c61f368af49fc2e (diff) | |
download | perl-f1d34ca8c42df1cea97652592d84d9a587312c74.tar.gz |
Use two colons for lexsub warning
-rw-r--r-- | lib/feature.pm | 4 | ||||
-rw-r--r-- | lib/warnings.pm | 10 | ||||
-rw-r--r-- | pod/perldiag.pod | 4 | ||||
-rw-r--r-- | pod/perllexwarn.pod | 17 | ||||
-rw-r--r-- | pod/perlsub.pod | 10 | ||||
-rwxr-xr-x | regen/feature.pl | 4 | ||||
-rw-r--r-- | regen/warnings.pl | 8 | ||||
-rw-r--r-- | t/cmd/lexsub.t | 2 | ||||
-rw-r--r-- | warnings.h | 2 |
9 files changed, 21 insertions, 40 deletions
diff --git a/lib/feature.pm b/lib/feature.pm index f585f16424..5a56a90a10 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -237,7 +237,7 @@ change in future versions of Perl. For this reason, F<feature.pm> will warn when you enable the feature, unless you have explicitly disabled the warning: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; This enables declaration of subroutines via C<my sub foo>, C<state sub foo> and C<our sub foo> syntax. See L<perlsub/Lexical Subroutines> for details. @@ -382,7 +382,7 @@ sub __common { $^H |= $hint_uni8bit if $name eq 'unicode_strings'; if ($experimental{$name}) { require warnings; - warnings::warnif("experimental:$name", + warnings::warnif("experimental::$name", "The $name feature is experimental"); } } else { diff --git a/lib/warnings.pm b/lib/warnings.pm index a80d45756b..2dc64d316f 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -55,10 +55,6 @@ or disabled. A number of functions are provided to assist module authors. -In all the descriptions below, $category can also be a warnings category -and ID separated by a colon, such as "experimental:lexical_subs". See -L<perllexwarn/Individual Warning IDs>. - =over 4 =item use warnings::register @@ -233,7 +229,7 @@ our %Offsets = ( # Warnings Categories added in Perl 5.017 'experimental' => 102, - 'experimental:lexical_subs'=> 104, + 'experimental::lexical_subs'=> 104, ); our %Bits = ( @@ -248,7 +244,7 @@ our %Bits = ( 'exec' => "\x00\x40\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", # [3] 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x01", # [51,52] - 'experimental:lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [52] + 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [52] 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [46] @@ -304,7 +300,7 @@ our %DeadBits = ( 'exec' => "\x00\x80\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", # [3] 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x02", # [51,52] - 'experimental:lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [52] + 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [52] 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [46] diff --git a/pod/perldiag.pod b/pod/perldiag.pod index fee150635d..f12264c075 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1864,7 +1864,7 @@ as a return, a goto, or a loop control statement. (F) To use lexical subs, you must first enable them: - no warnings 'experimental:lexical_subs'; + no warnings 'experimental::lexical_subs'; use feature 'lexical_subs'; my sub foo { ... } @@ -4785,7 +4785,7 @@ to use the feature, but know that in doing so you are taking the risk of using an experimental feature which may change or be removed in a future Perl version: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; use feature "lexical_subs"; =item The %s function is unimplemented diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod index 3b6b827a36..c6494dbbb7 100644 --- a/pod/perllexwarn.pod +++ b/pod/perllexwarn.pod @@ -220,7 +220,9 @@ The current hierarchy is: | +- exiting | - +- experimental + +- experimental --+ + | | + | +- experimental::lexical_subs | +- glob | @@ -337,19 +339,6 @@ Note: In Perl 5.6.1, the lexical warnings category "deprecated" was a sub-category of the "syntax" category. It is now a top-level category in its own right. -=head2 Individual Warning IDs - -The "experimental" warnings category, added in Perl 5.18, -contains IDs for individual warnings, so that each warning can -be turned on or off. Currently there is only one such warning, -labelled "experimental:lexical_subs". You enable and disable -it like this: - - use warnings "experimental:lexical_subs"; - no warnings "experimental:lexical_subs"; - -The plan is to extend this convention to all warnings in a future release. - =head2 Fatal Warnings X<warning, fatal> diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 993b2b5467..87d45d30ac 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -830,7 +830,7 @@ modified or removed in future versions of Perl. Lexical subroutines are only available under the C<use feature 'lexical_subs'> pragma, which produces a warning unless the -"experimental:lexical_subs" warning is disabled. +"experimental::lexical_subs" warnings category is disabled. Beginning with Perl 5.18, you can declare a private subroutine with C<my> or C<state>. As with state variables, the C<state> keyword is only @@ -839,7 +839,7 @@ available under C<use feature 'state'> or C<use 5.010> or higher. These subroutines are only visible within the block in which they are declared, and only after that declaration: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; foo(); # calls the package/global subroutine @@ -871,7 +871,7 @@ containing block to the next. So, in general, "state" subroutines are faster. But "my" subs are necessary if you want to create closures: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; sub whatever { @@ -894,7 +894,7 @@ subroutine of the same name. The two main uses for this are to switch back to using the package sub inside an inner scope: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; sub foo { ... } @@ -912,7 +912,7 @@ and to make a subroutine visible to other packages in the same scope: package MySneakyModule; - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; our sub do_something { ... } diff --git a/regen/feature.pl b/regen/feature.pl index da43f62c17..a5c8b2da93 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -548,7 +548,7 @@ change in future versions of Perl. For this reason, F<feature.pm> will warn when you enable the feature, unless you have explicitly disabled the warning: - no warnings "experimental:lexical_subs"; + no warnings "experimental::lexical_subs"; This enables declaration of subroutines via C<my sub foo>, C<state sub foo> and C<our sub foo> syntax. See L<perlsub/Lexical Subroutines> for details. @@ -680,7 +680,7 @@ sub __common { $^H |= $hint_uni8bit if $name eq 'unicode_strings'; if ($experimental{$name}) { require warnings; - warnings::warnif("experimental:$name", + warnings::warnif("experimental::$name", "The $name feature is experimental"); } } else { diff --git a/regen/warnings.pl b/regen/warnings.pl index feb95c971b..38eca47a37 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -85,7 +85,7 @@ my $tree = { 'threads' => [ 5.008, DEFAULT_OFF], 'imprecision' => [ 5.011, DEFAULT_OFF], 'experimental' => [ 5.017, { - 'experimental:lexical_subs' => + 'experimental::lexical_subs' => [ 5.017, DEFAULT_ON ], }], @@ -212,7 +212,7 @@ sub printTree } my ($ver, $rest) = @{ $v } ; - if (ref $rest && $k ne 'experimental') + if (ref $rest) { my $bar = @keys ? "|" : " "; print " -" . "-" x ($max - length $k ) . "+\n" ; @@ -487,10 +487,6 @@ or disabled. A number of functions are provided to assist module authors. -In all the descriptions below, $category can also be a warnings category -and ID separated by a colon, such as "experimental:lexical_subs". See -L<perllexwarn/Individual Warning IDs>. - =over 4 =item use warnings::register diff --git a/t/cmd/lexsub.t b/t/cmd/lexsub.t index 4dc223f9ea..06ee24cee0 100644 --- a/t/cmd/lexsub.t +++ b/t/cmd/lexsub.t @@ -24,7 +24,7 @@ is $@, qq 'Experimental "our" subs not enabled at foo line 8.\n', # -------------------- our -------------------- # -no warnings "experimental:lexical_subs"; +no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; { our sub foo { 42 } diff --git a/warnings.h b/warnings.h index 0ac6989145..974f451d66 100644 --- a/warnings.h +++ b/warnings.h @@ -90,7 +90,7 @@ /* Warnings Categories added in Perl 5.017 */ #define WARN_EXPERIMENTAL 51 -#define WARN_EXPERIMENTAL_LEXICAL_SUBS 52 +#define WARN_EXPERIMENTAL__LEXICAL_SUBS 52 #define WARNsize 14 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125" |