assignments are traversed in the correct order now
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 10 Apr 2008 18:51:23 +0000 (20:51 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Thu, 10 Apr 2008 18:51:23 +0000 (20:51 +0200)
--HG--
branch : trunk

jinja2/compiler.py

index 48c9d9973087382ac9257b27b401384fa7cf2e5b..65912c7a726b404b7e7befe64b1641d1e512999b 100644 (file)
@@ -160,6 +160,11 @@ class FrameIdentifierVisitor(NodeVisitor):
         """Macros set local."""
         self.identifiers.declared_locally.add(node.name)
 
+    def visit_Assign(self, node):
+        """Visit assignments in the correct order."""
+        self.visit(node.node)
+        self.visit(node.target)
+
     # stop traversing at instructions that have their own scope.
     visit_Block = visit_CallBlock = visit_FilterBlock = \
         visit_For = lambda s, n: None