Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Get 'is Parent' to actually call .^add_parent.
  • Loading branch information
jnthn committed Oct 2, 2010
1 parent ded349e commit 3c25cb5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/NQP/Actions.pm
Expand Up @@ -400,14 +400,30 @@ sub package($/) {
PAST::Var.new( :name('type_obj'), :scope('register') )
)
# XXX name
# XXX is parent
));
if $<package_def><repr> {
my $repr_name := $<package_def><repr>[0].ast;
$repr_name.named('repr');
$*PACKAGE-SETUP[0][0][1].push($repr_name);
}

# Add call to add_parent if we have one.
# XXX Doesn't handle lexical classes yet.
if $<package_def><parent> {
my @ns := pir::clone__PP($<package_def><parent>);
my $name := @ns.pop;
$*PACKAGE-SETUP.push(PAST::Op.new(
:pasttype('callmethod'), :name('add_parent'),
PAST::Op.new(
# XXX nqpop get_how
:pirop('get_how PP'),
PAST::Var.new( :name('type_obj'), :scope('register') )
),
PAST::Var.new( :name('type_obj'), :scope('register') ),
PAST::Var.new( :name(~$name), :namespace(@ns), :scope('package') )
));
}

# Postfix it with a call to compose.
$*PACKAGE-SETUP.push(PAST::Op.new(
:pasttype('callmethod'), :name('compose'),
Expand Down

0 comments on commit 3c25cb5

Please sign in to comment.