Пример #1
0
 def visitMacroEnd(self, node, env):
     if self.inDef:
         Macro.endMacro()
         node.nodetype = "None"
         node.data = []
         self.inDef = False
     elif not self.nestedError:
         Err.log("Unmatched .macend")
Пример #2
0
 def visitMacroBegin(self, node, env):
     if self.inDef:
         Err.log("Nested macro definition")
         self.nestedError = True
     else:
         Macro.newMacro(node.data[0])
         node.nodetype = "None"
         node.data = []
         self.inDef = True
Пример #3
0
 def visitMacroInvoke(self, node, env):
     replacement = Macro.expandMacro(node.ppt, node.data[0], node.data[1:])
     node.nodetype = replacement.nodetype
     node.data = replacement.data
     self.changed = True
Пример #4
0
 def visitUnknown(self, node, env):
     if self.inDef:
         Macro.registerNode(node)
         node.nodetype = "None"
         node.data = []
Пример #5
0
 def postPass(self):
     if self.inDef:
         Err.log("Unmatched .macro")
     elif Cmd.print_ir:
         print>>sys.stderr, "Macro definitions:"
         Macro.dump()
Пример #6
0
 def postPass(self):
     if self.inDef:
         Err.log("Unmatched .macro")
     elif Cmd.print_ir:
         print>>sys.stderr, "Macro definitions:"
         Macro.dump()
Пример #7
0
	def postPass(self):
		if self.inDef:
			Err.log("Unmatched .macro")
		elif Cmd.verbose > 2:
			print "Macro definitions:"
			Macro.dump()