Skip to content

Commit

Permalink
[dotnet] Get keyed_int in place enough for array lookups (but can not…
Browse files Browse the repository at this point in the history
… has binding yet).
  • Loading branch information
jnthn committed Oct 19, 2010
1 parent ebb368a commit 5cac036
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion dotnet/compiler/PAST2DNSTCompiler.pm
Expand Up @@ -651,7 +651,7 @@ our multi sub dnst_for(PAST::Op $op) {
:name($tmp_name), :type('RakudoObject'),
dnst_for(PAST::Op.new(
:pasttype('callmethod'), :name('new'),
PAST::Var.new( :name('NQPList'), :scope('lexical') )
PAST::Var.new( :name('NQPArray'), :scope('lexical') )
))
)
);
Expand Down Expand Up @@ -815,6 +815,24 @@ our multi sub dnst_for(PAST::Var $var) {
DNST::Literal.new( :value($var.name), :escape(1) )
);
}
elsif $scope eq 'keyed_int' {
# Get thing to do lookup in without bind context applied - we simply
# want to look it up.
# XXX viviself, vivibase.
if $*BIND_CONTEXT {
my $*BIND_CONTEXT := 0;
return dnst_for(PAST::Op.new(
:pasttype('callmethod'), :name('bind_pos'),
@($var)[0], @($var)[1]
));
}
else {
return dnst_for(PAST::Op.new(
:pasttype('callmethod'), :name('at_pos'),
@($var)[0], @($var)[1]
));
}
}
else {
pir::die("Don't know how to compile variable scope " ~ $var.scope);
}
Expand Down

0 comments on commit 5cac036

Please sign in to comment.