checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / MetaGrammar.java
index 9244f05..bfddf72 100644 (file)
@@ -73,7 +73,10 @@ public class MetaGrammar extends ReflectiveWalker {
         public Object  _leftbrace_(String s)                 { return SELF; }
         public Object _plus_(final Element r) { return new Rep(r, null, false, false); }
     //public Element _tilde__slash__tilde_(final Element r) { return Repeat.maximal(r); }
-    public Object _plus__slash_(final Element r, Element s) { /*return Repeat.many1(r, s);*/ return new Rep(r, s, false, false); }
+    public Object _plus__slash_(final Element r, Object s) {
+        if (s instanceof String) s = CharToken.string((String)s);
+        return new Rep(r, (Element)s, false, false);
+    }
     //public Element _star__slash_(final Element r, Element s) { return Repeat.many0(r, s); }
     //public Element _star__star_(final Element r, Element s) { return Repeat.maximal(Repeat.many0(r, s)); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
@@ -240,6 +243,7 @@ public class MetaGrammar extends ReflectiveWalker {
                     else if (o[i] instanceof MyLift)      { o2[j] = CharToken.string(tag = ((MyLift)o[i]).s); drops[j] = true; }
                     else if (o[i] instanceof String)      { o2[j] = CharToken.string(      ((String)o[i])  ); drops[j] = true; }
                     else if (o[i] instanceof Rep)         o2[j] = ((Rep)o[i]).build(ws);
+                    //else if (o[i] instanceof PreBrace)    o2[j]
                     else                                  o2[j] = (Element)o[i];
 
                     if (dropAll.contains(o2[j])) drops[j] = true;