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') );