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

[svn:parrot] r34557 - branches/rvar/languages/perl6/src/parser

From:
pmichaud
Date:
December 28, 2008 22:53
Subject:
[svn:parrot] r34557 - branches/rvar/languages/perl6/src/parser
Message ID:
20081229065259.4EF08CB9FA@x12.develooper.com
Author: pmichaud
Date: Sun Dec 28 22:52:58 2008
New Revision: 34557

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

Log:
[rakudo]: Do something reasonable with the 'returns' trait.


Modified: branches/rvar/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rvar/languages/perl6/src/parser/actions.pm	(original)
+++ branches/rvar/languages/perl6/src/parser/actions.pm	Sun Dec 28 22:52:58 2008
@@ -909,6 +909,12 @@
     }
     make PAST::Op.new( :name('list'), 'trait_auxiliary:' ~ $sym, $trait );
 }
+
+
+method trait_verb($/) {
+    my $sym := ~$<sym>;
+    make PAST::Op.new( :name('list'), 'trait_verb:' ~ $sym, 'XXX' );
+}
     
 
 method signature($/, $key) {

Modified: branches/rvar/languages/perl6/src/parser/grammar.pg
==============================================================================
--- branches/rvar/languages/perl6/src/parser/grammar.pg	(original)
+++ branches/rvar/languages/perl6/src/parser/grammar.pg	Sun Dec 28 22:52:58 2008
@@ -404,8 +404,11 @@
 }
 
 rule trait_verb {
+    [
     | $<sym>=[of|returns] <typename>
     | $<sym>=[handles] <EXPR>
+    ]
+    {*}
 }
 
 token capterm {



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