Example #1
0
def eliminateUnused(tree):
    syms = du.UseFinder().run(tree)
    unneeded = lambda sym: ismeta(sym) or pat.isauxmap(sym) and sym not in syms
    du.EliminateUnused().run(tree, unneeded)
Example #2
0
def ismemberaux(auxsym):
    return pat.isauxmap(auxsym) and ismember(auxsym.host)
Example #3
0
def isfieldaux(auxsym):
    return pat.isauxmap(auxsym) and isfield(auxsym.host)
Example #4
0
def isforward(auxsym):
    return (pat.isauxmap(auxsym) and
            dha.isBoundPat(auxsym.pat.elts[0]) and
            dha.isUnboundPat(auxsym.pat.elts[1]))