line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::AnyEvent::Helper::Filter; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
232250
|
use strict; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
213
|
|
4
|
6
|
|
|
6
|
|
35
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
287
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: source filter for AnyEvent-ize helper |
7
|
|
|
|
|
|
|
our $VERSION = 'v0.0.5'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
30
|
use Carp; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
461
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
6
|
|
|
6
|
|
5155
|
require filtered; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my @keys = qw(-remove_func -translate_func -replace_func -delete_func -exclude_func); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import |
18
|
|
|
|
|
|
|
{ |
19
|
6
|
|
|
6
|
|
130
|
my ($pkg, %arg) = @_; |
20
|
6
|
|
|
|
|
13
|
my ($with); |
21
|
6
|
|
100
|
|
|
115
|
$arg{$_} ||= [] for @keys; |
22
|
6
|
|
|
|
|
15
|
my $trans_arg = join ",\n", map { $_." => [qw(@{$arg{$_}})]" } @keys; |
|
30
|
|
|
|
|
32
|
|
|
30
|
|
|
|
|
113
|
|
23
|
6
|
100
|
|
|
|
32
|
if(exists $arg{-transformer}) { |
24
|
2
|
|
|
|
|
6
|
my $transformer = 'Module::AnyEvent::Helper::PPI::Transform::' . $arg{-transformer}; |
25
|
2
|
|
|
|
|
139
|
eval "require $transformer"; |
26
|
2
|
100
|
|
|
|
3636
|
croak "Can't load ${transformer}: $@" if $@; |
27
|
1
|
|
|
|
|
6
|
$with = <
|
28
|
|
|
|
|
|
|
'PPI::Transform::Sequence', |
29
|
|
|
|
|
|
|
$transformer => [], |
30
|
|
|
|
|
|
|
Module::AnyEvent::Helper::PPI::Transform => [ |
31
|
|
|
|
|
|
|
${trans_arg}] |
32
|
|
|
|
|
|
|
EOF |
33
|
|
|
|
|
|
|
} else { |
34
|
4
|
|
|
|
|
12
|
$with = <
|
35
|
|
|
|
|
|
|
'Module::AnyEvent::Helper::PPI::Transform', |
36
|
|
|
|
|
|
|
${trans_arg} |
37
|
|
|
|
|
|
|
EOF |
38
|
|
|
|
|
|
|
} |
39
|
5
|
|
|
|
|
36
|
filtered->import( |
40
|
|
|
|
|
|
|
by => 'Filter::PPI::Transform', |
41
|
|
|
|
|
|
|
with => $with, |
42
|
|
|
|
|
|
|
on => $arg{-target}, |
43
|
|
|
|
|
|
|
as => $arg{-as}, |
44
|
|
|
|
|
|
|
use_ppi => 1, |
45
|
|
|
|
|
|
|
() |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |