From 1600bd7ee25986cda60f5ad0ac3ff87e130bedaf Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Mon, 5 Jun 2023 12:04:53 +0200 Subject: [PATCH] Have attach cause BEGIN time And remove it from numerous other places in the actions. --- src/Raku/Actions.nqp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Raku/Actions.nqp b/src/Raku/Actions.nqp index c77e27947e0..5aa04a4dc5a 100644 --- a/src/Raku/Actions.nqp +++ b/src/Raku/Actions.nqp @@ -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); } @@ -417,14 +420,12 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { $block.replace-signature($.ast); } $block.replace-body($.ast); - $block.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $block; } method block($/) { my $block := $*BLOCK; $block.replace-body($.ast); - $block.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $block; } @@ -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($.ast)); - $block.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $block; } @@ -587,7 +587,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { my $ast := $ ?? $Pragma.new(:$name, :argument($.ast), :off) !! $Pragma.new(:$name, :off); - $ast.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $ast; } else { @@ -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; } @@ -726,7 +724,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { method statement_prefix:sym($/) { my $ast := self.r('StatementPrefix', 'Phaser', 'Begin').new($.ast); - $ast.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $ast; } @@ -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); @@ -1854,7 +1850,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { !! $.ast ); $routine.IMPL-CHECK($*R, $*CU.context, 1); - $routine.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $routine; } @@ -1877,7 +1872,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { } $regex.replace-body($.ast); $regex.IMPL-CHECK($*R, $*CU.context, 1); - $regex.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $regex; } @@ -2011,7 +2005,6 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions { my $trait := $ ?? $ast-type.new(:name($.ast), :argument($.ast)) !! $ast-type.new(:name($.ast)); - $trait.ensure-begin-performed($*R, $*CU.context); self.attach: $/, $trait; } }