Fix bugs for rhs -> default and exception handling.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 18 Jul 2008 08:11:51 +0000 (01:11 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 18 Jul 2008 08:11:51 +0000 (01:11 -0700)
Cython/CodeWriter.py
Cython/Compiler/ExprNodes.py
Cython/Compiler/Nodes.py

index 2d1928569cf8fa6271a159742e5e07c5a242a7de..7d995b0804c9ad2dccf3860114ec59e8806a072b 100644 (file)
@@ -70,9 +70,9 @@ class CodeWriter(TreeVisitor):
         if len(items) > 0:
             for item in items[:-1]:
                 self.visit(item)
-                if output_rhs and item.rhs is not None:
+                if output_rhs and item.default is not None:
                     self.put(u" = ")
-                    self.visit(item.rhs)
+                    self.visit(item.default)
                 self.put(u", ")
             self.visit(items[-1])
     
index 3ace94e7a0b3dd4f21c37e2ec5bbac64be9b9460..0644b9fc17d92e4d8ebe35f12e2fdd0b72811e20 100644 (file)
@@ -1670,7 +1670,7 @@ class SimpleCallNode(CallNode):
         return func_type
         
     def exception_checks(self):
-        func_type = self.function.type
+        func_type = self.function_type()
         exc_val = func_type.exception_value
         exc_check = func_type.exception_check
         if exc_val is None and self.function.entry.visibility != 'extern':
index 711c6880d3b454f6c1706da08413ff7fe106e02c..d237e5c61ca692a889402656014e1035bae12605 100644 (file)
@@ -358,6 +358,8 @@ class CNameDeclaratorNode(CDeclaratorNode):
     
     child_attrs = ['default']
     
+    default = None
+    
     def analyse(self, base_type, env, nonempty = 0):
         if nonempty and self.name == '':
             # Must have mistaken the name for the type.