Skip to content

Commit

Permalink
Put in IMPL-COMPOSE stub
Browse files Browse the repository at this point in the history
For creating a class' BUILDALL from its BUILDPLAN
  • Loading branch information
lizmat committed Jan 10, 2023
1 parent 34efa23 commit 50fd019
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Raku/Actions.nqp
Expand Up @@ -1283,6 +1283,7 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}
$package.replace-body: $body;
$package.IMPL-CHECK($*R, $*CU.context, 1);
$package.IMPL-COMPOSE();
$package.meta-object; # Ensure it's composed
self.attach: $/, $package;
}
Expand Down
25 changes: 19 additions & 6 deletions src/Raku/ast/package.rakumod
@@ -1,9 +1,14 @@
class RakuAST::Package is RakuAST::StubbyMeta is RakuAST::Term
is RakuAST::IMPL::ImmediateBlockUser
is RakuAST::Declaration is RakuAST::AttachTarget
is RakuAST::BeginTime is RakuAST::TraitTarget
is RakuAST::ImplicitBlockSemanticsProvider
is RakuAST::LexicalScope {
class RakuAST::Package
is RakuAST::StubbyMeta
is RakuAST::Term
is RakuAST::IMPL::ImmediateBlockUser
is RakuAST::Declaration
is RakuAST::AttachTarget
is RakuAST::BeginTime
is RakuAST::TraitTarget
is RakuAST::ImplicitBlockSemanticsProvider
is RakuAST::LexicalScope
{
has Str $.package-declarator;
has Mu $.how;
has Mu $.attribute-type;
Expand Down Expand Up @@ -385,6 +390,14 @@ class RakuAST::Package is RakuAST::StubbyMeta is RakuAST::Term
self.compile-time-value
}

method IMPL-COMPOSE() {
if $!package-declarator eq 'class' {
# create BUILDALL method if there's something to create,
# otherwise put in a generic fallback BUILDALL that doesn't
# do anything
}
}

method visit-children(Code $visitor) {
$visitor($!name);
self.visit-traits($visitor);
Expand Down

0 comments on commit 50fd019

Please sign in to comment.