then<R4> method

  1. @useResult
SequenceParser4<R1, R2, R3, R4> then<R4>(
  1. Parser<R4> other
)

Returns a parser that consumes the receiver followed by other in sequence and returns a SequenceParser4 with the 4 positional parse results.

Flattens into a strictly typed Record with 4 elements, preserving static type information.

For example, the parser char('a').then(char('b')).then(char('c')).then(char('d')) returns ('a', 'b', 'c', 'd') for the input 'abcd'.

Implementation

@useResult
SequenceParser4<R1, R2, R3, R4> then<R4>(Parser<R4> other) =>
    SequenceParser4<R1, R2, R3, R4>(parser1, parser2, parser3, other);