line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Evo; |
2
|
67
|
|
|
67
|
|
21321
|
use strict; |
|
67
|
|
|
|
|
131
|
|
|
67
|
|
|
|
|
1621
|
|
3
|
67
|
|
|
67
|
|
294
|
use warnings; |
|
67
|
|
|
|
|
119
|
|
|
67
|
|
|
|
|
1728
|
|
4
|
67
|
|
|
67
|
|
302
|
use Carp 'croak'; |
|
67
|
|
|
|
|
120
|
|
|
67
|
|
|
|
|
3011
|
|
5
|
67
|
|
|
67
|
|
26754
|
use Module::Load (); |
|
67
|
|
|
|
|
55985
|
|
|
67
|
|
|
|
|
1215
|
|
6
|
67
|
|
|
67
|
|
18880
|
use Evo::Attr; |
|
67
|
|
|
|
|
169
|
|
|
67
|
|
|
|
|
28894
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $ARGS_RX = qr/[\s\(\[]* ( [^\)\]]*?) [\s\)\]]*/x; |
10
|
|
|
|
|
|
|
my $EMPTY_ARGS = qr/\s*\(\s*\)\s*/x; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _parse { |
13
|
2412
|
|
|
2412
|
|
5108
|
my ($caller, $val) = @_; |
14
|
2412
|
|
|
|
|
3638
|
my $orig = $val; |
15
|
2412
|
|
|
|
|
5026
|
$val =~ tr/\n/ /; |
16
|
2412
|
|
|
|
|
9736
|
$val =~ s/^\s+|\s+$//g; |
17
|
|
|
|
|
|
|
|
18
|
2412
|
|
|
|
|
20109
|
$val =~ /^ ((\-|\/?(:{2})?)? $Evo::Internal::Util::RX_PKG_NOT_FIRST*) (.*)$/x; |
19
|
2412
|
100
|
|
|
|
8372
|
croak qq#Can't parse string "$orig"# unless $1; |
20
|
2411
|
|
|
|
|
6902
|
my ($class, $args) = (Evo::Internal::Util::resolve_package($caller, $1), $4); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# () |
23
|
2411
|
100
|
|
|
|
9680
|
return ($class, 1) if $args =~ $EMPTY_ARGS; |
24
|
|
|
|
|
|
|
|
25
|
2339
|
|
|
|
|
16824
|
$args =~ s/^$ARGS_RX$/$1/; |
26
|
2339
|
100
|
|
|
|
9483
|
return ($class, 0) unless $args; |
27
|
|
|
|
|
|
|
|
28
|
744
|
|
|
|
|
2394
|
my @args = split /[,\s]+/, $args; |
29
|
744
|
|
|
|
|
3443
|
($class, 0, @args); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub import { |
33
|
809
|
|
|
809
|
|
145985
|
shift; |
34
|
809
|
|
|
|
|
2780
|
my ($target, $filename, $line) = caller; |
35
|
|
|
|
|
|
|
|
36
|
809
|
|
|
|
|
3793
|
Evo::Attr->patch_package($target); |
37
|
|
|
|
|
|
|
|
38
|
809
|
|
|
|
|
2295
|
my @list = @_; |
39
|
809
|
50
|
|
|
|
1682
|
unshift @list, '-Default' unless grep { $_ && $_ eq '-Default' } @list; |
|
794
|
50
|
|
|
|
5358
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# trim |
42
|
809
|
|
|
|
|
1613
|
@list = grep {$_} map { my $s = $_; $s =~ s/^\s+|\s+$//g; $s } map { split /[;,]/, $_ } @list; |
|
2377
|
|
|
|
|
4487
|
|
|
2377
|
|
|
|
|
3515
|
|
|
2377
|
|
|
|
|
8285
|
|
|
2377
|
|
|
|
|
4796
|
|
|
1603
|
|
|
|
|
5832
|
|
43
|
809
|
|
|
|
|
1854
|
foreach my $key (@list) { |
44
|
2376
|
|
|
|
|
13146
|
my ($src, $empty, @args) = _parse($target, $key); |
45
|
2375
|
|
|
|
|
7775
|
Module::Load::load($src); |
46
|
2375
|
100
|
|
|
|
779815
|
next if $empty; |
47
|
2305
|
100
|
|
|
|
33876
|
if (my $import = $src->can('import')) { |
|
|
100
|
|
|
|
|
|
48
|
1868
|
|
|
|
|
5831
|
Evo::Internal::Util::inject( |
49
|
|
|
|
|
|
|
package => $target, |
50
|
|
|
|
|
|
|
line => $line, |
51
|
|
|
|
|
|
|
filename => $filename, |
52
|
|
|
|
|
|
|
code => $import |
53
|
|
|
|
|
|
|
)->($src, @args); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
elsif (@args) { |
56
|
1
|
|
|
|
|
147
|
croak qq{Got import arguments but "$src" doesn't have an "import" method}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
our $VERSION = '0.0403'; # VERSION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# ABSTRACT: Evo - the next generation development framework |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |