Skip to content

Commit

Permalink
[dotnet] Fix sub vivitype up a little. my @A won't crash and burn dur…
Browse files Browse the repository at this point in the history
…ing the compile now (though certainly arrays don't really work yet either).
  • Loading branch information
jnthn committed Oct 18, 2010
1 parent 832586c commit ca4842a
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions dotnet/compiler/Actions.pm
Expand Up @@ -22,13 +22,22 @@ sub block_immediate($block) {
}

sub vivitype($sigil) {
# XXX Needs to change to be more portable...
$sigil eq '%'
?? PAST::Op.new(:inline(" %r = root_new ['parrot';'Hash']"))
!! ($sigil eq '@'
?? PAST::Op.new(:inline(" %r = root_new ['parrot';'ResizablePMCArray']"))
# XXX ...and this is really wrong.
!! undef);
if $sigil eq '%' {
PAST::Op.new(
:pasttype('callmethod'), :name('new'),
PAST::Var.new( :name('NQPHash'), :scope('lexical') )
)
}
elsif $sigil eq '@' {
PAST::Op.new(
:pasttype('callmethod'), :name('new'),
PAST::Var.new( :name('NQPArray'), :scope('lexical') )
)
}
else {
# XXX This is REALLY wrong...
undef
}
}


Expand Down

0 comments on commit ca4842a

Please sign in to comment.