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

[svn:parrot] r33782 - trunk/languages/perl6/src/parser

From:
jonathan
Date:
December 10, 2008 14:42
Subject:
[svn:parrot] r33782 - trunk/languages/perl6/src/parser
Message ID:
20081210224154.4F8FBCBA89@x12.develooper.com
Author: jonathan
Date: Wed Dec 10 14:41:53 2008
New Revision: 33782

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

Log:
[rakudo] Make it an error to use only, multi or proto with an anonymous routine.

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm	(original)
+++ trunk/languages/perl6/src/parser/actions.pm	Wed Dec 10 14:41:53 2008
@@ -479,6 +479,11 @@
         create_sub($/, $past);
     }
 
+    # If we have an only, proto or multi, we must have a name.
+    if $<sym> ne "" && $past.name() eq "" {
+        $/.panic("'" ~ $<sym> ~ "' can only be used on named routines");
+    }
+
     # If it was multi or a proto, then emit a :multi.
     if $<sym> eq 'multi' || $<sym> eq 'proto' {
         # For now, if this is a multi we need to add code to transform the sub's



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