Esempio n. 1
0
    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(""))])
Esempio n. 2
0
def _concat(x):
    return lambda y: pregex.Concat([x, y])  # "(" + x + y + ")"
Esempio n. 3
0
def _concat(x): return lambda y: pregex.Concat([x,y]) #"(" + x + y + ")"
#def _wrapper(x): return lambda y: y

#specials = [".","*","+","?","|"]

disallowed = [
Esempio n. 4
0
def _concat(x): return lambda y: pregex.Concat([x, y])  # "(" + x + y + ")"


#For sketch:
def _kleene_5(x): return pregex.KleeneStar(x)