Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some pir:: => nqp:: for the setting.
  • Loading branch information
jnthn committed Feb 17, 2013
1 parent 10dac76 commit b9ee89a
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/core/Attribute.pm
Expand Up @@ -8,7 +8,7 @@ my class Attribute {
unless $package.HOW.declares_method($package, $meth_name) {
my $dcpkg := nqp::p6decont($package);
my $meth;
my int $attr_type = pir::repr_get_primitive_type_spec__IP($!type);
my int $attr_type = nqp::objprimspec($!type);
if self.rw {
$meth := nqp::p6bool(nqp::iseq_i($attr_type, 0))
??
Expand Down Expand Up @@ -78,7 +78,7 @@ my class Attribute {

method get_value(Mu $obj) {
my $decont := nqp::p6decont($obj);
given nqp::p6box_i(pir::repr_get_primitive_type_spec__IP($!type)) {
given nqp::p6box_i(nqp::objprimspec($!type)) {
when 0 { nqp::getattr($decont, $!package, $!name) }
when 1 { nqp::p6box_i(nqp::getattr_i($decont, $!package, $!name)) }
when 2 { nqp::p6box_n(nqp::getattr_n($decont, $!package, $!name)) }
Expand All @@ -88,7 +88,7 @@ my class Attribute {

method set_value(Mu $obj, Mu \value) {
my $decont := nqp::p6decont($obj);
given nqp::p6box_i(pir::repr_get_primitive_type_spec__IP($!type)) {
given nqp::p6box_i(nqp::objprimspec($!type)) {
when 0 { nqp::bindattr($decont, $!package, $!name, value) }
when 1 { nqp::p6box_i(nqp::bindattr_i($decont, $!package, $!name, value)) }
when 2 { nqp::p6box_n(nqp::bindattr_n($decont, $!package, $!name, value)) }
Expand Down
2 changes: 1 addition & 1 deletion src/core/Cursor.pm
Expand Up @@ -27,7 +27,7 @@ my class Cursor does NQPCursorRole {
else {
$value := nqp::p6list($value, List, Mu)
if nqp::islist($value);
nqp::iscclass(pir::const::CCLASS_NUMERIC, $key, 0)
nqp::iscclass(nqp::const::CCLASS_NUMERIC, $key, 0)
?? nqp::bindpos($list, $key, $value)
!! nqp::bindkey($hash, $key, $value);
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/Exception.pm
Expand Up @@ -210,7 +210,7 @@ do {
$err.print: $ex;
$err.print: "\n";
}
$_() for pir::perl6ize_type__PP(@*END_PHASERS);
$_() for nqp::p6type(@*END_PHASERS);
}
if $! {
pir::perl6_based_rethrow__0PP(nqp::getattr(nqp::p6decont($!), Exception, '$!ex'), $ex);
Expand Down Expand Up @@ -255,7 +255,7 @@ do {
}
}

my Mu $comp := pir::compreg__Ps('perl6');
my Mu $comp := nqp::getcomp('perl6');
$comp.HOW.add_method($comp, 'handle-exception',
method (|) {
my Mu $ex := nqp::atpos(pir::perl6_current_args_rpa__P(), 1);
Expand Down Expand Up @@ -1204,7 +1204,7 @@ my class X::Item is Exception {
X::NoDispatcher.new(:$redispatcher).throw;
};
my Mu $parrot_c_ex := nqp::getattr(%c_ex, EnumMap, '$!storage');
pir::set_hll_global__vsP('P6EX', $parrot_c_ex);
nqp::bindcurhllsym('P6EX', $parrot_c_ex);
0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/Mu.pm
Expand Up @@ -271,13 +271,13 @@ my class Mu {
}

method clone(*%twiddles) {
my $cloned := pir::repr_clone__PP(nqp::p6decont(self));
my $cloned := nqp::clone(nqp::p6decont(self));
for self.^attributes() -> $attr {
my $name := $attr.name;
my $package := $attr.package;
unless pir::repr_get_primitive_type_spec__IP($attr.type) {
unless nqp::objprimspec($attr.type) {
my $attr_val := nqp::getattr($cloned, $package, $name);
nqp::bindattr($cloned, $package, $name, pir::repr_clone__PP($attr_val.VAR))
nqp::bindattr($cloned, $package, $name, nqp::clone($attr_val.VAR))
if nqp::iscont($attr_val);
}
my $acc_name := $name.substr(2);
Expand Down
4 changes: 2 additions & 2 deletions src/core/Routine.pm
Expand Up @@ -21,7 +21,7 @@ my class Routine {

method candidates() {
self.is_dispatcher ??
pir::perl6ize_type__PP($!dispatchees) !!
nqp::p6type($!dispatchees) !!
(self,)
}

Expand All @@ -37,7 +37,7 @@ my class Routine {
# Call this lexical sub to get rid of 'self' in the signature.
sub checker(|) {
my Mu $cap := pir::find_lex__Ps('call_sig');
pir::perl6ize_type__PP(pir::perl6_get_matching_multis__PPP($disp, $cap))
nqp::p6type(pir::perl6_get_matching_multis__PPP($disp, $cap))
}
checker(|$c);
}
Expand Down
12 changes: 6 additions & 6 deletions src/core/Str.pm
Expand Up @@ -219,13 +219,13 @@ my class Str does Stringy {
my int $eos = nqp::chars($str);

# S02:3276-3277: Ignore leading and trailing whitespace
my int $pos = nqp::findnotcclass(pir::const::CCLASS_WHITESPACE,
my int $pos = nqp::findnotcclass(nqp::const::CCLASS_WHITESPACE,
$str, 0, $eos);
my int $end = nqp::sub_i($eos, 1);

$end = nqp::sub_i($end, 1)
while nqp::isge_i($end, $pos)
&& nqp::iscclass(pir::const::CCLASS_WHITESPACE, $str, $end);
&& nqp::iscclass(nqp::const::CCLASS_WHITESPACE, $str, $end);

# Return 0 if no non-whitespace characters in string
return 0 if nqp::islt_i($end, $pos);
Expand Down Expand Up @@ -729,7 +729,7 @@ my class Str does Stringy {
method trim-leading(Str:D:) {
my str $str = nqp::unbox_s(self);
my int $pos = nqp::findnotcclass(
pir::const::CCLASS_WHITESPACE,
nqp::const::CCLASS_WHITESPACE,
$str, 0, nqp::chars($str));
nqp::p6box_s(nqp::substr($str, $pos));
}
Expand All @@ -739,18 +739,18 @@ my class Str does Stringy {
my int $pos = nqp::chars($str) - 1;
$pos = $pos - 1
while nqp::isge_i($pos, 0)
&& nqp::iscclass(pir::const::CCLASS_WHITESPACE, $str, $pos);
&& nqp::iscclass(nqp::const::CCLASS_WHITESPACE, $str, $pos);
nqp::islt_i($pos, 0) ?? '' !! nqp::p6box_s(nqp::substr($str, 0, $pos + 1));
}

method trim(Str:D:) {
my str $str = nqp::unbox_s(self);
my int $pos = nqp::chars($str) - 1;
my int $left = nqp::findnotcclass(
pir::const::CCLASS_WHITESPACE, $str, 0, $pos + 1);
nqp::const::CCLASS_WHITESPACE, $str, 0, $pos + 1);
$pos = $pos - 1
while nqp::isge_i($pos, $left)
&& nqp::iscclass(pir::const::CCLASS_WHITESPACE, $str, $pos);
&& nqp::iscclass(nqp::const::CCLASS_WHITESPACE, $str, $pos);
nqp::islt_i($pos, $left) ?? '' !! nqp::p6box_s(nqp::substr($str, $left, $pos + 1 - $left));
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/control.pm
Expand Up @@ -148,7 +148,7 @@ proto sub eval($, *%) {*}
multi sub eval(Str $code, :$lang = 'perl6', PseudoStash :$context) {
my $eval_ctx := nqp::getattr(nqp::p6decont($context // CALLER::), PseudoStash, '$!ctx');
my $?FILES := 'eval_' ~ (state $no)++;
my $compiler := pir::compreg__PS($lang);
my $compiler := nqp::getcomp($lang);
X::Eval::NoSuchLang.new(:$lang).throw
if nqp::isnull($compiler);
my $pbc := $compiler.compile($code, :outer_ctx($eval_ctx), :global(GLOBAL));
Expand Down
28 changes: 14 additions & 14 deletions src/core/terms.pm
Expand Up @@ -2,9 +2,9 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }

{
my @ARGS;
my Mu $argiter := pir::get_hll_global__Ps('$!ARGITER');
my Mu $argiter := nqp::getcurhllsym('$!ARGITER');
@ARGS.push(nqp::p6box_s(nqp::shift($argiter))) while $argiter;
nqp::bindkey(pir::get_who__PP(PROCESS), '@ARGS', @ARGS);
nqp::bindkey(nqp::who(PROCESS), '@ARGS', @ARGS);
$PROCESS::ARGFILES = IO::ArgFiles.new(:args(@ARGS));

my %ENV;
Expand Down Expand Up @@ -39,14 +39,14 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
return $ret;
}
}
nqp::bindkey(pir::get_who__PP(PROCESS), '%ENV', %ENV);
nqp::bindkey(nqp::who(PROCESS), '%ENV', %ENV);

my $VM = {
name => 'parrot', # XXX: should be made dynamical
config => pir::perl6ize_type__PP(
config => nqp::p6type(
nqp::atpos(pir::getinterp__P, pir::const::IGLOBALS_CONFIG_HASH))
}
nqp::bindkey(pir::get_who__PP(PROCESS), '$VM', $VM);
nqp::bindkey(nqp::who(PROCESS), '$VM', $VM);

my Mu $compiler := pir::find_caller_lex__PS('$COMPILER_CONFIG');
my $PERL = {
Expand All @@ -59,10 +59,10 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
codename => nqp::p6box_s(nqp::atkey($compiler, 'codename')),
}
};
nqp::bindkey(pir::get_who__PP(PROCESS), '$PERL', $PERL);
nqp::bindkey(nqp::who(PROCESS), '$PERL', $PERL);

my $CWD = nqp::p6box_s(pir::new__PS('OS').cwd);
nqp::bindkey(pir::get_who__PP(PROCESS), '$CWD', $CWD);
nqp::bindkey(nqp::who(PROCESS), '$CWD', $CWD);

my @INC;
@INC.push(%ENV<RAKUDOLIB>.split($VM<config><osname> eq 'MSWin32' ?? ';' !! ':')) if %ENV<RAKUDOLIB>;
Expand All @@ -82,7 +82,7 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
%CUSTOM_LIB<home> = "$home/.perl6/$ver";
@INC.push(%CUSTOM_LIB<home> ~ '/lib');
}
nqp::bindkey(pir::get_who__PP(PROCESS), '%CUSTOM_LIB', %CUSTOM_LIB);
nqp::bindkey(nqp::who(PROCESS), '%CUSTOM_LIB', %CUSTOM_LIB);

my $I := nqp::atkey(nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I');
if nqp::defined($I) {
Expand All @@ -95,23 +95,23 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
}
}

nqp::bindkey(pir::get_who__PP(PROCESS), '@INC', @INC);
nqp::bindkey(nqp::who(PROCESS), '@INC', @INC);

my $PID = nqp::p6box_i(pir::getinterp__P().getpid());
nqp::bindkey(pir::get_who__PP(PROCESS), '$PID', $PID);
nqp::bindkey(nqp::who(PROCESS), '$PID', $PID);

my $OS = $VM<config><osname>; # XXX: master gets this information with the sysinfo dynop
nqp::bindkey(pir::get_who__PP(PROCESS), '$OS', $OS);
nqp::bindkey(nqp::who(PROCESS), '$OS', $OS);

my $OSVER = $VM<config><osvers>; # XXX: master gets this information with the sysinfo dynop
nqp::bindkey(pir::get_who__PP(PROCESS), '$OSVER', $OSVER);
nqp::bindkey(nqp::who(PROCESS), '$OSVER', $OSVER);

my $EXECUTABLE_NAME =
nqp::p6box_s(pir::interpinfo__Si(pir::const::INTERPINFO_EXECUTABLE_FULLNAME));
nqp::bindkey(pir::get_who__PP(PROCESS), '$EXECUTABLE_NAME', $EXECUTABLE_NAME);
nqp::bindkey(nqp::who(PROCESS), '$EXECUTABLE_NAME', $EXECUTABLE_NAME);
my Mu $comp := pir::compreg__Ps('perl6');

my $PROGRAM_NAME = $comp.user-progname();
nqp::bindkey(pir::get_who__PP(PROCESS), '$PROGRAM_NAME', $PROGRAM_NAME);
nqp::bindkey(nqp::who(PROCESS), '$PROGRAM_NAME', $PROGRAM_NAME);

}
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2013.01-160-gc41c8f4
2013.01-192-g98a623e

0 comments on commit b9ee89a

Please sign in to comment.