Address bug #16019 (actually an FR).

This commit is contained in:
Eric S. Raymond 2010-05-12 10:19:43 +00:00
parent b33a773e9f
commit 77f298883a

View file

@ -1473,6 +1473,20 @@ def hack_syntax(filename, lines):
in_standing_anim = False
if in_standing_anim:
lines[i] = re.sub(r"terrain([^_])", r"terrain_type\1", lines[i])
# Rename two attributes in [set_variable]
in_set_variable = False
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
if lines[i].startswith("#"):
pass
if "[set_variable]" in lines[i]:
in_set_variable = True
if "[/set_variable]" in lines[i]:
in_set_variable = False
if in_set_variable:
lines[i] = re.sub(r"format(?=\s*=)", r"value", lines[i])
lines[i] = re.sub(r"random(?=\s*=)", r"rand", lines[i])
# campaigns directory becomes add-ons
in_binary_path = in_textdomain = False
for i in range(len(lines)):