line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::NotQuiteLite::Parser::Unless; |
2
|
|
|
|
|
|
|
|
3
|
83
|
|
|
83
|
|
1465
|
use strict; |
|
83
|
|
|
|
|
193
|
|
|
83
|
|
|
|
|
2205
|
|
4
|
83
|
|
|
83
|
|
416
|
use warnings; |
|
83
|
|
|
|
|
197
|
|
|
83
|
|
|
|
|
1899
|
|
5
|
83
|
|
|
83
|
|
421
|
use Perl::PrereqScanner::NotQuiteLite::Util; |
|
83
|
|
|
|
|
176
|
|
|
83
|
|
|
|
|
25395
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub register { return { |
8
|
82
|
|
|
82
|
0
|
540
|
use => { |
9
|
|
|
|
|
|
|
unless => 'parse_unless_args', |
10
|
|
|
|
|
|
|
}, |
11
|
|
|
|
|
|
|
}} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse_unless_args { |
14
|
1
|
|
|
1
|
0
|
7
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
4
|
while(my $token = shift @$raw_tokens) { |
17
|
2
|
100
|
|
|
|
8
|
last if $token->[1] eq 'COMMA'; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
3
|
my $tokens = convert_string_tokens($raw_tokens); |
21
|
1
|
|
|
|
|
2
|
my $module = shift @$tokens; |
22
|
1
|
0
|
0
|
|
|
4
|
if (ref $module and ($module->[1] eq 'WORD' or $module->[1] eq 'KEYWORD')) { |
|
|
|
33
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
$module = $module->[0]; |
24
|
|
|
|
|
|
|
} |
25
|
1
|
50
|
|
|
|
2
|
if (is_module_name($module)) { |
26
|
1
|
50
|
|
|
|
3
|
if (is_version($tokens->[0])) { |
27
|
0
|
|
|
|
|
0
|
my $version = shift @$tokens; |
28
|
0
|
|
|
|
|
0
|
$c->add_recommendation($module => $version); |
29
|
|
|
|
|
|
|
} else { |
30
|
1
|
|
|
|
|
4
|
$c->add_recommendation($module => 0); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
|
push @{$c->{errors}}, "use unless module not found"; |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |