line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Keyword; |
2
|
2
|
|
|
2
|
|
160056
|
use 5.006; use strict; use warnings; our $VERSION = '0.02'; |
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
2
|
|
9
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
43
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
95
|
|
3
|
2
|
|
|
2
|
|
866
|
use MooX::ReturnModifiers; use Anonymous::Object; |
|
2
|
|
|
2
|
|
909
|
|
|
2
|
|
|
|
|
82
|
|
|
2
|
|
|
|
|
1015
|
|
|
2
|
|
|
|
|
19285
|
|
|
2
|
|
|
|
|
98
|
|
4
|
2
|
|
|
2
|
|
31
|
use feature qw/state/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
636
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub import { |
7
|
2
|
100
|
|
2
|
|
41
|
my ( $package, %import ) = (shift, ref $_[0] ? %{ $_[0] } : @_); |
|
1
|
|
|
|
|
7
|
|
8
|
2
|
|
|
|
|
8
|
my $target = caller; |
9
|
2
|
|
|
|
|
11
|
my $moo = Anonymous::Object->new(object_name => 'MooX::Keyword')->hash_to_object_context({ |
10
|
|
|
|
|
|
|
return_modifiers( $target ) |
11
|
|
|
|
|
|
|
}); # *\o/* |
12
|
|
|
|
|
|
|
|
13
|
2
|
50
|
|
|
|
196294
|
if ($import{extends}) { |
14
|
0
|
|
|
|
|
0
|
$moo->extends($import{extends}); |
15
|
0
|
|
|
|
|
0
|
%import = $import{extends}->keyword_meta; |
16
|
0
|
|
|
|
|
0
|
delete $import{extends}; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
keyword($target, $moo, 'keyword_meta', { builder => sub { |
20
|
0
|
|
|
0
|
|
0
|
my $m = shift; |
21
|
0
|
|
|
|
|
0
|
return %import; |
22
|
2
|
|
|
|
|
26
|
}}); |
23
|
2
|
|
|
|
|
11
|
keyword($target, $moo, $_, $import{$_}) for keys %import; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
137
|
return 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub keyword { |
29
|
2
|
|
|
2
|
|
17
|
no strict 'refs'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
366
|
|
30
|
3
|
|
|
3
|
0
|
10
|
my ($target, $moo, $keyword, $params) = @_; |
31
|
3
|
50
|
|
|
|
14
|
die 'no builder for ${keyword}' unless $params->{builder}; |
32
|
3
|
0
|
|
|
|
12
|
for ($keyword, $params->{alias} ? ref $params->{alias} ? @{ $params->{alias} } : $params->{alias} : ()) { |
|
0
|
50
|
|
|
|
0
|
|
33
|
3
|
|
|
|
|
23
|
*{"${target}::${_}"} = sub { |
34
|
2
|
|
|
2
|
|
19596
|
$params->{builder}->($moo, @_); |
35
|
3
|
|
|
|
|
11
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |