checkpoint
authoradam <adam@megacz.com>
Tue, 13 Dec 2005 06:39:49 +0000 (01:39 -0500)
committeradam <adam@megacz.com>
Tue, 13 Dec 2005 06:39:49 +0000 (01:39 -0500)
darcs-hash:20051213063949-5007d-4bda027f539891d14cce598609079568664c9079.gz

src/edu/berkeley/sbp/misc/MetaGrammar.java
tests/testcase.g

index 1b4f1d9..4d8bfc5 100644 (file)
@@ -76,7 +76,9 @@ public class MetaGrammar extends ReflectiveWalker {
         if (o.length <= 1) return o;
         Object[] ret = new Object[o.length * 2 - 1];
         for(int i=0; i<o.length; i++) {
-            ret[i*2]   = o[i];
+            Object oi = o[i];
+            //if (oi instanceof Rep) oi = ((Rep)oi).build(new MyDrop(sep));
+            ret[i*2]   = oi;
             if (i*2+1<ret.length) ret[i*2+1] = new MyDrop(sep);
         }
         return ret;
index 7245db8..8eb36f0 100644 (file)
@@ -1,7 +1,7 @@
 ts       ::= ws Ts ws => ts
-Ts       ::= Test*
+Ts       ::= test*
 ws      !::= w*
-Test     ::= ^"testcase" "{" Input output+ Grammar "}"
-           | ^"testcase" "{" Input         Grammar "}"
-output   ::= "output" quoted ";" / w*
-Input    ::= "input"  quoted ";"
+test     ::= ^"testcase" "{" input output+/ws   Grammar "}" /ws
+           | ^"testcase" "{" input              Grammar "}" /ws
+output   ::= "output" quoted ";" / ws
+input    ::= "input"  quoted ";" / ws