Author: jonathan
Date: Tue Feb 26 03:37:36 2008
New Revision: 26069

Modified:
   trunk/languages/perl6/src/parser/actions.pm
   trunk/languages/perl6/src/parser/grammar.pg

Log:
[rakudo] Make it so you can write expressions such as my $x = <-> $y { ... }. 
Note that it should work for -> as well as <->, but at the moment the first is 
a parse error; my guess is that it's going for prefix:- rather than the longer 
token ->.

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Tue Feb 26 03:37:36 2008
@@ -235,9 +235,12 @@
         $?BLOCK_SIGNATURED :=
             PAST::Block.new(
                 PAST::Stmts.new(
-                    PAST::Var.new( :name('$_'), :scope('parameter') )
+                    PAST::Var.new(
+                        :name('$_'),
+                        :scope('parameter'),
+                        :viviself('Undef')
+                    )
                 ),
-                :blocktype('declaration'),
                 :node( $/ )
             );
         $?BLOCK_SIGNATURED.symbol( '$_', :scope('lexical') );
@@ -961,7 +964,7 @@
         $past := $( $<statementlist> );
     }
     elsif ($key eq '{ }') {
-        $past := $( $<block> );
+        $past := $( $<pblock> );
     }
     make $past;
 }

Modified: trunk/languages/perl6/src/parser/grammar.pg
==============================================================================
--- trunk/languages/perl6/src/parser/grammar.pg (original)
+++ trunk/languages/perl6/src/parser/grammar.pg Tue Feb 26 03:37:36 2008
@@ -488,7 +488,7 @@
 token circumfix {
     | '(' <statementlist> ')' {*}                #= ( )
     | '[' <statementlist> ']' {*}                #= [ ]
-    | <block> {*}                                #= { }
+    | <?before '{' | <lambda> > <pblock> {*}     #= { }
 }
 
 token variable {

Reply via email to