summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-09 23:27:19 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-06-09 23:31:02 -0700
commitf2a78a4827a3bae74e46b5dd3cb1e57fa55dd461 (patch)
tree1c26a119860ca7b2f4d651acf37be72090046182 /regen
parent487ab7ef015b630f5313cf997ec92995061bb9e6 (diff)
downloadperl-f2a78a4827a3bae74e46b5dd3cb1e57fa55dd461.tar.gz
Make ‘make regen’ regenerate the tree in perllexwarn
‘perl regen/warnings.pl tree’ would already generate the tree, but it had to be run separately and then copied and pasted into perllexwarn. Now regen/warnings.pl modifies perllexwarn in place as part of its regeneration. The ‘tree’ command line argument will still cause the tree to be output to STDOUT. This causes the three missing experimental categories to be listed in perllexwarn, resolving ticket #118369.
Diffstat (limited to 'regen')
-rw-r--r--regen/warnings.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl
index dd3c49b79b..72d9a0b410 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -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
@@ -440,6 +443,25 @@ 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;