def SplitAllAfter(operand, ): splitall = util.Proxy() splitall.subject = (combine.GuardedChoice( SplitAfter(operand), congruent.Cons(base.ident, project.head * splitall), build.List((base.ident, )))) return splitall
def SplitBefore(operand): tail = types.term.Term('tail') return scope.Scope( (tail, ), build.List((AtSuffix( congruent.Cons(operand, base.ident) * match.Var(tail) * build.nil), build.Var(tail))))
def SplitKeep(operand): elem = types.term.Term('elem') tail = types.term.Term('tail') return scope.Scope( (elem, tail), build.List((AtSuffix( match.Cons(operand * match.Var(elem), match.Var(tail)) * build.nil), build.Var(elem), build.Var(tail))))
def SplitAfter(operand): tail = types.term.Term('tail') return scope.Scope( (tail, ), build.List( (AtSuffix(congruent.Cons(operand, match.Var(tail) * build.nil)), build.Var(tail))))