Yet more macro argument type checking. No mismatches in mainline.

This commit is contained in:
Eric S. Raymond 2010-02-14 22:24:31 +00:00
parent ea77b152ca
commit 2794e6c9ba
3 changed files with 10 additions and 10 deletions

View file

@ -58,14 +58,14 @@
#
# Use this to make other rule depend on adjacent terrain
#define FLAG_IF_ADJACENT TERRAIN ADJACENT FLAG CLASS
#define FLAG_IF_ADJACENT TERRAIN ADJACENT FLAG CLASS_NAME
[terrain_graphics]
[tile]
x=0
y=0
type={TERRAIN}
set_flag={FLAG},{CLASS}
no_flag={CLASS}
set_flag={FLAG},{CLASS_NAME}
no_flag={CLASS_NAME}
[/tile]
[tile]
x=0

View file

@ -273,7 +273,7 @@
#enddef
## this is defined separately for random variations for -n walls
#define WALL_1_VARIATION PROBABILITY TERRAIN_PATTERN ADJACENT IMAGESTEM
#define WALL_1_VARIATION PROB TERRAIN_PATTERN ADJACENT IMAGESTEM
[terrain_graphics]
map="
, 2
@ -292,7 +292,7 @@
type={ADJACENT}
[/tile]
{IMAGE_N {IMAGESTEM}}
probability={PROBABILITY}
probability={PROB}
[/terrain_graphics]
#enddef
@ -411,7 +411,7 @@
#enddef
## for random variations in n-ne and nw-n walls
#define WALL_2_VARIATION PROBABILITY TERRAIN_PATTERN ADJACENT IMAGESTEM
#define WALL_2_VARIATION PROB TERRAIN_PATTERN ADJACENT IMAGESTEM
[terrain_graphics]
map="
, 3
@ -436,7 +436,7 @@
set_flag=wall-s
[/tile]
{IMAGE_NW_N {IMAGESTEM}}
probability={PROBABILITY}
probability={PROB}
[/terrain_graphics]
[terrain_graphics]
@ -463,7 +463,7 @@
set_flag=wall-sw
[/tile]
{IMAGE_N_NE {IMAGESTEM}}
probability={PROBABILITY}
probability={PROB}
[/terrain_graphics]
#enddef

View file

@ -145,7 +145,7 @@ def formaltype(f):
# Deduce the expected type of the formal
if f.startswith("_"):
f = f[1:]
if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS", "PROB", "LAYER", "TIME") or f.endswith("_SIDE") or f.endswith("NUMBER") or f.endswith("AMOUNT") or f.endswith("COST") or f.endswith("_X") or f.endswith("_Y") or f.endswith("_INCREMENT") or f.endswith("_FACTOR") or f.endswith("_TIME"):
if f in ("SIDE", "X", "Y", "RED", "GREEN", "BLUE", "TURN", "RADIUS", "PROB", "LAYER", "TIME") or f.endswith("_SIDE") or f.endswith("NUMBER") or f.endswith("AMOUNT") or f.endswith("COST") 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"
@ -205,7 +205,7 @@ def actualtype(a):
atype = "terrain_code"
elif a.endswith(".wav") or a.endswith(".ogg"):
atype = "sound"
elif a.startswith('"') and a.endswith('"') or (a.startswith("_") and a != '_s'):
elif a.startswith('"') and a.endswith('"') or (a.startswith("_") and a[1] not in "abcdefghijklmnopqrstuvwxyz"):
atype = "stringliteral"
elif "=" in a:
atype = "filter"