Permalink
Browse files

Eliminate use of lexpad_pull cheat.

Logic re-written in terms of the new nqp:: ops.
  • Loading branch information...
1 parent a01efec commit d82aa5957d350329adc94b95ccd7303eb4c52ec2 @jnthn jnthn committed Oct 25, 2012
Showing with 21 additions and 4 deletions.
  1. +10 −2 src/HLL/Actions.pm
  2. +11 −2 src/HLL/Compiler.pm
View
@@ -47,8 +47,16 @@ class HLL::Actions {
method SET_BLOCK_OUTER_CTX($block) {
my $outer_ctx := %*COMPILING<%?OPTIONS><outer_ctx>;
if nqp::defined($outer_ctx) {
- for $outer_ctx.lexpad_full {
- $block.symbol($_.key, :scope<lexical>, :value($_.value));
+ until nqp::isnull($outer_ctx) {
+ my $pad := nqp::ctxlexpad($outer_ctx);
+ unless nqp::isnull($pad) {
+ for $pad {
+ my str $key := ~$_;
+ $block.symbol($key, :scope<lexical>, :value(nqp::atkey($pad, $key)))
+ unless $block.symbol($key);
+ }
+ }
+ $outer_ctx := nqp::ctxouter($outer_ctx);
}
}
}
View
@@ -127,8 +127,17 @@ class HLL::Compiler {
}
};
if nqp::defined($*MAIN_CTX) {
- for $*MAIN_CTX.lexpad_full() {
- %interactive_pad{$_.key} := $_.value;
+ my $cur_ctx := $*MAIN_CTX;
+ until nqp::isnull($cur_ctx) {
+ my $pad := nqp::ctxlexpad($cur_ctx);
+ unless nqp::isnull($pad) {
+ for $pad {
+ my str $key := ~$_;
+ %interactive_pad{$key} := nqp::atkey($pad, $key)
+ unless nqp::existskey(%interactive_pad, $key);
+ }
+ }
+ $cur_ctx := nqp::ctxouter($cur_ctx);
}
$save_ctx := $interactive_ctx;
}

0 comments on commit d82aa59

Please sign in to comment.