Skip to content

Commit

Permalink
RakuAST: make $(;) return () rather than (Nil,)
Browse files Browse the repository at this point in the history
Inspired by patrickb++ 's PR 5273
  • Loading branch information
lizmat committed Jun 13, 2023
1 parent e3a7474 commit a6bec92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Raku/ast/statements.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,12 @@ class RakuAST::StatementSequence
}

method IMPL-TO-QAST(RakuAST::IMPL::QASTContext $context) {
my @statements := self.code-statements;
my @statements;
for self.code-statements {
@statements.push($_)
unless nqp::istype($_,RakuAST::Statement::Empty);
}

my int $n := nqp::elems(@statements);
if $n == 1 {
nqp::atpos(@statements, 0).IMPL-TO-QAST($context)
Expand Down

0 comments on commit a6bec92

Please sign in to comment.