develooper Front page | perl.cvs.parrot | Postings from January 2009

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

From:
jonathan
Date:
January 6, 2009 13:40
Subject:
[svn:parrot] r35080 - branches/rvar/languages/perl6/src/parser
Message ID:
20090106214040.181E9CB9F9@x12.develooper.com
Author: jonathan
Date: Tue Jan  6 13:40:38 2009
New Revision: 35080

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

Log:
[rakudo] Restore check to make sure we can only multi/only/proto a named routine, as per S06.

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	Tue Jan  6 13:40:38 2009
@@ -516,6 +516,11 @@
     my $past :=  $<declarator> ?? $( $<declarator> ) !! $( $<routine_def> );
 
     if $past.isa(PAST::Block) {
+        # If we have a multi declarator, must have a named routine too.
+        if $sym ne "" && $past.name() eq "" {
+            $/.panic("'" ~ $<sym> ~ "' can only be used on named routines");
+        }
+
         # If we're declaring a multi or a proto, flag the sub as :multi,
         # and transform the sub's container to a Perl6MultiSub.
         if $sym eq 'multi' || $sym eq 'proto' {



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