Commit 6e14b174 authored by Guido van Rossum's avatar Guido van Rossum

Fix bug reported by Richard Jones in ZPT(19).

Also fix the error for a duplicate fill-slot (which was erroneously
reported as a duplicate slot *definition*).

Question arises, should we also complain about duplicate define-slot,
or is it okay to use define-slot with the same name more than once?
This would be similar to "#define X(a) (a+a)" in C; it does point out
that define-slot isn't a great name...
parent d1a02b0a
......@@ -245,7 +245,7 @@ class TALGenerator:
def emitRepeat(self, arg, position=(None, None)):
m = re.match("(?s)\s*(%s)\s+(.*)\Z" % NAME_RE, arg)
if not m:
raise TALError("invalid repeat syntax: " + `repeat`, position)
raise TALError("invalid repeat syntax: " + `arg`, position)
name, expr = m.group(1, 2)
cexpr = self.compileExpression(expr)
program = self.popProgram()
......@@ -281,7 +281,7 @@ class TALGenerator:
def emitFillSlot(self, slotName, position=(None, None)):
program = self.popProgram()
if self.slots.has_key(slotName):
raise METALError("duplicate slot definition: %s" % slotName,
raise METALError("duplicate fill-slot name: %s" % slotName,
position)
self.slots[slotName] = program
self.emit("fillSlot", slotName, program)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment