- if (zeroOkay && !manyOkay) {
- // FIXME
- add(Sequence.create(tag, new Element[] { }, null, false).followedBy(follow));
- add(Sequence.create(tag, new Element[] { e }, null, false).followedBy(follow));
- } else if (zeroOkay) {
- add(Sequence.create(tag, new Element[] { }, null, false).followedBy(follow));
- //add(new Sequence.Constant.Empty());
- // FUGLY
+ if (follow != null) {
+ Sequence s = Sequence.create(new Repeat(e, zeroOkay, manyOkay,
+ separator, maximal, tag, null)).followedBy(follow);
+ add(s);
+ return;
+ }
+ if (zeroOkay)
+ add(Sequence.create(tag, new Element[] { }, null).followedBy(follow));
+ if (!(zeroOkay && manyOkay))
+ add(Sequence.create(tag, new Element[] { e }, null).followedBy(follow));
+
+ // FEATURE: stringify ~[]* as ...
+ if (zeroOkay && manyOkay && separator!=null) {