This fix the bug but does not handle multidimensional arrays.
It is dependant on the nqp patch

Index: languages/perl6/src/parser/actions.pm
===================================================================
--- languages/perl6/src/parser/actions.pm       (revision 27594)
+++ languages/perl6/src/parser/actions.pm       (working copy)
@@ -1629,12 +1629,19 @@

 method circumfix($/, $key) {
     my $past;
-    if $key eq '( )' {
-        $past := $( $<statementlist> );
+    if $key eq '[ ]' or $key eq '( )' {
+        my $statement := $<statementlist><statement>;
+        if +$statement  == 1 {
+            if $statement[0]<expr><expr><type> eq 'infix:,' {
+                $past := $( $<statementlist> );
+            } else {
+                $past := PAST::Op.new( :node($/), :name('list'),
:pasttype('call') );
+                $past.push( $( $statement<expr> ) );
+            }
+        } else {
+           $past := PAST::Op.new( :node($/), :name('list'),
:pasttype('call') );
+        }
     }
-    if $key eq '[ ]' {
-        $past := $( $<statementlist> );
-    }
     elsif $key eq '{ }' {
         $past := $( $<pblock> );
     }




Index: compilers/nqp/src/Grammar.pg
===================================================================
--- compilers/nqp/src/Grammar.pg        (revision 27594)
+++ compilers/nqp/src/Grammar.pg        (working copy)
@@ -487,3 +487,11 @@
     is nullterm
     { ... }

+## loose logical operators
+proto infix:<and> is looser(infix:<,>)
+    is pasttype('if')
+    { .... }
+
+proto infix:<or> is looser(infix:<and>)
+    is pasttype('unless')
+    { ... }

-- 
cognominal stef

Reply via email to