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