Skip to content

Commit

Permalink
Eliminate use of lexpad_pull cheat.
Browse files Browse the repository at this point in the history
Logic re-written in terms of the new nqp:: ops.
  • Loading branch information
jnthn committed Oct 25, 2012
1 parent a01efec commit d82aa59
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/HLL/Actions.pm
Expand Up @@ -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);
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions src/HLL/Compiler.pm
Expand Up @@ -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;
}
Expand Down

0 comments on commit d82aa59

Please sign in to comment.