def _last_index(self, s):
        self.set_index(max(0, self._find_one_after_last_labeled_index() - 1))
def badmatch(match, badfn):
    """Make a copy of the given matcher, replacing its bad method with the given
    one.
    """
    m = copy.copy(match)
    m.bad = badfn
    return m