[ZPT] CVS: Zope/lib/python/TAL - TALInterpreter.py:1.66.2.4

Shane Hathaway shane@cvs.zope.org
Sat, 23 Mar 2002 21:14:02 -0500


Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv16634

Modified Files:
      Tag: shane-better-tracebacks-branch
	TALInterpreter.py 
Log Message:
Minor addition to allow Boa Constructor's debugger to step
through page templates.


=== Zope/lib/python/TAL/TALInterpreter.py 1.66.2.3 => 1.66.2.4 ===
                                  (`macroName`, `mode`), self.position)
         self.pushMacro(macroName, compiledSlots)
-        prev_source = self.sourceFile
+        saved_source = self.sourceFile
+        saved_position = self.position  # Used by Boa Constructor
         self.interpret(macro)
-        if self.sourceFile != prev_source:
-            self.engine.setSourceFile(prev_source)
-            self.sourceFile = prev_source
+        if self.sourceFile != saved_source:
+            self.engine.setSourceFile(saved_source)
+            self.sourceFile = saved_source
         self.popMacro()
     bytecode_handlers["useMacro"] = do_useMacro
 
@@ -544,11 +545,12 @@
             macroName, slots = self.popMacro()[:2]
             slot = slots.get(slotName)
             if slot is not None:
-                prev_source = self.sourceFile
+                saved_source = self.sourceFile
+                saved_position = self.position  # Used by Boa Constructor
                 self.interpret(slot)
-                if self.sourceFile != prev_source:
-                    self.engine.setSourceFile(prev_source)
-                    self.sourceFile = prev_source
+                if self.sourceFile != saved_source:
+                    self.engine.setSourceFile(saved_source)
+                    self.sourceFile = saved_source
                 self.pushMacro(macroName, slots, entering=0)
                 return
             self.pushMacro(macroName, slots)