selectFarthestJoined<R> function

Failure<R> selectFarthestJoined<R>(
  1. Failure<R> first,
  2. Failure<R> second
)

Reports the parser failure farthest down in the input string, joining error messages at the same position.

Implementation

Failure<R> selectFarthestJoined<R>(Failure<R> first, Failure<R> second) =>
    first.position > second.position
        ? first
        : first.position < second.position
            ? second
            : first.failure<R>('${first.message} OR ${second.message}');