Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement contextual scope.
  • Loading branch information
jnthn committed Jul 9, 2012
1 parent ad562d8 commit ffcadc6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/QAST/Compiler.nqp
Expand Up @@ -567,6 +567,19 @@ class QAST::Compiler is HLL::Compiler {
$ops.result($res_reg);
}
}
elsif $scope eq 'contextual' {
if $*BINDVAL {
my $valpost := self.coerce(self.as_post_clear_bindval($*BINDVAL), 'P');
$ops.push($valpost);
$ops.push_pirop('store_dynamic_lex', self.escape($name), $valpost.result);
$ops.result($valpost.result);
}
else {
my $res_reg := $*REGALLOC."fresh_p"();
$ops.push_pirop('find_dynamic_lex', $res_reg, self.escape($name));
$ops.result($res_reg);
}
}
else {
pir::die("QAST::Var with scope '$scope' NYI");
}
Expand Down

0 comments on commit ffcadc6

Please sign in to comment.