checkpoint
[sbp.git] / src / edu / berkeley / sbp / GSS.java
index 77464c2..3c1174e 100644 (file)
@@ -211,7 +211,7 @@ class GSS {
                 allqueued = true;
                 int where = parents().size();
                 for(Parser.Table.Reduction r : token==null ? state.getEofReductions() : state.getReductions(token))
-                    if (r.numPop > 1)
+                    if (r.numPop >= 1)
                         r.reduce(this, null, null);
                 for(int i=0; i<where; i++)
                     queueReductions(get(i), false);
@@ -235,12 +235,14 @@ class GSS {
                     // cache instances here as a way of avoiding
                     // recreating them.
                     if (r.numPop <= 0) continue;
-                    if (r.numPop == 1) {
-                        Forest ret = n.cache().get(r);
-                        if (ret != null) r.reduce(this, n2, ret);
-                        else n.cache().put(r, r.reduce(this, n2, null));
-                    } else {
-                        if (includeLongs) r.reduce(this, n2, null);
+                    if (includeLongs) {
+                        if (r.numPop == 1) {
+                            Forest ret = n.cache().get(r);
+                            if (ret != null) r.reduce(this, n2, ret);
+                            else n.cache().put(r, r.reduce(this, n2, null));
+                        } else {
+                            r.reduce(this, n2, null);
+                        }
                     }
                 }
             }