diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-09-14 23:17:55 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-09-14 23:17:55 (GMT) |
commit | 1048aa933f096c33738f5088c7362a00e2c5b85c (patch) | |
tree | 343bc3f22c35a264b17013a7ad6782e802002b69 /Lib/compiler | |
parent | dd32138e7dc66633b8804cd8e59ada5f9f5472c1 (diff) | |
download | cpython-1048aa933f096c33738f5088c7362a00e2c5b85c.zip cpython-1048aa933f096c33738f5088c7362a00e2c5b85c.tar.gz cpython-1048aa933f096c33738f5088c7362a00e2c5b85c.tar.bz2 |
Add code generator for yield stmt
Diffstat (limited to 'Lib/compiler')
-rw-r--r-- | Lib/compiler/pycodegen.py | 5 |
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): |