Improved macro type checking for terrain macros.

This commit is contained in:
Eric S. Raymond 2010-02-12 02:07:43 +00:00
parent c62c55e1a2
commit b543bb5115

View file

@ -157,8 +157,10 @@ def formaltype(f):
ftype = "range"
elif f in ("ALIGN",):
ftype = "alignment"
elif f in ("TERRAIN",):
elif f == "TERRAIN":
ftype = "terrain_code"
elif f.startswith("ADJACENT") or f in ("TERRAIN_PATTERN"):
ftype = "terrain_pattern"
elif f in ("NAME", "VAR", "IMAGESTEM", "ID", "FLAG") or f.endswith("_NAME") or f.endswith("_ID"):
ftype = "name"
elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION"):
@ -243,6 +245,8 @@ def argmatch(formals, actuals):
pass
elif atype in ("numeric", "position", "span", "empty") and ftype == "alliance":
pass
elif atype in ("terrain_code", "shortname", "name") and ftype == "terrain_pattern":
pass
elif atype != ftype and ftype is not None and atype is not None:
return False
return True