changeset 135:16f4be0b0e9a

Range analysis handles Expression-statements And it throws an assertionerror when it meets an unknown statement, instead of just returning None.
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 04 Nov 2009 14:28:59 +0100
parents 8e496d0ea446
children db7c7871bea4
files pysmcl/range_analysis.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/range_analysis.py	Wed Nov 04 10:53:23 2009 +0100
+++ b/pysmcl/range_analysis.py	Wed Nov 04 14:28:59 2009 +0100
@@ -124,6 +124,12 @@
             def visit_Return(self, node):
                 return env
 
+            def visit_Expr(self, node):
+                return env
+
+            def generic_visit(self, node):
+                assert False, "Not implemented: "+str(node.type)
+
         r = Visitor(self.prime).visit(node)
         if debug:
             print "Result of combination", r