Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Abstract -I logic into Rakudo::Internals
  • Loading branch information
lizmat committed Jan 13, 2016
1 parent 9463bd9 commit 007f027
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/core/CompUnit/RepositoryRegistry.pm
Expand Up @@ -42,19 +42,9 @@ class CompUnit::RepositoryRegistry {
# normal start up
else {
$raw-specs := nqp::list();
my $I := nqp::atkey(nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I');
if nqp::defined($I) {
if nqp::islist($I) {
my Mu $iter := nqp::iterator($I);
while $iter {
nqp::push($raw-specs,nqp::unbox_s($_))
for parse-include-specS(nqp::shift($iter));
}
}
else {
nqp::push($raw-specs,nqp::unbox_s($_))
for parse-include-specS($I);
}
for Rakudo::Internals.INCLUDE -> $specs {
nqp::push($raw-specs,nqp::unbox_s($_))
for parse-include-specS($specs);
}

if nqp::existskey($ENV,'RAKUDOLIB') {
Expand Down
9 changes: 9 additions & 0 deletions src/core/Rakudo/Internals.pm
Expand Up @@ -731,6 +731,15 @@ my class Rakudo::Internals {
?? '--profile'
!! Empty
}
# whatever specified with -I
method INCLUDE() {
nqp::existskey($compiling-options,'I')
?? do {
my $I := nqp::atkey($compiling-options,'I');
nqp::islist($I) ?? $I !! nqp::list($I)
}
!! nqp::list()
}

#?if moar
method PRECOMP-EXT() { "moarvm" }
Expand Down

0 comments on commit 007f027

Please sign in to comment.