selectFarthestJoined<T> function

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

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

Implementation

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