def __call__(self, pre): if self.arity == len(self.args): if self.arity == 0: return pregex.Concat([self.f, pre]) elif self.arity == 1: return pregex.Concat([self.f(*self.args), pre]) else: return pregex.Concat([self.f(self.args), pre]) #this line is bad, need brackets around input to f if f is Alt else: return PRC(self.f, self.arity, args=self.args+[pre(pregex.String(""))])
def _concat(x): return lambda y: pregex.Concat([x, y]) # "(" + x + y + ")"
def _concat(x): return lambda y: pregex.Concat([x,y]) #"(" + x + y + ")" #def _wrapper(x): return lambda y: y #specials = [".","*","+","?","|"] disallowed = [
def _concat(x): return lambda y: pregex.Concat([x, y]) # "(" + x + y + ")" #For sketch: def _kleene_5(x): return pregex.KleeneStar(x)