Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
simplify module loading
  • Loading branch information
moritz committed Jul 26, 2011
1 parent f74a171 commit bcb8d70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/Perl6/ModuleLoader.pm
Expand Up @@ -19,27 +19,6 @@ class Perl6::ModuleLoader {
# with what we already have.
my $module_ctx;
my $path := pir::join('/', pir::split('::', $module_name)) ~ '.pbc';
my @prefixes := [];
try {
my $prefix := %*COMPILING<%?OPTIONS><module-path>;
if $prefix {
pir::push(@prefixes, $prefix);
pir::push(@prefixes, "$prefix/blib");
} else {
pir::push(@prefixes, '.');
pir::push(@prefixes, 'blib');
}
CATCH {
pir::push(@prefixes, '.');
pir::push(@prefixes, 'blib');
}
}
for @prefixes -> $prefix {
if pir::stat__isi("$prefix/$path", 0) {
$path := "$prefix/$path";
last;
}
}
try {
my $prefix := %*COMPILING<%?OPTIONS><module-path>;
if $prefix {
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/SymbolTable.pm
Expand Up @@ -109,7 +109,7 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
# Do load in code.
my $fixup := PAST::Stmts.new(
PAST::Op.new(
:pirop('load_bytecode vs'), 'blib/Perl6/ModuleLoader.pbc'
:pirop('load_bytecode vs'), 'Perl6/ModuleLoader.pbc'
),
PAST::Op.new(
:pasttype('callmethod'), :name('set_outer_ctx'),
Expand All @@ -136,7 +136,7 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
# Make sure we do the loading during deserialization.
self.add_event(:deserialize_past(PAST::Stmts.new(
PAST::Op.new(
:pirop('load_bytecode vs'), 'blib/Perl6/ModuleLoader.pbc'
:pirop('load_bytecode vs'), 'Perl6/ModuleLoader.pbc'
),
PAST::Op.new(
:pasttype('callmethod'), :name('load_module'),
Expand Down

0 comments on commit bcb8d70

Please sign in to comment.