diff python/c3/analyse.py @ 186:46d62dadd61b

Improved testsuite
author Windel Bouwman
date Sat, 25 May 2013 14:26:25 +0200
parents 0b5b2ee6b435
children c1ccb1cb4cef
line wrap: on
line diff
--- a/python/c3/analyse.py	Fri May 24 20:45:03 2013 +0200
+++ b/python/c3/analyse.py	Sat May 25 14:26:25 2013 +0200
@@ -6,8 +6,11 @@
    def __init__(self, diag):
       self.diag = diag
       self.visitor = Visitor(self.a1, self.analyze)
+
    def analyzePackage(self, pkg):
-      self.visitor.visit(pkg)
+        self.ok = True
+        self.visitor.visit(pkg)
+        return self.ok
    def resolveDesignator(self, d, referee=None):
       assert type(d) is Designator
       if d.scope.hasSymbol(d.tname):
@@ -17,6 +20,7 @@
             s.addRef(referee)
          return s
       else:
+         self.ok = False
          msg = 'Cannot resolve name {0}'.format(d.tname)
          self.diag.error(msg, d.loc)
    def a1(self, sym):