tuple4<A, B, C, D> function

Parser<Tuple4<A, B, C, D>> tuple4<A, B, C, D>(
  1. Parser<A> a,
  2. Parser<B> b,
  3. Parser<C> c,
  4. Parser<D> d
)

A typed parser that parses a sequence of 4 values of different types.

Implementation

Parser<Tuple4<A, B, C, D>> tuple4<A, B, C, D>(
    Parser<A> a, Parser<B> b, Parser<C> c, Parser<D> d) {
  return chain([a, b, c, d]).map((r) {
    return Tuple4(
        r.value[0] as A, r.value[1] as B, r.value[2] as C, r.value[3] as D);
  });
}