More wmllint/wmlscope cleanup.

This commit is contained in:
Eric S. Raymond 2010-09-12 21:38:15 +00:00
parent d775692a87
commit 28a730d1af
5 changed files with 20 additions and 20 deletions

View file

@ -143,7 +143,7 @@
{LIMIT_RECRUITS 1 (Merman Fighter) 3}
{LIMIT_RECRUITS 1 (Mermaid Initiate) 3}
#define PUT_CITIZEN X Y TRAIT_1 TRAIT_2
#define PUT_CITIZEN X Y TRAIT_1_WML TRAIT_2_WML
[unit]
type=Merman Citizen
side=1
@ -151,8 +151,8 @@
y={Y}
# wmlscope: start ignoring
[modifications]
{TRAIT_{TRAIT_1}}
{TRAIT_{TRAIT_2}}
{TRAIT_{TRAIT_1_WML}}
{TRAIT_{TRAIT_2_WML}}
[/modifications]
# wmlscope: stop ignoring
generate_name=yes

View file

@ -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. Chasm hexes are found rather than hard-coded
# the BAT_TYPE_LIST_WML. 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
#define BATS_EXIT_CAVE BAT_TYPE_LIST_WML
#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})}
{RANDOM ({BAT_TYPE_LIST_WML})}
[unit]
type=$random
x=$chasm_hexes[$hex].x

View file

@ -1,7 +1,7 @@
#textdomain wesnoth-dw
# Finds the nearest hex to (X,Y) within MAX_DISTANCE that matches the FILTER, and stores the location in VARIABLE with x, y, and terrain. If there is more than one location found, VARIABLE will be an array.
#define NEAREST_HEX X Y MAX_DISTANCE FILTER VARIABLE
#define NEAREST_HEX X Y MAX_DISTANCE FILTER VAR_NAME
[set_variable]
name=distance
value=0
@ -33,12 +33,12 @@
y={Y}
radius=$distance
[/and]
variable={VARIABLE}
variable={VAR_NAME}
[/store_locations]
[if]
[variable]
name={VARIABLE}.length
name={VAR_NAME}.length
greater_than=0
[/variable]
[then]

View file

@ -97,22 +97,22 @@
[/set_variable]
#enddef
#define GLOBAL_VARIABLE NAMESPACE LOCAL_VAR GLOBAL_VAR SIDE
#define GLOBAL_VARIABLE NAMESPACE LOCAL_VAR_NAME GLOBAL_VAR_NAME SIDE
#Assigns a persistent variable with the contents of a standard variable.
[set_global_variable]
namespace={NAMESPACE}
from_local={LOCAL_VAR}
to_global={GLOBAL_VAR}
from_local={LOCAL_VAR_NAME}
to_global={GLOBAL_VAR_NAME}
side={SIDE}
[/set_global_variable]
#enddef
#define VARIABLE_FROM_GLOBAL NAMESPACE GLOBAL_VAR LOCAL_VAR SIDE
#define VARIABLE_FROM_GLOBAL NAMESPACE GLOBAL_VAR_NAME LOCAL_VAR_NAME SIDE
#Retrieves the contents of a persistent variable and stores them in a standard variable.
[get_global_variable]
namespace={NAMESPACE}
from_global={GLOBAL_VAR}
to_local={LOCAL_VAR}
from_global={GLOBAL_VAR_NAME}
to_local={LOCAL_VAR_NAME}
side={SIDE}
#immediate=no
[/get_global_variable]
@ -134,10 +134,10 @@
[/variable]
#enddef
#define CLEAR_VARIABLE VAR
#define CLEAR_VARIABLE VAR_NAME
# Macro to clear a variable previously set.
[clear_variable]
name={VAR}
name={VAR_NAME}
[/clear_variable]
#enddef

View file

@ -151,7 +151,7 @@ def formaltype(f):
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") 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"):
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"):
ftype = "numeric"
elif f in ("POSITION",) or f.endswith("_POSITION") or f == "BASE":
ftype = "position"
@ -169,7 +169,7 @@ def formaltype(f):
ftype = "terrain_pattern"
elif f.startswith("TERRAIN") or f.endswith("TERRAIN"):
ftype = "terrain_code"
elif f in ("NAME", "VAR", "IMAGESTEM", "ID", "FLAG") or f.endswith("_NAME") or f.endswith("_ID"):
elif f in ("NAME", "VAR", "IMAGESTEM", "ID", "FLAG", "BUILDER") or f.endswith("_NAME") or f.endswith("_ID"):
ftype = "name"
elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION"):
ftype = "optional_string"
@ -183,7 +183,7 @@ def formaltype(f):
ftype = "filter"
elif f == "WML" or f.endswith("_WML"):
ftype = "wml"
elif f in ("AFFIX",) or f.endswith("AFFIX"):
elif f in ("AFFIX", "POSTFIX") 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):