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