Created
October 23, 2011 18:51
-
-
Save jnthn/1307705 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 b6188d5..d6f8836 100644 | |
--- a/src/Perl6/Actions.pm | |
+++ b/src/Perl6/Actions.pm | |
@@ -3247,7 +3247,10 @@ class Perl6::Actions is HLL::Actions { | |
method postcircumfix:sym<[ ]>($/) { | |
my $past := PAST::Op.new( :name('postcircumfix:<[ ]>'), :pasttype('callmethod'), :node($/) ); | |
- if $<semilist><statement> { $past.push($<semilist>.ast); } | |
+ if $<semilist><statement> { | |
+ my $slast := $<semilist>.ast; | |
+ $past.push(+@($slast) == 1 && $slast[0]<boxable_native> ?? $slast[0][2] !! $slast); | |
+ } | |
make $past; | |
} | |
diff --git a/src/Perl6/Optimizer.pm b/src/Perl6/Optimizer.pm | |
index 6664705..bd592ad 100644 | |
--- a/src/Perl6/Optimizer.pm | |
+++ b/src/Perl6/Optimizer.pm | |
@@ -280,7 +280,7 @@ class Perl6::Optimizer { | |
my $i := 0; | |
while $i < +@($node) { | |
my $visit := $node[$i]; | |
- unless pir::isa($visit, 'String') || pir::isa($visit, 'Integer') { | |
+ unless pir::isa($visit, 'String') || pir::isa($visit, 'Integer') || pir::isa($visit, 'Float') { | |
if $visit.isa(PAST::Op) { | |
$node[$i] := self.visit_op($visit) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment