line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Method::Generate::BuildAll; |
2
|
28
|
|
|
28
|
|
3097
|
use strict; |
|
28
|
|
|
|
|
61
|
|
|
28
|
|
|
|
|
943
|
|
3
|
28
|
|
|
28
|
|
152
|
use warnings; |
|
28
|
|
|
|
|
54
|
|
|
28
|
|
|
|
|
836
|
|
4
|
|
|
|
|
|
|
|
5
|
28
|
|
|
28
|
|
149
|
use Moo::Object (); |
|
28
|
|
|
|
|
58
|
|
|
28
|
|
|
|
|
1024
|
|
6
|
28
|
|
|
28
|
|
1456
|
BEGIN { our @ISA = qw(Moo::Object) } |
7
|
28
|
|
|
28
|
|
2118
|
use Sub::Quote qw(quote_sub quotify); |
|
28
|
|
|
|
|
12389
|
|
|
28
|
|
|
|
|
1863
|
|
8
|
28
|
|
|
28
|
|
1270
|
use Moo::_Utils qw(_getglob _linear_isa); |
|
28
|
|
|
|
|
70
|
|
|
28
|
|
|
|
|
10052
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub generate_method { |
11
|
22
|
|
|
22
|
0
|
66
|
my ($self, $into) = @_; |
12
|
22
|
|
|
|
|
86
|
quote_sub "${into}::BUILDALL" |
13
|
|
|
|
|
|
|
=> join('', |
14
|
|
|
|
|
|
|
$self->_handle_subbuild($into), |
15
|
|
|
|
|
|
|
qq{ my \$self = shift;\n}, |
16
|
|
|
|
|
|
|
$self->buildall_body_for($into, '$self', '@_'), |
17
|
|
|
|
|
|
|
qq{ return \$self\n}, |
18
|
|
|
|
|
|
|
) |
19
|
|
|
|
|
|
|
=> {} |
20
|
|
|
|
|
|
|
=> { no_defer => 1 } |
21
|
|
|
|
|
|
|
; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _handle_subbuild { |
25
|
22
|
|
|
22
|
|
102
|
my ($self, $into) = @_; |
26
|
22
|
|
|
|
|
91
|
' if (ref($_[0]) ne '.quotify($into).') {'."\n". |
27
|
|
|
|
|
|
|
' return shift->Moo::Object::BUILDALL(@_)'.";\n". |
28
|
|
|
|
|
|
|
' }'."\n"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub buildall_body_for { |
32
|
56
|
|
|
56
|
0
|
494
|
my ($self, $into, $me, $args) = @_; |
33
|
|
|
|
|
|
|
my @builds = |
34
|
180
|
|
|
|
|
418
|
grep *{_getglob($_)}{CODE}, |
35
|
|
|
|
|
|
|
map "${_}::BUILD", |
36
|
56
|
|
|
|
|
100
|
reverse @{_linear_isa($into)}; |
|
56
|
|
|
|
|
412
|
|
37
|
56
|
|
|
|
|
568
|
' (('.$args.')[0]->{__no_BUILD__} or ('."\n" |
38
|
|
|
|
|
|
|
.join('', map qq{ ${me}->${_}(${args}),\n}, @builds) |
39
|
|
|
|
|
|
|
." )),\n"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |