line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PLS::Parser::Pod::Package; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
66
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
292
|
|
4
|
11
|
|
|
11
|
|
44
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
278
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
49
|
use parent 'PLS::Parser::Pod'; |
|
11
|
|
|
|
|
34
|
|
|
11
|
|
|
|
|
62
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
PLS::Parser::Pod::Package |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This is a subclass of L<PLS::Parser::Pod>, used to find POD for a package. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
0
|
0
|
|
my ($class, @args) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my %args = @args; |
23
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(%args); |
24
|
0
|
|
|
|
|
|
$self->{package} = $args{package}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self; |
27
|
|
|
|
|
|
|
} ## end sub new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub find |
30
|
|
|
|
|
|
|
{ |
31
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $definitions; |
34
|
0
|
0
|
|
|
|
|
$definitions = $self->{index}->find_package($self->{package}) if (ref $self->{index} eq 'PLS::Parser::Index'); |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
0
|
|
|
|
if (ref $definitions eq 'ARRAY' and scalar @$definitions) |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
|
|
|
foreach my $definition (@$definitions) |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
|
my $path = URI->new($definition->{uri})->file; |
41
|
0
|
0
|
|
|
|
|
open my $fh, '<', $path or next; |
42
|
0
|
|
|
|
|
|
my $text = do { local $/; <$fh> }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my ($ok, $markdown) = $self->get_markdown_from_text(\$text); |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
if ($ok) |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
|
|
|
$self->{markdown} = $markdown; |
48
|
0
|
|
|
|
|
|
return 1; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} ## end foreach my $definition (@$definitions...) |
51
|
|
|
|
|
|
|
} ## end if (ref $definitions eq...) |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my ($ok, $markdown) = $self->get_markdown_for_package($self->{package}); |
54
|
0
|
0
|
|
|
|
|
$self->{markdown} = $markdown if $ok; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
return $ok; |
57
|
|
|
|
|
|
|
} ## end sub find |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |