mail[Wesnoth-commits] r52659 - /trunk/data/tools/wmllint


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by strgaltent on January 19, 2012 - 18:58:
Author: anonymissimus
Date: Thu Jan 19 18:58:30 2012
New Revision: 52659

URL: http://svn.gna.org/viewcvs/wesnoth?rev=52659&view=rev
Log:
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

Modified:
    trunk/data/tools/wmllint

Modified: trunk/data/tools/wmllint
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmllint?rev=52659&r1=52658&r2=52659&view=diff
==============================================================================
--- trunk/data/tools/wmllint (original)
+++ trunk/data/tools/wmllint Thu Jan 19 18:58:30 2012
@@ -1720,6 +1720,7 @@
     unbalanced = False
     newdata = []
     refname = None
+    in_lua = False
     while mfile:
         if not map_only:
             line = mfile.pop(0)
@@ -1880,6 +1881,15 @@
             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("#")




Related Messages


Powered by MHonArc, Updated Thu Jan 19 19:00:09 2012