line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Minions::Implementation; |
2
|
|
|
|
|
|
|
|
3
|
31
|
|
|
31
|
|
13154
|
use strict; |
|
31
|
|
|
|
|
58
|
|
|
31
|
|
|
|
|
775
|
|
4
|
31
|
|
|
31
|
|
728
|
use Minions::_Guts; |
|
31
|
|
|
|
|
58
|
|
|
31
|
|
|
|
|
537
|
|
5
|
31
|
|
|
31
|
|
837
|
use Package::Stash; |
|
31
|
|
|
|
|
16466
|
|
|
31
|
|
|
|
|
552
|
|
6
|
31
|
|
|
31
|
|
9177
|
use Readonly; |
|
31
|
|
|
|
|
90004
|
|
|
31
|
|
|
|
|
10539
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
38
|
|
|
38
|
|
796
|
my ($class, %arg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
38
|
|
|
|
|
238
|
strict->import(); |
12
|
|
|
|
|
|
|
|
13
|
38
|
|
|
|
|
130
|
$arg{-caller} = (caller)[0]; |
14
|
38
|
|
|
|
|
515
|
$class->define(%arg); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub define { |
18
|
38
|
|
|
38
|
0
|
117
|
my ($class, %arg) = @_; |
19
|
|
|
|
|
|
|
|
20
|
38
|
|
33
|
|
|
179
|
my $caller_pkg = delete $arg{-caller} || (caller)[0]; |
21
|
38
|
|
|
|
|
503
|
my $stash = Package::Stash->new($caller_pkg); |
22
|
|
|
|
|
|
|
|
23
|
38
|
|
|
|
|
248
|
$class->update_args(\%arg); |
24
|
38
|
|
|
|
|
134
|
$class->add_attribute_syms(\%arg, $stash); |
25
|
|
|
|
|
|
|
|
26
|
38
|
|
|
|
|
9904
|
$stash->add_symbol('%__meta__', \%arg); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub add_attribute_syms { |
30
|
38
|
|
|
38
|
0
|
80
|
my ($class, $arg, $stash) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my @slots = ( |
33
|
38
|
|
|
|
|
125
|
keys %{ $arg->{has} }, |
34
|
38
|
100
|
|
|
|
73
|
@{ $arg->{requires}{attributes} || [] }, |
|
38
|
|
|
|
|
271
|
|
35
|
|
|
|
|
|
|
'', # semiprivate pkg |
36
|
|
|
|
|
|
|
); |
37
|
38
|
|
|
|
|
142
|
foreach my $slot ( @slots ) { |
38
|
79
|
|
|
|
|
241
|
$class->add_obfu_name($arg, $stash, $slot); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub add_obfu_name { |
43
|
79
|
|
|
79
|
0
|
169
|
my ($class, $arg, $stash, $slot) = @_; |
44
|
|
|
|
|
|
|
|
45
|
79
|
|
|
|
|
543
|
my $data_version = $stash->get_symbol('$DATA_VERSION'); |
46
|
79
|
|
|
|
|
315
|
Readonly my $sym_val => sprintf( |
47
|
|
|
|
|
|
|
"%s-$slot", |
48
|
|
|
|
|
|
|
Minions::_Guts::attribute_sym($data_version), |
49
|
|
|
|
|
|
|
); |
50
|
79
|
|
|
|
|
6960
|
$Minions::_Guts::obfu_name{$slot} = $sym_val; |
51
|
|
|
|
|
|
|
|
52
|
79
|
|
|
|
|
515
|
my $prefix = ''; |
53
|
79
|
100
|
100
|
|
|
469
|
if($slot eq '' || $arg->{attr_style} eq '_2') { |
|
|
50
|
66
|
|
|
|
|
54
|
39
|
|
|
|
|
76
|
$prefix = '__'; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
elsif($arg->{attr_style} eq 'uc' || ! $arg->{attr_style}) { |
57
|
40
|
|
|
|
|
111
|
$slot = uc $slot; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
$stash->add_symbol( |
60
|
79
|
|
|
|
|
873
|
sprintf('$%s%s', $prefix, $slot), |
61
|
|
|
|
|
|
|
\ $sym_val |
62
|
|
|
|
|
|
|
); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
26
|
0
|
|
sub update_args {} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |