line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::prefixedlist; |
2
|
|
|
|
|
|
|
$Tangerine::hook::prefixedlist::VERSION = '0.20'; |
3
|
15
|
|
|
15
|
|
1278
|
use 5.010; |
|
15
|
|
|
|
|
50
|
|
4
|
15
|
|
|
15
|
|
116
|
use strict; |
|
15
|
|
|
|
|
263
|
|
|
15
|
|
|
|
|
332
|
|
5
|
15
|
|
|
15
|
|
229
|
use warnings; |
|
15
|
|
|
|
|
35
|
|
|
15
|
|
|
|
|
416
|
|
6
|
15
|
|
|
15
|
|
73
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
70
|
|
7
|
15
|
|
|
15
|
|
982
|
use List::Util 1.33 qw(any); |
|
15
|
|
|
|
|
235
|
|
|
15
|
|
|
|
|
918
|
|
8
|
15
|
|
|
15
|
|
75
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
341
|
|
9
|
15
|
|
|
15
|
|
90
|
use Tangerine::Occurence; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
371
|
|
10
|
15
|
|
|
15
|
|
74
|
use Tangerine::Utils qw(stripquotelike $vre); |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
5641
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub run { |
13
|
136
|
|
|
136
|
1
|
226
|
my ($self, $s) = @_; |
14
|
136
|
100
|
100
|
191
|
|
528
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
191
|
|
100
|
|
|
1079
|
|
15
|
218
|
|
|
218
|
|
2978
|
(any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) { |
16
|
9
|
|
|
|
|
159
|
my ($version) = $s->[2] =~ $vre; |
17
|
9
|
|
50
|
|
|
108
|
$version //= ''; |
18
|
9
|
50
|
|
|
|
23
|
my $voffset = $version ? 3 : 2; |
19
|
9
|
|
|
|
|
13
|
my @args; |
20
|
9
|
50
|
|
|
|
26
|
if (scalar(@$s) > $voffset) { |
21
|
9
|
50
|
|
|
|
31
|
return if $s->[$voffset] eq ';'; |
22
|
9
|
|
|
|
|
133
|
@args = @$s; |
23
|
9
|
|
|
|
|
38
|
@args = @args[($voffset) .. $#args]; |
24
|
9
|
|
|
|
|
32
|
@args = stripquotelike(@args); |
25
|
|
|
|
|
|
|
} |
26
|
9
|
|
|
|
|
17
|
my $prefix; |
27
|
9
|
100
|
|
|
|
26
|
if ($s->[1] eq 'Tk::widgets') { |
28
|
1
|
|
|
|
|
14
|
$prefix = 'Tk' |
29
|
|
|
|
|
|
|
} else { |
30
|
8
|
|
|
|
|
70
|
$prefix = $s->[1] |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
33
|
|
|
|
|
|
|
modules => { |
34
|
|
|
|
|
|
|
map { |
35
|
9
|
|
|
|
|
19
|
( $prefix.'::'.$_ => Tangerine::Occurence->new() ) |
|
23
|
|
|
|
|
70
|
|
36
|
|
|
|
|
|
|
} @args, |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
127
|
|
|
|
|
2005
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |