diff ide/compiler/compiler.py @ 7:2db4d2b362e6

Added xml project
author windel
date Sat, 15 Oct 2011 10:03:21 +0200
parents 1784af239df4
children de004f808e56
line wrap: on
line diff
--- a/ide/compiler/compiler.py	Fri Oct 07 11:20:06 2011 +0200
+++ b/ide/compiler/compiler.py	Sat Oct 15 10:03:21 2011 +0200
@@ -4,6 +4,7 @@
 from .parser import Parser
 from .codegenerator import CodeGenerator
 from .nodes import ExportedSymbol
+from .errors import CompilerException
 
 class Compiler:
    versie = '0.9.3'
@@ -20,7 +21,10 @@
       # Pass 1: parsing and type checking
       tokens = lexer.tokenize(src) # Lexical stage
       p = Parser(tokens)
-      ast = p.parseModule() # Parse a module
+      try:
+         ast = p.parseModule() # Parse a module
+      except CompilerException as e:
+         p.errorlist.append( (e.row, e.col, e.msg) )
       if len(p.errorlist) > 0:
          self.errorlist = p.errorlist
          return