Add code generator for yield stmt

This commit is contained in:
Jeremy Hylton 2001-09-14 23:17:55 +00:00
parent dd32138e7d
commit 1048aa933f
2 changed files with 10 additions and 0 deletions

View File

@ -909,6 +909,11 @@ class CodeGenerator:
self.visit(node.value)
self.emit('RETURN_VALUE')
def visitYield(self, node):
self.set_lineno(node)
self.visit(node.value)
self.emit('YIELD_STMT')
# slice and subscript stuff
def visitSlice(self, node, aug_flag=None):

View File

@ -909,6 +909,11 @@ class CodeGenerator:
self.visit(node.value)
self.emit('RETURN_VALUE')
def visitYield(self, node):
self.set_lineno(node)
self.visit(node.value)
self.emit('YIELD_STMT')
# slice and subscript stuff
def visitSlice(self, node, aug_flag=None):