line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PLS::Parser::Pod::Variable; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
66
|
use strict; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
257
|
|
4
|
11
|
|
|
11
|
|
52
|
use warnings; |
|
11
|
|
|
|
|
13
|
|
|
11
|
|
|
|
|
235
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
52
|
use parent 'PLS::Parser::Pod'; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
46
|
|
7
|
|
|
|
|
|
|
|
8
|
11
|
|
|
11
|
|
544
|
use Pod::Simple::Search; |
|
11
|
|
|
|
|
76
|
|
|
11
|
|
|
|
|
2579
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
PLS::Parser::Pod::Variable |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 DESCRIPTION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
This is a subclass of L<PLS::Parser::Pod> for finding POD for a Perl builtin variable. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
0
|
|
my ($class, @args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
my %args = @args; |
25
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(%args); |
26
|
0
|
|
|
|
|
|
$self->{variable} = $args{variable}; |
27
|
0
|
|
|
|
|
|
$self->{package} = $args{package}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return $self; |
30
|
|
|
|
|
|
|
} ## end sub new |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub find |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my ($ok, $markdown) = $self->run_perldoc_command('-Tuv', $self->{variable}); |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if ($ok) |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
|
$self->{markdown} = $markdown; |
41
|
0
|
|
|
|
|
|
return 1; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
return 0 unless (length $self->{package}); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $search = Pod::Simple::Search->new(); |
47
|
0
|
|
|
|
|
|
my $include = $self->get_clean_inc(); |
48
|
0
|
|
|
|
|
|
$search->inc(0); |
49
|
0
|
|
|
|
|
|
my $path = $search->find($self->{package}, @{$include}); |
|
0
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
($ok, $markdown) = $self->find_pod_in_file($path, $self->{variable}); |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
if ($ok) |
53
|
|
|
|
|
|
|
{ |
54
|
0
|
|
|
|
|
|
$self->{markdown} = $markdown; |
55
|
0
|
|
|
|
|
|
return 1; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return 0; |
59
|
|
|
|
|
|
|
} ## end sub find |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |