develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34652 - in trunk/languages/perl6/src: classes parser

From:
pmichaud
Date:
December 30, 2008 09:26
Subject:
[svn:parrot] r34652 - in trunk/languages/perl6/src: classes parser
Message ID:
20081230172647.B85ADCB9FA@x12.develooper.com
Author: pmichaud
Date: Tue Dec 30 09:26:46 2008
New Revision: 34652

Modified:
   trunk/languages/perl6/src/classes/Positional.pir
   trunk/languages/perl6/src/parser/actions.pm

Log:
[rakudo]:  Fix empty slice -- e.g., @a[2..1] .  Resolves RT #61842.


Modified: trunk/languages/perl6/src/classes/Positional.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Positional.pir	(original)
+++ trunk/languages/perl6/src/classes/Positional.pir	Tue Dec 30 09:26:46 2008
@@ -96,7 +96,7 @@
     .local pmc args
     args = argsblock()
     args = 'list'(args)
-    .tailcall 'postcircumfix:[ ]'(invocant, args :flat, options :flat :named)
+    .tailcall 'postcircumfix:[ ]'(invocant, args, options :flat :named)
 .end
 
 =back

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm	(original)
+++ trunk/languages/perl6/src/parser/actions.pm	Tue Dec 30 09:26:46 2008
@@ -1560,8 +1560,11 @@
 method postcircumfix($/, $key) {
     my $past;
     if $key eq '[ ]' {
-        $past := PAST::Block.new( $( $<semilist> ), :blocktype('declaration') );
-        $past := PAST::Op.new( $past, :name('postcircumfix:[ ]'), :node($/) );
+        $past := PAST::Op.new( :name('postcircumfix:[ ]'), :node($/) );
+        if $<semilist><EXPR> {
+            my $slice := $( $<semilist> );
+            $past.push( PAST::Block.new( $slice, :blocktype('declaration') ) );
+        }
     }
     elsif $key eq '( )' {
         $past := build_call( $( $<semilist> ) );



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About