Skip to content

Commit

Permalink
Merge pull request #715 from LLFourn/nom
Browse files Browse the repository at this point in the history
Temp fix for say (require IO::Socket::SSL)
  • Loading branch information
lizmat committed Feb 17, 2016
2 parents 6159b5e + 6e47e54 commit bb9ca8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
11 changes: 5 additions & 6 deletions src/Perl6/Actions.nqp
Expand Up @@ -1767,13 +1767,15 @@ class Perl6::Actions is HLL::Actions does STDActions {
my $compunit_past;
my $target_package;
my $has_file;
my $longname;
if $<module_name> {
for $<module_name><longname><colonpair> -> $colonpair {
if ~$colonpair<identifier> eq 'file' {
$has_file := $colonpair.ast[2];
last;
}
}
$longname := $*W.dissect_longname($<module_name><longname>);
$target_package := $*W.dissect_longname($<module_name><longname>).name_past;
}
if $<module_name> && nqp::defined($has_file) == 0 {
Expand Down Expand Up @@ -1811,11 +1813,6 @@ class Perl6::Actions is HLL::Actions does STDActions {
:name<&REQUIRE_IMPORT>,
$compunit_past,
);
if $target_package {
$target_package.named('target-package');
$require_past.push($target_package);
}

if $<EXPR> {
my $p6_argiter := $*W.compile_time_evaluate($/, $<EXPR>.ast).eager.iterator;
my $IterationEnd := $*W.find_symbol(['IterationEnd']);
Expand All @@ -1833,7 +1830,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
}
$past.push($require_past);

$past.push($<module_name>
?? self.make_indirect_lookup($longname.components())
!! $<file>.ast);
make $past;
}

Expand Down
10 changes: 3 additions & 7 deletions src/core/operators.pm
Expand Up @@ -566,7 +566,7 @@ sub INDIRECT_NAME_LOOKUP($root, *@chunks) is raw {
$thing;
}

sub REQUIRE_IMPORT($compunit, *@syms,:$target-package) {
sub REQUIRE_IMPORT($compunit, *@syms) {
my $handle := $compunit.handle;
my $DEFAULT := $handle.export-package()<DEFAULT>.WHO;
my $GLOBALish := $handle.globalish-package.WHO;
Expand All @@ -582,13 +582,9 @@ sub REQUIRE_IMPORT($compunit, *@syms,:$target-package) {
if @missing {
X::Import::MissingSymbols.new(:from($compunit.short-name), :@missing).throw;
}
# Merge GLOBALish from compunit.
# XXX: should probably use CALLER::UNIT:: but RT #127536
# Merge GLOBAL from compunit.
GLOBAL::.merge-symbols($GLOBALish);

$target-package.defined ??
INDIRECT_NAME_LOOKUP($GLOBALish,$target-package) !!
$compunit.short-name; # roast says if requiring file return its path
Nil;
}

sub infix:<andthen>(+a) {
Expand Down

0 comments on commit bb9ca8c

Please sign in to comment.