[ZPT] CVS: Packages/TAL - TALGenerator.py:1.30

guido@digicool.com guido@digicool.com
Thu, 5 Apr 2001 20:59:47 -0400 (EDT)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv4825

Modified Files:
	TALGenerator.py 
Log Message:
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...



--- Updated File TALGenerator.py in package Packages/TAL --
--- TALGenerator.py	2001/03/27 16:57:59	1.29
+++ TALGenerator.py	2001/04/06 00:59:45	1.30
@@ -245,7 +245,7 @@
     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 @@
     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)