| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::NotQuiteLite::Parser::Plack; |
|
2
|
|
|
|
|
|
|
|
|
3
|
82
|
|
|
82
|
|
1244
|
use strict; |
|
|
82
|
|
|
|
|
154
|
|
|
|
82
|
|
|
|
|
2059
|
|
|
4
|
82
|
|
|
82
|
|
389
|
use warnings; |
|
|
82
|
|
|
|
|
185
|
|
|
|
82
|
|
|
|
|
2100
|
|
|
5
|
82
|
|
|
82
|
|
450
|
use Perl::PrereqScanner::NotQuiteLite::Util; |
|
|
82
|
|
|
|
|
221
|
|
|
|
82
|
|
|
|
|
35737
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub register { return { |
|
8
|
81
|
|
|
81
|
0
|
406
|
use => { |
|
9
|
|
|
|
|
|
|
'Plack::Builder' => 'parse_plack_builder_args', |
|
10
|
|
|
|
|
|
|
}, |
|
11
|
|
|
|
|
|
|
}} |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse_plack_builder_args { |
|
14
|
9
|
|
|
9
|
0
|
20
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# TODO: support add_middleware(_if) methods? |
|
17
|
|
|
|
|
|
|
|
|
18
|
9
|
|
|
|
|
30
|
$c->register_keyword_parser( |
|
19
|
|
|
|
|
|
|
'enable', |
|
20
|
|
|
|
|
|
|
[$class, 'parse_enable_args', $used_module], |
|
21
|
|
|
|
|
|
|
); |
|
22
|
9
|
|
|
|
|
24
|
$c->register_keyword_parser( |
|
23
|
|
|
|
|
|
|
'enable_if', |
|
24
|
|
|
|
|
|
|
[$class, 'parse_enable_if_args', $used_module], |
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub parse_enable_args { |
|
29
|
3
|
|
|
3
|
0
|
6
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
|
30
|
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
8
|
my $tokens = convert_string_tokens($raw_tokens); |
|
32
|
3
|
|
|
|
|
5
|
shift @$tokens; # discard 'enable' itself |
|
33
|
|
|
|
|
|
|
|
|
34
|
3
|
50
|
|
|
|
7
|
my $module = shift @$tokens or return; |
|
35
|
3
|
100
|
|
|
|
12
|
if ($module =~ s/^\+//) { |
|
36
|
1
|
|
|
|
|
4
|
$c->add($module => 0); |
|
37
|
|
|
|
|
|
|
} else { |
|
38
|
2
|
|
|
|
|
6
|
$module =~ s/^Plack::Middleware:://; |
|
39
|
2
|
|
|
|
|
8
|
$c->add("Plack::Middleware::".$module => 0); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub parse_enable_if_args { |
|
44
|
6
|
|
|
6
|
0
|
13
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
6
|
|
|
|
|
15
|
while(my $token = shift @$raw_tokens) { |
|
47
|
15
|
100
|
66
|
|
|
72
|
last if $token->[1] eq 'COMMA' or ref $token->[0]; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
6
|
100
|
|
|
|
27
|
shift @$raw_tokens if $raw_tokens->[0][1] eq 'COMMA'; |
|
50
|
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
19
|
my $tokens = convert_string_tokens($raw_tokens); |
|
52
|
|
|
|
|
|
|
|
|
53
|
6
|
50
|
|
|
|
15
|
my $module = shift @$tokens or return; |
|
54
|
6
|
100
|
|
|
|
21
|
if ($module =~ s/^\+//) { |
|
55
|
2
|
|
|
|
|
7
|
$c->add($module => 0); |
|
56
|
|
|
|
|
|
|
} else { |
|
57
|
4
|
|
|
|
|
19
|
$module =~ s/^Plack::Middleware:://; |
|
58
|
4
|
|
|
|
|
16
|
$c->add("Plack::Middleware::".$module => 0); |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |