line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
8
|
|
|
8
|
|
182429
|
use strict; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
410
|
|
2
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
465
|
|
3
|
|
|
|
|
|
|
package signatures; # git description: v0.12-5-gde90008 |
4
|
|
|
|
|
|
|
# ABSTRACT: Subroutine signatures with no source filter |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
43
|
use XSLoader; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
248
|
|
9
|
8
|
|
|
8
|
|
4962
|
use B::Hooks::Parser 0.12; |
|
8
|
|
|
|
|
32259
|
|
|
8
|
|
|
|
|
316
|
|
10
|
8
|
|
|
8
|
|
59
|
use B::Hooks::OP::Check 0.17; |
|
8
|
|
|
|
|
119
|
|
|
8
|
|
|
|
|
319
|
|
11
|
8
|
|
|
8
|
|
4919
|
use B::Hooks::OP::PPAddr 0.03; |
|
8
|
|
|
|
|
4739
|
|
|
8
|
|
|
|
|
278
|
|
12
|
8
|
|
|
8
|
|
4600
|
use B::Hooks::EndOfScope 0.08 (); |
|
8
|
|
|
|
|
91712
|
|
|
8
|
|
|
|
|
4525
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
XSLoader::load( |
15
|
|
|
|
|
|
|
__PACKAGE__, |
16
|
|
|
|
|
|
|
$VERSION, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
my %pkgs; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub import { |
23
|
14
|
|
|
14
|
|
9011
|
my ($class) = @_; |
24
|
14
|
|
|
|
|
107
|
my $caller = caller(); |
25
|
14
|
|
|
|
|
42
|
$pkgs{$caller} = $class->setup_for($caller); |
26
|
14
|
|
|
|
|
400439
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub unimport { |
30
|
2
|
|
|
2
|
|
513
|
my ($class) = @_; |
31
|
2
|
|
|
|
|
3
|
my $caller = caller(); |
32
|
2
|
|
|
|
|
9
|
$class->teardown_for(delete $pkgs{$caller}); |
33
|
2
|
|
|
|
|
102
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub setup_for { |
38
|
14
|
|
|
14
|
0
|
23
|
my ($class, $caller) = @_; |
39
|
14
|
|
|
|
|
233
|
my $ret = $class->setup($caller); |
40
|
|
|
|
|
|
|
|
41
|
14
|
|
|
|
|
77
|
$^H{"${class}::enabled"} = 1; |
42
|
|
|
|
|
|
|
|
43
|
14
|
|
|
|
|
37
|
my $old_warn = $SIG{__WARN__}; |
44
|
|
|
|
|
|
|
$SIG{__WARN__} = sub { |
45
|
20
|
50
|
|
20
|
|
1019
|
if ($_[0] !~ /^(?:(?:Illegal character in prototype)|(?:Prototype after '.')) for /) { |
46
|
0
|
0
|
|
|
|
0
|
$old_warn ? $old_warn->(@_) : warn @_; |
47
|
|
|
|
|
|
|
} |
48
|
14
|
|
|
|
|
76
|
}; |
49
|
|
|
|
|
|
|
|
50
|
14
|
|
|
|
|
23
|
my $unregister; |
51
|
|
|
|
|
|
|
{ |
52
|
14
|
|
|
|
|
13
|
my $called = 0; |
|
14
|
|
|
|
|
20
|
|
53
|
|
|
|
|
|
|
$unregister = sub { |
54
|
30
|
100
|
|
30
|
|
4887
|
return if $called++; |
55
|
14
|
|
|
|
|
64
|
$class->teardown_for([$ret, $unregister]); |
56
|
14
|
|
|
|
|
79
|
$SIG{__WARN__} = $old_warn; |
57
|
14
|
|
|
|
|
54
|
}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
14
|
|
|
|
|
50
|
&B::Hooks::EndOfScope::on_scope_end($unregister); |
61
|
|
|
|
|
|
|
|
62
|
14
|
|
|
|
|
211
|
return [$ret, $unregister]; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub teardown_for { |
66
|
16
|
|
|
16
|
0
|
25
|
my ($class, $data) = @_; |
67
|
16
|
|
|
|
|
53
|
delete $^H{"${class}::enabled"}; |
68
|
16
|
|
|
|
|
80
|
$class->teardown($data->[0]); |
69
|
16
|
|
|
|
|
48
|
$data->[1]->(); |
70
|
16
|
|
|
|
|
33
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub callback { |
74
|
18
|
|
|
18
|
1
|
37
|
my ($class, $offset, $proto) = @_; |
75
|
18
|
|
|
|
|
64
|
my $inject = $class->proto_unwrap($proto); |
76
|
18
|
|
|
|
|
47
|
$class->inject($offset, $inject); |
77
|
18
|
|
|
|
|
1620
|
return; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub proto_unwrap { |
81
|
17
|
|
|
17
|
1
|
24
|
my ($class, $proto) = @_; |
82
|
17
|
100
|
|
|
|
46
|
return '' unless length $proto; |
83
|
16
|
|
|
|
|
61
|
return "my ($proto) = \@_;"; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub inject { |
87
|
18
|
|
|
18
|
1
|
24
|
my ($class, $offset, $inject) = @_; |
88
|
18
|
|
|
|
|
848
|
my $linestr = B::Hooks::Parser::get_linestr(); |
89
|
18
|
|
|
|
|
45
|
substr($linestr, $offset + 1, 0) = $inject; |
90
|
18
|
|
|
|
|
34
|
B::Hooks::Parser::set_linestr($linestr); |
91
|
18
|
|
|
|
|
23
|
return; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |