Author: jonathan
Date: Tue Feb 26 03:50:25 2008
New Revision: 26070

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

Log:
[rakudo] Make .foo call $_.foo.

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:50:25 2008
@@ -549,6 +549,15 @@
             )
         );
     }
+    elsif $key eq 'methodop' {
+        # Call on $_.
+        $past := $( $/{$key} );
+        $past.unshift(PAST::Var.new(
+            :name('$_'),
+            :scope('lexical'),
+            :node($/)
+        ));
+    }
     else {
         $past := $( $/{$key} );
     }

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:50:25 2008
@@ -436,6 +436,7 @@
     | <circumfix> {*}                            #= circumfix
     | <variable> {*}                             #= variable
     | <subcall> {*}                              #= subcall
+    | <methodop> {*}                             #= methodop
     | <value> {*}                                #= value
     | <statement_prefix> {*}                     #= statement_prefix
     | <regex_declarator> {*}                     #= regex_declarator

Reply via email to