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