Skip to content

Commit

Permalink
Change references of $*PERL to $*RAKU
Browse files Browse the repository at this point in the history
Also simplify t/08-performance/05-processkeys.t using set operators.
  • Loading branch information
lizmat committed Jan 23, 2020
1 parent bde1069 commit 77d8fa3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/core.c/CompUnit/PrecompilationRepository.pm6
Expand Up @@ -90,7 +90,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
:$repo-id,
:$refresh,
) {
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*RAKU.compiler.id);
my $RMD = $*RAKUDO_MODULE_DEBUG;
for @precomp-stores -> $store {
$RMD("Trying to load {$id ~ ($repo-id ?? '.repo-id' !! '')} from $store.prefix()") if $RMD;
Expand All @@ -104,7 +104,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
}

method !load-dependencies(CompUnit::PrecompilationUnit:D $precomp-unit, @precomp-stores) {
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*RAKU.compiler.id);
my $RMD = $*RAKUDO_MODULE_DEBUG;
my $resolve = False;
my $repo = $*REPO;
Expand Down Expand Up @@ -188,7 +188,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
return %loaded{$id} if %loaded{$id}:exists;
}
my $RMD = $*RAKUDO_MODULE_DEBUG;
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*RAKU.compiler.id);
my $unit = self!load-file(@precomp-stores, $id);
if $unit {
if (not $since or $unit.modified > $since)
Expand Down Expand Up @@ -230,7 +230,7 @@ class CompUnit::PrecompilationRepository::Default does CompUnit::PrecompilationR
:$source-name = $path.Str,
:$precomp-stores,
) {
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*RAKU.compiler.id);
my $io = self.store.destination($compiler-id, $id);
return False unless $io;
my $RMD = $*RAKUDO_MODULE_DEBUG;
Expand Down
2 changes: 1 addition & 1 deletion src/core.c/CompUnit/Repository/Installation.pm6
Expand Up @@ -261,7 +261,7 @@ sub MAIN(:$name, :$auth, :$ver, *@, *%) {
my $*RESOURCES = Distribution::Resources.new(:repo(self), :$dist-id);
my %done;

my $compiler-id = CompUnit::PrecompilationId.new-without-check($*PERL.compiler.id);
my $compiler-id = CompUnit::PrecompilationId.new-without-check($*RAKU.compiler.id);
for %provides.sort {
my $id = CompUnit::PrecompilationId.new-without-check($_.value.values[0]<file>);
$precomp.store.delete($compiler-id, $id);
Expand Down
2 changes: 1 addition & 1 deletion src/core.c/Deprecations.pm6
Expand Up @@ -66,7 +66,7 @@ class Rakudo::Deprecations {

my $ver;
method DEPRECATED($alternative,$from?,$removed?,:$up = 1,:$what,:$file,:$line,Bool :$lang-vers) {
$ver //= $*PERL.compiler.version;
$ver //= $*RAKU.compiler.version;
my $version = $lang-vers ?? nqp::getcomp('perl6').language_version !! $ver;
# if $lang-vers was given, treat the provided versions as language
# versions, rather than compiler versions. Note that we can't
Expand Down
4 changes: 2 additions & 2 deletions src/core.c/Exception.pm6
Expand Up @@ -1611,7 +1611,7 @@ my class X::Syntax::Perl5Var does X::Syntax {
'$|', "the filehandle's .out-buffer attribute",
'$?', '$! for handling child errors also',
'$@', '$!',
'$]', '$*PERL.version or $*PERL.compiler.version',
'$]', '$*RAKU.version or $*RAKU.compiler.version',

'$^C', 'COMPILING namespace',
'$^H', '$?FOO variables',
Expand All @@ -1620,7 +1620,7 @@ my class X::Syntax::Perl5Var does X::Syntax {
'$^R', 'an explicit result variable',
'$^S', 'context function',
'$^T', '$*INIT-INSTANT',
'$^V', '$*PERL.version or $*PERL.compiler.version',
'$^V', '$*RAKU.version or $*RAKU.compiler.version',
'$^X', '$*EXECUTABLE-NAME',

'@-', '.from method',
Expand Down
15 changes: 7 additions & 8 deletions t/08-performance/05-processkeys.t
@@ -1,25 +1,24 @@
use Test;
plan 1;

# output of "perl6 -e 'use Test; .say for PROCESS::.keys.sort.map: { qq:!c/ Q{$_},/ }'"
my %allowed = (
# output of "raku -e 'use Test; .say for PROCESS::.keys.sort.map: { qq:!c/ Q{$_},/ }'"
my $allowed = (
Q{$AWAITER},
Q{$CWD},
Q{$CORE-SETTING-REV},
Q{$ERR},
Q{$IN},
Q{$OUT},
Q{$PERL},
Q{$PID},
Q{$RAKU},
Q{$RAKUDO_MODULE_DEBUG},
Q{$REPO},
Q{$SCHEDULER},
Q{$SPEC},
Q{%ENV},
Q{&chdir},
).map: { $_ => 1 };
);

my @unknown;
@unknown.push($_) unless %allowed{$_}:exists for PROCESS::.keys;
diag "Found {+@unknown} unexpected entries: { @unknown.sort }" unless
ok @unknown == 0, "No unexpected entries in PROCESS::";
my $unknown = PROCESS::.keys (-) $allowed;
diag "Found {+$unknown} unexpected entries: $unknown" unless
ok $unknown == 0, "No unexpected entries in PROCESS::";

0 comments on commit 77d8fa3

Please sign in to comment.