Skip to content
Browse files

simplify module loading

  • Loading branch information...
1 parent f74a171 commit bcb8d70668d0f99f40be3d2c7fea735bfa5658a8 @moritz moritz committed
Showing with 2 additions and 23 deletions.
  1. +0 −21 src/Perl6/ModuleLoader.pm
  2. +2 −2 src/Perl6/SymbolTable.pm
View
21 src/Perl6/ModuleLoader.pm
@@ -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 {
View
4 src/Perl6/SymbolTable.pm
@@ -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'),
@@ -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'),

0 comments on commit bcb8d70

Please sign in to comment.
Something went wrong with that request. Please try again.