mirror of https://github.com/python/cpython
Add code generator for yield stmt
This commit is contained in:
parent
dd32138e7d
commit
1048aa933f
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue