repsep<E> function

Expression<List<E>> repsep<E>(
  1. Expression<E> expression,
  2. Expression sep
)

Implementation

Expression<List<E>> repsep<E>(Expression<E> expression, Expression sep) {
  final t = seql([sep], expression).star;
  return seq2(expression, t).map((r) => [r.$1, ...r.$2]);
}