wmllint code for bug #10089 confirmed correct,

I'm removing the conditionalization by --future.
This commit is contained in:
Eric S. Raymond 2007-10-05 20:05:11 +00:00
parent 801aa3003f
commit f6630cdca5

View file

@ -927,34 +927,33 @@ def hack_syntax(filename, lines):
print 'warning: duplicated attack %s at:' % key
for dup in linenos:
print '"%s", %d: %s' % (filename, dup, key)
if future:
# Lift obsolete image_short and image_long tags
expanded = """\
# Lift obsolete image_short and image_long tags
expanded = """\
[attack_anim]
apply_to=attack
start_time=-150
[frame]
duration=300
image=%s
[/frame]
[attack_filter]
range=%s
[/attack_filter]
apply_to=attack
start_time=-150
[frame]
duration=300
image=%s
[/frame]
[attack_filter]
range=%s
[/attack_filter]
[/attack_anim]\
"""
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
m = re.search(r"(\s+)image_short=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n"
lines[i] = m.group(1) + image_block % (m.group(2), "melee")
modcount += 1
m = re.search(r"(\s+)image_long=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n"
lines[i] = m.group(1) + image_block % (m.group(2), "ranged")
modcount += 1
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
m = re.search(r"(\s+)image_short=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n"
lines[i] = m.group(1) + image_block % (m.group(2), "melee")
modcount += 1
m = re.search(r"(\s+)image_long=(.*)", lines[i])
if m:
image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n"
lines[i] = m.group(1) + image_block % (m.group(2), "ranged")
modcount += 1
# More syntax transformations would go here.
return (lines, modcount)