Esempio n. 1
0
 def visit_UnaryOpExpr(self, node: gt_ir.UnaryOpExpr,
                       **kwargs: Any) -> SIR.UnaryOperator:
     op = self._make_operator(node.op)
     operand = self.visit(node.arg)
     return sir_utils.make_unary_operator(op, operand)
Esempio n. 2
0
 def unop(self, expr: expr, op):
     py_unop_to_sir_unop = {UAdd: "+", USub: "-", Not: "!"}
     return make_unary_operator(py_unop_to_sir_unop[type(op)],
                                self.expression(expr))