checkpoint harmony
[sbp.git] / src / edu / berkeley / sbp / GSS.java
index cff543d..993c21f 100644 (file)
@@ -154,10 +154,10 @@ class GSS {
             return ret.toString();
         }
         
-        public boolean isDone() throws Parser.Failed {
+        public boolean isDone() throws ParseFailed {
             if (token != null) return false;
             if (token==null && finalResult==null)
-                throw new Parser.Failed(error(red("unexpected end of file\n")),
+                throw new ParseFailed(error(red("unexpected end of file\n")),
                                         getLocation());
             return true;
         }
@@ -296,15 +296,11 @@ class GSS {
         class Reset extends RuntimeException { }
 
         public void invoke(State st, Forest result, Node n) {
-            boolean ok = next.newNode(n, result, st, false);
-            if (ok && !good) {
-                good = !st.lame();
-                //if (good) System.out.println(st);
-            }
+            good |= next.newNode(n, result, st, false);
         }
 
         /** perform all shift operations, adding promoted nodes to <tt>next</tt> */
-        public void shift(Phase next, Forest result) throws Parser.Failed {
+        public void shift(Phase next, Forest result) throws ParseFailed {
             if (prev!=null) prev.hash = null;
             this.next = next;
             closed = true;
@@ -320,10 +316,10 @@ class GSS {
             }
 
             if (!good && token!=null)
-                throw new Parser.Failed(error(red("unexpected character")+" "+purple(token)+" encountered at "+green(getLocation())+"\n"),
+                throw new ParseFailed(error(red("unexpected character")+" "+purple(token)+" encountered at "+green(getLocation())+"\n"),
                                         getLocation());
             if (token==null && finalResult==null)
-                throw new Parser.Failed(error(red("unexpected end of file\n")),
+                throw new ParseFailed(error(red("unexpected end of file\n")),
                                         getLocation());
 
             // this massively improves GC performance