Author: ai0867
Date: Wed Oct 1 15:59:48 2008
New Revision: 29806
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29806&view=rev
Log:
* Add --define option: add preprocessor defines.
Modified:
trunk/data/tools/wmltest
Modified: trunk/data/tools/wmltest
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmltest?rev=29806&r1=29805&r2=29806&view=diff
==============================================================================
--- trunk/data/tools/wmltest (original)
+++ trunk/data/tools/wmltest Wed Oct 1 15:59:48 2008
@@ -6,7 +6,6 @@
"""
#TODO:
#-Include linenumbers and filenames in "complaint messages"
-#-Create option to define macros (like MULTIPLAYER or CAMPAIGN_HTTT)
#-Write function to check dependencies
#-Create a way to do linking PLUS some extra tag-specific things.
#List of dependencies to check:
@@ -83,6 +82,10 @@
action = "count",
dest = "verbose",
help = "Increase verbosity, 4 is the maximum.")
+ op.add_option("-D", "--define",
+ action = "append",
+ dest = "defines",
+ help = "Define (empty) preprocessor macros, for campaign/multiplayer
inclusion.")
(options, args) = op.parse_args()
if not options.path:
@@ -106,7 +109,10 @@
if options.verbose > 3:
parser.verbose = True
- map(parser.parse_file, args)
+ for file in args:
+ parser.parse_file(file)
+ for macro in options.defines:
+ parser.parse_text("#define %s \n#enddef" % (macro, ) )
data = wmldata.DataSub("WML")
parser.parse_top(data)
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits