line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# A quite dimwitted pod2plaintext that need only know how to format whatever |
3
|
|
|
|
|
|
|
# text comes out of Pod::BlackBox's _gen_errata |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require 5; |
6
|
|
|
|
|
|
|
package Pod::Simple::Checker; |
7
|
1
|
|
|
1
|
|
961
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
8
|
1
|
|
|
1
|
|
6
|
use Carp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
9
|
1
|
|
|
1
|
|
503
|
use Pod::Simple::Methody (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
10
|
1
|
|
|
1
|
|
5
|
use Pod::Simple (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
19
|
|
11
|
1
|
|
|
1
|
|
5
|
use vars qw( @ISA $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
90
|
|
12
|
|
|
|
|
|
|
$VERSION = '3.42'; |
13
|
|
|
|
|
|
|
@ISA = ('Pod::Simple::Methody'); |
14
|
|
|
|
|
|
|
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) |
15
|
|
|
|
|
|
|
? \&Pod::Simple::DEBUG |
16
|
|
|
|
|
|
|
: sub() {0} |
17
|
1
|
50
|
|
1
|
|
27
|
} |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
559
|
use Text::Wrap 98.112902 (); # was 2001.0131, but I don't think we need that |
|
1
|
|
|
|
|
2797
|
|
|
1
|
|
|
|
|
1178
|
|
20
|
|
|
|
|
|
|
$Text::Wrap::wrap = 'overflow'; |
21
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub any_errata_seen { # read-only accessor |
24
|
0
|
|
|
0
|
1
|
|
return $_[1]->{'Errata_seen'}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
my $new = $self->SUPER::new(@_); |
30
|
0
|
|
0
|
|
|
|
$new->{'output_fh'} ||= *STDOUT{IO}; |
31
|
0
|
|
|
|
|
|
$new->nix_X_codes(1); |
32
|
0
|
|
|
|
|
|
$new->nbsp_for_S(1); |
33
|
0
|
|
|
|
|
|
$new->{'Thispara'} = ''; |
34
|
0
|
|
|
|
|
|
$new->{'Indent'} = 0; |
35
|
0
|
|
|
|
|
|
$new->{'Indentstring'} = ' '; |
36
|
0
|
|
|
|
|
|
$new->{'Errata_seen'} = 0; |
37
|
0
|
|
|
|
|
|
return $new; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
41
|
|
|
|
|
|
|
|
42
|
0
|
0
|
|
0
|
0
|
|
sub handle_text { $_[0]{'Errata_seen'} and $_[0]{'Thispara'} .= $_[1] } |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
0
|
|
sub start_Para { $_[0]{'Thispara'} = '' } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub start_head1 { |
47
|
0
|
0
|
|
0
|
0
|
|
if($_[0]{'Errata_seen'}) { |
48
|
0
|
|
|
|
|
|
$_[0]{'Thispara'} = ''; |
49
|
|
|
|
|
|
|
} else { |
50
|
0
|
0
|
|
|
|
|
if($_[1]{'errata'}) { # start of errata! |
51
|
0
|
|
|
|
|
|
$_[0]{'Errata_seen'} = 1; |
52
|
0
|
0
|
|
|
|
|
$_[0]{'Thispara'} = $_[0]{'source_filename'} ? |
53
|
|
|
|
|
|
|
"$_[0]{'source_filename'} -- " : '' |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
0
|
|
|
0
|
0
|
|
sub start_head2 { $_[0]{'Thispara'} = '' } |
58
|
0
|
|
|
0
|
0
|
|
sub start_head3 { $_[0]{'Thispara'} = '' } |
59
|
0
|
|
|
0
|
0
|
|
sub start_head4 { $_[0]{'Thispara'} = '' } |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
0
|
0
|
|
sub start_Verbatim { $_[0]{'Thispara'} = '' } |
62
|
0
|
|
|
0
|
0
|
|
sub start_item_bullet { $_[0]{'Thispara'} = '* ' } |
63
|
0
|
|
|
0
|
0
|
|
sub start_item_number { $_[0]{'Thispara'} = "$_[1]{'number'}. " } |
64
|
0
|
|
|
0
|
0
|
|
sub start_item_text { $_[0]{'Thispara'} = '' } |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
0
|
0
|
|
sub start_over_bullet { ++$_[0]{'Indent'} } |
67
|
0
|
|
|
0
|
0
|
|
sub start_over_number { ++$_[0]{'Indent'} } |
68
|
0
|
|
|
0
|
0
|
|
sub start_over_text { ++$_[0]{'Indent'} } |
69
|
0
|
|
|
0
|
0
|
|
sub start_over_block { ++$_[0]{'Indent'} } |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
0
|
0
|
|
sub end_over_bullet { --$_[0]{'Indent'} } |
72
|
0
|
|
|
0
|
0
|
|
sub end_over_number { --$_[0]{'Indent'} } |
73
|
0
|
|
|
0
|
0
|
|
sub end_over_text { --$_[0]{'Indent'} } |
74
|
0
|
|
|
0
|
0
|
|
sub end_over_block { --$_[0]{'Indent'} } |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# . . . . . Now the actual formatters: |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
0
|
0
|
|
sub end_head1 { $_[0]->emit_par(-4) } |
80
|
0
|
|
|
0
|
0
|
|
sub end_head2 { $_[0]->emit_par(-3) } |
81
|
0
|
|
|
0
|
0
|
|
sub end_head3 { $_[0]->emit_par(-2) } |
82
|
0
|
|
|
0
|
0
|
|
sub end_head4 { $_[0]->emit_par(-1) } |
83
|
0
|
|
|
0
|
0
|
|
sub end_Para { $_[0]->emit_par( 0) } |
84
|
0
|
|
|
0
|
0
|
|
sub end_item_bullet { $_[0]->emit_par( 0) } |
85
|
0
|
|
|
0
|
0
|
|
sub end_item_number { $_[0]->emit_par( 0) } |
86
|
0
|
|
|
0
|
0
|
|
sub end_item_text { $_[0]->emit_par(-2) } |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub emit_par { |
89
|
0
|
0
|
|
0
|
0
|
|
return unless $_[0]{'Errata_seen'}; |
90
|
0
|
|
|
|
|
|
my($self, $tweak_indent) = splice(@_,0,2); |
91
|
0
|
|
0
|
|
|
|
my $length = 2 * $self->{'Indent'} + ($tweak_indent||0); |
92
|
0
|
0
|
|
|
|
|
my $indent = ' ' x ($length > 0 ? $length : 0); |
93
|
|
|
|
|
|
|
# Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0 |
94
|
|
|
|
|
|
|
# 'Negative repeat count does nothing' since 5.22 |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
97
|
0
|
|
|
|
|
|
my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n"); |
98
|
0
|
|
|
|
|
|
$out =~ s/$Pod::Simple::nbsp/ /g; |
99
|
0
|
|
|
|
|
|
print {$self->{'output_fh'}} $out, |
|
0
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
#"\n" |
101
|
|
|
|
|
|
|
; |
102
|
0
|
|
|
|
|
|
$self->{'Thispara'} = ''; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
return; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# . . . . . . . . . . And then off by its lonesome: |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub end_Verbatim { |
110
|
0
|
0
|
|
0
|
0
|
|
return unless $_[0]{'Errata_seen'}; |
111
|
0
|
|
|
|
|
|
my $self = shift; |
112
|
0
|
|
|
|
|
|
$self->{'Thispara'} =~ s/$Pod::Simple::nbsp/ /g; |
113
|
0
|
|
|
|
|
|
$self->{'Thispara'} =~ s/$Pod::Simple::shy//g; |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my $i = ' ' x ( 2 * $self->{'Indent'} + 4); |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
|
$self->{'Thispara'} =~ s/^/$i/mg; |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
|
print { $self->{'output_fh'} } '', |
120
|
0
|
|
|
|
|
|
$self->{'Thispara'}, |
121
|
|
|
|
|
|
|
"\n\n" |
122
|
|
|
|
|
|
|
; |
123
|
0
|
|
|
|
|
|
$self->{'Thispara'} = ''; |
124
|
0
|
|
|
|
|
|
return; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
128
|
|
|
|
|
|
|
1; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
__END__ |