From ebe55aa9df755a2175b739b40b659db5130a964c Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 10 Apr 2008 20:51:23 +0200 Subject: [PATCH] assignments are traversed in the correct order now --HG-- branch : trunk --- jinja2/compiler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 48c9d99..65912c7 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -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 -- 2.26.2