Clean up some macros in UtBS, improve the wmllint stack checker.

This commit is contained in:
Eric S. Raymond 2007-06-13 18:41:31 +00:00
parent fd504ee721
commit 558813e89f
3 changed files with 19 additions and 8 deletions

View file

@ -1945,7 +1945,7 @@ name=i
value=$number_enemies
[/set_variable]
{LOOP i}
{STARTLOOP i}
[if]
[variable]
@ -2011,7 +2011,7 @@ value=$number_enemies
{CLEAR_VARIABLE unitstats}
{NEXT i}
{ENDLOOP i}
#destroy ally's villages in the tunnels
@ -2307,7 +2307,7 @@ value=1
value=$number_to_kill
[/set_variable]
{LOOP i}
{STARTLOOP i}
[store_locations]
x=24-46
@ -2405,7 +2405,7 @@ value=1
fire_event=no
[/kill]
{NEXT i}
{ENDLOOP i}
[message]
description=Dwarf Leader

View file

@ -33,8 +33,8 @@
[/set_variable]
#enddef
#create a loop that runs X times
#define LOOP VAR
#define STARTLOOP VAR
# Loop VAR times, counting from -VAR to -1.
[set_variable]
name={VAR}
multiply=-1
@ -45,7 +45,18 @@ multiply=-1
name={VAR}
less_than=0
[/variable]
[do]
[do] #enddef
# Same as mainline NEXT
#define ENDLOOP VAR
# Macro to end a WML clause that iterates over an array.
[set_variable]
name={VAR}
add=1
[/set_variable]
[/do]
[/while]
{CLEAR_VARIABLE {VAR}}
#enddef
# create a unit with full upkeep

View file

@ -535,7 +535,7 @@ def translator(filename, mapxforms, textxform):
#print '"%s", line %d: %s' % (filename, lineno+1, tagstack)
# It's an error if the tag stack is nonempty at the end of any file:
if tagstack:
print >>sys.stderr, '"%s", line %d: tag stack nonempty at end of file.' % (filename, lineno)
print >>sys.stderr, '"%s", line %d: tag stack nonempty (%s) at end of file.' % (filename, lineno, tagstack)
tagstack = []
# Track which maps are modified, we'll use this later for determining
# which files get a .map extension.