Skip to content

Commit

Permalink
Rename second-level CORE namespaces to v6<rev>
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Aug 17, 2019
1 parent ac707d2 commit ae7e77e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 9 additions & 6 deletions src/Perl6/World.nqp
Expand Up @@ -4817,12 +4817,15 @@ class Perl6::World is HLL::World {

if nqp::iseq_s(@name[0], 'CORE') { # Looking in CORE:: namespace
nqp::shift(@name := nqp::clone(@name));
my $rev := nqp::lc(@name[0]);
# If a supported language revision requested
if nqp::chars($rev) == 1 && nqp::existskey(nqp::getcomp('perl6').language_revisions,$rev) {
$no-outers := 1; # you don't see other COREs!
nqp::shift(@name);
$setting_name := 'CORE' ~ (nqp::iseq_s($rev, 'c') ?? '' !! ".$rev");
if nqp::iseq_i(nqp::chars(@name[0]),3)
&& nqp::iseq_i(nqp::index(@name[0], 'v6'),0) {
my $rev := nqp::substr(@name[0],2,1);
# If a supported language revision requested
if nqp::chars($rev) == 1 && nqp::existskey(nqp::getcomp('perl6').language_revisions,$rev) {
$no-outers := 1; # you don't see other COREs!
nqp::shift(@name);
$setting_name := 'CORE' ~ (nqp::iseq_s($rev, 'c') ?? '' !! ".$rev");
}
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/core.e/PseudoStash.pm6
Expand Up @@ -189,7 +189,7 @@ my class PseudoStash is Map {


method !find-rev-core($key) {
my $rev = nqp::lc($key);
my $rev = nqp::substr($key, 2, 1);
my $ctx := $!ctx;
my $found := nqp::null();
my $stash;
Expand Down Expand Up @@ -221,7 +221,9 @@ my class PseudoStash is Map {
multi method AT-KEY(PseudoStash:D: Str() $key) is raw {
my $name := $!package.^name;
my Mu $val := nqp::if(
(nqp::iseq_s($name, 'CORE') && nqp::iseq_i(nqp::chars($key), 1)),
(nqp::iseq_s($name, 'CORE')
&& nqp::iseq_i(nqp::chars($key), 3)
&& nqp::iseq_i(nqp::index($key, 'v6'), 0)),
self!find-rev-core($key),
nqp::null()
);
Expand Down

0 comments on commit ae7e77e

Please sign in to comment.