Commit 7f288103 authored by Tom Niget's avatar Tom Niget

Fix unary op emission

parent d912b16b
...@@ -286,7 +286,9 @@ class ExpressionVisitor(NodeVisitor): ...@@ -286,7 +286,9 @@ class ExpressionVisitor(NodeVisitor):
yield from self.visit_unary_operation(node.op, node.operand) yield from self.visit_unary_operation(node.op, node.operand)
def visit_unary_operation(self, op, operand) -> Iterable[str]: def visit_unary_operation(self, op, operand) -> Iterable[str]:
yield SYMBOLS[type(op)] if type(op) != str:
op = SYMBOLS[type(op)]
yield op
yield from self.prec("unary").visit(operand) yield from self.prec("unary").visit(operand)
def visit_IfExp(self, node: ast.IfExp) -> Iterable[str]: def visit_IfExp(self, node: ast.IfExp) -> Iterable[str]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment