Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created November 15, 2011 17:29
Show Gist options
  • Save mlschroe/1367707 to your computer and use it in GitHub Desktop.
Save mlschroe/1367707 to your computer and use it in GitHub Desktop.
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -1410,6 +1410,7 @@ class Perl6::Actions is HLL::Actions {
# install it in the lexpad.
my $outer := $*ST.cur_lexpad();
$outer[0].push(PAST::Stmt.new($block));
+ $outer[0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($block))));
# Install &?ROUTINE.
$*ST.install_lexical_symbol($block, '&?ROUTINE', $code);
@@ -1631,6 +1632,7 @@ class Perl6::Actions is HLL::Actions {
# Install PAST block so that it gets capture_lex'd correctly.
my $outer := $*ST.cur_lexpad();
$outer[0].push($past);
+ $outer[0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($past))));
# Apply traits.
for $<trait> {
@@ -1822,6 +1824,7 @@ class Perl6::Actions is HLL::Actions {
# Install PAST block so that it gets capture_lex'd correctly.
my $outer := $*ST.cur_lexpad();
$outer[0].push($past);
+ $outer[0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($past))));
# Apply traits.
if $traits {
@@ -4041,7 +4045,9 @@ class Perl6::Actions is HLL::Actions {
my $code := $*ST.create_code_object($block, 'Method', $sig);
# Block should go in current lexpad, in correct lexical context.
- ($*ST.cur_lexpad())[0].push($block);
+ my $outer := $*ST.cur_lexpad();
+ $outer[0].push($block);
+ $outer[0].push(PAST::Op.new( :pirop('capture_lex__vP'), PAST::Val.new( :value($block))));
# Dispatch trait. XXX Should really be Bool::True, not Int here...
my $true := ($*ST.add_constant('Int', 'int', 1))<compile_time_value>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment