selectFarthest<R> function

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

Reports the parser failure farthest down in the input string, preferring later failures over earlier ones.

Implementation

Failure<R> selectFarthest<R>(Failure<R> first, Failure<R> second) =>
    first.position <= second.position ? second : first;