Navigation Menu

Skip to content

Commit

Permalink
rename $*ST to $*W. No functional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Dec 17, 2011
1 parent d59a2d3 commit 02cced8
Show file tree
Hide file tree
Showing 7 changed files with 330 additions and 330 deletions.
504 changes: 252 additions & 252 deletions src/Perl6/Actions.pm

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions src/Perl6/Grammar.pm
Expand Up @@ -25,7 +25,7 @@ grammar Perl6::Grammar is HLL::Grammar {
# objects that cross the compile-time/run-time boundary that are
# associated with this compilation unit.
my $file := pir::find_caller_lex__ps('$?FILES');
my $*ST := pir::isnull($file) ??
my $*W := pir::isnull($file) ??
Perl6::World.new(:handle(~pir::time__N())) !!
Perl6::World.new(:handle(~pir::time__N()), :description($file));

Expand Down Expand Up @@ -154,7 +154,7 @@ grammar Perl6::Grammar is HLL::Grammar {
my $cont := Perl6::Pod::serialize_aos(
[~$*DOC]
)<compile_time_value>;
my $block := $*ST.add_constant(
my $block := $*W.add_constant(
'Pod::Block::Declarator', 'type_new',
:nocache, :content($cont),
);
Expand Down Expand Up @@ -415,41 +415,41 @@ grammar Perl6::Grammar is HLL::Grammar {
{
# Create unit outer (where we assemble any lexicals accumulated
# from e.g. REPL) and the real UNIT.
$*UNIT_OUTER := $*ST.push_lexpad($/);
$*UNIT := $*ST.push_lexpad($/);
$*UNIT_OUTER := $*W.push_lexpad($/);
$*UNIT := $*W.push_lexpad($/);
$*UNIT<IN_DECL> := 'mainline';

# If we already have a specified outer context, then that's
# our setting. Otherwise, load one.
unless pir::defined(%*COMPILING<%?OPTIONS><outer_ctx>) {
$*SETTING := $*ST.load_setting(%*COMPILING<%?OPTIONS><setting> // 'CORE');
$*SETTING := $*W.load_setting(%*COMPILING<%?OPTIONS><setting> // 'CORE');
}
$/.CURSOR.unitstart();
try {
my $EXPORTHOW := $*ST.find_symbol(['EXPORTHOW']);
my $EXPORTHOW := $*W.find_symbol(['EXPORTHOW']);
for $EXPORTHOW.WHO {
%*HOW{$_.key} := $_.value;
}
}

# Create GLOBAL(ish).
$*GLOBALish := $*ST.pkg_create_mo(%*HOW<package>, :name('GLOBAL'));
$*ST.pkg_compose($*GLOBALish);
$*GLOBALish := $*W.pkg_create_mo(%*HOW<package>, :name('GLOBAL'));
$*W.pkg_compose($*GLOBALish);

# Create EXPORT.
$*EXPORT := $*ST.pkg_create_mo(%*HOW<package>, :name('EXPORT'));
$*ST.pkg_compose($*EXPORT);
$*EXPORT := $*W.pkg_create_mo(%*HOW<package>, :name('EXPORT'));
$*W.pkg_compose($*EXPORT);

# We start with the current package as that also.
$*PACKAGE := $*GLOBALish;

# Install unless we've no setting, in which case we've likely no
# static lexpad class yet either. Also, UNIT needs a code object.
unless %*COMPILING<%?OPTIONS><setting> eq 'NULL' {
$*ST.install_lexical_symbol($*UNIT, 'GLOBALish', $*GLOBALish);
$*ST.install_lexical_symbol($*UNIT, 'EXPORT', $*EXPORT);
$*ST.install_lexical_symbol($*UNIT, '$?PACKAGE', $*PACKAGE);
$*ST.create_code_object($*UNIT, 'Block', $*ST.create_signature([]));
$*W.install_lexical_symbol($*UNIT, 'GLOBALish', $*GLOBALish);
$*W.install_lexical_symbol($*UNIT, 'EXPORT', $*EXPORT);
$*W.install_lexical_symbol($*UNIT, '$?PACKAGE', $*PACKAGE);
$*W.create_code_object($*UNIT, 'Block', $*W.create_signature([]));
}
}

Expand All @@ -461,14 +461,14 @@ grammar Perl6::Grammar is HLL::Grammar {
[ $ || <.panic: 'Confused'> ]

{
$*POD_PAST := $*ST.add_constant(
$*POD_PAST := $*W.add_constant(
'Array', 'type_new', |$*POD_BLOCKS
);
$*ST.install_lexical_symbol(
$*W.install_lexical_symbol(
$*UNIT, '$=POD', $*POD_PAST<compile_time_value>
);
$*ST.pop_lexpad(); # UNIT
$*ST.pop_lexpad(); # UNIT_OUTER
$*W.pop_lexpad(); # UNIT
$*W.pop_lexpad(); # UNIT_OUTER
}

# CHECK time.
Expand Down Expand Up @@ -557,12 +557,12 @@ grammar Perl6::Grammar is HLL::Grammar {
| <?terminator> <.panic: 'Missing block'>
| <?> <.panic: 'Malformed block'>
]
{ $*CURPAD := $*ST.pop_lexpad() }
{ $*CURPAD := $*W.pop_lexpad() }
}

token unitstart { <?> }
token you_are_here { <?> }
token newpad { <?> { $*ST.push_lexpad($/) } }
token newpad { <?> { $*W.push_lexpad($/) } }
token finishpad { <?> }

proto token terminator { <...> }
Expand Down Expand Up @@ -653,7 +653,7 @@ grammar Perl6::Grammar is HLL::Grammar {
] ** ','
{
for $<module_name> {
$*ST.load_module(~$_<longname>, $*GLOBALish);
$*W.load_module(~$_<longname>, $*GLOBALish);
}
}
}
Expand All @@ -665,7 +665,7 @@ grammar Perl6::Grammar is HLL::Grammar {
my @name := parse_name(~$<module_name><longname>);
my $module;
my $found := 0;
try { $module := $*ST.find_symbol(@name); $found := 1; }
try { $module := $*W.find_symbol(@name); $found := 1; }
if $found {
do_import($module.WHO, $<arglist>);
}
Expand Down Expand Up @@ -708,7 +708,7 @@ grammar Perl6::Grammar is HLL::Grammar {
|| {
unless ~$<doc> && !%*COMPILING<%?OPTIONS><doc> {
if $longname {
my $module := $*ST.load_module(~$longname,
my $module := $*W.load_module(~$longname,
$*GLOBALish);
do_import($module, $<arglist>);
$/.CURSOR.import_EXPORTHOW($module);
Expand All @@ -724,7 +724,7 @@ grammar Perl6::Grammar is HLL::Grammar {
if pir::exists($module, 'EXPORT') {
my $EXPORT := $module<EXPORT>.WHO;
if pir::exists($EXPORT, 'DEFAULT') {
$*ST.import($EXPORT<DEFAULT>);
$*W.import($EXPORT<DEFAULT>);
}
}
}
Expand Down Expand Up @@ -1145,7 +1145,7 @@ grammar Perl6::Grammar is HLL::Grammar {

rule package_def {
:my $longname;
:my $outer := $*ST.cur_lexpad();
:my $outer := $*W.cur_lexpad();
:my $*DECLARAND;
:my $*IN_DECL := 'package';
:my $*CURPAD;
Expand Down Expand Up @@ -1182,8 +1182,8 @@ grammar Perl6::Grammar is HLL::Grammar {
my $exists := 0;
if $longname && $*SCOPE ne 'anon' {
my @name := parse_name(~$longname<name>);
if $*ST.already_declared($*SCOPE, $*OUTERPACKAGE, $outer, @name) {
$*PACKAGE := $*ST.find_symbol(@name);
if $*W.already_declared($*SCOPE, $*OUTERPACKAGE, $outer, @name) {
$*PACKAGE := $*W.find_symbol(@name);
$exists := 1;
}
}
Expand All @@ -1209,11 +1209,11 @@ grammar Perl6::Grammar is HLL::Grammar {
if $*REPR ne '' {
%args<repr> := $*REPR;
}
$*PACKAGE := $*ST.pkg_create_mo(%*HOW{$*PKGDECL}, |%args);
$*PACKAGE := $*W.pkg_create_mo(%*HOW{$*PKGDECL}, |%args);

# Install it in the symbol table if needed.
if $longname {
$*ST.install_package_longname($/, $longname, $*SCOPE,
$*W.install_package_longname($/, $longname, $*SCOPE,
$*PKGDECL, $*OUTERPACKAGE, $outer, $*PACKAGE);
}
}
Expand All @@ -1228,13 +1228,13 @@ grammar Perl6::Grammar is HLL::Grammar {
$group := $*PACKAGE;
}
else {
$group := $*ST.pkg_create_mo(%*HOW{'role-group'}, :name(~$longname<name>));
$*ST.install_package_longname($/, $longname, $*SCOPE,
$group := $*W.pkg_create_mo(%*HOW{'role-group'}, :name(~$longname<name>));
$*W.install_package_longname($/, $longname, $*SCOPE,
$*PKGDECL, $*OUTERPACKAGE, $outer, $group);
}

# Construct role meta-object with group.
$*PACKAGE := $*ST.pkg_create_mo(%*HOW{$*PKGDECL}, :name(~$longname<name>),
$*PACKAGE := $*W.pkg_create_mo(%*HOW{$*PKGDECL}, :name(~$longname<name>),
:group($group), :signatured($<signature> ?? 1 !! 0));
}
}
Expand All @@ -1253,27 +1253,27 @@ grammar Perl6::Grammar is HLL::Grammar {
# Locate type.
my $found;
my @name := parse_name(~$longname<name>);
try { $*PACKAGE := $*ST.find_symbol(@name); $found := 1 }
try { $*PACKAGE := $*W.find_symbol(@name); $found := 1 }
unless $found {
$/.CURSOR.panic("Could not find a $*PKGDECL " ~
~$longname<name> ~ " to augment");
}
}

# Install $?PACKAGE, $?ROLE, $?CLASS, ::?CLASS as needed.
my $curpad := $*ST.cur_lexpad();
my $curpad := $*W.cur_lexpad();
unless $curpad.symbol('$?PACKAGE') {
$*ST.install_lexical_symbol($curpad, '$?PACKAGE', $*PACKAGE);
$*W.install_lexical_symbol($curpad, '$?PACKAGE', $*PACKAGE);
if $*PKGDECL eq 'class' || $*PKGDECL eq 'grammar' {
$*ST.install_lexical_symbol($curpad, '$?CLASS', $*PACKAGE);
$*ST.install_lexical_symbol($curpad, '::?CLASS', $*PACKAGE);
$*W.install_lexical_symbol($curpad, '$?CLASS', $*PACKAGE);
$*W.install_lexical_symbol($curpad, '::?CLASS', $*PACKAGE);
}
elsif $*PKGDECL eq 'role' {
$*ST.install_lexical_symbol($curpad, '$?ROLE', $*PACKAGE);
$*ST.install_lexical_symbol($curpad, '$?CLASS',
$*ST.pkg_create_mo(%*HOW<generic>, :name('$?CLASS')));
$*ST.install_lexical_symbol($curpad, '::?CLASS',
$*ST.pkg_create_mo(%*HOW<generic>, :name('::?CLASS')));
$*W.install_lexical_symbol($curpad, '$?ROLE', $*PACKAGE);
$*W.install_lexical_symbol($curpad, '$?CLASS',
$*W.pkg_create_mo(%*HOW<generic>, :name('$?CLASS')));
$*W.install_lexical_symbol($curpad, '::?CLASS',
$*W.pkg_create_mo(%*HOW<generic>, :name('::?CLASS')));
}
}

Expand Down Expand Up @@ -1317,7 +1317,7 @@ grammar Perl6::Grammar is HLL::Grammar {
{ $*IN_DECL := ''; }
<.finishpad>
<statementlist> # whole rest of file, presumably
{ $*CURPAD := $*ST.pop_lexpad() }
{ $*CURPAD := $*W.pop_lexpad() }
|| <.panic: "Too late for semicolon form of $*PKGDECL definition">
]
|| <.panic: "Unable to parse $*PKGDECL definition">
Expand Down Expand Up @@ -1476,7 +1476,7 @@ grammar Perl6::Grammar is HLL::Grammar {
'{' <.ws> '*' <.ws> '}'
<?ENDSTMT>
<.finishpad>
{ $*CURPAD := $*ST.pop_lexpad() }
{ $*CURPAD := $*W.pop_lexpad() }
}

###########################
Expand Down Expand Up @@ -1509,7 +1509,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token fakesignature {
<.newpad>
<signature>
{ $*ST.pop_lexpad() }
{ $*W.pop_lexpad() }
}

token signature {
Expand Down Expand Up @@ -1660,7 +1660,7 @@ grammar Perl6::Grammar is HLL::Grammar {
'{'[
| ['*'|'<...>'|'<*>'] <?{ $*MULTINESS eq 'proto' }> $<onlystar>={1}
|<p6regex=.LANG('Regex','nibbler')>]'}'<?ENDSTMT>
{ $*CURPAD := $*ST.pop_lexpad() }
{ $*CURPAD := $*W.pop_lexpad() }
] || <.panic: "Malformed regex">
] }

Expand All @@ -1674,7 +1674,7 @@ grammar Perl6::Grammar is HLL::Grammar {
| <longname>
{
my @name := parse_name(~$<longname><name>);
if $*ST.already_declared($*SCOPE, $*PACKAGE, $*ST.cur_lexpad(), @name) {
if $*W.already_declared($*SCOPE, $*PACKAGE, $*W.cur_lexpad(), @name) {
$/.CURSOR.panic("Illegal redeclaration of symbol " ~
~$<longname><name>);
}
Expand All @@ -1698,7 +1698,7 @@ grammar Perl6::Grammar is HLL::Grammar {
<longname>
{
my @name := parse_name(~$<longname><name>);
if $*ST.already_declared($*SCOPE, $*PACKAGE, $*ST.cur_lexpad(), @name) {
if $*W.already_declared($*SCOPE, $*PACKAGE, $*W.cur_lexpad(), @name) {
$/.CURSOR.panic("Illegal redeclaration of symbol " ~
~$<longname><name>);
}
Expand Down Expand Up @@ -1782,7 +1782,7 @@ grammar Perl6::Grammar is HLL::Grammar {
[
|| <?{
my $longname := $<longname>.Str;
pir::substr($longname, 0, 2) eq '::' || $*ST.is_name(parse_name($longname))
pir::substr($longname, 0, 2) eq '::' || $*W.is_name(parse_name($longname))
}>
<.unsp>? [ <?before '['> '[' ~ ']' <arglist> ]?
|| <args>
Expand Down Expand Up @@ -1896,7 +1896,7 @@ grammar Perl6::Grammar is HLL::Grammar {
my $longname := canonical_type_longname($<longname>);
pir::substr($longname, 0, 2) eq '::' ??
1 !! # ::T introduces a type, so always is one
$*ST.is_name(parse_name($longname))
$*W.is_name(parse_name($longname))
}>
]
# parametric type?
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/Metamodel/BOOTSTRAP.pm
Expand Up @@ -768,15 +768,15 @@ else {
}

# Bool::False and Bool::True.
# XXX $*ST calls here are deeply evil.
# XXX $*W calls here are deeply evil.
# XXX Maybe Bool is an enum, so we do it with EnumHOW?
my $false := pir::repr_instance_of__PP(Bool);
pir::repr_bind_attr_int__vPPsI($false, Bool, '$!value', 0);
$*ST.add_object($false);
$*W.add_object($false);
(Bool.WHO)<False> := $false;
my $true := pir::repr_instance_of__PP(Bool);
pir::repr_bind_attr_int__vPPsI($true, Bool, '$!value', 1);
$*ST.add_object($true);
$*W.add_object($true);
(Bool.WHO)<True> := $true;
pir::perl6_set_bools__vPP($false, $true);

Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Optimizer.pm
Expand Up @@ -39,7 +39,7 @@ class Perl6::Optimizer {
# over OUTER since we don't walk loadinits).
my $unit := $past<UNIT>;
my $*GLOBALish := $past<GLOBALish>;
my $*ST := $past<ST>;
my $*W := $past<W>;
unless $unit.isa(PAST::Block) {
pir::die("Optimizer could not find UNIT");
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class Perl6::Optimizer {
my $meth := $pkg.HOW.find_private_method($pkg, $name);
if $meth {
try {
my $call := $*ST.get_object_sc_ref_past($meth); # may fail, thus the try
my $call := $*W.get_object_sc_ref_past($meth); # may fail, thus the try
my $inv := $op.shift;
$op.shift; $op.shift; # name, package (both pre-resolved now)
$op.unshift($inv);
Expand Down

0 comments on commit 02cced8

Please sign in to comment.