Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate the final mentions of viviself.
  • Loading branch information
jnthn committed Jul 14, 2012
1 parent cec243e commit 85cdbc8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/QPerl6/World.pm
Expand Up @@ -393,9 +393,23 @@ class QPerl6::World is HLL::World {
if $prim {
if $state { nqp::die("Natively typed state variables not yet implemented") }
if $var {
if $prim == 1 { $var.viviself(QAST::IVal.new( :value(0) )) }
elsif $prim == 2 { $var.viviself(PAST::Op.new( :pirop('set__Ns'), 'NaN' )) }
elsif $prim == 3 { $var.viviself(SAST::SVal.new( :value('') )) }
if $prim == 1 {
$block[0].push(QAST::Op.new( :op('bind'),
QAST::Var.new( :scope('lexical'), :name($name) ),
QAST::IVal.new( :value(0) ) ))
}
elsif $prim == 2 {
$block[0].push(QAST::Op.new( :op('bind'),
QAST::Var.new( :scope('lexical'), :name($name) ),
QAST::VM.new(
:pirop('set__Ns'), QAST::SVal.new( :value('NaN')
))));
}
elsif $prim == 3 {
$block[0].push(QAST::Op.new( :op('bind'),
QAST::Var.new( :scope('lexical'), :name($name) ),
QAST::SVal.new( :value('') ) ))
}
}
return 1;
}
Expand Down

0 comments on commit 85cdbc8

Please sign in to comment.