Author: esr
Date: Tue Sep 30 03:09:12 2008
New Revision: 29776

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29776&view=rev
Log:
Beat wmlscpe into not complaining about multiple definitions of the 
carryover macros (they're conditionalized, but wmlscope cannot know this).

Modified:
    trunk/data/core/macros/carryover-utils.cfg
    trunk/data/tools/wesnoth/wmltools.py
    trunk/data/tools/wmlscope

Modified: trunk/data/core/macros/carryover-utils.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/macros/carryover-utils.cfg?rev=29776&r1=29775&r2=29776&view=diff
==============================================================================
--- trunk/data/core/macros/carryover-utils.cfg (original)
+++ trunk/data/core/macros/carryover-utils.cfg Tue Sep 30 03:09:12 2008
@@ -1,4 +1,7 @@
+#textdomain wesnoth
 # These aren't actually macros, but they need to go somewhere anyway.
+
+# The wmlscope pragmas prevent spurious complaints about multiple definitions
 
 #ifdef EASYNEWCARRYOVER
     #define EASY
@@ -6,6 +9,8 @@
     #define NEW_GOLD_CARRYOVER_USED
     #enddef
 #endif
+
+# wmlscope: start ignoring
 
 #ifdef NORMALNEWCARRYOVER
     #define NORMAL
@@ -20,6 +25,8 @@
     #define NEW_GOLD_CARRYOVER_USED
     #enddef
 #endif
+
+# wmlscope: stop ignoring
 
 # These are used in scenarios, to include the carryover-defining keys into
 # [endlevel]s and to show the carryover details in the objectives dialog.
@@ -42,10 +49,12 @@
 20% of finishing gold carried over to the next scenario."
     #enddef
 #else
+    # wmlscope: start ignoring
     #define NEW_GOLD_CARRYOVER_NOTE_40
         ""
     #enddef
     #define NEW_GOLD_CARRYOVER_NOTE_20
         ""
     #enddef
+    # wmlscope: stop ignoring
 #endif

Modified: trunk/data/tools/wesnoth/wmltools.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=29776&r1=29775&r2=29776&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Tue Sep 30 03:09:12 2008
@@ -305,6 +305,7 @@
         self.noxref = False
         self.properties = {}
         self.unit_ids = {}
+        ignoreflag = False
         if warnlevel >=2:
             print "*** Beginning definition-gathering pass..."
         for (namespace, filename) in self.filelist.generator():
@@ -335,6 +336,18 @@
                         if namespace not in self.properties:
                             self.properties[namespace] = {}
                         self.properties[namespace][prop] = value
+                    if "# wmlscope: start ignoring" in line:
+                        if warnlevel:
+                            print '"%s", line %d: starting ignoring' \
+                                  % (filename, n+1)
+                        ignoreflag = True
+                    elif "# wmlscope: stop ignoring" in line:
+                        if warnlevel:
+                            print '"%s", line %d: stopping ignoring' \
+                                  % (filename, n+1)
+                        ignoreflag = False
+                    elif ignoreflag:
+                        continue
                     if line.strip().startswith("#define"):
                         tokens = line.split()
                         name = tokens[1]

Modified: trunk/data/tools/wmlscope
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlscope?rev=29776&r1=29775&r2=29776&view=diff
==============================================================================
--- trunk/data/tools/wmlscope (original)
+++ trunk/data/tools/wmlscope Tue Sep 30 03:09:12 2008
@@ -30,6 +30,12 @@
 #
 # somewhere.  wmlscope will complain when it sees a nam,espace with no export
 # property, then treat it as non-exporting.
+#
+# You can tell wmlscope to ignore stretches of config files
+# with the following magic comments?
+#
+#     # wmlscope: start ignoring
+#     # wmlscope: stop ignoring
 #
 # This tool does catch one kind of implicit reference: if an attack name
 # is specified but no icon is given, the attack icon will default to


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to