Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

always import MANDATORY exports

  • Loading branch information...
commit e51b93bf3aaaeeb50650341b53cb9883b320983e 1 parent 83aea7d
@moritz moritz authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/Perl6/Grammar.pm
View
8 src/Perl6/Grammar.pm
@@ -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 {
@@ -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);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.