checkpoint
[sbp.git] / src / edu / berkeley / sbp / Sequence.java
index fb1262f..4d9e41f 100644 (file)
@@ -228,10 +228,11 @@ public abstract class Sequence extends Element implements Iterable<Element> {
         }
         public <T> Forest<T> postReduce(Input.Location loc, Forest<T>[] args, Position p) {
             Forest<T>[] args2 = new Forest[count];
+            Object[] labs2 = new Object[count];
             int j = 0;
-            for(int i=0; i<args.length; i++) if (!drops[i]) args2[j++] = args[i];
+            for(int i=0; i<args.length; i++) if (!drops[i]) { labs2[j] = labs==null?null:labs[i]; args2[j++] = args[i]; }
             //System.out.println("reduce \""+tag+"\"");
-            return Forest.create(loc, (T)tag, args2, labs, false, false, p);
+            return Forest.create(loc, (T)tag, args2, labs2, false, false, p);
         }
         public StringBuffer toString(StringBuffer sb, boolean spacing) {
             int len = sb.length();