示例#1
0
文件: codegen.py 项目: fmota/klein
 def compile(self):
     emit.comment(repr(self))
     self.location = emit.location()
     for fn, origin in self.fns:
         fn(origin, self.location)
     del self.fns
示例#2
0
文件: codegen.py 项目: fmota/klein
 def produce(self, fn):
     if self.location is None:
         self.fns.append((fn, emit.location()))
     else:
         fn(emit.location(), self.location)