/** * A {@link Parser} that runs {@code this} for 0 ore more times separated and optionally terminated by {@code * delim}. For example: {@code "foo;foo;foo"} and {@code "foo;foo;"} both matches {@code foo.sepEndBy(semicolon)}. * * <p>The return values are collected in a {@link List}. */ public final Parser<List<T>> sepEndBy(Parser<?> delim) { return Parsers.or(sepEndBy1(delim), EmptyListParser.<T>instance()); }
/** * A {@link Parser} that runs {@code this} 0 or more times separated by {@code delim}. * * <p>The return values are collected in a {@link List}. */ public final Parser<List<T>> sepBy(Parser<?> delim) { return Parsers.or(sepBy1(delim), EmptyListParser.<T>instance()); }