line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2003-2021 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
5
|
|
|
|
|
|
|
# This code is part of perl distribution OODoc. It is licensed under the |
6
|
|
|
|
|
|
|
# same terms as Perl itself: https://spdx.org/licenses/Artistic-2.0.html |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package OODoc::Text::Chapter; |
9
|
1
|
|
|
1
|
|
922
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
10
|
|
|
|
|
|
|
$VERSION = '2.02'; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5
|
use base 'OODoc::Text::Structure'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
15
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use Log::Report 'oodoc'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
18
|
1
|
|
|
1
|
|
246
|
use List::Util 'first'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
664
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init($) |
22
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
23
|
0
|
|
0
|
|
|
|
$args->{type} ||= 'Chapter'; |
24
|
0
|
0
|
0
|
|
|
|
$args->{container} ||= delete $args->{manual} or panic; |
25
|
0
|
|
0
|
|
|
|
$args->{level} ||= 1; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
|
|
|
$self->SUPER::init($args) |
28
|
|
|
|
|
|
|
or return; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->{OTC_sections} = []; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub emptyExtension($) |
36
|
0
|
|
|
0
|
1
|
|
{ my ($self, $container) = @_; |
37
|
0
|
|
|
|
|
|
my $empty = $self->SUPER::emptyExtension($container); |
38
|
0
|
|
|
|
|
|
my @sections = map $_->emptyExtension($empty), $self->sections; |
39
|
0
|
|
|
|
|
|
$empty->sections(@sections); |
40
|
0
|
|
|
|
|
|
$empty; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
|
sub manual() {shift->container} |
44
|
0
|
|
|
0
|
1
|
|
sub path() {shift->name} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub findSubroutine($) |
47
|
0
|
|
|
0
|
0
|
|
{ my ($self, $name) = @_; |
48
|
0
|
|
|
|
|
|
my $sub = $self->SUPER::findSubroutine($name); |
49
|
0
|
0
|
|
|
|
|
return $sub if defined $sub; |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
foreach my $section ($self->sections) |
52
|
0
|
|
|
|
|
|
{ my $sub = $section->findSubroutine($name); |
53
|
0
|
0
|
|
|
|
|
return $sub if defined $sub; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
undef; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub findEntry($) |
60
|
0
|
|
|
0
|
1
|
|
{ my ($self, $name) = @_; |
61
|
0
|
0
|
|
|
|
|
return $self if $self->name eq $name; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
foreach my $section ($self->sections) |
64
|
0
|
|
|
|
|
|
{ my $entry = $section->findEntry($name); |
65
|
0
|
0
|
|
|
|
|
return $entry if defined $entry; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
(); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub all($@) |
72
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
73
|
0
|
|
|
|
|
|
($self->SUPER::all(@_), map {$_->all(@_)} $self->sections); |
|
0
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub section($) |
78
|
0
|
|
|
0
|
1
|
|
{ my ($self, $thing) = @_; |
79
|
|
|
|
|
|
|
|
80
|
0
|
0
|
|
|
|
|
if(ref $thing) |
81
|
0
|
|
|
|
|
|
{ push @{$self->{OTC_sections}}, $thing; |
|
0
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
return $thing; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
0
|
|
|
first {$_->name eq $thing} $self->sections; |
|
0
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub sections() |
90
|
0
|
|
|
0
|
1
|
|
{ my $self = shift; |
91
|
0
|
0
|
|
|
|
|
if(@_) |
92
|
0
|
|
|
|
|
|
{ $self->{OTC_sections} = [ @_ ]; |
93
|
0
|
|
|
|
|
|
$_->container($self) for @_; |
94
|
|
|
|
|
|
|
} |
95
|
0
|
|
|
|
|
|
@{$self->{OTC_sections}}; |
|
0
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
1; |