line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::prefixedlist; |
2
|
|
|
|
|
|
|
$Tangerine::hook::prefixedlist::VERSION = '0.19'; |
3
|
15
|
|
|
15
|
|
1000
|
use 5.010; |
|
15
|
|
|
|
|
39
|
|
4
|
15
|
|
|
15
|
|
61
|
use strict; |
|
15
|
|
|
|
|
20
|
|
|
15
|
|
|
|
|
346
|
|
5
|
15
|
|
|
15
|
|
58
|
use warnings; |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
405
|
|
6
|
15
|
|
|
15
|
|
58
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
145
|
|
7
|
15
|
|
|
15
|
|
882
|
use List::MoreUtils qw(any); |
|
15
|
|
|
|
|
23
|
|
|
15
|
|
|
|
|
97
|
|
8
|
15
|
|
|
15
|
|
5481
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
339
|
|
9
|
15
|
|
|
15
|
|
61
|
use Tangerine::Occurence; |
|
15
|
|
|
|
|
16
|
|
|
15
|
|
|
|
|
311
|
|
10
|
15
|
|
|
15
|
|
62
|
use Tangerine::Utils qw(stripquotelike); |
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
4835
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub run { |
13
|
132
|
|
|
132
|
1
|
158
|
my ($self, $s) = @_; |
14
|
132
|
100
|
100
|
185
|
|
445
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
185
|
|
100
|
|
|
694
|
|
15
|
212
|
|
|
212
|
|
2063
|
(any { $s->[1] eq $_ } qw(Mo POE Tk::widgets))) { |
16
|
9
|
|
|
|
|
69
|
my ($version) = $s->[2] =~ /^(\d.*)$/o; |
17
|
9
|
|
50
|
|
|
92
|
$version //= ''; |
18
|
9
|
50
|
|
|
|
15
|
my $voffset = $version ? 3 : 2; |
19
|
9
|
|
|
|
|
11
|
my @args; |
20
|
9
|
50
|
|
|
|
24
|
if (scalar(@$s) > $voffset) { |
21
|
9
|
50
|
|
|
|
20
|
return if $s->[$voffset] eq ';'; |
22
|
9
|
|
|
|
|
132
|
@args = @$s; |
23
|
9
|
|
|
|
|
30
|
@args = @args[($voffset) .. $#args]; |
24
|
9
|
|
|
|
|
31
|
@args = stripquotelike(@args); |
25
|
|
|
|
|
|
|
} |
26
|
9
|
|
|
|
|
13
|
my $prefix; |
27
|
9
|
100
|
|
|
|
39
|
if ($s->[1] eq 'Tk::widgets') { |
28
|
1
|
|
|
|
|
19
|
$prefix = 'Tk' |
29
|
|
|
|
|
|
|
} else { |
30
|
8
|
|
|
|
|
70
|
$prefix = $s->[1] |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
33
|
|
|
|
|
|
|
modules => { |
34
|
|
|
|
|
|
|
map { |
35
|
9
|
|
|
|
|
21
|
( $prefix.'::'.$_ => Tangerine::Occurence->new() ) |
|
23
|
|
|
|
|
75
|
|
36
|
|
|
|
|
|
|
} @args, |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
123
|
|
|
|
|
1313
|
return; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |