line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Method::Generate::BuildAll; |
2
|
28
|
|
|
28
|
|
3415
|
use strict; |
|
28
|
|
|
|
|
73
|
|
|
28
|
|
|
|
|
900
|
|
3
|
28
|
|
|
28
|
|
136
|
use warnings; |
|
28
|
|
|
|
|
58
|
|
|
28
|
|
|
|
|
714
|
|
4
|
|
|
|
|
|
|
|
5
|
28
|
|
|
28
|
|
134
|
use Moo::Object (); |
|
28
|
|
|
|
|
54
|
|
|
28
|
|
|
|
|
966
|
|
6
|
28
|
|
|
28
|
|
1332
|
BEGIN { our @ISA = qw(Moo::Object) } |
7
|
28
|
|
|
28
|
|
1371
|
use Sub::Quote qw(quote_sub quotify); |
|
28
|
|
|
|
|
12941
|
|
|
28
|
|
|
|
|
1777
|
|
8
|
28
|
|
|
28
|
|
1584
|
use Moo::_Utils qw(_getglob _linear_isa); |
|
28
|
|
|
|
|
62
|
|
|
28
|
|
|
|
|
9284
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub generate_method { |
11
|
22
|
|
|
22
|
0
|
66
|
my ($self, $into) = @_; |
12
|
22
|
|
|
|
|
92
|
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
|
|
51
|
my ($self, $into) = @_; |
26
|
22
|
|
|
|
|
139
|
' 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
|
495
|
my ($self, $into, $me, $args) = @_; |
33
|
|
|
|
|
|
|
my @builds = |
34
|
180
|
|
|
|
|
412
|
grep *{_getglob($_)}{CODE}, |
35
|
|
|
|
|
|
|
map "${_}::BUILD", |
36
|
56
|
|
|
|
|
110
|
reverse @{_linear_isa($into)}; |
|
56
|
|
|
|
|
469
|
|
37
|
56
|
|
|
|
|
616
|
' (('.$args.')[0]->{__no_BUILD__} or ('."\n" |
38
|
|
|
|
|
|
|
.join('', map qq{ ${me}->${_}(${args}),\n}, @builds) |
39
|
|
|
|
|
|
|
." )),\n"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |