fix another flaw in the loop logic

...and insert an explicit reference to class WmlIterator
This commit is contained in:
Patrick Parker 2007-09-06 03:08:41 +00:00
parent 001d1fa9bf
commit f960520716

View file

@ -681,7 +681,7 @@ def hack_syntax(filename, lines):
lines = lines[:i] + lines[i+2:]
# Upconvert old radius usage
if "1.3.7" in versions and future:
radius_pos = wmlfind("radius=")
radius_pos = wmlfind("radius=", WmlIterator(lines))
while radius_pos is not None:
scopeIter = radius_pos.iterScope()
startline = scopeIter.lineno()
@ -705,7 +705,7 @@ def hack_syntax(filename, lines):
lines = lines[:startline] + [wspace + "[and]"] + to_indent +\
[wspace + "[/and]"] + no_indent + lines[scopeIter.lineno():]
modcount += 1
radius_pos = wmlfind("radius=", radius_pos.next())
radius_pos = wmlfind("radius=", WmlIterator(lines, startline+len(to_indent)+1+radius_danger))
# More syntax transformations would go here.
return (lines, modcount)