fix cascade order of assignments for complete assignments within parallel assignments
authorStefan Behnel <scoder@users.berlios.de>
Fri, 23 Oct 2009 13:53:24 +0000 (15:53 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 23 Oct 2009 13:53:24 +0000 (15:53 +0200)
Cython/Compiler/Parsing.py

index c163d35b7c0963027f283a2925a1ddec27d9210c..95769e849ef4e9dd96fa55d5328ab000843bbd1d 100644 (file)
@@ -928,7 +928,7 @@ def flatten_parallel_assignments(input, output):
         output.append(input)
         return
 
-    complete_assignments = [rhs]
+    complete_assignments = []
 
     rhs_size = len(rhs.args)
     lhs_targets = [ [] for _ in range(rhs_size) ]
@@ -968,8 +968,9 @@ def flatten_parallel_assignments(input, output):
                 for targets, expr in zip(lhs_targets, lhs.args):
                     targets.append(expr)
 
-    if len(complete_assignments) > 1:
-        output.append(complete_assignments[::-1])
+    if complete_assignments:
+        complete_assignments.append(rhs)
+        output.append(complete_assignments)
 
     # recursively flatten partial assignments
     for cascade, rhs in zip(lhs_targets, rhs.args):