diff python/c3/astnodes.py @ 158:9683a4cd848f

Added some functions for code generation
author Windel Bouwman
date Fri, 08 Mar 2013 16:52:44 +0100
parents b28a11c01dbe
children 8104fc8b5e90
line wrap: on
line diff
--- a/python/c3/astnodes.py	Sun Mar 03 18:14:35 2013 +0100
+++ b/python/c3/astnodes.py	Fri Mar 08 16:52:44 2013 +0100
@@ -145,7 +145,8 @@
       return 'COMPOUND STATEMENT'
 
 class EmptyStatement(Node):
-   pass
+   def __repr__(self):
+      return 'NOP'
 
 class ReturnStatement(Node):
    def __init__(self, expr):
@@ -168,7 +169,7 @@
     return 'CALL {0} '.format(self.proc)
 
 class IfStatement(Node):
-   def __init__(self, condition, truestatement, falsestatement=None):
+   def __init__(self, condition, truestatement, falsestatement):
       self.condition = condition
       self.truestatement = truestatement
       self.falsestatement = falsestatement