mail[Wesnoth-commits] r20136 - /trunk/data/tools/wmllint


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by patrick_X99 on September 06, 2007 - 04:43:
Author: sapient
Date: Thu Sep  6 04:43:04 2007
New Revision: 20136

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20136&view=rev
Log:
fix a flaw in the loop logic

Modified:
    trunk/data/tools/wmllint

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=20136&r1=20135&r2=20136&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Thu Sep  6 04:43:04 2007
@@ -682,29 +682,30 @@
     # Upconvert old radius usage
     if "1.3.7" in versions and future:
         radius_pos = wmlfind("radius=")
-        scopeIter = radius_pos.iterScope()
-        startline = scopeIter.lineno()
-        wspace = radius_pos.text()
-        wspace = wspace[:len(wspace)-len(wspace.lstrip())]
-        radius_danger = False
-        to_indent = []
-        no_indent = []
-        for pos in scopeIter:
-            tag = pos.tag()
-            if tag in ("[and]", "[or]", "[not]"):
-                radius_danger = True
-                no_indent.extend(pos.text().splitlines())
-            elif tag in ("variable=", "side=", "count=", "adjacent="):
-                no_indent.extend(pos.text().splitlines())
-            else:
-                to_add = pos.text().splitlines()
-                to_add[0] = baseindent + to_add[0]
-                to_indent.extend(to_add)
-        if radius_danger:
-            lines = lines[:startline] + [wspace + "[and]"] + to_indent +\
-                    [wspace + "[/and]"] + no_indent + 
lines[scopeIter.lineno():]
-            modcount += 1
-        
+        while radius_pos is not None:
+            scopeIter = radius_pos.iterScope()
+            startline = scopeIter.lineno()
+            wspace = radius_pos.text()
+            wspace = wspace[:len(wspace)-len(wspace.lstrip())]
+            radius_danger = False
+            to_indent = []
+            no_indent = []
+            for pos in scopeIter:
+                tag = pos.tag()
+                if tag in ("[and]", "[or]", "[not]"):
+                    radius_danger = True
+                    no_indent.extend(pos.text().splitlines())
+                elif tag in ("variable=", "side=", "count=", "adjacent="):
+                    no_indent.extend(pos.text().splitlines())
+                else:
+                    to_add = pos.text().splitlines()
+                    to_add[0] = baseindent + to_add[0]
+                    to_indent.extend(to_add)
+            if radius_danger:
+                lines = lines[:startline] + [wspace + "[and]"] + to_indent +\
+                        [wspace + "[/and]"] + no_indent + 
lines[scopeIter.lineno():]
+                modcount += 1
+            radius_pos = wmlfind("radius=", radius_pos.next())        
     # More syntax transformations would go here.
     return (lines, modcount)
 




Related Messages


Powered by MHonArc, Updated Thu Sep 06 05:20:29 2007