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

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

From:
pmichaud
Date:
December 28, 2008 17:33
Subject:
[svn:parrot] r34533 - branches/rvar/languages/perl6/src/parser
Message ID:
20081229013304.33D7BCB9FA@x12.develooper.com
Author: pmichaud
Date: Sun Dec 28 17:33:03 2008
New Revision: 34533

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

Log:
[rakudo]:  Fix case where params have no explicit traits.


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 17:33:03 2008
@@ -1020,15 +1020,17 @@
     }
 
     my $readtype := '';
-    for @($<trait>) {
-        my $traitpast := $( $_ );
-        my $name := $traitpast[1];
-        if $name eq 'readonly' || $name eq 'rw' || $name eq 'copy' {
-            $readtype && 
-                $/.panic("Can only use one of readonly, rw, and copy");
-            $readtype := $name;
+    if $<trait> {
+        for @($<trait>) {
+            my $traitpast := $( $_ );
+            my $name := $traitpast[1];
+            if $name eq 'readonly' || $name eq 'rw' || $name eq 'copy' {
+                $readtype && 
+                    $/.panic("Can only use one of readonly, rw, and copy");
+                $readtype := $name;
+            }
+            # else $traitlist.push( $traitpast );  ## when we do other traits
         }
-        # else $traitlist.push( $traitpast );  ## when we do other traits
     }
     $symbol<readtype> := PAST::Val.new( :value($readtype || 'readonly') );
 



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