line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::Method::Signatures::Param::Named; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
2582
|
use Moose::Role; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
28
|
|
4
|
3
|
|
|
3
|
|
11452
|
use MooseX::Types::Moose qw/Str/; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
9443
|
use namespace::clean -except => 'meta'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has label => ( |
9
|
|
|
|
|
|
|
is => 'ro', |
10
|
|
|
|
|
|
|
isa => Str, |
11
|
|
|
|
|
|
|
lazy_build => 1, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _label_from_variable_name { |
15
|
72
|
|
|
72
|
|
70
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
# strip sigil |
17
|
72
|
|
|
|
|
2240
|
return substr($self->variable_name, 1); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _build_label { |
21
|
35
|
|
|
35
|
|
53
|
my ($self) = @_; |
22
|
35
|
|
|
|
|
67
|
return $self->_label_from_variable_name; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _stringify_required { |
26
|
42
|
|
|
42
|
|
46
|
my ($self) = @_; |
27
|
42
|
100
|
|
|
|
1191
|
return $self->required ? q{!} : q{}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
around _stringify_variable_name => sub { |
31
|
|
|
|
|
|
|
my $orig = shift; |
32
|
|
|
|
|
|
|
my ($self) = @_; |
33
|
|
|
|
|
|
|
my $ret = q{:}; |
34
|
|
|
|
|
|
|
my ($before, $after) = (q{}) x 2; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $implicit_label = $self->_label_from_variable_name if $self->can('variable_name'); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
if (!$implicit_label || $self->label ne $implicit_label) { |
39
|
|
|
|
|
|
|
$before = $self->label . q{(}; |
40
|
|
|
|
|
|
|
$after = q{)}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$ret .= $before . $orig->(@_) . $after; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return $ret; |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |