Disable closures inside cdef functions for now.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 16 Jul 2010 07:23:48 +0000 (00:23 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 16 Jul 2010 07:23:48 +0000 (00:23 -0700)
Cython/Compiler/DebugFlags.py
Cython/Compiler/ParseTreeTransforms.py

index d6d52189437a03b80c76443274e963ec4a9fb1cb..19aa3ca2b222ecf2ee02fde05bd03bcf2e7c02a5 100644 (file)
@@ -7,7 +7,7 @@ debug_coercion = 0
 debug_temp_code_comments = 0
 
 # Write a call trace of the code generation phase into the C code
-debug_trace_code_generation = 0
+debug_trace_code_generation = 1
 
 # Do not replace exceptions with user-friendly error messages
 debug_no_exception_intercept = 0
index 161de9d008a9cccb20b1cff85913afd6cd8ed1c2..64c29a0c488755db6bca44c8dc3a7b74869f1555 100644 (file)
@@ -1224,6 +1224,12 @@ class MarkClosureVisitor(CythonTransform):
         node.needs_closure = self.needs_closure
         self.needs_closure = True
         return node
+    
+    def visit_CFuncDefNode(self, node):
+        self.visit_FuncDefNode(node)
+        if node.needs_closure:
+            error(node.pos, "closures inside cdef functions not yet supported")
+        return node
 
     def visit_LambdaNode(self, node):
         self.needs_closure = False