Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove trailing whitespace
  • Loading branch information
lizmat committed Dec 23, 2014
1 parent d45c53a commit c05de61
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Perl6/ModuleLoader.nqp
Expand Up @@ -11,30 +11,30 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my %modules_loaded;
my %settings_loaded;
my $absolute_path_func;

my %language_module_loaders := nqp::hash(
'NQP', nqp::gethllsym('nqp', 'ModuleLoader'),
);
);

method register_language_module_loader($lang, $loader) {
nqp::die("Language loader already registered for $lang")
if nqp::existskey(%language_module_loaders, $lang);
%language_module_loaders{$lang} := $loader;
}

method register_absolute_path_func($func) {
$absolute_path_func := $func;
}

method absolute_path($path) {
$absolute_path_func ?? $absolute_path_func($path) !! $path;
}

method ctxsave() {
$*MAIN_CTX := nqp::ctxcaller(nqp::ctx());
$*CTXSAVE := 0;
}

method search_path() {
# See if we have an @*INC set up, and if so just use that.
my $PROCESS := nqp::gethllsym('perl6', 'PROCESS');
Expand All @@ -60,12 +60,12 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my @search_paths;
@search_paths.push('.');
@search_paths.push('blib');
for self.vm_search_paths() {
for self.vm_search_paths() {
@search_paths.push($_);
}
@search_paths
}

method load_module($module_name, %opts, *@GLOBALish, :$line, :$file, :%chosen) {
unless %chosen {
# See if we need to load it from elsewhere.
Expand All @@ -91,7 +91,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
nqp::die("Do not know how to load code from " ~ %opts<from>);
}
}

# Locate all the things that we potentially could load. Choose
# the first one for now (XXX need to filter by version and auth).
my @prefixes := self.search_path();
Expand All @@ -107,7 +107,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
}
%chosen := @candidates[0];
}

my @MODULES := nqp::clone(@*MODULES // []);
for @MODULES -> $m {
if $m<module> eq $module_name {
Expand Down Expand Up @@ -165,7 +165,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
"When pre-compiling a module, its dependencies must be pre-compiled first.\n" ~
"Please pre-compile " ~ %chosen<pm>);
}

# Read source file.
DEBUG("loading ", %chosen<pm>) if $DEBUG;
#?if parrot
Expand All @@ -180,7 +180,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my $source := nqp::readallfh($fh);
nqp::closefh($fh);
#?endif

# Get the compiler and compile the code, then run it
# (which runs the mainline and captures UNIT).
my $?FILES := %chosen<pm>;
Expand Down Expand Up @@ -214,7 +214,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
return {};
}
}

# This is a first cut of the globals merger. For another approach,
# see sorear++'s work in Niecza. That one is likely more "pure"
# than this, but that would seem to involve copying too, and the
Expand Down Expand Up @@ -264,16 +264,16 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
}
}
}

method load_setting($setting_name) {
my $setting;

if $setting_name ne 'NULL' {
# Unless we already did so, locate and load the setting.
unless nqp::defined(%settings_loaded{$setting_name}) {
# Find it.
my $path := self.find_setting($setting_name);

# Load it.
my $*CTXSAVE := self;
my $*MAIN_CTX;
Expand All @@ -287,13 +287,13 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
}
%settings_loaded{$setting_name} := $*MAIN_CTX;
}

$setting := %settings_loaded{$setting_name};
}

return $setting;
}

# Handles any object repossession conflicts that occurred during module load,
# or complains about any that cannot be resolved.
method resolve_repossession_conflicts(@conflicts) {
Expand All @@ -311,7 +311,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
# now, we let it pass by with "latest wins" semantics.
}
}

sub stash_hash($pkg) {
my $hash := $pkg.WHO;
unless nqp::ishash($hash) {
Expand Down

0 comments on commit c05de61

Please sign in to comment.