line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Function::Parameters::Info; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
84
|
use v5.14.0; |
|
4
|
|
|
|
|
11
|
|
4
|
4
|
|
|
4
|
|
18
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
117
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
14
|
use Function::Parameters; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
24
|
|
7
|
4
|
|
|
4
|
|
19
|
use Carp (); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
447
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '2.000005'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
package Function::Parameters::Param; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use overload |
15
|
40
|
50
|
|
40
|
|
8101
|
fallback => 1, |
16
|
4
|
|
|
|
|
29
|
'""' => method (@) { $self->{name} }, |
|
40
|
|
|
|
|
36
|
|
|
40
|
|
|
|
|
27
|
|
|
40
|
|
|
|
|
698
|
|
17
|
4
|
|
|
4
|
|
17
|
; |
|
4
|
|
|
|
|
4
|
|
18
|
|
|
|
|
|
|
|
19
|
42
|
50
|
33
|
42
|
|
65
|
method new($class: :$name, :$type) { |
|
42
|
50
|
|
|
|
144
|
|
|
42
|
50
|
|
|
|
54
|
|
|
42
|
50
|
|
|
|
72
|
|
|
42
|
50
|
|
|
|
67
|
|
|
42
|
|
|
|
|
70
|
|
|
42
|
|
|
|
|
69
|
|
|
42
|
|
|
|
|
22
|
|
20
|
42
|
|
|
|
|
212
|
bless { @_ }, $class |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
8
|
50
|
|
8
|
|
1009
|
method name() { $self->{name} } |
|
8
|
50
|
|
|
|
15
|
|
|
8
|
|
|
|
|
6
|
|
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
51
|
|
24
|
8
|
50
|
|
8
|
|
17
|
method type() { $self->{type} } |
|
8
|
50
|
|
|
|
13
|
|
|
8
|
|
|
|
|
5
|
|
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
19
|
|
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
|
24
|
) { |
|
16
|
50
|
|
|
|
67
|
|
|
16
|
50
|
|
|
|
14
|
|
|
16
|
50
|
|
|
|
88
|
|
|
16
|
50
|
|
|
|
29
|
|
|
16
|
50
|
|
|
|
26
|
|
|
16
|
50
|
|
|
|
29
|
|
|
16
|
50
|
|
|
|
23
|
|
|
16
|
50
|
|
|
|
22
|
|
|
16
|
50
|
|
|
|
22
|
|
|
16
|
|
|
|
|
22
|
|
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
10
|
|
36
|
16
|
|
|
|
|
76
|
bless {@_}, $class |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
11
|
50
|
|
11
|
0
|
55
|
method keyword() { $self->{keyword} } |
|
11
|
50
|
|
|
|
16
|
|
|
11
|
|
|
|
|
9
|
|
|
11
|
|
|
|
|
8
|
|
|
11
|
|
|
|
|
53
|
|
40
|
55
|
50
|
|
55
|
0
|
86
|
method nshift () { $self->{nshift} } |
|
55
|
50
|
|
|
|
72
|
|
|
55
|
|
|
|
|
40
|
|
|
55
|
|
|
|
|
47
|
|
|
55
|
|
|
|
|
65
|
|
41
|
21
|
50
|
|
21
|
1
|
39
|
method slurpy () { $self->{slurpy} } |
|
21
|
50
|
|
|
|
33
|
|
|
21
|
|
|
|
|
15
|
|
|
21
|
|
|
|
|
14
|
|
|
21
|
|
|
|
|
65
|
|
42
|
22
|
50
|
|
22
|
1
|
44
|
method positional_optional() { @{$self->{_positional_optional}} } |
|
22
|
50
|
|
|
|
37
|
|
|
22
|
|
|
|
|
15
|
|
|
22
|
|
|
|
|
18
|
|
|
22
|
|
|
|
|
18
|
|
|
22
|
|
|
|
|
63
|
|
43
|
38
|
50
|
|
38
|
1
|
72
|
method named_required () { @{$self->{_named_required}} } |
|
38
|
50
|
|
|
|
56
|
|
|
38
|
|
|
|
|
29
|
|
|
38
|
|
|
|
|
27
|
|
|
38
|
|
|
|
|
30
|
|
|
38
|
|
|
|
|
132
|
|
44
|
22
|
50
|
|
22
|
1
|
48
|
method named_optional () { @{$self->{_named_optional}} } |
|
22
|
50
|
|
|
|
34
|
|
|
22
|
|
|
|
|
20
|
|
|
22
|
|
|
|
|
10
|
|
|
22
|
|
|
|
|
19
|
|
|
22
|
|
|
|
|
78
|
|
45
|
|
|
|
|
|
|
|
46
|
22
|
50
|
|
22
|
1
|
51
|
method positional_required() { |
|
22
|
50
|
|
|
|
32
|
|
|
22
|
|
|
|
|
19
|
|
|
22
|
|
|
|
|
17
|
|
47
|
22
|
|
|
|
|
18
|
my @p = @{$self->{_positional_required}}; |
|
22
|
|
|
|
|
41
|
|
48
|
22
|
|
|
|
|
30
|
splice @p, 0, $self->nshift; |
49
|
|
|
|
|
|
|
@p |
50
|
22
|
|
|
|
|
87
|
} |
51
|
|
|
|
|
|
|
|
52
|
12
|
50
|
|
12
|
1
|
32
|
method args_min() { |
|
12
|
50
|
|
|
|
19
|
|
|
12
|
|
|
|
|
9
|
|
|
12
|
|
|
|
|
10
|
|
53
|
12
|
|
|
|
|
9
|
my $r = 0; |
54
|
12
|
|
|
|
|
8
|
$r += @{$self->{_positional_required}}; |
|
12
|
|
|
|
|
16
|
|
55
|
12
|
|
|
|
|
22
|
$r += $self->named_required * 2; |
56
|
12
|
|
|
|
|
34
|
$r |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
12
|
50
|
|
12
|
1
|
30
|
method args_max() { |
|
12
|
50
|
|
|
|
17
|
|
|
12
|
|
|
|
|
11
|
|
|
12
|
|
|
|
|
7
|
|
60
|
12
|
100
|
100
|
|
|
19
|
return 0 + 'Inf' if defined $self->slurpy || $self->named_required || $self->named_optional; |
|
|
|
66
|
|
|
|
|
61
|
4
|
|
|
|
|
3
|
my $r = 0; |
62
|
4
|
|
|
|
|
3
|
$r += @{$self->{_positional_required}}; |
|
4
|
|
|
|
|
6
|
|
63
|
4
|
|
|
|
|
6
|
$r += $self->positional_optional; |
64
|
4
|
|
|
|
|
10
|
$r |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
12
|
50
|
|
12
|
1
|
155
|
method invocant() { |
|
12
|
50
|
|
|
|
19
|
|
|
12
|
|
|
|
|
11
|
|
|
12
|
|
|
|
|
10
|
|
68
|
12
|
|
|
|
|
21
|
my $nshift = $self->nshift; |
69
|
|
|
|
|
|
|
return undef |
70
|
12
|
100
|
|
|
|
31
|
if $nshift == 0; |
71
|
6
|
100
|
|
|
|
16
|
return $self->{_positional_required}[0] |
72
|
|
|
|
|
|
|
if $nshift == 1; |
73
|
3
|
|
|
|
|
303
|
Carp::croak "Can't return a single invocant; this function has $nshift"; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
21
|
50
|
|
21
|
1
|
54
|
method invocants() { |
|
21
|
50
|
|
|
|
50
|
|
|
21
|
|
|
|
|
17
|
|
|
21
|
|
|
|
|
17
|
|
77
|
21
|
|
|
|
|
15
|
my @p = @{$self->{_positional_required}}; |
|
21
|
|
|
|
|
39
|
|
78
|
21
|
|
|
|
|
31
|
splice @p, $self->nshift; |
79
|
|
|
|
|
|
|
@p |
80
|
21
|
|
|
|
|
65
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
'ok' |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |