def generate_any(expression, genstate): if expression.invert: # I don't use "IsNotIn" since that allows EOF return [(None, TT.IsIn, convert_re.invert(expression.chars))] else: return [(None, TT.IsIn, expression.chars)]
def generate_literal(expression, genstate): if expression.invert: # Can't use "InNot" since it can match EOF return [(None, TT.IsIn, convert_re.invert(expression.char))] else: return [(None, TT.Is, expression.char)]