diff python/c3/builder.py @ 226:240111e0456f

Work on named types
author Windel Bouwman
date Fri, 12 Jul 2013 17:25:31 +0200
parents 1c7364bd74c7
children 6ed3d3a82a63
line wrap: on
line diff
--- a/python/c3/builder.py	Thu Jul 11 07:42:30 2013 +0200
+++ b/python/c3/builder.py	Fri Jul 12 17:25:31 2013 +0200
@@ -8,25 +8,24 @@
         Reports errors to the diagnostics system
     """
     def __init__(self, diag):
-      self.diag = diag
-      self.parser = Parser(diag)
-      self.tc = TypeChecker(diag)
-      self.al = Analyzer(diag)
-      self.cg = CodeGenerator()
+        self.diag = diag
+        self.parser = Parser(diag)
+        self.tc = TypeChecker(diag)
+        self.al = Analyzer(diag)
+        self.cg = CodeGenerator()
     def build(self, src):
-      """ Create IR-code from sources """
-      pkg = self.parser.parseSource(src)
-      if not pkg:
+        """ Create IR-code from sources """
+        pkg = self.parser.parseSource(src)
+        if not pkg:
             return
-      self.pkg = pkg
-      # TODO: merge the two below?
-      #AstPrinter().printAst(pkg)
-      if not self.al.analyzePackage(pkg):
+        self.pkg = pkg
+        # TODO: merge the two below?
+        #AstPrinter().printAst(pkg)
+        if not self.al.analyzePackage(pkg):
             return
-      if not self.tc.checkPackage(pkg):
+        if not self.tc.checkPackage(pkg):
             return
 
-      # Only return ircode when everything is OK
-      ircode = self.cg.gencode(pkg)
-      return ircode
+        # Only return ircode when everything is OK
+        return self.cg.gencode(pkg)