[Zope3-checkins] SVN: Zope3/trunk/src/zope/tal/talinterpreter.py - add a comment about a mysterious instance variable

Fred L. Drake, Jr. fdrake at gmail.com
Mon Aug 15 12:41:12 EDT 2005


Log message for revision 37939:
  - add a comment about a mysterious instance variable
  - remove an unused assignment statement
  - simplify an expression assignment
  

Changed:
  U   Zope3/trunk/src/zope/tal/talinterpreter.py

-=-
Modified: Zope3/trunk/src/zope/tal/talinterpreter.py
===================================================================
--- Zope3/trunk/src/zope/tal/talinterpreter.py	2005-08-15 15:07:00 UTC (rev 37938)
+++ Zope3/trunk/src/zope/tal/talinterpreter.py	2005-08-15 16:40:42 UTC (rev 37939)
@@ -184,6 +184,7 @@
         #   [macroName, slots, definingName, extending, entering, i18ncontext]
         # the entries are mutated while on the stack
         self.macroStack = []
+        # `inUseDirective` is set iff we're handling a metal:use-macro
         self.inUseDirective = False
         self.position = None, None  # (lineno, offset)
         self.col = 0
@@ -839,7 +840,6 @@
     bytecode_handlers["condition"] = do_condition
 
     def do_defineMacro(self, (macroName, macro)):
-        macs = self.macroStack
         wasInUse = self.inUseDirective
         self.inUseDirective = False
         self.interpret(macro)
@@ -888,10 +888,7 @@
         # extendMacro results from a combination of define-macro and
         # use-macro.  definingName has the value of the
         # metal:define-macro attribute.
-        extending = False
-        if self.metal and self.inUseDirective:
-            # extend the calling directive.
-            extending = True
+        extending = self.metal and self.inUseDirective
         self.do_useMacro((macroName, macroExpr, compiledSlots, block),
                          definingName, extending)
     bytecode_handlers["extendMacro"] = do_extendMacro



More information about the Zope3-Checkins mailing list