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

guido@digicool.com guido@digicool.com
Thu, 17 May 2001 21:24:35 -0400 (EDT)


Update of /cvs-repository/Packages/TAL
In directory korak.digicool.com:/tmp/cvs-serv17582

Modified Files:
	TALGenerator.py 
Log Message:
Allow define-slot and fill-slot on the same tag.


--- Updated File TALGenerator.py in package Packages/TAL --
--- TALGenerator.py	2001/05/18 00:42:07	1.37
+++ TALGenerator.py	2001/05/18 01:24:04	1.38
@@ -379,8 +379,9 @@
         replace = taldict.get("replace")
         attrsubst = taldict.get("attributes")
         onError = taldict.get("on-error")
-        if len(metaldict) > 1:
-            raise METALError("at most one METAL attribute per element",
+        if len(metaldict) > 1 and (defineMacro or useMacro):
+            raise METALError("define-macro and use-macro cannot be used "
+                             "together or with define-slot or fill-slot",
                              position)
         if content and replace:
             raise TALError("content and replace are mutually exclusive",
@@ -402,12 +403,12 @@
             self.pushSlots()
             self.pushProgram()
             todo["useMacro"] = useMacro
-        if defineSlot:
-            self.pushProgram()
-            todo["defineSlot"] = defineSlot
         if fillSlot:
             self.pushProgram()
             todo["fillSlot"] = fillSlot
+        if defineSlot:
+            self.pushProgram()
+            todo["defineSlot"] = defineSlot
         if taldict:
             self.emit("beginScope")
             self.emit("rawAttrs", self.makeAttrDict(attrlist))
@@ -504,14 +505,14 @@
             self.emitOnError(name, onError, position)
         if scope:
             self.emit("endScope")
-        if defineMacro:
-            self.emitDefineMacro(defineMacro, position)
-        if useMacro:
-            self.emitUseMacro(useMacro)
         if defineSlot:
             self.emitDefineSlot(defineSlot)
         if fillSlot:
             self.emitFillSlot(fillSlot, position)
+        if useMacro:
+            self.emitUseMacro(useMacro)
+        if defineMacro:
+            self.emitDefineMacro(defineMacro, position)
 
 def test():
     t = TALGenerator()