selectFarthest<T> function Null safety

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

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

Implementation

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