Permalink
Browse files

Make sure we don't stick a 0 into the AST.

Instead, put a Nil there if we have an empty statement.
  • Loading branch information...
1 parent 0d491be commit 59b7e51b34057ae1cae87950b5d0a009aee6dbbf @jnthn jnthn committed Jul 21, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Perl6/Actions.nqp
@@ -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;
}

0 comments on commit 59b7e51

Please sign in to comment.