Skip to content

Commit

Permalink
Change the internal HLL language to "Raku"
Browse files Browse the repository at this point in the history
Rakudo is implemented as a HLL on top of NQP, because NQP is intended
to be a compiler building toolkit.  Historically the name "perl6" was
used.  This commit changes *all* occurrences of the use of that name
to "Raku" and it also contains an NQP bump, because somehow some
references to "perl6" somehow sneaked into there.

This is a single massive commit, because that was the only way to do it.
  • Loading branch information
lizmat committed Jan 24, 2020
1 parent 0d81a86 commit b787095
Show file tree
Hide file tree
Showing 62 changed files with 306 additions and 306 deletions.
4 changes: 2 additions & 2 deletions lib/NativeCall.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ our role Native[Routine $r, $libname where Str|Callable|List|IO::Path|Distributi
self,
Code,
'$!do',
nqp::getattr(nqp::hllizefor($body, 'perl6'), ForeignCode, '$!do')
nqp::getattr(nqp::hllizefor($body, 'Raku'), ForeignCode, '$!do')
);
}

Expand Down Expand Up @@ -504,7 +504,7 @@ our role Native[Routine $r, $libname where Str|Callable|List|IO::Path|Distributi
}

method !compile-function-body(Mu $block) {
my $perl6comp := nqp::getcomp("perl6");
my $perl6comp := nqp::getcomp("Raku");
my @stages = $perl6comp.stages;
Nil until @stages.shift eq 'optimize';

Expand Down
34 changes: 17 additions & 17 deletions src/Perl6/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ register_op_desugar('p6forstmt', -> $qast {
});
register_op_desugar('p6scalarfromdesc', -> $qast {
my $desc := QAST::Node.unique('descriptor');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $default_cont_spec := nqp::gethllsym('perl6', 'default_cont_spec');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
my $default_cont_spec := nqp::gethllsym('Raku', 'default_cont_spec');
QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
Expand Down Expand Up @@ -741,7 +741,7 @@ register_op_desugar('p6scalarfromdesc', -> $qast {
# eventually have everything using this version of the op.
register_op_desugar('p6scalarfromcertaindesc', -> $qast {
my $desc := QAST::Node.unique('descriptor');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
Expand All @@ -767,7 +767,7 @@ register_op_desugar('p6scalarfromcertaindesc', -> $qast {
)
});
register_op_desugar('p6scalarwithvalue', -> $qast {
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
QAST::Op.new(
:op('p6assign'),
QAST::Op.new(
Expand All @@ -782,7 +782,7 @@ register_op_desugar('p6scalarwithvalue', -> $qast {
});
register_op_desugar('p6recont_ro', -> $qast {
my $result := QAST::Node.unique('result');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
Expand Down Expand Up @@ -818,7 +818,7 @@ register_op_desugar('p6recont_ro', -> $qast {
});
register_op_desugar('p6var', -> $qast {
my $result := QAST::Node.unique('result');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
Expand Down Expand Up @@ -853,7 +853,7 @@ register_op_desugar('p6var', -> $qast {
my $is_moar;
register_op_desugar('p6decontrv_internal', -> $qast {
unless nqp::isconcrete($is_moar) {
$is_moar := nqp::getcomp('perl6').backend.name eq 'moar';
$is_moar := nqp::getcomp('Raku').backend.name eq 'moar';
}
if $is_moar {
my $result := QAST::Node.unique('result');
Expand All @@ -876,8 +876,8 @@ register_op_desugar('p6var', -> $qast {
}
else {
my $result := QAST::Node.unique('result');
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Scalar')) );
my $Iterable := QAST::WVal.new( :value(nqp::gethllsym('perl6', 'Iterable')) );
my $Scalar := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Scalar')) );
my $Iterable := QAST::WVal.new( :value(nqp::gethllsym('Raku', 'Iterable')) );
QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
Expand Down Expand Up @@ -943,7 +943,7 @@ register_op_desugar('p6var', -> $qast {
my $is_moar;
register_op_desugar('p6assign', -> $qast {
unless nqp::isconcrete($is_moar) {
$is_moar := nqp::getcomp('perl6').backend.name eq 'moar';
$is_moar := nqp::getcomp('Raku').backend.name eq 'moar';
}
if $is_moar {
my $cont := QAST::Node.unique('assign_cont');
Expand Down Expand Up @@ -1379,7 +1379,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

# Wrap everything in a QAST::CompUnit.
make QAST::CompUnit.new(
:hll('perl6'),
:hll('Raku'),

# Serialization related bits.
:sc($*W.sc()),
Expand Down Expand Up @@ -2431,7 +2431,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

sub single_top_level_whenever($block) {
if $*WHENEVER_COUNT == 1
&& nqp::getcomp('perl6').language_version ne '6.c' {
&& nqp::getcomp('Raku').language_version ne '6.c' {
my $stmts := $block[1];
if nqp::istype($stmts, QAST::Stmts) {
my @stmts := $stmts.list;
Expand Down Expand Up @@ -3923,7 +3923,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
method routine_declarator:sym<submethod>($/) { make $<method_def>.ast; }

sub decontrv_op() {
$*W.lang-ver-before('d') && nqp::getcomp('perl6').backend.name eq 'moar'
$*W.lang-ver-before('d') && nqp::getcomp('Raku').backend.name eq 'moar'
?? 'p6decontrv_6c'
!! 'p6decontrv'
}
Expand Down Expand Up @@ -4302,7 +4302,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
# Operations need checking for their inlinability. If they are OK in
# themselves, it comes down to the children.
elsif nqp::istype($node, QAST::Op) {
if nqp::getcomp('QAST').operations.is_inlinable('perl6', $node.op) {
if nqp::getcomp('QAST').operations.is_inlinable('Raku', $node.op) {
my $replacement := $node.shallow_clone();
my int $i := 0;
my int $n := +@($node);
Expand Down Expand Up @@ -6428,7 +6428,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
}
$past.node($/);
nqp::getcomp('QAST').operations.attach_result_type('perl6', $past);
nqp::getcomp('QAST').operations.attach_result_type('Raku', $past);
make $past;
}

Expand Down Expand Up @@ -8847,7 +8847,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
# (e.g. we can get the same errors).
my $need_full_binder := 1;
unless nqp::defined($use_vm_binder) {
$use_vm_binder := nqp::getcomp('perl6').backend.name eq 'moar' || nqp::getcomp('perl6').backend.name eq 'js';
$use_vm_binder := nqp::getcomp('Raku').backend.name eq 'moar' || nqp::getcomp('Raku').backend.name eq 'js';
}
if $use_vm_binder {
# If there are zero parameters, then we can trivially leave it to
Expand Down Expand Up @@ -10396,7 +10396,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

method pod_block:sym<finish>($/) {
$*W.install_lexical_symbol(
$*UNIT,'$=finish', nqp::hllizefor(~$<finish>, 'perl6'));
$*UNIT,'$=finish', nqp::hllizefor(~$<finish>, 'Raku'));
}

method pod_content:sym<config>($/) {
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Perl6::Compiler is HLL::Compiler {

my $argiter := nqp::iterator(@args);
nqp::shift($argiter) if $argiter && !nqp::defined(%options<e>);
nqp::bindhllsym('perl6', '$!ARGITER', $argiter);
nqp::bindhllsym('Raku', '$!ARGITER', $argiter);
my $super := nqp::findmethod(HLL::Compiler, 'command_eval');
my %*COMPILING;
%*COMPILING<%?OPTIONS> := %options;
Expand Down Expand Up @@ -100,9 +100,9 @@ class Perl6::Compiler is HLL::Compiler {

method usage($name?, :$use-stderr = False) {
my $print-func := $use-stderr ?? &note !! &say;
my $compiler := nqp::getcomp("perl6").backend.name;
my $compiler := nqp::getcomp("Raku").backend.name;
my $moar-options := '';
if nqp::getcomp("perl6").backend.name eq 'moar' {
if nqp::getcomp("Raku").backend.name eq 'moar' {
$moar-options := q --profile[=name] write profile information to a file
Extension controls format:
.json outputs in JSON
Expand Down
8 changes: 4 additions & 4 deletions src/Perl6/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:my $*LASTQUOTE := [0,0];
{
nqp::getcomp('perl6').reset_language_version();
nqp::getcomp('Raku').reset_language_version();
$*W.comp_unit_stage0($/)
}
Expand Down Expand Up @@ -851,7 +851,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
rule lang-version {
:my $comp := nqp::getcomp('perl6');
:my $comp := nqp::getcomp('Raku');
[
<.ws>? 'use' <version> {} # <-- update $/ so we can grab $<version>
# we parse out the numeral, since we could have "6d"
Expand Down Expand Up @@ -1186,7 +1186,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
<sym><.kok>
[
|| <?{
nqp::getcomp('perl6').language_version eq '6.c'
nqp::getcomp('Raku').language_version eq '6.c'
|| $*WHENEVER_COUNT >= 0
}>
|| <.typed_panic('X::Comp::WheneverOutOfScope')>
Expand Down Expand Up @@ -5639,7 +5639,7 @@ grammar Perl6::QGrammar is HLL::Grammar does STD {
nqp::push_s(@pplist, $newpp);
# yes, the currying is necessary. Otherwise weird things can happen,
# e.g. perl6 -e 'q:w:x//; q:ww:v//' turning the second into q:w:x:v//
# e.g. raku -e 'q:w:x//; q:ww:v//' turning the second into q:w:x:v//
role postproc[@curlist] {
method postprocessors() {
@curlist;
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Metamodel/ClassHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Perl6::Metamodel::ClassHOW
else {
$new_type := nqp::newtype($metaclass, $repr);
}
my $obj := nqp::settypehll($new_type, 'perl6');
my $obj := nqp::settypehll($new_type, 'Raku');
$metaclass.set_name($obj, $name // "<anon|{$anon_id++}>");
self.add_stash($obj);
$metaclass.set_ver($obj, $ver) if $ver;
Expand Down Expand Up @@ -288,7 +288,7 @@ class Perl6::Metamodel::ClassHOW
method find_method_fallback($obj, $name) {
# If the object is a junction, need to do a junction dispatch.
if $obj.WHAT =:= $junction_type && $junction_autothreader {
my $p6name := nqp::hllizefor($name, 'perl6');
my $p6name := nqp::hllizefor($name, 'Raku');
return -> *@pos_args, *%named_args {
$junction_autothreader($p6name, |@pos_args, |%named_args)
};
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Metamodel/CoercionHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class Perl6::Metamodel::CoercionHOW
}
BEGIN {
my $root := nqp::newtype(Perl6::Metamodel::CoercionHOW, 'Uninstantiable');
nqp::settypehll($root, 'perl6');
nqp::settypehll($root, 'Raku');
nqp::setparameterizer($root, sub ($type, $params) {
# Re-use same HOW.
nqp::settypehll(nqp::newtype($type.HOW, 'Uninstantiable'), 'perl6');
nqp::settypehll(nqp::newtype($type.HOW, 'Uninstantiable'), 'Raku');
});
(Perl6::Metamodel::CoercionHOW.WHO)<root> := $root;
}
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/ConcreteRoleHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Perl6::Metamodel::ConcreteRoleHOW

method new_type(:@roles, :$name = '<anon>', :$ver, :$auth, :$repr, :$api) {
my $metarole := self.new(:roles(@roles));
my $obj := nqp::settypehll(nqp::newtype($metarole, 'Uninstantiable'), 'perl6');
my $obj := nqp::settypehll(nqp::newtype($metarole, 'Uninstantiable'), 'Raku');
$metarole.set_name($obj, $name);
$metarole.set_ver($obj, $ver);
$metarole.set_auth($obj, $auth) if $auth;
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/ConcretizationCache.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ role Perl6::Metamodel::ConcretizationCache {
method !make_capture(@pos, %named) {
if nqp::isnull($capture_type) {
# Fetch and preserve Capture type object. But don't do so until it's fully ready.
$capture_type := nqp::gethllsym('perl6', 'Capture');
$capture_type := nqp::gethllsym('Raku', 'Capture');
return nqp::null()
if nqp::isnull($capture_type) || !$capture_type.HOW.is_composed($capture_type)
}
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/CurriedRoleHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Perl6::Metamodel::CurriedRoleHOW

my $meta := self.new(:curried_role($curried_role), :pos_args(@pos_args),
:named_args(%named_args), :name($name));
my $type := nqp::settypehll(nqp::newtype($meta, 'Uninstantiable'), 'perl6');
my $type := nqp::settypehll(nqp::newtype($meta, 'Uninstantiable'), 'Raku');

nqp::settypecheckmode($type, 2);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Perl6/Metamodel/DefiniteHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Perl6::Metamodel::DefiniteHOW
# Do check when we're on LHS of smartmatch (e.g. Even ~~ Int).
method type_check($definite_type, $checkee) {
my $base_type := self.base_type($definite_type);
nqp::hllboolfor(nqp::istype($base_type, $checkee), "perl6")
nqp::hllboolfor(nqp::istype($base_type, $checkee), "Raku")
}

# Here we check the value itself (when on RHS on smartmatch).
Expand All @@ -119,18 +119,18 @@ class Perl6::Metamodel::DefiniteHOW
nqp::hllboolfor(
nqp::istype($checkee, $base_type) &&
nqp::isconcrete($checkee) == $definite,
"perl6"
"Raku"
)
}
}

BEGIN {
my $root := nqp::newtype(Perl6::Metamodel::DefiniteHOW, 'Uninstantiable');
nqp::settypehll($root, 'perl6');
nqp::settypehll($root, 'Raku');

nqp::setparameterizer($root, sub ($type, $params) {
# Re-use same HOW.
my $thing := nqp::settypehll(nqp::newtype($type.HOW, 'Uninstantiable'), 'perl6');
my $thing := nqp::settypehll(nqp::newtype($type.HOW, 'Uninstantiable'), 'Raku');
nqp::settypecheckmode($thing, 2)
});
(Perl6::Metamodel::DefiniteHOW.WHO)<root> := $root;
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/EnumHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Perl6::Metamodel::EnumHOW

method new_type(:$name!, :$base_type?, :$repr = 'P6opaque', :$is_mixin) {
my $meta := self.new();
my $obj := nqp::settypehll(nqp::newmixintype($meta, $repr), 'perl6');
my $obj := nqp::settypehll(nqp::newmixintype($meta, $repr), 'Raku');
$meta.set_name($obj, $name);
$meta.set_base_type($meta, $base_type) unless $base_type =:= NQPMu;
$meta.setup_mixin_cache($obj);
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/GenericHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Perl6::Metamodel::GenericHOW
# ourself.
method new_type(:$name) {
my $meta := self.new();
my $obj := nqp::settypehll(nqp::newtype($meta, 'Uninstantiable'), 'perl6');
my $obj := nqp::settypehll(nqp::newtype($meta, 'Uninstantiable'), 'Raku');
$meta.set_name($obj, $name);
$obj
}
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Metamodel/LanguageRevision.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ role Perl6::Metamodel::LanguageRevision
unless (nqp::iseq_i(nqp::chars($ver), 3) && nqp::eqat($ver, '6.', 0));
$lang-ver := $ver;
}
elsif nqp::getcomp('perl6') {
elsif nqp::getcomp('Raku') {
# NOTE: It turns out that nqp::getcomp path for obtaining the language version isn't reliable as sometimes
# language_version method reports wrong version.
my $rev;
Expand All @@ -21,7 +21,7 @@ role Perl6::Metamodel::LanguageRevision
$rev := $*W.find_symbol(['CORE-SETTING-REV'], :setting-only) || $*W.setting_revision;
}
$lang-ver := ($rev && '6.' ~ $rev) # compile-time if CORE is available
|| nqp::getcomp('perl6').language_version; # otherwise try the compiler
|| nqp::getcomp('Raku').language_version; # otherwise try the compiler
}
else {
return
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/MROBasedTypeChecking.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ role Perl6::Metamodel::MROBasedTypeChecking {
}

method does($obj, $type) {
nqp::hllboolfor(nqp::istype($obj, $type), "perl6")
nqp::hllboolfor(nqp::istype($obj, $type), "Raku")
}

method type_check($obj, $checkee) {
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/Metamodel/MethodContainer.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ role Perl6::Metamodel::MethodContainer {
# Always need local methods on the list.
my @meths;
for @!method_order {
@meths.push(nqp::hllizefor($_, 'perl6'));
@meths.push(nqp::hllizefor($_, 'Raku'));
}

# If local flag was not passed, include those from parents.
unless $local {
for self.parents($obj, :all($all), :excl($excl)) {
for nqp::hllize($_.HOW.method_table($_)) {
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'perl6'));
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'Raku'));
}
for nqp::hllize($_.HOW.submethod_table($_)) {
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'perl6'));
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'Raku'));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/Mixins.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ role Perl6::Metamodel::Mixins {
if $need-mixin-attribute {
my $found := $mixin_type.HOW.mixin_attribute($mixin_type);
unless $found {
my %ex := nqp::gethllsym('perl6', 'P6EX');
my %ex := nqp::gethllsym('Raku', 'P6EX');
if !nqp::isnull(%ex) && nqp::existskey(%ex, 'X::Role::Initialization') {
nqp::atkey(%ex, 'X::Role::Initialization')(@roles[0]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/ModuleHOW.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Perl6::Metamodel::ModuleHOW
method new_type(:$name = '<anon>', :$repr, :$ver, :$auth, :$api) {
if $repr { nqp::die("'module' does not support custom representations") }
my $metaclass := self.new();
my $obj := nqp::settypehll(nqp::newtype($metaclass, 'Uninstantiable'), 'perl6');
my $obj := nqp::settypehll(nqp::newtype($metaclass, 'Uninstantiable'), 'Raku');
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver);
$metaclass.set_auth($obj, $auth) if $auth;
Expand Down
Loading

0 comments on commit b787095

Please sign in to comment.