class Treetop::Runtime::CompiledParser

def failure_reason

def failure_reason
  return nil unless (tf = terminal_failures) && tf.size > 0
  "Expected " +
    (tf.size == 1 ?
     (tf[0].unexpected ? OtherThan : '')+tf[0].expected_string :
           "one of #{tf.map{|f| (f.unexpected ? OtherThan : '')+f.expected_string}.uniq*', '}"
    ) +
          " at line #{failure_line}, column #{failure_column} (byte #{failure_index+1})" +
          (failure_index > 0 ? " after #{input[index...failure_index]}" : '')
end