line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::NotQuiteLite::Parser::TestRequires; |
2
|
|
|
|
|
|
|
|
3
|
82
|
|
|
82
|
|
1480
|
use strict; |
|
82
|
|
|
|
|
157
|
|
|
82
|
|
|
|
|
1885
|
|
4
|
82
|
|
|
82
|
|
320
|
use warnings; |
|
82
|
|
|
|
|
166
|
|
|
82
|
|
|
|
|
1515
|
|
5
|
82
|
|
|
82
|
|
374
|
use Perl::PrereqScanner::NotQuiteLite::Util; |
|
82
|
|
|
|
|
154
|
|
|
82
|
|
|
|
|
30471
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub register { return { |
8
|
81
|
|
|
81
|
0
|
398
|
use => { |
9
|
|
|
|
|
|
|
'Test::Requires' => 'parse_test_requires_args', |
10
|
|
|
|
|
|
|
}, |
11
|
|
|
|
|
|
|
}} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse_test_requires_args { |
14
|
5
|
|
|
5
|
0
|
17
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
15
|
|
|
|
|
|
|
|
16
|
5
|
|
|
|
|
24
|
$c->register_keyword_parser( |
17
|
|
|
|
|
|
|
'test_requires', |
18
|
|
|
|
|
|
|
[$class, 'parse_test_requires_function_args', $used_module], |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
19
|
my $tokens = convert_string_tokens($raw_tokens); |
22
|
5
|
50
|
|
|
|
19
|
if (is_version($tokens->[0])) { |
23
|
0
|
|
|
|
|
0
|
$c->add($used_module => shift @$tokens); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
5
|
100
|
100
|
|
|
48
|
if (ref $tokens->[0] and $tokens->[0][1] and $tokens->[0][1] eq '{}') { |
|
|
|
100
|
|
|
|
|
27
|
1
|
|
|
|
|
4
|
my $tokens_in_hashref = convert_string_tokens($tokens->[0][0]); |
28
|
1
|
|
|
|
|
6
|
while(my ($key, undef, $value, undef) = splice @$tokens_in_hashref, 0, 4) { |
29
|
1
|
50
|
|
|
|
4
|
next unless is_module_name($key); |
30
|
1
|
50
|
|
|
|
9
|
next unless is_version($value); |
31
|
1
|
|
|
|
|
4
|
$c->add_recommendation($key => $value); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} else { |
34
|
4
|
|
|
|
|
18
|
for my $token (@$tokens) { |
35
|
6
|
100
|
|
|
|
47
|
next if ref $token; |
36
|
2
|
50
|
|
|
|
7
|
if ($token =~ /^v?5/) { |
37
|
0
|
|
|
|
|
0
|
$c->add_recommendation(perl => $token); |
38
|
|
|
|
|
|
|
} else { |
39
|
2
|
|
|
|
|
11
|
$c->add_recommendation($token => 0); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub parse_test_requires_function_args { |
46
|
1
|
|
|
1
|
0
|
4
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
4
|
my $tokens = convert_string_tokens($raw_tokens); |
49
|
1
|
|
|
|
|
3
|
$c->add_recommendation($_ => 0) for grep {!ref $_} @$tokens; |
|
3
|
|
|
|
|
11
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |