Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove internal references to $*OS
So that we don't generate deprecated warnings when just running core functions
  • Loading branch information
lizmat committed May 21, 2014
1 parent bc585f2 commit a5103c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/core/Exception.pm
Expand Up @@ -365,11 +365,11 @@ my role X::Comp is Exception {
has @.highexpect;
multi method gist(::?CLASS:D: :$sorry = True, :$expect = True) {
if $.is-compile-time {
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*OS ne 'MSWin32';
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*DISTRO.name ne 'mswin32';
my ($red, $green, $yellow, $clear) = $color
?? ("\e[31m", "\e[32m", "\e[33m", "\e[0m")
!! ("", "", "", "");
my $eject = $*OS eq 'MSWin32' ?? "<HERE>" !! "\x[23CF]";
my $eject = $*DISTRO.name eq 'MSWin32' ?? "<HERE>" !! "\x[23CF]";
my $r = $sorry ?? self.sorry_heading() !! "";
$r ~= "$.message\nat $.filename():$.line\n------> ";
$r ~= "$green$.pre$yellow$eject$red$.post$clear" if defined $.pre;
Expand All @@ -391,7 +391,7 @@ my role X::Comp is Exception {
}
}
method sorry_heading() {
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*OS ne 'MSWin32';
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*DISTRO.name ne 'mswin32';
my ($red, $clear) = $color ?? ("\e[31m", "\e[0m") !! ("", "");
"$red==={$clear}SORRY!$red===$clear Error while compiling $.filename\n"
}
Expand All @@ -412,7 +412,7 @@ my class X::Comp::Group is Exception {
multi method gist(::?CLASS:D:) {
my $r = "";
if $.panic || @.sorrows {
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*OS ne 'MSWin32';
my $color = %*ENV<RAKUDO_ERROR_COLOR> // $*DISTRO.name ne 'mswin32';
my ($red, $clear) = $color ?? ("\e[31m", "\e[0m") !! ("", "");
$r ~= "$red==={$clear}SORRY!$red===$clear\n";
for @.sorrows {
Expand Down Expand Up @@ -921,7 +921,7 @@ my class X::Syntax::Perl5Var does X::Syntax {
'$^I' => '$*INPLACE',
'$^M' => 'a global form such as $*M',
'$^N' => '$/[*-1]',
'$^O' => '$?OS or $*OS',
'$^O' => '$?DISTRO.name or $*DISTRO.name',
'$^R' => 'an explicit result variable',
'$^S' => 'context function',
'$^T' => '$*BASETIME',
Expand Down
8 changes: 4 additions & 4 deletions src/core/IO/Spec.pm
Expand Up @@ -15,7 +15,7 @@ my class IO::Spec {
# 'VMS' => 'VMS'
);

# this is really just a way of getting $*OS when it's not in scope yet
# really just a way of getting $*DISTRO.name when it's not in scope yet
my $submodule;
#?if parrot
$submodule = %module{ nqp::atkey(nqp::atpos(pir::getinterp__P, pir::const::IGLOBALS_CONFIG_HASH), 'osname') };
Expand All @@ -28,9 +28,9 @@ my class IO::Spec {
#?endif
my $SPEC := IO::Spec.WHO{ $submodule // 'Unix' };

method FSTYPE ($OS = $*OS) { %module{$OS} // 'Unix' }
method FSTYPE ($OS = $*DISTRO.name) { %module{$OS} // 'Unix' }

#| Dispatches methods to the appropriate class for the current $*OS
#| Dispatches methods to the appropriate class for the current $*DISTRO.name
#| Well, it should, if handles worked here. Still useful, though.
method MODULE
# handles
Expand All @@ -42,7 +42,7 @@ my class IO::Spec {

#| Returns a copy of the module for the given OS string
#| e.g. IO::Spec.os('Win32') returns IO::Spec::Win32
method os (Str $OS = $*OS) {
method os (Str $OS = $*DISTRO.name) {
IO::Spec.WHO{%module{$OS} // 'Unix'};
}

Expand Down

0 comments on commit a5103c3

Please sign in to comment.