[svn:parrot] r41749 - in trunk/compilers/nqp/src: . Grammar

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Wed Oct 7 03:15:35 UTC 2009


Author: pmichaud
Date: Wed Oct  7 03:15:34 2009
New Revision: 41749
URL: https://trac.parrot.org/parrot/changeset/41749

Log:
[nqp]:  Allow methods to be named "category:sym<...>".

Modified:
   trunk/compilers/nqp/src/Grammar.pg
   trunk/compilers/nqp/src/Grammar/Actions.pir

Modified: trunk/compilers/nqp/src/Grammar.pg
==============================================================================
--- trunk/compilers/nqp/src/Grammar.pg	Wed Oct  7 03:14:57 2009	(r41748)
+++ trunk/compilers/nqp/src/Grammar.pg	Wed Oct  7 03:15:34 2009	(r41749)
@@ -215,7 +215,7 @@
 
 rule routine_def {
     $<declarator>=['sub'|'method']
-    <ident>
+    $<name>=[<ident>[':sym<'<-[>]>+'>']?]
     '(' <signature> ')'
     <block>
     {*}

Modified: trunk/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- trunk/compilers/nqp/src/Grammar/Actions.pir	Wed Oct  7 03:14:57 2009	(r41748)
+++ trunk/compilers/nqp/src/Grammar/Actions.pir	Wed Oct  7 03:15:34 2009	(r41749)
@@ -372,7 +372,7 @@
 
 ##    method routine_def($/) {
 ##        my $past := $($<block>);
-##        $past.name(~$<ident>);
+##        $past.name(~$<name>);
 ##        $past.node($/);
 ##        $past.blocktype('declaration');
 ##        $past.control('return_pir');
@@ -394,7 +394,7 @@
     .local pmc past
     $P0 = match['block']
     past = $P0.'ast'()
-    $S0 = match['ident']
+    $S0 = match['name']
     past.'name'($S0)
     past.'node'(match)
     past.'blocktype'('declaration')


More information about the parrot-commits mailing list