6.19.10.2.20. The Tangler Stack

Interscript supports stacking of tanglers. The internal commands tangler_push, and tangler_pop push and pop the stack, while tangler_set changes the top of the stack.

These operations call the start and end section methods of the tangler objects as they become, or cease to become, the current tangler, this ensures correct source file references are inserted into the code files.

Start python section to interscript/frames/inputf.py[30 /42 ] Next Prev First Last
   878: #line 1169 "input_frame.ipk"
   879:   def tangler_push(self,f):
   880:     "Push the current tangler onto the tangler stack then set it to the given tangler"
   881:     self.current_tangler_stack.append(self.current_tangler)
   882:     self.current_tangler = f
   883: 
   884:   def tangler_pop(self):
   885:     "Set the current tangler to the top of the tangler stack and pop it."
   886:     self.current_tangler = self.current_tangler_stack[-1]
   887:     del self.current_tangler_stack[-1]
   888: 
   889:   def tangler_set(self,f):
   890:     "Set the current tangler"
   891:     self.current_tangler = f
   892: 
   893:   def get_tangler(self):
   894:     "Get the current tangler (may be None)"
   895:     return self.current_tangler
   896: 
End python section to interscript/frames/inputf.py[30]