Ejemplo n.º 1
0
 def unroll_generator_next(self, printer, ctx, obj_symbol):
     next_symbol = obj_symbol.get("__next__", free=False)
     if next_symbol:
         yield next_symbol, [], {}
         result_symbol = make_result_symbol(ctx.builder, next_symbol)
         for symbol in result_symbol.values():
             self.target.store(printer, ctx, symbol)
Ejemplo n.º 2
0
 def unroll_generator_iter(self, printer, ctx, obj_symbol):
     iter_symbol = obj_symbol.get("__iter__", free=False)
     if iter_symbol:
         yield iter_symbol, [], {}
         result_symbol = make_result_symbol(ctx.builder, iter_symbol)
         for symbol in result_symbol.geners():
             self.target.store(printer, ctx, symbol)
         for symbol in result_symbol.values():
             yield from self.unroll_generator_next(printer, ctx, symbol)
Ejemplo n.º 3
0
 def load(self, printer, ctx):
     callee_symbol = merge_symbols(self.nick(), *self.local.callee_symbols)
     result_symbol = make_result_symbol(ctx.builder, callee_symbol)
     if not result_symbol:
         printer("? Can't load callee result:", callee_symbol)
     return result_symbol