line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Tags::Hybrid; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
711
|
use strict; use warnings; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
|
|
84
|
|
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
10
|
use parent 'Perl::Tags'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.32'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 C<Perl::Tags::Hybrid> |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Combine the results of multiple parsers, for example C<Perl::Tags::Naive> |
11
|
|
|
|
|
|
|
and C<Perl::Tags::PPI>. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $parser = Perl::Tags::Hybrid->new( |
16
|
|
|
|
|
|
|
taggers => [ |
17
|
|
|
|
|
|
|
Perl::Tags::Naive->new, |
18
|
|
|
|
|
|
|
Perl::Tags::PPI->new, |
19
|
|
|
|
|
|
|
], |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 C<get_tags_for_file> |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Registers the results from running each sub-taggers |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub get_taggers { |
29
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
30
|
1
|
50
|
|
|
|
1
|
return @{ $self->{taggers} || [] }; |
|
1
|
|
|
|
|
6
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_tags_for_file { |
34
|
1
|
|
|
1
|
1
|
3
|
my ($self, $file) = @_; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
4
|
my @taggers = $self->get_taggers; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
4
|
return map { $_->get_tags_for_file( $file ) } @taggers; |
|
2
|
|
|
|
|
13
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|