comparison python/c3/astnodes.py @ 166:da0087b82fbe

Improved type checking
author Windel Bouwman
date Fri, 22 Mar 2013 16:15:31 +0100
parents 598d3888a11c
children 0b5b2ee6b435
comparison
equal deleted inserted replaced
165:598d3888a11c 166:da0087b82fbe
92 def __init__(self, a, op, b): 92 def __init__(self, a, op, b):
93 self.a = a 93 self.a = a
94 self.b = b 94 self.b = b
95 self.op = op # Operation: '+', '-', '*', '/', 'mod' 95 self.op = op # Operation: '+', '-', '*', '/', 'mod'
96 def __repr__(self): 96 def __repr__(self):
97 typ = self.typ if hasattr(self, 'typ') else '' 97 return 'BINOP {0}'.format(self.op)
98 return 'BINOP {0} {1}'.format(self.op, typ)
99 98
100 class VariableUse(Node): 99 class VariableUse(Node):
101 def __init__(self, target): 100 def __init__(self, target):
102 self.target = target 101 self.target = target
103 def __repr__(self): 102 def __repr__(self):