line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Method::Generate::BuildAll; |
2
|
28
|
|
|
28
|
|
3463
|
use strict; |
|
28
|
|
|
|
|
58
|
|
|
28
|
|
|
|
|
852
|
|
3
|
28
|
|
|
28
|
|
181
|
use warnings; |
|
28
|
|
|
|
|
54
|
|
|
28
|
|
|
|
|
673
|
|
4
|
|
|
|
|
|
|
|
5
|
28
|
|
|
28
|
|
135
|
use Moo::Object (); |
|
28
|
|
|
|
|
64
|
|
|
28
|
|
|
|
|
983
|
|
6
|
28
|
|
|
28
|
|
1284
|
BEGIN { our @ISA = qw(Moo::Object) } |
7
|
28
|
|
|
28
|
|
1201
|
use Sub::Quote qw(quote_sub quotify); |
|
28
|
|
|
|
|
12412
|
|
|
28
|
|
|
|
|
1658
|
|
8
|
28
|
|
|
28
|
|
1019
|
use Moo::_Utils qw(_getglob _linear_isa); |
|
28
|
|
|
|
|
67
|
|
|
28
|
|
|
|
|
9996
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub generate_method { |
11
|
22
|
|
|
22
|
0
|
69
|
my ($self, $into) = @_; |
12
|
22
|
|
|
|
|
89
|
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
|
|
49
|
my ($self, $into) = @_; |
26
|
22
|
|
|
|
|
70
|
' 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
|
477
|
my ($self, $into, $me, $args) = @_; |
33
|
|
|
|
|
|
|
my @builds = |
34
|
180
|
|
|
|
|
420
|
grep *{_getglob($_)}{CODE}, |
35
|
|
|
|
|
|
|
map "${_}::BUILD", |
36
|
56
|
|
|
|
|
105
|
reverse @{_linear_isa($into)}; |
|
56
|
|
|
|
|
386
|
|
37
|
56
|
|
|
|
|
584
|
' (('.$args.')[0]->{__no_BUILD__} or ('."\n" |
38
|
|
|
|
|
|
|
.join('', map qq{ ${me}->${_}(${args}),\n}, @builds) |
39
|
|
|
|
|
|
|
." )),\n"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |