diff python/c3/typecheck.py @ 215:c1ccb1cb4cef

Major changes in c3 frontend
author Windel Bouwman
date Fri, 05 Jul 2013 13:00:03 +0200
parents 46d62dadd61b
children 3f6c30a5d234
line wrap: on
line diff
--- a/python/c3/typecheck.py	Fri Jul 05 11:18:58 2013 +0200
+++ b/python/c3/typecheck.py	Fri Jul 05 13:00:03 2013 +0200
@@ -12,17 +12,15 @@
 class TypeChecker:
    def __init__(self, diag):
       self.diag = diag
-      self.visitor = Visitor(self.precheck, self.check2)
    def error(self, msg, loc):
         """ Wrapper that registers the message and marks the result invalid """
         self.diag.error(msg, loc)
         self.ok = False
    def checkPackage(self, pkg):
         self.ok = True
-        self.visitor.visit(pkg)
+        visitor = Visitor()
+        visitor.visit(pkg, f_post=self.check2)
         return self.ok
-   def precheck(self, sym):
-      pass
    def check2(self, sym):
       if type(sym) is Function:
          pass