line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Parse::Method::Signatures::Param::Named; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
3046
|
use Moose::Role; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
27
|
|
4
|
3
|
|
|
3
|
|
11686
|
use MooseX::Types::Moose qw/Str/; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
9783
|
use namespace::clean -except => 'meta'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
34
|
|
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
|
|
89
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
# strip sigil |
17
|
72
|
|
|
|
|
2309
|
return substr($self->variable_name, 1); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _build_label { |
21
|
35
|
|
|
35
|
|
65
|
my ($self) = @_; |
22
|
35
|
|
|
|
|
72
|
return $self->_label_from_variable_name; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _stringify_required { |
26
|
42
|
|
|
42
|
|
55
|
my ($self) = @_; |
27
|
42
|
100
|
|
|
|
1272
|
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; |