Created
September 9, 2012 15:20
-
-
Save moritz/3685011 to your computer and use it in GitHub Desktop.
export variables
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
diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm | |
index 6bd91e9..ad542e9 100644 | |
--- a/src/Perl6/Actions.pm | |
+++ b/src/Perl6/Actions.pm | |
@@ -1679,9 +1679,14 @@ class Perl6::Actions is HLL::Actions { | |
my $descriptor := $*W.create_container_descriptor(%cont_info<value_type>, 1, $name); | |
# Install the container. | |
- $*W.install_lexical_container($BLOCK, $name, %cont_info, $descriptor, | |
+ my $cont := $*W.install_lexical_container($BLOCK, $name, %cont_info, $descriptor, | |
:state($*SCOPE eq 'state')); | |
+ # apply traits | |
+ for $<trait> -> $t { | |
+ $*W.ex-handle($t, { ($t.ast)($cont, :SYMBOL($name)) }); | |
+ } | |
+ | |
# Set scope and type on container, and if needed emit code to | |
# reify a generic type. | |
if $past.isa(QAST::Var) { | |
diff --git a/src/Perl6/World.pm b/src/Perl6/World.pm | |
index 1176b91..dfe17c1 100644 | |
--- a/src/Perl6/World.pm | |
+++ b/src/Perl6/World.pm | |
@@ -444,7 +444,7 @@ class Perl6::World is HLL::World { | |
my $slp := self.get_static_lexpad($block); | |
$slp.add_static_value(~$name, $cont, 1, ($state ?? 1 !! 0)); | |
- 1; | |
+ $cont; | |
} | |
# Builds PAST that constructs a container. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment