[Checkins] SVN: Sandbox/malthe/chameleon.core/ Fixed variable deletion mechanism.

Malthe Borch mborch at gmail.com
Sat Nov 15 18:16:56 EST 2008


Log message for revision 92994:
  Fixed variable deletion mechanism.

Changed:
  U   Sandbox/malthe/chameleon.core/CHANGES.txt
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/codegen.py

-=-
Modified: Sandbox/malthe/chameleon.core/CHANGES.txt
===================================================================
--- Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-15 23:14:37 UTC (rev 92993)
+++ Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-15 23:16:55 UTC (rev 92994)
@@ -4,6 +4,12 @@
 HEAD
 ~~~~
 
+- Only pretend to delete variables; this improves performance and
+  guarantees that we don't attempt to delete a variables which is used
+  in a nested scope (closure). It works, because the code generation
+  transform silently drops the delete-statements, but removes them
+  from its internal scope dictionary. [malthe]
+
 - Remove variables from scope dictionary upon block exit. [malthe]
 
 - Split out compile-function such that we can always write the source

Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/codegen.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/codegen.py	2008-11-15 23:14:37 UTC (rev 92993)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/codegen.py	2008-11-15 23:16:55 UTC (rev 92994)
@@ -82,6 +82,7 @@
             else:
                 self.locals[-1].remove(node.name)
                 self.names.remove(node.name)
+                return None
         return node
 
     def visitClass(self, node):



More information about the Checkins mailing list