Commit cedb82a7 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 8368e533
......@@ -3011,13 +3011,13 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
return node
if not node.operand.is_literal:
return node
if isinstance(node, ExprNodes.NotNode):
return ExprNodes.BoolNode(node.pos, value = bool(node.constant_result),
constant_result = bool(node.constant_result))
if node.operator == '!':
return ExprNodes.BoolNode(node.pos, value=bool(node.constant_result),
constant_result=bool(node.constant_result))
elif isinstance(node.operand, ExprNodes.BoolNode):
return ExprNodes.IntNode(node.pos, value = str(int(node.constant_result)),
type = PyrexTypes.c_int_type,
constant_result = int(node.constant_result))
return ExprNodes.IntNode(node.pos, value=str(int(node.constant_result)),
type=PyrexTypes.c_int_type,
constant_result=int(node.constant_result))
elif node.operator == '+':
return self._handle_UnaryPlusNode(node)
elif node.operator == '-':
......
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