Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactor !YOU_ARE_HERE to use outer_ctx.
  • Loading branch information
pmichaud committed Jul 7, 2010
1 parent b0cd2b8 commit c9aa0e9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Perl6/Actions.pm
Expand Up @@ -664,12 +664,18 @@ method term:sym<sigterm>($/) { make $<sigterm>.ast; }
method term:sym<YOU_ARE_HERE>($/) {
my $past := PAST::Block.new(
:name('!YOU_ARE_HERE'),
PAST::Var.new( :name('mainline'), :scope('parameter') ),
PAST::Op.new( :pasttype('callmethod'), :name('set_outer'),
PAST::Var.new( :name('mainline'), :scope('lexical') ),
PAST::Var.new( :scope('keyed'), PAST::Op.new( :pirop('getinterp P') ), 'sub' )
),
PAST::Op.new( :pasttype('call'), PAST::Var.new( :name('mainline'), :scope('lexical') ) )
PAST::Op.new(
:inline(
'$P0 = getinterp',
'$P0 = $P0["context"]',
'$P0 = getattribute $P0, "outer_ctx"',
'%0."set_outer_ctx"($P0)',
'%r = %0(%1)'
),
PAST::Var.new( :name('mainline'), :scope('parameter') ),
PAST::Var.new( :name('$MAIN'), :scope('parameter'),
:viviself( PAST::Val.new( :value(0) ) ) )
)
);
@BLOCK[0][0].push(PAST::Var.new(
:name('!YOU_ARE_HERE'), :isdecl(1), :viviself($past), :scope('lexical')
Expand Down

0 comments on commit c9aa0e9

Please sign in to comment.