[svn:parrot] r38329 - branches/pmc_pct/compilers/pmc/src/parser

bacek at svn.parrot.org bacek at svn.parrot.org
Fri Apr 24 15:35:17 UTC 2009


Author: bacek
Date: Fri Apr 24 15:35:16 2009
New Revision: 38329
URL: https://trac.parrot.org/parrot/changeset/38329

Log:
Fix "smart" parsing. bacek--

Modified:
   branches/pmc_pct/compilers/pmc/src/parser/grammar.pg

Modified: branches/pmc_pct/compilers/pmc/src/parser/grammar.pg
==============================================================================
--- branches/pmc_pct/compilers/pmc/src/parser/grammar.pg	Fri Apr 24 15:31:48 2009	(r38328)
+++ branches/pmc_pct/compilers/pmc/src/parser/grammar.pg	Fri Apr 24 15:35:16 2009	(r38329)
@@ -61,7 +61,6 @@
 rule body {
     [ <class_init> | <vtable> | <method> | <multi> ]* 
     {*}
-    || <.panic: "Unexpected PMC content">
 }
 
 # PMC can have class_init function.
@@ -76,9 +75,11 @@
 }
 
 rule method {
-    'METHOD' || <identifier> '(' <parrot_c_arguments> ')' <c_body>
+    'METHOD' [
+        [ <identifier> '(' <parrot_c_arguments> ')' <c_body> ]
+        | <.panic: "Unexpected METHOD content">
+    ]
     {*}
-    || <.panic: "Malformed METHOD definition">
 }
 
 rule multi {


More information about the parrot-commits mailing list