Skip to content

Commit

Permalink
setting $*MAIN, which is the currently active main language
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Apr 29, 2013
1 parent 8f4b93d commit 42e799e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Perl5.pm
Expand Up @@ -12,6 +12,11 @@ sub EXPORT(*@a) {
%*LANG<P5Regex> := Perl6::P5RegexGrammar;
%*LANG<P5Regex-actions> := Perl6::P5RegexActions;
$*ACTIONS := %*LANG<Perl5-actions>;

$*MAIN := 'Perl5';

$*W.install_lexical_symbol($*W.cur_lexpad(), '%?LANG', $*W.p6ize_recursive(%*LANG));
$*W.install_lexical_symbol($*W.cur_lexpad(), '$*MAIN', $*W.p6ize_recursive($*MAIN));

my $PROCESS := nqp::gethllsym('perl6', 'PROCESS');
if !nqp::isnull($PROCESS) && nqp::existskey($PROCESS.WHO, '%CUSTOM_LIB') {
Expand All @@ -20,7 +25,7 @@ sub EXPORT(*@a) {
my %INC := $INC.FLATTENABLE_HASH();
unless nqp::existskey(%INC, 'Perl5') {
%INC<Perl5> := $*W.find_symbol(['Array']).new;
my $PERL5LIB := $*W.get_env('PERL5LIB');
my $PERL5LIB := nqp::atkey(nqp::getenvhash(), 'PERL5LIB');
if nqp::defined($PERL5LIB) {
%INC<Perl5>.unshift: $*W.p6ize_recursive( nqp::split(':', $PERL5LIB) )
}
Expand Down

0 comments on commit 42e799e

Please sign in to comment.