Found some false positives; implement a magic comment to ignore them.

This commit is contained in:
Eric S. Raymond 2007-11-10 17:58:37 +00:00
parent 11045df5fc
commit eb28d8e83a
4 changed files with 13 additions and 12 deletions

View file

@ -119,9 +119,9 @@
{UNIT (Bowman) (Owain) ( _ "Owain") 1 31 12}
{UNIT (Spearman) (Aethun) ( _ "Aethun") 1 31 13}
{UNIT (Spearman) (Yran) ( _ Yran) 3 5 17}
{UNIT (Swordsman) (Luddry) ( _ Luddy) 3 6 17}
{UNIT (Spearman) (Gwilam) ( _ Gwilam) 3 6 18}
{UNIT (Spearman) (Yran) ( _ "Yran") 3 5 17}
{UNIT (Swordsman) (Luddry) ( _ "Luddy") 3 6 17}
{UNIT (Spearman) (Gwilam) ( _ "Gwilam") 3 6 18}
{VARIABLE malin_used_necromancy 0}
[/event]

View file

@ -369,7 +369,7 @@ _f, _f, _f, _f, _f, _f, Re, _f, _f, _f, _f, _f,
[/rule]
[rule] # Convert cave villages to stone villages
old=Vu
new=_f, Re, Uu^Vud, Uh, Uu^Uf
new=_f, Re, Uu^Vud, Uh, Uu^Uf # wmllint: ignore
terrain=Uu^Vud
[/rule]
[rule] # Add stone villages

View file

@ -11,21 +11,21 @@
editor_image=off-map/offmap-editor
id=off_map
name= _ "None"
string=_off^_usr
string=_off^_usr # wmllint: ignore
[/terrain]
[terrain]
symbol_image=void
id=shroud
name= _ "Shroud"
string=_s
string=_s # wmllint: ignore
[/terrain]
[terrain]
symbol_image=fog
id=fog
name= _ "Fog"
string=_f
string=_f # wmllint: ignore
[/terrain]
#

View file

@ -1508,11 +1508,12 @@ if __name__ == '__main__':
for (old, new) in conversion2.items():
transformed = old.sub(new, transformed)
# Check for things marked translated that aren't strings
m = re.search(r'[=(]\s*_\s*("?)', transformed)
if m and not m.group(1):
msg = '"%s", line %d: translatability mark before non-string' % \
(filename, lineno)
print >>sys.stderr, msg
if "_" in transformed and not "wmllint: ignore" in transformed:
m = re.search(r'[=(]\s*_\s*("?)', transformed)
if m and not m.group(1):
msg = '"%s", line %d: translatability mark before non-string' % \
(filename, lineno)
print >>sys.stderr, msg
# Report the changes
if verbose > 0 and transformed != line:
msg = "%s, line %d: %s -> %s" % \