Skip to content

Commit

Permalink
Rename EnumMap to Map
Browse files Browse the repository at this point in the history
Suggested by jnthn++
  • Loading branch information
niner committed Sep 5, 2015
1 parent 03b5a0a commit 5af3079
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 135 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -6972,7 +6972,7 @@ Compilation unit '$file' contained the following violations:
:op('create'),
QAST::WVal.new( :value($*W.find_symbol(['Hash'])) )
),
QAST::WVal.new( :value($*W.find_symbol(['EnumMap'])) ),
QAST::WVal.new( :value($*W.find_symbol(['Map'])) ),
QAST::SVal.new( :value('$!storage') ),
QAST::Var.new( :name($name), :scope('local') )
));
Expand Down
4 changes: 2 additions & 2 deletions src/Perl6/Compiler.nqp
Expand Up @@ -219,8 +219,8 @@ class Perl6::Compiler is HLL::Compiler {
}

my $our := nqp::getlexrel($ctx, '$?PACKAGE').WHO;
my $EnumMap := self.eval('EnumMap', :outer_ctx(nqp::null()));
my $storage := nqp::getattr($our, $EnumMap, '$!storage');
my $Map := self.eval('Map', :outer_ctx(nqp::null()));
my $storage := nqp::getattr($our, $Map, '$!storage');

$it := nqp::iterator($storage);

Expand Down
26 changes: 13 additions & 13 deletions src/Perl6/Metamodel/BOOTSTRAP.nqp
Expand Up @@ -64,7 +64,7 @@ my stub Num metaclass Perl6::Metamodel::ClassHOW { ... };
my stub List metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Slip metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Array metaclass Perl6::Metamodel::ClassHOW { ... };
my stub EnumMap metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Map metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Hash metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Capture metaclass Perl6::Metamodel::ClassHOW { ... };
my stub Bool metaclass Perl6::Metamodel::ClassHOW { ... };
Expand Down Expand Up @@ -686,7 +686,7 @@ my class Binder {
# that. Otherwise, putting Mu in there is fine; Hash is smart
# enough to know what to do.
my $hash := nqp::create(Hash);
nqp::bindattr($hash, EnumMap, '$!storage', $named_args || Mu);
nqp::bindattr($hash, Map, '$!storage', $named_args || Mu);
$bind_fail := bind_one_param($lexpad, $sig, $param, $no_nom_type_check, $error,
0, $hash, 0, 0.0, '');
return $bind_fail if $bind_fail;
Expand Down Expand Up @@ -2616,15 +2616,15 @@ BEGIN {
Array.HOW.add_attribute(Array, BOOTSTRAPATTR.new(:name<$!descriptor>, :type(Mu), :package(Array)));
Array.HOW.compose_repr(Array);

# my class EnumMap is Cool {
# my class Map is Cool {
# has Mu $!storage;
EnumMap.HOW.add_parent(EnumMap, Cool);
EnumMap.HOW.add_attribute(EnumMap, scalar_attr('$!storage', Mu, EnumMap, :associative_delegate));
EnumMap.HOW.compose_repr(EnumMap);
Map.HOW.add_parent(Map, Cool);
Map.HOW.add_attribute(Map, scalar_attr('$!storage', Mu, Map, :associative_delegate));
Map.HOW.compose_repr(Map);

# my class Hash is EnumMap {
# my class Hash is Map {
# has Mu $!descriptor;
Hash.HOW.add_parent(Hash, EnumMap);
Hash.HOW.add_parent(Hash, Map);
Hash.HOW.add_attribute(Hash, BOOTSTRAPATTR.new(:name<$!descriptor>, :type(Mu), :package(Hash)));
Hash.HOW.compose_repr(Hash);

Expand Down Expand Up @@ -2672,7 +2672,7 @@ BEGIN {
Stash.HOW.compose_repr(Stash);

# Configure the stash type.
Perl6::Metamodel::Configuration.set_stash_type(Stash, EnumMap);
Perl6::Metamodel::Configuration.set_stash_type(Stash, Map);

# Give everything we've set up so far a Stash.
Perl6::Metamodel::ClassHOW.add_stash(Mu);
Expand Down Expand Up @@ -2780,7 +2780,7 @@ BEGIN {
EXPORT::DEFAULT.WHO<List> := List;
EXPORT::DEFAULT.WHO<Slip> := Slip;
EXPORT::DEFAULT.WHO<Array> := Array;
EXPORT::DEFAULT.WHO<EnumMap> := EnumMap;
EXPORT::DEFAULT.WHO<Map> := Map;
EXPORT::DEFAULT.WHO<Hash> := Hash;
EXPORT::DEFAULT.WHO<Capture> := Capture;
EXPORT::DEFAULT.WHO<ObjAt> := ObjAt;
Expand Down Expand Up @@ -2856,7 +2856,7 @@ Perl6::Metamodel::EnumHOW.set_default_invoke_handler(
Mu.HOW.invocation_handler(Mu));

# Configure the MOP (not persisted as it ends up in a lexical...)
Perl6::Metamodel::Configuration.set_stash_type(Stash, EnumMap);
Perl6::Metamodel::Configuration.set_stash_type(Stash, Map);
Perl6::Metamodel::Configuration.set_submethod_type(Submethod);

# Register default parent types.
Expand All @@ -2865,7 +2865,7 @@ Perl6::Metamodel::GrammarHOW.set_default_parent_type(Grammar);

# Put PROCESS in place, and ensure it's never repossessed.
nqp::neverrepossess(PROCESS.WHO);
nqp::neverrepossess(nqp::getattr(PROCESS.WHO, EnumMap, '$!storage'));
nqp::neverrepossess(nqp::getattr(PROCESS.WHO, Map, '$!storage'));
nqp::bindhllsym('perl6', 'PROCESS', PROCESS);

# HLL configuration: interop, boxing and exit handling.
Expand All @@ -2884,7 +2884,7 @@ nqp::sethllconfig('perl6', nqp::hash(
},
'foreign_transform_hash', -> $hash {
my $result := nqp::create(Hash);
nqp::bindattr($result, EnumMap, '$!storage', $hash);
nqp::bindattr($result, Map, '$!storage', $hash);
$result
},
'foreign_transform_code', -> $code {
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Metamodel/EnumHOW.nqp
@@ -1,5 +1,5 @@
# This is the meta-object for an enumeration (declared with enum).
# It keeps hold of the enumeration values in an EnumMap, which is
# It keeps hold of the enumeration values in an Map, which is
# created at composition time. It supports having roles composed in,
# one or two of which presumably provide the core enum-ish methods.
class Perl6::Metamodel::EnumHOW
Expand Down
6 changes: 3 additions & 3 deletions src/Perl6/World.nqp
Expand Up @@ -655,13 +655,13 @@ class Perl6::World is HLL::World {
}
if nqp::existskey($module, '&EXPORT') {
my $result := $module<&EXPORT>(|@positional_imports);
my $EnumMap := self.find_symbol(['EnumMap']);
if nqp::istype($result, $EnumMap) {
my $Map := self.find_symbol(['Map']);
if nqp::istype($result, $Map) {
my $storage := $result.hash.FLATTENABLE_HASH();
self.import($/, $storage, $package_source_name);
}
else {
nqp::die("&EXPORT sub did not return an EnumMap");
nqp::die("&EXPORT sub did not return an Map");
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Any-iterable-methods.pm
Expand Up @@ -653,7 +653,7 @@ augment class Any {
if nqp::istype($it, Enum) {
take $it.key => $it.value
}
elsif nqp::istype($it, EnumMap) and !nqp::iscont($it) {
elsif nqp::istype($it, Map) and !nqp::iscont($it) {
take Slip.new(|$it.pairs)
}
elsif $it =:= IterationEnd {
Expand Down
6 changes: 3 additions & 3 deletions src/core/CallFrame.pm
Expand Up @@ -10,8 +10,8 @@ my class CallFrame {
while $i-- {
$ctx := nqp::ctxcaller($ctx);
}
my $h := nqp::create(EnumMap);
nqp::bindattr($h, EnumMap, '$!storage', $ctx);
my $h := nqp::create(Map);
nqp::bindattr($h, Map, '$!storage', $ctx);
nqp::bindattr($self, CallFrame, '%!my', $h);
nqp::bindattr($self, CallFrame, '$!level', $l);

Expand All @@ -34,7 +34,7 @@ my class CallFrame {
"%annotations<file> at line %annotations<line>";
}
method code() {
my $ctx := nqp::getattr(%!my, EnumMap, '$!storage');
my $ctx := nqp::getattr(%!my, Map, '$!storage');
nqp::getcodeobj(nqp::ctxcode($ctx));
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/Capture.pm
Expand Up @@ -12,7 +12,7 @@ my class Capture { # declared in BOOTSTRAP
nqp::bindattr(self, Capture, '$!list',
nqp::getattr(nqp::decont(@list.List), List, '$!reified')
);
my Mu $hs := nqp::getattr(nqp::decont(%hash), EnumMap, '$!storage');
my Mu $hs := nqp::getattr(nqp::decont(%hash), Map, '$!storage');
nqp::bindattr(self, Capture, '$!hash', nqp::ishash($hs) ?? $hs !! nqp::hash());
}

Expand Down Expand Up @@ -53,8 +53,8 @@ my class Capture { # declared in BOOTSTRAP
}

method hash(Capture:D:) {
my $enum := nqp::create(EnumMap);
nqp::bindattr($enum, EnumMap, '$!storage', $!hash);
my $enum := nqp::create(Map);
nqp::bindattr($enum, Map, '$!storage', $!hash);
$enum;
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/Enumeration.pm
Expand Up @@ -70,9 +70,9 @@ sub ANON_ENUM(*@args) {
%res{$_} = $prev.=succ;
}
}
my $r := nqp::create(EnumMap);
nqp::bindattr($r, EnumMap, '$!storage',
nqp::getattr(%res, EnumMap, '$!storage'));
my $r := nqp::create(Map);
nqp::bindattr($r, Map, '$!storage',
nqp::getattr(%res, Map, '$!storage'));
$r;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/Exception.pm
Expand Up @@ -2009,7 +2009,7 @@ my class X::Inheritance::NotComposed does X::MOP {
%c_ex{'X::Inheritance::NotComposed'} = sub ($child-name, $parent-name) {
X::Inheritance::NotComposed.new(:$child-name, :$parent-name).throw;
}
nqp::bindcurhllsym('P6EX', nqp::getattr(%c_ex, EnumMap, '$!storage'));
nqp::bindcurhllsym('P6EX', nqp::getattr(%c_ex, Map, '$!storage'));

0;
}
Expand Down

0 comments on commit 5af3079

Please sign in to comment.