line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::prefixedlist; |
2
|
|
|
|
|
|
|
$Tangerine::hook::prefixedlist::VERSION = '0.23'; |
3
|
16
|
|
|
16
|
|
812
|
use 5.010; |
|
16
|
|
|
|
|
37
|
|
4
|
16
|
|
|
16
|
|
49
|
use strict; |
|
16
|
|
|
|
|
14
|
|
|
16
|
|
|
|
|
257
|
|
5
|
16
|
|
|
16
|
|
89
|
use warnings; |
|
16
|
|
|
|
|
255
|
|
|
16
|
|
|
|
|
328
|
|
6
|
16
|
|
|
16
|
|
105
|
use parent 'Tangerine::Hook'; |
|
16
|
|
|
|
|
17
|
|
|
16
|
|
|
|
|
102
|
|
7
|
16
|
|
|
16
|
|
672
|
use Tangerine::HookData; |
|
16
|
|
|
|
|
22
|
|
|
16
|
|
|
|
|
228
|
|
8
|
16
|
|
|
16
|
|
48
|
use Tangerine::Occurence; |
|
16
|
|
|
|
|
14
|
|
|
16
|
|
|
|
|
268
|
|
9
|
16
|
|
|
16
|
|
39
|
use Tangerine::Utils qw(any stripquotelike $vre); |
|
16
|
|
|
|
|
19
|
|
|
16
|
|
|
|
|
4117
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub run { |
12
|
142
|
|
|
142
|
1
|
135
|
my ($self, $s) = @_; |
13
|
142
|
100
|
100
|
199
|
|
316
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
199
|
|
100
|
|
|
598
|
|
14
|
230
|
|
|
230
|
|
1699
|
(any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) { |
15
|
9
|
|
|
|
|
70
|
my ($version) = $s->[2] =~ $vre; |
16
|
9
|
|
50
|
|
|
73
|
$version //= ''; |
17
|
9
|
50
|
|
|
|
16
|
my $voffset = $version ? 3 : 2; |
18
|
9
|
|
|
|
|
7
|
my @args; |
19
|
9
|
50
|
|
|
|
25
|
if (scalar(@$s) > $voffset) { |
20
|
9
|
50
|
|
|
|
16
|
return if $s->[$voffset] eq ';'; |
21
|
9
|
|
|
|
|
85
|
@args = @$s; |
22
|
9
|
|
|
|
|
21
|
@args = @args[($voffset) .. $#args]; |
23
|
9
|
|
|
|
|
22
|
@args = stripquotelike(@args); |
24
|
|
|
|
|
|
|
} |
25
|
9
|
|
|
|
|
10
|
my $prefix; |
26
|
9
|
100
|
|
|
|
21
|
if ($s->[1] eq 'Tk::widgets') { |
27
|
1
|
|
|
|
|
9
|
$prefix = 'Tk' |
28
|
|
|
|
|
|
|
} else { |
29
|
8
|
|
|
|
|
42
|
$prefix = $s->[1] |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
32
|
|
|
|
|
|
|
modules => { |
33
|
|
|
|
|
|
|
map { |
34
|
9
|
|
|
|
|
15
|
( $prefix.'::'.$_ => Tangerine::Occurence->new() ) |
|
23
|
|
|
|
|
45
|
|
35
|
|
|
|
|
|
|
} @args, |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
133
|
|
|
|
|
1089
|
return; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |