Skip to content

Commit

Permalink
Have attach cause BEGIN time
Browse files Browse the repository at this point in the history
And remove it from numerous other places in the actions.
  • Loading branch information
jnthn committed Jun 5, 2023
1 parent 4392264 commit 1600bd7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Raku/Actions.nqp
Expand Up @@ -25,6 +25,9 @@ role Raku::CommonActions {
if nqp::istype($node, self.r('ParseTime')) {
$node.ensure-parse-performed($*R, $*CU.context);
}
if nqp::istype($node, self.r('BeginTime')) {
$node.ensure-begin-performed($*R, $*CU.context);
}
if nqp::istype($node, self.r('ImplicitLookups')) {
$node.resolve-implicit-lookups-with($*R);
}
Expand Down Expand Up @@ -417,14 +420,12 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
$block.replace-signature($<signature>.ast);
}
$block.replace-body($<blockoid>.ast);
$block.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $block;
}

method block($/) {
my $block := $*BLOCK;
$block.replace-body($<blockoid>.ast);
$block.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $block;
}

Expand All @@ -435,7 +436,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
method unit-block($/) {
my $block := $*BLOCK;
$block.replace-body(self.r('Blockoid').new($<statementlist>.ast));
$block.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $block;
}

Expand Down Expand Up @@ -587,7 +587,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
my $ast := $<arglist><EXPR>
?? $Pragma.new(:$name, :argument($<arglist><EXPR>.ast), :off)
!! $Pragma.new(:$name, :off);
$ast.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $ast;
}
else {
Expand Down Expand Up @@ -636,7 +635,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}

$ast := self.r('Statement', 'Need').new(:@module-names);
$ast.ensure-begin-performed($*R, $*CU.context);

self.attach: $/, $ast;
}
Expand Down Expand Up @@ -726,7 +724,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {

method statement_prefix:sym<BEGIN>($/) {
my $ast := self.r('StatementPrefix', 'Phaser', 'Begin').new($<blorst>.ast);
$ast.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $ast;
}

Expand Down Expand Up @@ -1657,7 +1654,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
if nqp::istype($package, self.r('ParseTime')) {
$package.ensure-parse-performed($*R, $*CU.context);
}
$package.ensure-begin-performed($*R, $*CU.context);

# Let the resolver know which package we're in.
$*R.push-package($package);
Expand Down Expand Up @@ -1854,7 +1850,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
!! $<blockoid>.ast
);
$routine.IMPL-CHECK($*R, $*CU.context, 1);
$routine.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $routine;
}

Expand All @@ -1877,7 +1872,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}
$regex.replace-body($<nibble>.ast);
$regex.IMPL-CHECK($*R, $*CU.context, 1);
$regex.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $regex;
}

Expand Down Expand Up @@ -2011,7 +2005,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
my $trait := $<circumfix>
?? $ast-type.new(:name($<longname>.ast), :argument($<circumfix>.ast))
!! $ast-type.new(:name($<longname>.ast));
$trait.ensure-begin-performed($*R, $*CU.context);
self.attach: $/, $trait;
}
}
Expand Down

0 comments on commit 1600bd7

Please sign in to comment.