Properly conditionalize another conversion.
This commit is contained in:
parent
d43d693c7c
commit
b527bc665b
1 changed files with 7 additions and 4 deletions
|
@ -1603,10 +1603,13 @@ def translator(filename, mapxforms, textxform):
|
|||
(newdata, hacked) = hack_syntax(filename, newdata)
|
||||
# Run everything together
|
||||
filetext = "".join(newdata)
|
||||
# WML syntax changed in 1.3.5. The transformation cannot
|
||||
# conveniently be done line-by-line.
|
||||
transformed = re.sub(r"(if]|while])\s*\[or]([\w\W]*?)\[/or]\s*",
|
||||
r"\1\2", filetext);
|
||||
if upconvert:
|
||||
# WML syntax changed in 1.3.5. The transformation cannot
|
||||
# conveniently be done line-by-line.
|
||||
transformed = re.sub(r"(if]|while])\s*\[or]([\w\W]*?)\[/or]\s*",
|
||||
r"\1\2", filetext);
|
||||
else:
|
||||
transformed = filetext
|
||||
# Return None if the transformation functions made no changes.
|
||||
if modified or hacked or transformed != filetext:
|
||||
return transformed
|
||||
|
|
Loading…
Add table
Reference in a new issue