line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::NotQuiteLite::Parser::Catalyst; |
2
|
|
|
|
|
|
|
|
3
|
83
|
|
|
83
|
|
1452
|
use strict; |
|
83
|
|
|
|
|
186
|
|
|
83
|
|
|
|
|
2334
|
|
4
|
83
|
|
|
83
|
|
427
|
use warnings; |
|
83
|
|
|
|
|
181
|
|
|
83
|
|
|
|
|
1943
|
|
5
|
83
|
|
|
83
|
|
419
|
use Perl::PrereqScanner::NotQuiteLite::Util; |
|
83
|
|
|
|
|
189
|
|
|
83
|
|
|
|
|
31683
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub register { return { |
8
|
82
|
|
|
82
|
0
|
489
|
use => { |
9
|
|
|
|
|
|
|
Catalyst => 'parse_catalyst_args', |
10
|
|
|
|
|
|
|
}, |
11
|
|
|
|
|
|
|
}} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse_catalyst_args { |
14
|
3
|
|
|
3
|
0
|
7
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
|
|
7
|
my @copied_tokens = @$raw_tokens; |
17
|
3
|
100
|
50
|
|
|
25
|
if (($copied_tokens[0][1] || '') eq '()') { |
18
|
2
|
|
|
|
|
65
|
my $token = shift @copied_tokens; |
19
|
2
|
|
|
|
|
8
|
unshift @copied_tokens, @{$token->[0]}; |
|
2
|
|
|
|
|
8
|
|
20
|
|
|
|
|
|
|
} |
21
|
3
|
50
|
|
|
|
11
|
if (is_version($copied_tokens[0])) { |
22
|
0
|
|
|
|
|
0
|
$c->add($used_module => shift @copied_tokens); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
7
|
my @plugins; |
26
|
3
|
|
|
|
|
7
|
for my $token (@copied_tokens) { |
27
|
14
|
50
|
|
|
|
33
|
my $desc = $token->[1] or next; |
28
|
14
|
100
|
|
|
|
34
|
if ($desc eq 'STRING') { |
|
|
100
|
|
|
|
|
|
29
|
4
|
|
|
|
|
10
|
push @plugins, $token->[0][0]; |
30
|
|
|
|
|
|
|
} elsif ($desc eq 'QUOTED_WORD_LIST') { |
31
|
1
|
|
|
|
|
16
|
push @plugins, split /\s/, $token->[0][0]; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
6
|
for my $plugin (@plugins) { |
36
|
9
|
100
|
|
|
|
123
|
next if $plugin =~ /^\-/; |
37
|
8
|
100
|
|
|
|
33
|
$plugin = "Catalyst::Plugin::$plugin" unless $plugin =~ s/^\+//; |
38
|
8
|
100
|
|
|
|
24
|
$c->add($plugin => 0) if is_module_name($plugin); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |