| 1 | use MooseX::Declare; | ||
| 2 | class VAST::variable { | ||
| 3 | use utf8; | ||
| 4 | use Mildew::AST::Helpers; | ||
| 5 | method emit_m0ld { | ||
| 6 | my $m = shift; | ||
| 7 | use YAML::XS; | ||
| 8 | my $twigil = $m->{twigil}[0]{SYM} || ''; | ||
| 9 | if ($twigil eq '!') { | ||
| 10 | call('postcircumfix:{ }'=> FETCH(call('^!instance_storage'=> | ||
| 11 | FETCH(lookup('$¿self')))), | ||
| 12 | [call 'postcircumfix:( )' => FETCH(call('postcircumfix:{ }' => lookupf('PRIMITIVES::'),[string '&storage_name'])) => [capturize([lookupf('$?CLASS'),string varname($m)])]]); | ||
| 13 | } elsif ($twigil eq '.') { | ||
| 14 | call($m->{desigilname}{longname}->canonical,FETCH(lookup('$¿self'))); | ||
| 15 | } elsif ($self->{desigilname}{longname}) { | ||
| 16 | my @name = $self->{desigilname}{longname}->components; | ||
| 17 | my $name = pop(@name); | ||
| 18 | $name = ($self->{sigil}{TEXT} || '').($self->{twigil}[0]{TEXT} || '') .$name; | ||
| 19 | if (scalar @name) { | ||
| 20 | $name = call('postcircumfix:{ }'=>FETCH(lookup_package(@name)),[string($name)]); | ||
| 21 | } else { | ||
| 22 | lookup($name); | ||
| 23 | } | ||
| 24 | } elsif ($self->{sublongname}) { | ||
| 25 | my ($name) = $self->{sublongname}->components; | ||
| 26 | lookup(($self->{sigil}{TEXT} || '').($self->{twigil}[0]{TEXT} || '').$name); | ||
| 27 | } else { | ||
| 28 | use YAML::XS; | ||
| 29 | die Dump($self); | ||
| 30 | |||
| 31 | #XXX; | ||
| 32 | } | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 36 | 1; |