line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Function::Parameters::Info; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
53
|
use v5.14.0; |
|
4
|
|
|
|
|
15
|
|
4
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
128
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
21
|
use Function::Parameters; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
26
|
|
7
|
4
|
|
|
4
|
|
26
|
use Carp (); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
429
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '2.002004'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
package Function::Parameters::Param; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use overload |
15
|
40
|
50
|
|
40
|
|
7952
|
fallback => 1, |
16
|
4
|
|
|
|
|
37
|
'""' => method (@) { $self->{name} }, |
|
40
|
|
|
|
|
62
|
|
|
40
|
|
|
|
|
61
|
|
|
40
|
|
|
|
|
809
|
|
17
|
4
|
|
|
4
|
|
39
|
; |
|
4
|
|
|
|
|
15
|
|
18
|
|
|
|
|
|
|
|
19
|
42
|
50
|
33
|
42
|
|
94
|
method new($class: :$name, :$type) { |
|
42
|
50
|
|
|
|
169
|
|
|
42
|
50
|
|
|
|
68
|
|
|
42
|
50
|
|
|
|
110
|
|
|
42
|
50
|
|
|
|
104
|
|
|
42
|
|
|
|
|
92
|
|
|
42
|
|
|
|
|
107
|
|
|
42
|
|
|
|
|
61
|
|
20
|
42
|
|
|
|
|
235
|
bless { @_ }, $class |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
8
|
50
|
|
8
|
|
981
|
method name() { $self->{name} } |
|
8
|
50
|
|
|
|
18
|
|
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
61
|
|
24
|
8
|
50
|
|
8
|
|
24
|
method type() { $self->{type} } |
|
8
|
50
|
|
|
|
20
|
|
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
29
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
method new($class: |
28
|
|
|
|
|
|
|
:$keyword, |
29
|
|
|
|
|
|
|
:$nshift, |
30
|
|
|
|
|
|
|
:$_positional_required, |
31
|
|
|
|
|
|
|
:$_positional_optional, |
32
|
|
|
|
|
|
|
:$_named_required, |
33
|
|
|
|
|
|
|
:$_named_optional, |
34
|
|
|
|
|
|
|
:$slurpy, |
35
|
16
|
50
|
33
|
16
|
0
|
62
|
) { |
|
16
|
50
|
|
|
|
68
|
|
|
16
|
50
|
|
|
|
31
|
|
|
16
|
50
|
|
|
|
76
|
|
|
16
|
50
|
|
|
|
46
|
|
|
16
|
50
|
|
|
|
41
|
|
|
16
|
50
|
|
|
|
39
|
|
|
16
|
50
|
|
|
|
34
|
|
|
16
|
50
|
|
|
|
33
|
|
|
16
|
50
|
|
|
|
34
|
|
|
16
|
|
|
|
|
33
|
|
|
16
|
|
|
|
|
39
|
|
|
16
|
|
|
|
|
21
|
|
36
|
16
|
|
|
|
|
93
|
bless {@_}, $class |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
11
|
50
|
|
11
|
0
|
77
|
method keyword() { $self->{keyword} } |
|
11
|
50
|
|
|
|
25
|
|
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
13
|
|
|
11
|
|
|
|
|
55
|
|
40
|
55
|
50
|
|
55
|
0
|
118
|
method nshift () { $self->{nshift} } |
|
55
|
50
|
|
|
|
111
|
|
|
55
|
|
|
|
|
83
|
|
|
55
|
|
|
|
|
76
|
|
|
55
|
|
|
|
|
106
|
|
41
|
21
|
50
|
|
21
|
1
|
54
|
method slurpy () { $self->{slurpy} } |
|
21
|
50
|
|
|
|
46
|
|
|
21
|
|
|
|
|
32
|
|
|
21
|
|
|
|
|
28
|
|
|
21
|
|
|
|
|
87
|
|
42
|
22
|
50
|
|
22
|
1
|
67
|
method positional_optional() { @{$self->{_positional_optional}} } |
|
22
|
50
|
|
|
|
45
|
|
|
22
|
|
|
|
|
48
|
|
|
22
|
|
|
|
|
31
|
|
|
22
|
|
|
|
|
38
|
|
|
22
|
|
|
|
|
87
|
|
43
|
38
|
50
|
|
38
|
1
|
103
|
method named_required () { @{$self->{_named_required}} } |
|
38
|
50
|
|
|
|
96
|
|
|
38
|
|
|
|
|
62
|
|
|
38
|
|
|
|
|
47
|
|
|
38
|
|
|
|
|
56
|
|
|
38
|
|
|
|
|
153
|
|
44
|
22
|
50
|
|
22
|
1
|
66
|
method named_optional () { @{$self->{_named_optional}} } |
|
22
|
50
|
|
|
|
43
|
|
|
22
|
|
|
|
|
41
|
|
|
22
|
|
|
|
|
25
|
|
|
22
|
|
|
|
|
36
|
|
|
22
|
|
|
|
|
96
|
|
45
|
|
|
|
|
|
|
|
46
|
22
|
50
|
|
22
|
1
|
77
|
method positional_required() { |
|
22
|
50
|
|
|
|
49
|
|
|
22
|
|
|
|
|
41
|
|
|
22
|
|
|
|
|
28
|
|
47
|
22
|
|
|
|
|
35
|
my @p = @{$self->{_positional_required}}; |
|
22
|
|
|
|
|
54
|
|
48
|
22
|
|
|
|
|
51
|
splice @p, 0, $self->nshift; |
49
|
|
|
|
|
|
|
@p |
50
|
22
|
|
|
|
|
129
|
} |
51
|
|
|
|
|
|
|
|
52
|
12
|
50
|
|
12
|
1
|
40
|
method args_min() { |
|
12
|
50
|
|
|
|
27
|
|
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
18
|
|
53
|
12
|
|
|
|
|
19
|
my $r = 0; |
54
|
12
|
|
|
|
|
18
|
$r += @{$self->{_positional_required}}; |
|
12
|
|
|
|
|
23
|
|
55
|
12
|
|
|
|
|
30
|
$r += $self->named_required * 2; |
56
|
12
|
|
|
|
|
47
|
$r |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
12
|
50
|
|
12
|
1
|
38
|
method args_max() { |
|
12
|
50
|
|
|
|
29
|
|
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
15
|
|
60
|
12
|
100
|
100
|
|
|
28
|
return 0 + 'Inf' if defined $self->slurpy || $self->named_required || $self->named_optional; |
|
|
|
66
|
|
|
|
|
61
|
4
|
|
|
|
|
8
|
my $r = 0; |
62
|
4
|
|
|
|
|
6
|
$r += @{$self->{_positional_required}}; |
|
4
|
|
|
|
|
9
|
|
63
|
4
|
|
|
|
|
22
|
$r += $self->positional_optional; |
64
|
4
|
|
|
|
|
15
|
$r |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
12
|
50
|
|
12
|
1
|
249
|
method invocant() { |
|
12
|
50
|
|
|
|
28
|
|
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
19
|
|
68
|
12
|
|
|
|
|
28
|
my $nshift = $self->nshift; |
69
|
|
|
|
|
|
|
return undef |
70
|
12
|
100
|
|
|
|
41
|
if $nshift == 0; |
71
|
6
|
100
|
|
|
|
20
|
return $self->{_positional_required}[0] |
72
|
|
|
|
|
|
|
if $nshift == 1; |
73
|
3
|
|
|
|
|
369
|
Carp::croak "Can't return a single invocant; this function has $nshift"; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
21
|
50
|
|
21
|
1
|
73
|
method invocants() { |
|
21
|
50
|
|
|
|
46
|
|
|
21
|
|
|
|
|
34
|
|
|
21
|
|
|
|
|
31
|
|
77
|
21
|
|
|
|
|
28
|
my @p = @{$self->{_positional_required}}; |
|
21
|
|
|
|
|
58
|
|
78
|
21
|
|
|
|
|
51
|
splice @p, $self->nshift; |
79
|
|
|
|
|
|
|
@p |
80
|
21
|
|
|
|
|
98
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
'ok' |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |