Skip to content

Commit

Permalink
update NQP syntax for PIR inline
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed May 28, 2010
1 parent 5855443 commit bac8e86
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/parser/actions.pm
Expand Up @@ -153,9 +153,11 @@ method end($/) {
my $past := PAST::Block.new( $<comp_stmt>.ast(), :node($/) );
$past.blocktype('declaration');
my $sub := PAST::Compiler.compile( $past );
PIR q< $P0 = get_hll_global ['cardinal'], '@?END_BLOCKS' >;
PIR q< $P1 = find_lex '$sub' >;
PIR q< push $P0, $P1 >;
Q:PIR {
$P0 = get_hll_global ['cardinal'], '@?END_BLOCKS'
$P1 = find_lex '$sub'
push $P0, $P1
};
make $past;
}
Expand All @@ -164,15 +166,15 @@ method indexed_assignment($/) {
my $rhs := $<rhs>.ast();
my $primary := $<basic_primary>.ast();

$keys := $<keys>.ast();
$keys := $<keys>.ast();

my $past := PAST::Op.new( :name('[]='), :pasttype('callmethod'), :node($/) );

$past.push( $primary );

while $keys[0] {
$past.push( $keys.shift() );
}
while $keys[0] {
$past.push( $keys.shift() );
}

$past.push( $rhs );

Expand Down

0 comments on commit bac8e86

Please sign in to comment.