(partial) fix for incorrect wmllint 'unbalanced' handling

This commit is contained in:
Alexander van Gessel 2010-01-13 05:32:10 +01:00
parent a422b4d425
commit bc58979929

View file

@ -1695,14 +1695,14 @@ def translator(filename, mapxforms, textxform):
# Handle text (non-map) lines. It can use within().
newline = textxform(filename, lineno, line)
newdata.append(newline + terminator)
fields = newline.split("#")
trimmed = fields[0]
destringed = re.sub('"[^"]*"', '', trimmed) # Ignore string literals
comment = ""
if len(fields) > 1:
comment = fields[1]
# Now do warnings based on the state of the tag stack.
if not unbalanced:
fields = newline.split("#")
trimmed = fields[0]
destringed = re.sub('"[^"]*"', '', trimmed) # Ignore string literals
comment = ""
if len(fields) > 1:
comment = fields[1]
for instance in re.finditer(r"\[\/?\+?([a-z][a-z_]*[a-z])\]", destringed):
tag = instance.group(1)
attributes = []