[svn:parrot] r38300 - in branches/pmc_pct/compilers/pmc: src/parser t t/data

bacek at svn.parrot.org bacek at svn.parrot.org
Fri Apr 24 13:21:44 UTC 2009


Author: bacek
Date: Fri Apr 24 13:21:44 2009
New Revision: 38300
URL: https://trac.parrot.org/parrot/changeset/38300

Log:
Add slurpy and named adverbs

Added:
   branches/pmc_pct/compilers/pmc/t/data/class17.pmc
   branches/pmc_pct/compilers/pmc/t/data/class18.pmc
Modified:
   branches/pmc_pct/compilers/pmc/src/parser/grammar.pg
   branches/pmc_pct/compilers/pmc/t/01-parse.t

Modified: branches/pmc_pct/compilers/pmc/src/parser/grammar.pg
==============================================================================
--- branches/pmc_pct/compilers/pmc/src/parser/grammar.pg	Fri Apr 24 13:12:05 2009	(r38299)
+++ branches/pmc_pct/compilers/pmc/src/parser/grammar.pg	Fri Apr 24 13:21:44 2009	(r38300)
@@ -113,11 +113,16 @@
 
 rule adverb {
     [
-    | ':optional'
+    | ':optional' <named>?
+    | ':slurpy' <named>?
     | ':opt_flag'
     ]
 }
 
+rule named {
+    ':named' [ '("' <identifier> '")' ]?
+}
+
 token identifier {
     <.ident>
 }

Modified: branches/pmc_pct/compilers/pmc/t/01-parse.t
==============================================================================
--- branches/pmc_pct/compilers/pmc/t/01-parse.t	Fri Apr 24 13:12:05 2009	(r38299)
+++ branches/pmc_pct/compilers/pmc/t/01-parse.t	Fri Apr 24 13:21:44 2009	(r38300)
@@ -5,7 +5,7 @@
 .include 'test_more.pir'
 load_bytecode 'compilers/pmc/pmc.pbc'
     .local int total
-    total = 17
+    total = 19
 
     plan(total)
     test_parse(total)

Added: branches/pmc_pct/compilers/pmc/t/data/class17.pmc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/pmc_pct/compilers/pmc/t/data/class17.pmc	Fri Apr 24 13:21:44 2009	(r38300)
@@ -0,0 +1,8 @@
+pmclass Foo {
+    METHOD add_method(STRING *name, PMC *sub,
+                              int vtable     :optional :named("vtable"),
+                              int has_vtable :opt_flag,
+                              int anon       :optional :named("anon"),
+                              int has_anon   :opt_flag) {
+    }
+}

Added: branches/pmc_pct/compilers/pmc/t/data/class18.pmc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/pmc_pct/compilers/pmc/t/data/class18.pmc	Fri Apr 24 13:21:44 2009	(r38300)
@@ -0,0 +1,4 @@
+pmclass Foo {
+    METHOD new(PMC *args :slurpy :named) {
+    }
+}


More information about the parrot-commits mailing list