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

Improved type checking
author Windel Bouwman
date Fri, 22 Mar 2013 16:15:31 +0100
parents 8104fc8b5e90
children 0b5b2ee6b435
comparison
equal deleted inserted replaced
165:598d3888a11c 166:da0087b82fbe
33 elif type(node) is ReturnStatement: 33 elif type(node) is ReturnStatement:
34 self.visit(node.expr) 34 self.visit(node.expr)
35 elif type(node) is Binop: 35 elif type(node) is Binop:
36 self.visit(node.a) 36 self.visit(node.a)
37 self.visit(node.b) 37 self.visit(node.b)
38 elif type(node) in [EmptyStatement, Constant, VariableUse, Variable, Literal, FunctionType]: 38 elif type(node) is Constant:
39 self.visit(node.value)
40 elif type(node) in [EmptyStatement, VariableUse, Variable, Literal, FunctionType]:
39 # Those nodes do not have child nodes. 41 # Those nodes do not have child nodes.
40 pass 42 pass
41 else: 43 else:
42 print('UNK visit', node) 44 print('UNK visit', node)
43 self.f2(node) 45 self.f2(node)