Skip to content

Commit

Permalink
make adhoc declared variables our-scoped
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed May 22, 2013
1 parent 6f80ba5 commit 07924e6
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/Perl5/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ role STD5 {
my $descriptor := $*W.create_container_descriptor(%cont_info<value_type>, 1, $name);

$*W.install_lexical_container($BLOCK, $name, %cont_info, $descriptor,
:scope($*SCOPE), :package($*PACKAGE));
:scope('our'), :package($*PACKAGE));

# Set scope and type on container, and if needed emit code to
# reify a generic type.
Expand All @@ -366,13 +366,11 @@ role STD5 {
QAST::Op.new( :op('curlexpad') ));
}

if $*SCOPE eq 'our' {
$BLOCK[0].push(QAST::Op.new(
:op('bind'),
$varast,
$*W.symbol_lookup([$name], $/, :package_only(1), :lvalue(1))
));
}
$BLOCK[0].push(QAST::Op.new(
:op('bind'),
$varast,
$*W.symbol_lookup([$name], $/, :package_only(1), :lvalue(1))
));
}
}
else {
Expand Down

0 comments on commit 07924e6

Please sign in to comment.