Пример #1
0
    def visit_Tuple(self, node):
        if node.named:
            result = qlast.NamedTuple(elements=[
                qlast.TupleElement(name=el.name, val=self.visit(el.val))
                for el in node.elements
            ])
        else:
            result = qlast.Tuple(
                elements=[self.visit(e.val) for e in node.elements])

        return result
Пример #2
0
 def reduce_ShortNodeName_ASSIGN_Expr(self, *kids):
     self.val = qlast.TupleElement(
         name=kids[0].val,
         val=kids[2].val
     )