selectFarthest function

Failure selectFarthest(
  1. Failure first,
  2. Failure second
)

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

Implementation

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