

def Trailered(child, ctx):
    if (len(child) < 2):
        return child[0]
    p = child[0]
    for n in child[1:]:
        assert (not n.expr)
        if (isinstance(n, Call) and isinstance(p, GetAttr)):
            if (isinstance(p.expr, Call) and isinstance(p.expr.expr, Name) and (p.expr.expr.value == 'super')):
                n = Super([p.name, n.arguments], ('', (n.lineno, n.col)))
            else:
                n = CallAttr([p.expr, p.name, n.arguments], ('', (n.lineno, n.col)))
        else:
            n.expr = p
        p = n
    return n

dataset/ETHPy150Open tailhook/pyzza/pyzza/parser.py Trailered/original