Browse Source

Add missing visitor for signed numerics.

pull/68/head
Joseph Davies 7 years ago
parent
commit
8cbbb17f32
Signed by untrusted user: Deledrius
GPG Key ID: 28ACC6E8D2B24B8A
  1. 6
      korman/plasma_attributes.py

6
korman/plasma_attributes.py

@ -92,6 +92,12 @@ class PlasmaAttributeVisitor(ast.NodeVisitor):
def visit_NameConstant(self, node): def visit_NameConstant(self, node):
return node.value return node.value
def visit_UnaryOp(self, node):
if type(node.op) == ast.USub:
return -self.visit(node.operand)
elif type(node.op) == ast.UAdd:
return self.visit(node.operand)
def generic_visit(self, node): def generic_visit(self, node):
ast.NodeVisitor.generic_visit(self, node) ast.NodeVisitor.generic_visit(self, node)

Loading…
Cancel
Save