This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rv2hv does not use its TARG
[perl5.git] / regen / warnings.pl
index e0f3583..acca0d0 100644 (file)
@@ -3,10 +3,13 @@
 # Regenerate (overwriting only if changed):
 #
 #    lib/warnings.pm
+#    pod/perllexwarn.pod
 #    warnings.h
 #
 # from information hardcoded into this script (the $tree hash), plus the
-# template for warnings.pm in the DATA section.
+# template for warnings.pm in the DATA section.  Only part of
+# pod/perllexwarn.pod (the warnings category hierarchy) is generated,
+# the other parts remaining untouched.
 #
 # When changing the number of warnings, t/op/caller.t should change to
 # correspond with the value of $BYTES in lib/warnings.pm
@@ -16,7 +19,7 @@
 #
 # This script is normally invoked from regen.pl.
 
-$VERSION = '1.02_03';
+$VERSION = '1.02_05';
 
 BEGIN {
     require 'regen/regen_lib.pl';
@@ -37,6 +40,7 @@ my $tree = {
                                        'newline'       => [ 5.008, DEFAULT_OFF],
                                        'exec'          => [ 5.008, DEFAULT_OFF],
                                        'layer'         => [ 5.008, DEFAULT_OFF],
+                               'syscalls'      => [ 5.019, DEFAULT_OFF],
                           }],
        'syntax'        => [ 5.008, {   
                                'ambiguous'     => [ 5.008, DEFAULT_OFF],
@@ -56,7 +60,7 @@ my $tree = {
                                'internal'      => [ 5.008, DEFAULT_OFF],
                                'debugging'     => [ 5.008, DEFAULT_ON],
                                'malloc'        => [ 5.008, DEFAULT_ON],
-                          }],
+                          }],
         'deprecated'   => [ 5.008, DEFAULT_ON],
                'void'          => [ 5.008, DEFAULT_OFF],
                'recursion'     => [ 5.008, DEFAULT_OFF],
@@ -89,6 +93,12 @@ my $tree = {
                                     [ 5.017, DEFAULT_ON ],
                                 'experimental::regex_sets' =>
                                     [ 5.017, DEFAULT_ON ],
+                                'experimental::lexical_topic' =>
+                                    [ 5.017, DEFAULT_ON ],
+                                'experimental::smartmatch' =>
+                                    [ 5.017, DEFAULT_ON ],
+                                'experimental::postderef' =>
+                                    [ 5.019, DEFAULT_ON ],
                         }],
 
                 #'default'     => [ 5.008, DEFAULT_ON ],
@@ -436,10 +446,29 @@ while (<DATA>) {
 
 read_only_bottom_close_and_rename($pm);
 
+my $lexwarn = open_new 'pod/perllexwarn.pod', '>';
+open my $oldlexwarn, "pod/perllexwarn.pod"
+  or die "$0 cannot open pod/perllexwarn.pod for reading: $!";
+select +(select($lexwarn), do {
+    while(<$oldlexwarn>) {
+       print;
+       last if /=for warnings.pl begin/;
+    }
+    print "\n";
+    printTree($tree, "    ") ;
+    print "\n";
+    while(<$oldlexwarn>) {
+       last if /=for warnings.pl end/;
+    }
+    do { print } while <$oldlexwarn>;
+})[0];
+
+close_and_rename($lexwarn);
+
 __END__
 package warnings;
 
-our $VERSION = '1.16';
+our $VERSION = '1.20';
 
 # Verify that we're called correctly so that warnings will work.
 # see also strict.pm.
@@ -825,6 +854,6 @@ sub warnif
 
 # These are not part of any public interface, so we can delete them to save
 # space.
-delete $warnings::{$_} foreach qw(NORMAL FATAL MESSAGE);
+delete @warnings::{qw(NORMAL FATAL MESSAGE)};
 
 1;