line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sub::Meta::Finder::FunctionParameters; |
2
|
2
|
|
|
2
|
|
1500
|
use strict; |
|
2
|
|
|
1
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
|
1
|
|
|
|
|
473
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
1
|
|
3
|
|
|
2
|
|
|
|
|
93
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
349
|
use Function::Parameters; |
|
0
|
|
|
1
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
146
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub find_materials { |
8
|
|
|
|
|
|
|
my $sub = shift; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $info = Function::Parameters::info($sub); |
11
|
|
|
|
|
|
|
return unless $info; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $keyword = $info->keyword; |
14
|
|
|
|
|
|
|
my $nshift = $info->nshift; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @args; |
17
|
|
|
|
|
|
|
for ($info->positional_required) { |
18
|
|
|
|
|
|
|
push @args => { |
19
|
|
|
|
|
|
|
type => $_->type, |
20
|
|
|
|
|
|
|
name => $_->name, |
21
|
|
|
|
|
|
|
positional => 1, |
22
|
|
|
|
|
|
|
required => 1, |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
for ($info->positional_optional) { |
27
|
|
|
|
|
|
|
push @args => { |
28
|
|
|
|
|
|
|
type => $_->type, |
29
|
|
|
|
|
|
|
name => $_->name, |
30
|
|
|
|
|
|
|
positional => 1, |
31
|
|
|
|
|
|
|
required => 0, |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
for ($info->named_required) { |
36
|
|
|
|
|
|
|
push @args => { |
37
|
|
|
|
|
|
|
type => $_->type, |
38
|
|
|
|
|
|
|
name => $_->name, |
39
|
|
|
|
|
|
|
named => 1, |
40
|
|
|
|
|
|
|
required => 1, |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
for ($info->named_optional) { |
45
|
|
|
|
|
|
|
push @args => { |
46
|
|
|
|
|
|
|
type => $_->type, |
47
|
|
|
|
|
|
|
name => $_->name, |
48
|
|
|
|
|
|
|
named => 1, |
49
|
|
|
|
|
|
|
required => 0, |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $invocant = $info->invocant ? +{ |
54
|
|
|
|
|
|
|
name => $info->invocant->name, |
55
|
|
|
|
|
|
|
$info->invocant->type ? ( type => $info->invocant->type ) : (), |
56
|
|
|
|
|
|
|
} : undef; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my $slurpy = $info->slurpy ? +{ |
59
|
|
|
|
|
|
|
name => $info->slurpy->name, |
60
|
|
|
|
|
|
|
$info->slurpy->type ? ( type => $info->slurpy->type ) : (), |
61
|
|
|
|
|
|
|
} : undef; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
return +{ |
64
|
|
|
|
|
|
|
sub => $sub, |
65
|
|
|
|
|
|
|
is_method => $keyword eq 'method' ? !!1 : !!0, |
66
|
|
|
|
|
|
|
parameters => { |
67
|
|
|
|
|
|
|
args => \@args, |
68
|
|
|
|
|
|
|
nshift => $nshift, |
69
|
|
|
|
|
|
|
$invocant ? ( invocant => $invocant ) : (), |
70
|
|
|
|
|
|
|
$slurpy ? ( slurpy => $slurpy ) : (), |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
__END__ |