summaryrefslogtreecommitdiff
path: root/lib/diagnostics.pm
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-02-12 23:30:13 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-02-12 23:49:21 -0800
commitf4739a71a55f13abd9474496c261e7e801ff8d46 (patch)
treefc0565db394e4c281a1d1cd7977a33fc14ea5fc5 /lib/diagnostics.pm
parent2fe2bdfdc021075e8d79fba5050f89faea5f656c (diff)
downloadperl-f4739a71a55f13abd9474496c261e7e801ff8d46.tar.gz
Make diagnostics.pm understand messages sharing descriptions
We currently have entries in perldiag like this: =item Code point 0x%X is not Unicode, may not be portable =item Code point 0x%X is not Unicode, no properties match it; all inverse properties do (W utf8) You had a code point above the Unicode maximum of U+10FFFF. ... diagnostics.pm needs to know that the description applies to the first =item, as well as to the second.
Diffstat (limited to 'lib/diagnostics.pm')
-rw-r--r--lib/diagnostics.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm
index cd4e7b6151..b3464488d7 100644
--- a/lib/diagnostics.pm
+++ b/lib/diagnostics.pm
@@ -319,7 +319,9 @@ my %msg;
print STDERR "FINISHING COMPILATION for $_\n" if $DEBUG;
local $/ = '';
my $header;
+ my @headers;
my $for_item;
+ my $seen_body;
while (<POD_DIAG>) {
sub _split_pod_link {
@@ -365,10 +367,22 @@ my %msg;
}
s/^/ /gm;
$msg{$header} .= $_;
+ for my $h(@headers) { $msg{$h} .= $_ }
+ ++$seen_body;
undef $for_item;
}
next;
}
+
+ # If we have not come across the body of the description yet, then
+ # the previous header needs to share the same description.
+ if ($seen_body) {
+ @headers = ();
+ }
+ else {
+ push @headers, $header if defined $header;
+ }
+
unless ( s/=item (.*?)\s*\z//) {
if ( s/=head1\sDESCRIPTION//) {
@@ -428,6 +442,7 @@ my %msg;
if $msg{$header};
$msg{$header} = '';
+ $seen_body = 0;
}