| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
7
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
26
|
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
73
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Pad::Tie::Plugin::Base::HashObjectAttr; |
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use base 'Pad::Tie::Plugin'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
91
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
21
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use Devel::LexAlias (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9973
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub provides { |
|
11
|
6
|
|
|
6
|
1
|
26
|
$_[0]->attr_type . '_attr' |
|
12
|
|
|
|
|
|
|
} |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub sigil { |
|
15
|
0
|
|
|
0
|
0
|
0
|
Carp::confess "subclass $_[0] did not override virtual method 'sigil'" |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub build_attrs { |
|
19
|
3
|
|
|
3
|
0
|
7
|
my ($plugin, $ctx, $self, $args) = @_; |
|
20
|
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
21
|
$args = $plugin->canon_args($args); |
|
22
|
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
8
|
my $rv = { pre_call => [] }; |
|
24
|
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
86
|
my $sigil = $plugin->sigil; |
|
26
|
|
|
|
|
|
|
# XXX something isn't quite right here in the relationship between provides |
|
27
|
|
|
|
|
|
|
# and the name of 'build_attrs' and ... |
|
28
|
3
|
|
|
|
|
7
|
my ($attr_type) = $plugin->provides; |
|
29
|
3
|
|
|
|
|
10
|
for my $method (keys %$args) { |
|
30
|
3
|
|
|
|
|
5
|
my $name = $args->{$method}; |
|
31
|
3
|
|
|
|
|
6
|
my $var_name = "$sigil$name"; |
|
32
|
3
|
50
|
|
|
|
9
|
if (exists $ctx->{$var_name}) { |
|
33
|
0
|
|
|
|
|
0
|
Carp::carp "removing existing context entry for $var_name; " . |
|
34
|
|
|
|
|
|
|
"adding entry for $attr_type => $method"; |
|
35
|
0
|
|
|
|
|
0
|
delete $ctx->{$var_name}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
$plugin->build_one_attr( |
|
38
|
3
|
|
|
|
|
26
|
$ctx, $self, { |
|
39
|
|
|
|
|
|
|
method => $method, |
|
40
|
|
|
|
|
|
|
name => $name, |
|
41
|
|
|
|
|
|
|
}, |
|
42
|
|
|
|
|
|
|
$rv, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
16
|
return $rv; |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub build_one_attr { |
|
50
|
3
|
|
|
3
|
0
|
6
|
my ($plugin, $ctx, $self, $arg, $rv) = @_; |
|
51
|
3
|
|
|
|
|
8
|
my $sigil = $plugin->sigil; |
|
52
|
3
|
|
|
|
|
23
|
push @{ $rv->{pre_call} }, sub { |
|
53
|
27
|
|
|
27
|
|
214
|
my ($self, $code, $args) = @_; |
|
54
|
27
|
|
|
|
|
814
|
Devel::LexAlias::lexalias( |
|
55
|
|
|
|
|
|
|
$code, |
|
56
|
|
|
|
|
|
|
"$sigil$arg->{name}", |
|
57
|
|
|
|
|
|
|
$plugin->ref_for_attr( |
|
58
|
|
|
|
|
|
|
$ctx, |
|
59
|
|
|
|
|
|
|
$self, |
|
60
|
|
|
|
|
|
|
$arg, |
|
61
|
|
|
|
|
|
|
), |
|
62
|
|
|
|
|
|
|
); |
|
63
|
3
|
|
|
|
|
4
|
}; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |