* Currently this class exports only static methods to create repetitions;
* there are no public instance methods or constructors
*/
-public class Repeat extends Union {
+class Repeat extends Union {
public Repeat(final Element e, boolean zeroOkay, boolean manyOkay, Object tag) {
this(e, zeroOkay, manyOkay, null, false, tag); }
add(Sequence.create(tag, new Element[] { }, null).followedBy(follow));
if (!(zeroOkay && manyOkay))
add(Sequence.create(tag, new Element[] { e }, null).followedBy(follow));
- if (zeroOkay && manyOkay)
+
+ // FEATURE: stringify ~[]* as ...
+ if (zeroOkay && manyOkay && separator!=null) {
add(Sequence.create(many1(e, separator, tag)).followedBy(follow));
- if (!zeroOkay && manyOkay) {
+
+ } else if (manyOkay) {
if (separator==null)
add(Sequence.create(tag,
new Element[] { Repeat.this, e },