Example #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
Example #2
0
 def reduce_LPAREN_NamedTupleElementList_COMMA_RPAREN(self, *kids):
     self.val = qlast.NamedTuple(elements=kids[1].val)