def __init__(self, parent, ts, token): Mirror.__init__(self, parent, ts, token) flags = 0 self._match_this_many = 1 if token.options: if "g" in token.options: self._match_this_many = 0 if "i" in token.options: flags |= re.IGNORECASE self._find = re.compile(token.search, flags | re.DOTALL) self._replace = _CleverReplace(token.replace)
def _resolve_ambiguity(self, all_tokens, seen_ts): for parent, token in all_tokens: if isinstance(token, MirrorToken): if token.no not in seen_ts: seen_ts[token.no] = TabStop(parent, token) else: Mirror(parent, seen_ts[token.no], token)
def __init__(self, parent, ts, token): Mirror.__init__(self, parent, ts, token) TextObjectTransformation.__init__(self, token)