now wmllint can correct deprecated [or] syntax inside [*while]

(previously just [*if])
This commit is contained in:
Patrick Parker 2007-07-27 23:14:13 +00:00
parent baa5eaa97b
commit 57752960f5

View file

@ -790,8 +790,8 @@ def translator(filename, mapxforms, textxform):
filetext = "".join(newdata)
# WML syntax changed in 1.3.5. The transformation cannot
# conveniently be done line-by-line.
transformed = re.sub(r"if]\s*\[or]([\w\W]*?)\[/or]\s*",
r"if]\1", filetext);
transformed = re.sub(r"(if]|while])\s*\[or]([\w\W]*?)\[/or]\s*",
r"\1\2", filetext);
# Return None if the transformation functions made no changes.
if modified or hacked or transformed != filetext:
return transformed