line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::PrereqScanner::NotQuiteLite::Parser::MojoBase; |
2
|
|
|
|
|
|
|
|
3
|
82
|
|
|
82
|
|
1071
|
use strict; |
|
82
|
|
|
|
|
220
|
|
|
82
|
|
|
|
|
1851
|
|
4
|
82
|
|
|
82
|
|
330
|
use warnings; |
|
82
|
|
|
|
|
167
|
|
|
82
|
|
|
|
|
1629
|
|
5
|
82
|
|
|
82
|
|
336
|
use Perl::PrereqScanner::NotQuiteLite::Util; |
|
82
|
|
|
|
|
146
|
|
|
82
|
|
|
|
|
24177
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my @MojoBaseLike = qw/ |
8
|
|
|
|
|
|
|
Mojo::Base |
9
|
|
|
|
|
|
|
Mojo::Weixin::Base Mojo::Webqq::Base |
10
|
|
|
|
|
|
|
Kelp::Base Rethinkdb::Base PMLTQ::Base |
11
|
|
|
|
|
|
|
/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub register { |
14
|
81
|
|
|
81
|
0
|
334
|
my ($class, %args) = @_; |
15
|
81
|
50
|
|
|
|
181
|
my %mojo_base_like = map {$_ => 1} (@MojoBaseLike, @{$args{mojo_base_like} || []}); |
|
486
|
|
|
|
|
992
|
|
|
81
|
|
|
|
|
494
|
|
16
|
81
|
|
|
|
|
185
|
my %mapping; |
17
|
81
|
|
|
|
|
259
|
for my $module (keys %mojo_base_like) { |
18
|
486
|
|
|
|
|
817
|
$mapping{use}{$module} = 'parse_mojo_base_args'; |
19
|
|
|
|
|
|
|
} |
20
|
81
|
|
|
|
|
474
|
return \%mapping; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub parse_mojo_base_args { |
24
|
12
|
|
|
12
|
0
|
23
|
my ($class, $c, $used_module, $raw_tokens) = @_; |
25
|
|
|
|
|
|
|
|
26
|
12
|
|
|
|
|
26
|
my $tokens = convert_string_tokens($raw_tokens); |
27
|
12
|
50
|
|
|
|
25
|
if (is_version($tokens->[0])) { |
28
|
0
|
|
|
|
|
0
|
$c->add($used_module => shift @$tokens); |
29
|
|
|
|
|
|
|
} |
30
|
12
|
|
|
|
|
17
|
my $module = $tokens->[0]; |
31
|
12
|
100
|
|
|
|
25
|
if (ref $module) { |
32
|
2
|
|
|
|
|
3
|
$module = $module->[0]; |
33
|
|
|
|
|
|
|
} |
34
|
12
|
100
|
|
|
|
23
|
if (is_module_name($module)) { |
35
|
8
|
|
|
|
|
19
|
$module =~ s|'|::|g; |
36
|
8
|
|
|
|
|
23
|
$c->add($module => 0); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |