line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Evo; |
2
|
67
|
|
|
67
|
|
30427
|
use strict; |
|
67
|
|
|
|
|
161
|
|
|
67
|
|
|
|
|
2025
|
|
3
|
67
|
|
|
67
|
|
380
|
use warnings; |
|
67
|
|
|
|
|
155
|
|
|
67
|
|
|
|
|
2254
|
|
4
|
67
|
|
|
67
|
|
392
|
use Carp 'croak'; |
|
67
|
|
|
|
|
140
|
|
|
67
|
|
|
|
|
3925
|
|
5
|
67
|
|
|
67
|
|
47976
|
use Module::Load (); |
|
67
|
|
|
|
|
70999
|
|
|
67
|
|
|
|
|
1541
|
|
6
|
67
|
|
|
67
|
|
24496
|
use Evo::Attr; |
|
67
|
|
|
|
|
228
|
|
|
67
|
|
|
|
|
34244
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $ARGS_RX = qr/[\s\(\[]* ( [^\)\]]*?) [\s\)\]]*/x; |
10
|
|
|
|
|
|
|
my $EMPTY_ARGS = qr/\s*\(\s*\)\s*/x; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _parse { |
13
|
2533
|
|
|
2533
|
|
5800
|
my ($caller, $val) = @_; |
14
|
2533
|
|
|
|
|
4234
|
my $orig = $val; |
15
|
2533
|
|
|
|
|
5919
|
$val =~ tr/\n/ /; |
16
|
2533
|
|
|
|
|
11499
|
$val =~ s/^\s+|\s+$//g; |
17
|
|
|
|
|
|
|
|
18
|
2533
|
|
|
|
|
23611
|
$val =~ /^ ((\-|\/?(:{2})?)? $Evo::Internal::Util::RX_PKG_NOT_FIRST*) (.*)$/x; |
19
|
2533
|
100
|
|
|
|
9872
|
croak qq#Can't parse string "$orig"# unless $1; |
20
|
2532
|
|
|
|
|
8031
|
my ($class, $args) = (Evo::Internal::Util::resolve_package($caller, $1), $4); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# () |
23
|
2532
|
100
|
|
|
|
11364
|
return ($class, 1) if $args =~ $EMPTY_ARGS; |
24
|
|
|
|
|
|
|
|
25
|
2460
|
|
|
|
|
20838
|
$args =~ s/^$ARGS_RX$/$1/; |
26
|
2460
|
100
|
|
|
|
11274
|
return ($class, 0) unless $args; |
27
|
|
|
|
|
|
|
|
28
|
810
|
|
|
|
|
3249
|
my @args = split /[,\s]+/, $args; |
29
|
810
|
|
|
|
|
4323
|
($class, 0, @args); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub import { |
33
|
842
|
|
|
842
|
|
187512
|
shift; |
34
|
842
|
|
|
|
|
3682
|
my ($target, $filename, $line) = caller; |
35
|
|
|
|
|
|
|
|
36
|
842
|
|
|
|
|
4856
|
Evo::Attr->patch_package($target); |
37
|
|
|
|
|
|
|
|
38
|
842
|
|
|
|
|
2742
|
my @list = @_; |
39
|
842
|
50
|
|
|
|
1952
|
unshift @list, '-Default' unless grep { $_ && $_ eq '-Default' } @list; |
|
827
|
50
|
|
|
|
6308
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# trim |
42
|
842
|
|
|
|
|
1949
|
@list = grep {$_} map { my $s = $_; $s =~ s/^\s+|\s+$//g; $s } map { split /[;,]/, $_ } @list; |
|
2498
|
|
|
|
|
5303
|
|
|
2498
|
|
|
|
|
4106
|
|
|
2498
|
|
|
|
|
10057
|
|
|
2498
|
|
|
|
|
5546
|
|
|
1669
|
|
|
|
|
6708
|
|
43
|
842
|
|
|
|
|
2153
|
foreach my $key (@list) { |
44
|
2497
|
|
|
|
|
14986
|
my ($src, $empty, @args) = _parse($target, $key); |
45
|
2496
|
|
|
|
|
9443
|
Module::Load::load($src); |
46
|
2496
|
100
|
|
|
|
932096
|
next if $empty; |
47
|
2426
|
100
|
|
|
|
39089
|
if (my $import = $src->can('import')) { |
|
|
100
|
|
|
|
|
|
48
|
1978
|
|
|
|
|
7290
|
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
|
|
|
|
|
120
|
croak qq{Got import arguments but "$src" doesn't have an "import" method}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
our $VERSION = '0.0405'; # VERSION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# ABSTRACT: Evo - the next generation development framework |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |