Skip to content

Commit

Permalink
Ensure import, use and need return something (Nil for now), so we don…
Browse files Browse the repository at this point in the history
…'t get IMCC errors if you try and use the result of the use statement for something.
  • Loading branch information
jnthn committed Oct 19, 2011
1 parent 07b9b00 commit 433839e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Perl6/Actions.pm
Expand Up @@ -653,20 +653,20 @@ class Perl6::Actions is HLL::Actions {
}

method statement_control:sym<need>($/) {
my $past := PAST::Stmts.new( :node($/) );
my $past := PAST::Var.new( :name('Nil'), :scope('lexical') );
for $<version> {
# XXX TODO: Version checks.
}
make $past;
}

method statement_control:sym<import>($/) {
my $past := PAST::Stmts.new( :node($/) );
my $past := PAST::Var.new( :name('Nil'), :scope('lexical') );
make $past;
}

method statement_control:sym<use>($/) {
my $past := PAST::Stmts.new( :node($/) );
my $past := PAST::Var.new( :name('Nil'), :scope('lexical') );
if $<version> {
# TODO: replace this by code that doesn't always die with
# a useless error message
Expand Down Expand Up @@ -696,7 +696,7 @@ class Perl6::Actions is HLL::Actions {
:name('True'),
:namespace(['Bool']),
:scope('package'),
),
)
);
}
elsif ~$<module_name> eq 'FORBID_PIR' {
Expand Down

0 comments on commit 433839e

Please sign in to comment.