Skip to content

Commit

Permalink
Make sure we don't stick a 0 into the AST.
Browse files Browse the repository at this point in the history
Instead, put a Nil there if we have an empty statement.
  • Loading branch information
jnthn committed Jul 21, 2016
1 parent 0d491be commit 59b7e51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Perl6/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,13 +1190,14 @@ class Perl6::Actions is HLL::Actions does STDActions {
if $<statement> > 1 {
my $l := QAST::Op.new( :name('&infix:<,>'), :op('call') );
for $<statement> {
$l.push(wanted($_.ast,'semilist'));
my $sast := $_.ast || QAST::WVal.new( :value($*W.find_symbol(['Nil'])) );
$l.push(wanted($sast, 'semilist'));
}
$past.push($l);
$past.annotate('multislice', 1);
}
else {
$past.push($<statement>[0].ast);
$past.push($<statement>[0].ast || QAST::WVal.new( :value($*W.find_symbol(['Nil'])) ));
}
make $past;
}
Expand Down

0 comments on commit 59b7e51

Please sign in to comment.