summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/pycodegen.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-09-14 23:17:55 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-09-14 23:17:55 (GMT)
commit1048aa933f096c33738f5088c7362a00e2c5b85c (patch)
tree343bc3f22c35a264b17013a7ad6782e802002b69 /Lib/compiler/pycodegen.py
parentdd32138e7dc66633b8804cd8e59ada5f9f5472c1 (diff)
downloadcpython-1048aa933f096c33738f5088c7362a00e2c5b85c.zip
cpython-1048aa933f096c33738f5088c7362a00e2c5b85c.tar.gz
cpython-1048aa933f096c33738f5088c7362a00e2c5b85c.tar.bz2
Add code generator for yield stmt
Diffstat (limited to 'Lib/compiler/pycodegen.py')
-rw-r--r--Lib/compiler/pycodegen.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py
index bfb5059..0097482 100644
--- a/Lib/compiler/pycodegen.py
+++ b/Lib/compiler/pycodegen.py
@@ -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):