implements _get_next_line()