Make wmllint ignore embedded lua. There's no bug report for this.

Apparently it didn't already, it just didn't break so far, but the lua
I added in Hornshark let it choke.

wmllint ignores lines with << until a line with >> now (start and
end lines included).

esr: have a look pls
This commit is contained in:
Anonymissimus 2012-01-19 17:58:30 +00:00
parent 2b4dade6c5
commit 5d1c3d227b

View file

@ -1720,6 +1720,7 @@ def translator(filename, mapxforms, textxform):
unbalanced = False
newdata = []
refname = None
in_lua = False
while mfile:
if not map_only:
line = mfile.pop(0)
@ -1880,6 +1881,15 @@ def translator(filename, mapxforms, textxform):
newdata.append(line + terminator)
else:
# Handle text (non-map) lines. It can use within().
# Ignore lines with embedded lua.
if in_lua:
if ">>" in line:
in_lua = False
continue
elif "<<" in line:
if not ">>" in line:
in_lua = True
continue
newline = textxform(filename, lineno, line)
newdata.append(newline + terminator)
fields = newline.split("#")