diff python/c3/semantics.py @ 194:b01429a5d695

Fixed test
author Windel Bouwman
date Wed, 29 May 2013 22:36:37 +0200
parents a51b3c956386
children 003c8a976fff
line wrap: on
line diff
--- a/python/c3/semantics.py	Sun May 26 23:58:59 2013 +0200
+++ b/python/c3/semantics.py	Wed May 29 22:36:37 2013 +0200
@@ -1,5 +1,6 @@
 from . import astnodes
 from .scope import Scope, topScope
+from ppci import CompilerError
 
 class Semantics:
    """ This class constructs the AST from parser input """
@@ -12,7 +13,7 @@
    def addSymbol(self, s):
       if self.curScope.hasSymbol(s.name):
          msg = 'Redefinition of {0}'.format(s.name)
-         self.diag.error(msg, s.loc)
+         raise CompilerError(msg, s.loc)
       else:
          self.curScope.addSymbol(s)
    def handlePackage(self, name, loc):