Author: esr
Date: Mon Sep 13 04:17:43 2010
New Revision: 46432
URL: http://svn.gna.org/viewcvs/wesnoth?rev=46432&view=rev
Log:
More wmlscope/wmllint cleanup, adding and improving typechecking.
Modified:
trunk/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg
trunk/data/campaigns/Dead_Water/scenarios/09_The_Mage.cfg
trunk/data/tools/wesnoth/wmltools.py
Modified: trunk/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg?rev=46432&r1=46431&r2=46432&view=diff
==============================================================================
--- trunk/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg (original)
+++ trunk/data/campaigns/Dead_Water/scenarios/01_Invasion.cfg Mon Sep 13
04:17:43 2010
@@ -143,7 +143,7 @@
{LIMIT_RECRUITS 1 (Merman Fighter) 3}
{LIMIT_RECRUITS 1 (Mermaid Initiate) 3}
-#define PUT_CITIZEN X Y TRAIT_1_WML TRAIT_2_WML
+#define PUT_CITIZEN X Y TRAIT_1_NAME TRAIT_2_NAME
[unit]
type=Merman Citizen
side=1
@@ -151,8 +151,8 @@
y={Y}
# wmlscope: start ignoring
[modifications]
- {TRAIT_{TRAIT_1_WML}}
- {TRAIT_{TRAIT_2_WML}}
+ {TRAIT_{TRAIT_1_NAME}}
+ {TRAIT_{TRAIT_2_NAME}}
[/modifications]
# wmlscope: stop ignoring
generate_name=yes
Modified: trunk/data/campaigns/Dead_Water/scenarios/09_The_Mage.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Dead_Water/scenarios/09_The_Mage.cfg?rev=46432&r1=46431&r2=46432&view=diff
==============================================================================
--- trunk/data/campaigns/Dead_Water/scenarios/09_The_Mage.cfg (original)
+++ trunk/data/campaigns/Dead_Water/scenarios/09_The_Mage.cfg Mon Sep 13
04:17:43 2010
@@ -272,11 +272,11 @@
# *****BEGIN BATS SECTION****************BEGIN BATS SECTION*****
# Puts bats in the southern chasm. Random bats will be chosen from
- # the BAT_TYPE_LIST_WML. Chasm hexes are found rather than hard-coded
+ # the BAT_TYPES_VALUE. Chasm hexes are found rather than hard-coded
# so they can be moved or changed on the map without affecting
# this macro. (As long as they don't go too far.) Besides, it's
# easy to do.
-#define BATS_EXIT_CAVE BAT_TYPE_LIST_WML
+#define BATS_EXIT_CAVE BAT_TYPES_VALUE
#find chasm hexes, and put them in an array
[store_locations]
variable=chasm_hexes
@@ -290,7 +290,7 @@
# Put a bat into each chasm hex.
{FOREACH chasm_hexes hex}
- {RANDOM ({BAT_TYPE_LIST_WML})}
+ {RANDOM ({BAT_TYPES_VALUE})}
[unit]
type=$random
x=$chasm_hexes[$hex].x
Modified: trunk/data/tools/wesnoth/wmltools.py
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=46432&r1=46431&r2=46432&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Mon Sep 13 04:17:43 2010
@@ -151,8 +151,10 @@
f = f[1:]
if f == "SIDE" or f.endswith("_SIDE"):
ftype = "side"
- elif f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "PROB",
"LAYER", "TIME", "DURATION") or f.endswith("NUMBER") or f.endswith("AMOUNT") or
f.endswith("PERCENTAGE") or f.endswith("COST") or f.endswith("RADIUS") or
f.endswith("_X") or f.endswith("_Y") or f.endswith("_INCREMENT") or
f.endswith("_FACTOR") or f.endswith("_TIME") or f.endswith("_SIZE"):
+ elif f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "PROB",
"LAYER", "TIME", "DURATION") or f.endswith("NUMBER") or f.endswith("AMOUNT") or
f.endswith("COST") or f.endswith("RADIUS") or f.endswith("_X") or
f.endswith("_Y") or f.endswith("_INCREMENT") or f.endswith("_FACTOR") or
f.endswith("_TIME") or f.endswith("_SIZE"):
ftype = "numeric"
+ elif f.endswith("PERCENTAGE"):
+ ftype = "percentage"
elif f in ("POSITION",) or f.endswith("_POSITION") or f == "BASE":
ftype = "position"
elif f.endswith("_SPAN"):
@@ -169,7 +171,7 @@
ftype = "terrain_pattern"
elif f.startswith("TERRAIN") or f.endswith("TERRAIN"):
ftype = "terrain_code"
- elif f in ("NAME", "VAR", "IMAGESTEM", "ID", "FLAG", "BUILDER") or
f.endswith("_NAME") or f.endswith("_ID"):
+ elif f in ("NAME", "NAMESPACE", "VAR", "IMAGESTEM", "ID", "FLAG",
"BUILDER") or f.endswith("_NAME") or f.endswith("_ID") or f.endswith("_VAR"):
ftype = "name"
elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION"):
ftype = "optional_string"
@@ -183,7 +185,7 @@
ftype = "filter"
elif f == "WML" or f.endswith("_WML"):
ftype = "wml"
- elif f in ("AFFIX", "POSTFIX") or f.endswith("AFFIX"):
+ elif f in ("AFFIX", "POSTFIX", "ROTATION") or f.endswith("AFFIX"):
ftype = "affix"
# The regexp case avoids complaints about some wacky terrain macros.
elif f.endswith("VALUE") or re.match("[ARS][0-9]", f):
@@ -198,6 +200,8 @@
# Deduce the type of the actual
if a.isdigit() or a.startswith("-") and a[1:].isdigit():
atype = "numeric"
+ elif re.match(r"0\.[0-9]+\Z", a):
+ atype = "percentage"
elif re.match(r"-?[0-9]+,-?[0-9]+\Z", a):
atype = "position"
elif re.match(r"([0-9]+\-[0-9]+,?|[0-9]+,?)+\Z", a):
@@ -246,7 +250,7 @@
pass
elif atype in ("numeric", "position") and ftype == "span":
pass
- elif atype in ("shortname", "name", "empty") and ftype == "affix":
+ elif atype in ("shortname", "name", "empty", "stringliteral") and
ftype == "affix":
pass
elif atype in ("shortname", "name", "stringliteral") and ftype ==
"string":
pass
@@ -259,6 +263,8 @@
elif atype in ("terrain_code", "shortname", "name") and ftype ==
"terrain_pattern":
pass
elif atype in ("string", "shortname", "name") and ftype == "types":
+ pass
+ elif atype in ("numeric", "percentage") and ftype == "percentage":
pass
elif atype == "range" and ftype == "name":
pass
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits