Teach wmllint to convert letter= to terrain= when appropriate.

Fix a comment.
This commit is contained in:
Eric S. Raymond 2008-02-12 13:16:22 +00:00
parent 52001c6ca7
commit 1981d43bad
2 changed files with 13 additions and 2 deletions

View file

@ -8,8 +8,8 @@
# * transition-$direction : the corresponding tile already has the transition
# in the given direction (or should not have one). No other one should be
# added.
# * keep-of-$castle : castle being a tile letter. The corresponding tile is the
# keep correspoding to the given castle tile
# * keep-of-$castle : castle being a tile code. The corresponding tile is the
# keep corresponding to the given castle tile
#
# when adding new probabilities update the commented line
# the proper way to calculate the propabilities is described here

View file

@ -1496,6 +1496,17 @@ start_time=-150
image_block = expanded.replace("\n", "\n" + m.group(1)) + "\n"
lines[i] = m.group(1) + image_block % (m.group(2), "ranged")
modcount += 1
# In [terrain], letter= to terrain=
in_terrain = False
for i in range(len(lines)):
if "no-syntax-rewrite" in lines[i]:
break
if "[terrain]" in lines[i]:
in_terrain = True
if "[/terrain]" in lines[i]:
in_terrain = False
if in_terrain:
lines[i] = lines[i].replace("letter", "terrain")
# More syntax transformations would go here.
return (lines, modcount)