Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[src/glue] translated !setup_named_enum PIR->p6
This is an idempotent commit that paves the way for more correct enum semantics.
- Loading branch information
Carl Masak
committed
Jul 22, 2010
1 parent
00848d2
commit 0d0fd7e
Showing
4 changed files
with
17 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Note: this file probably wants to be in some Perl6::CompilerGuts namespace. | ||
|
||
our sub SETUP_NAMED_ENUM($name, $values) { | ||
# For now, just install EnumMap under the main name. | ||
my @full_ns = Perl6::Grammar::parse_name($name); | ||
my ($shortname, @base_ns) = @full_ns; | ||
pir::set_hll_global__vPSP(@base_ns, $shortname, $values); | ||
|
||
for $values.kv -> $key, $value { | ||
pir::set_hll_global__vPSP(@full_ns, $key, $value); | ||
pir::set_hll_global__vPSP(@base_ns, $key, $value); | ||
} | ||
} | ||
|
||
|