- if (dropAll) ret = Sequence.drop(els, false);
- else {
- Production prod = new Production(tag, (cnt==null?null:cnt.name), els, drops);
- ret = cx.rm.createSequence(prod);
- if (ret == null) {
- int idx = -1;
- for(int i=0; i<els.length; i++)
- if (!drops[i])
- if (idx==-1) idx = i;
- else throw new Error("multiple non-dropped elements in sequence: " + Sequence.drop(els,false));
- if (idx != -1) ret = Sequence.singleton(els, idx);
- else ret = Sequence.drop(els, false);
- }
+ Production prod = new Production(tag, (cnt==null?null:cnt.name), els, drops);
+ ret = cx.rm.createSequence(prod);
+ if (ret == null) {
+ int idx = -1;
+ for(int i=0; i<els.length; i++)
+ if (!drops[i])
+ if (idx==-1) idx = i;
+ else throw new Error("multiple non-dropped elements in sequence: " + Sequence.create(els, null));
+ if (idx != -1) ret = Sequence.create(els, idx);
+ else ret = Sequence.create(els, null);