Skip to content

Commit 42601fe

Browse files
committed
Fix a couple of bugs that broke 33-init.t.
1 parent f837f1c commit 42601fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/NQP/Actions.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,8 @@ class NQP::Actions is HLL::Actions {
309309
}
310310

311311
method statement_prefix:sym<INIT>($/) {
312-
my $init_block := PAST::Block.new(:blocktype('immediate'));
313-
$init_block.loadinit.push($<blorst>.ast);
314-
make $init_block;
312+
@BLOCK[0].push($<blorst>.ast);
313+
make PAST::Stmts.new();
315314
}
316315

317316
method statement_prefix:sym<try>($/) {
@@ -614,6 +613,10 @@ class NQP::Actions is HLL::Actions {
614613
$past := PAST::Stmts.new();
615614
}
616615
elsif $*SCOPE eq 'our' {
616+
# Depending on if this was already considered our scoped,
617+
# we may or may not have got a node in $var that's set up
618+
# right already. We build it here just to be sure.
619+
$name := ~$<variable>;
617620
$past := lexical_package_lookup([$name], $/);
618621
$past.viviself( vivitype($sigil) );
619622
$BLOCK.symbol($name, :scope('package') );

0 commit comments

Comments
 (0)