VAST/longname.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 38 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use MooseX::Declare;
2 class VAST::longname {
3 use utf8;
4 use Mildew::AST::Helpers;
5 method canonical {
6 my $single_variant = '';
7 if ($self->{colonpair}[1]) {
8 if ($self->{colonpair}[1]{signature}) {
9 # TODO handle whitespace sensibly
10 $single_variant = ':(' . $self->{colonpair}[1]{signature}->Str . ')';
11 } else {
12 XXX;
13 }
14 }
15 my $name = $self->{name}{identifier}{TEXT};
16 my $v = $self->{colonpair}[0]{v};
17 if ($v) {
18 $name . ':' . $v->{circumfix}{nibble}->Str . $single_variant;
19 } else {
20 $name;
21 }
22 }
23 method components {
24 my $nibbles = $self->{colonpair}[0]{v}{nibble}{nibbles}[0];
25 my @components = ($self->{name}{identifier}{TEXT},map {$_->{identifier}[0]{TEXT}} @{$self->{name}{morename}});
26 $components[-1] .= ':' . $nibbles if $nibbles;
27 return @components;
28 }
29 }
30 1;