line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
6
|
|
|
6
|
|
1007
|
use strict; |
|
6
|
|
|
|
|
60
|
|
|
6
|
|
|
|
|
642
|
|
2
|
|
|
|
|
|
|
package Inline::Foo; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require Inline; |
5
|
|
|
|
|
|
|
our @ISA = qw(Inline); |
6
|
|
|
|
|
|
|
our $VERSION = '0.86'; |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
34
|
use Carp; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
747
|
|
9
|
6
|
|
|
6
|
|
38
|
use File::Spec; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
3948
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub register { |
12
|
|
|
|
|
|
|
return { |
13
|
0
|
|
|
0
|
0
|
0
|
language => 'Foo', |
14
|
|
|
|
|
|
|
aliases => ['foo'], |
15
|
|
|
|
|
|
|
type => 'interpreted', |
16
|
|
|
|
|
|
|
suffix => 'foo', |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub usage_config { |
21
|
0
|
|
|
0
|
0
|
0
|
my $key = shift; |
22
|
0
|
|
|
|
|
0
|
"'$key' is not a valid config option for Inline::Foo\n"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub usage_config_bar { |
26
|
0
|
|
|
0
|
0
|
0
|
"Invalid value for Inline::Foo config option BAR"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub validate { |
30
|
13
|
|
|
13
|
0
|
21
|
my $o = shift; |
31
|
13
|
|
50
|
|
|
125
|
$o->{ILSM}{PATTERN} ||= 'foo-'; |
32
|
13
|
|
50
|
|
|
53
|
$o->{ILSM}{BAR} ||= 0; |
33
|
13
|
|
|
|
|
46
|
while (@_) { |
34
|
6
|
|
|
|
|
21
|
my ($key, $value) = splice @_, 0, 2; |
35
|
6
|
100
|
|
|
|
13
|
if ($key eq 'PATTERN') { |
36
|
3
|
|
|
|
|
7
|
$o->{ILSM}{PATTERN} = $value; |
37
|
3
|
|
|
|
|
10
|
next; |
38
|
|
|
|
|
|
|
} |
39
|
3
|
50
|
|
|
|
7
|
if ($key eq 'BAR') { |
40
|
3
|
50
|
|
|
|
15
|
croak usage_config_bar |
41
|
|
|
|
|
|
|
unless $value =~ /^[01]$/; |
42
|
3
|
|
|
|
|
7
|
$o->{ILSM}{BAR} = $value; |
43
|
3
|
|
|
|
|
8
|
next; |
44
|
|
|
|
|
|
|
} |
45
|
0
|
|
|
|
|
0
|
croak usage_config($key); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub build { |
50
|
13
|
|
|
13
|
0
|
19
|
my $o = shift; |
51
|
13
|
|
|
|
|
51
|
my $code = $o->{API}{code}; |
52
|
13
|
|
|
|
|
23
|
my $pattern = $o->{ILSM}{PATTERN}; |
53
|
13
|
|
|
|
|
121
|
$code =~ s/$pattern//g; |
54
|
13
|
100
|
|
|
|
47
|
$code =~ s/bar-//g if $o->{ILSM}{BAR}; |
55
|
|
|
|
|
|
|
{ |
56
|
13
|
|
|
|
|
19
|
package Foo::Tester; |
57
|
13
|
|
|
|
|
19
|
our $VERSION = '0.02'; |
58
|
13
|
|
|
2
|
|
594
|
eval $code; |
|
2
|
|
|
2
|
|
31
|
|
|
2
|
|
|
2
|
|
5
|
|
|
3
|
|
|
3
|
|
83
|
|
|
4
|
|
|
1
|
|
48
|
|
|
2
|
|
|
1
|
|
7
|
|
|
2
|
|
|
1
|
|
9
|
|
|
1
|
|
|
0
|
|
5
|
|
|
0
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
13
|
50
|
|
|
|
85
|
croak "Foo build failed:\n$@" if $@; |
61
|
13
|
|
|
|
|
101
|
my $path = File::Spec->catdir($o->{API}{install_lib},'auto',$o->{API}{modpname}); |
62
|
13
|
|
|
|
|
90
|
my $obj = $o->{API}{location}; |
63
|
13
|
50
|
|
|
|
302
|
$o->mkpath($path) unless -d $path; |
64
|
13
|
50
|
|
|
|
646
|
open FOO_OBJ, "> $obj" |
65
|
|
|
|
|
|
|
or croak "Can't open $obj for output\n$!"; |
66
|
13
|
|
|
|
|
83
|
binmode(FOO_OBJ, ':utf8'); |
67
|
13
|
|
|
|
|
118
|
print FOO_OBJ $code; |
68
|
13
|
|
|
|
|
352
|
close \*FOO_OBJ; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub load { |
72
|
13
|
|
|
13
|
0
|
24
|
my $o = shift; |
73
|
13
|
|
|
|
|
25
|
my $obj = $o->{API}{location}; |
74
|
13
|
50
|
|
|
|
382
|
open FOO_OBJ, "< $obj" |
75
|
|
|
|
|
|
|
or croak "Can't open $obj for output\n$!"; |
76
|
13
|
|
|
|
|
68
|
binmode(FOO_OBJ, ':utf8'); |
77
|
13
|
|
|
|
|
4443
|
my $code = join '', ; |
78
|
13
|
|
|
|
|
105
|
close \*FOO_OBJ; |
79
|
13
|
|
|
|
|
725
|
eval "package $o->{API}{pkg};\n$code"; |
80
|
13
|
50
|
|
|
|
111
|
croak "Unable to load Foo module $obj:\n$@" if $@; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub info { |
84
|
3
|
|
|
3
|
1
|
96
|
my $o = shift; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |