VAST/term__S_name.pm untested

filter: Statementstmt 0.0% 0 / 45 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 73 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use v5.10;
2 use MooseX::Declare;
3 use utf8;
4 class VAST::term__S_name {
5 use Mildew::AST::Helpers;
6 method emit_m0ld {
7  
8  
9 my $name = $self->{longname}->{name};
10 if ($name->{morename} and !$name->{identifier}) {
11 my @name = map {$_->{identifier}[0]{TEXT}} @{$name->{morename}};
12 my $thing;
13 if (scalar @name > 1) {
14 my $name = pop(@name);
15 call('postcircumfix:{ }'=>FETCH(lookup_package(@name)),[string($name)]);
16 } else {
17 lookup($name[-1]);
18 }
19  
20 } elsif ($self->{args}) {
21 my @name = $self->{longname}->components;
22 my $func;
23 if (scalar @name > 1) {
24 my $var = pop(@name);
25 $func = call('postcircumfix:{ }'=>FETCH(lookup_package(@name)),[string('&'.$var)]);
26 } else {
27 $func = lookup('&'.$name[-1]);
28 }
29 fcall FETCH($func) => named_and_positional($self->{args}->emit_m0ld);
30 } else {
31 my $pkg;
32 if ($name->{identifier}{TEXT} eq 'CALLER') {
33 $pkg = call new => reg '?SMOP__S1P__FlattenedScope',
34 [ call lexical => (call back => (call continuation => reg '$interpreter')) ];
35 } elsif ($name->{identifier}{TEXT} eq 'MY') {
36 $pkg = call new => reg '?SMOP__S1P__FlattenedScope',
37 [ reg '$scope' ];
38 } else {
39 XXX;
40 }
41 if ($self->{postcircumfix} && @{$self->{postcircumfix}}) {
42 call('postcircumfix:{ }'=>FETCH($pkg),[string($self->{postcircumfix}[0]{nibble}->Str)]);
43 } else {
44 $pkg;
45 }
46 }
47 }
48 }