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.
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 {
}
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//) {
if $msg{$header};
$msg{$header} = '';
+ $seen_body = 0;
}
@INC = 'lib';
}
-use Test::More tests => 5;
+use Test::More tests => 6;
BEGIN { use_ok('diagnostics') }
warn
'Lexing code attempted to stuff non-Latin-1 character into Latin-1 input';
like $warning, qr/using lex_stuff_pvn_flags or similar/, 'L<foo|bar/baz>';
+
+# Multiple messages with the same description
+seek STDERR, 0,0;
+$warning = '';
+warn 'Code point 0x%X is not Unicode, may not be portable';
+like $warning, qr/W utf8/,
+ 'Message sharing its description with the following message';
+