| 1 | use MooseX::Declare; | ||
| 2 | class VAST::sublongname { | ||
| 3 | use utf8; | ||
| 4 | use Mildew::AST::Helpers; | ||
| 5 | method components { | ||
| 6 | my $shortname = $self->{subshortname}; | ||
| 7 | if ($shortname->{desigilname}) { | ||
| 8 | $shortname->{desigilname}{longname}->components; | ||
| 9 | } elsif ($shortname->{category}) { | ||
| 10 | my $single_variant = ''; | ||
| 11 | if ($shortname->{colonpair}[1]) { | ||
| 12 | if ($shortname->{colonpair}[1]{fakesignature}) { | ||
| 13 | # TODO handle whitespace sensibly | ||
| 14 | $single_variant = ':(' . $shortname->{colonpair}[1]{fakesignature}->Str . ')'; | ||
| 15 | } else { | ||
| 16 | XXX; | ||
| 17 | } | ||
| 18 | } | ||
| 19 | # TODO find the source of the warning | ||
| 20 | my $ret = | ||
| 21 | $self->{sigil}{TEXT} | ||
| 22 | . ($self->{twigil}[0]{TEXT} // '') | ||
| 23 | . $shortname->{category}{TEXT} | ||
| 24 | . ':' | ||
| 25 | . $shortname->{colonpair}[0]{v}{circumfix}{nibble}->Str | ||
| 26 | . $single_variant; | ||
| 27 | return $ret; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||
| 31 | 1; |