Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
always import MANDATORY exports
  • Loading branch information
moritz committed May 8, 2012
1 parent 83aea7d commit e51b93b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Perl6/Grammar.pm
Expand Up @@ -787,6 +787,7 @@ grammar Perl6::Grammar is HLL::Grammar {
sub do_import($module, $package_source_name, $arglist?) {
if pir::exists($module, 'EXPORT') {
my $EXPORT := $module<EXPORT>.WHO;
my @to_import := ['MANDATORY'];
if pir::defined($arglist) {
my $Pair := $*W.find_symbol(['Pair']);
for $arglist -> $tag {
Expand All @@ -802,8 +803,11 @@ grammar Perl6::Grammar is HLL::Grammar {
}
}
else {
if pir::exists($EXPORT, 'DEFAULT') {
$*W.import($EXPORT<DEFAULT>, $package_source_name);
nqp::push(@to_import, 'DEFAULT');
}
for @to_import -> $tag {
if pir::exists($EXPORT, $tag) {
$*W.import($EXPORT{$tag}, $package_source_name);
}
}
}
Expand Down

0 comments on commit e51b93b

Please sign in to comment.