summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/ast.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-18 00:07:14 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-18 00:07:14 (GMT)
commit8548f9b1831b995e8b499015ffae87920dd8b8ae (patch)
tree92280939195bf8a2dc620257c96f44888320ce8c /Lib/compiler/ast.py
parent4fd9e2fc134a8a95fa9ef29e39572f82f3b5240e (diff)
downloadcpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.zip
cpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.tar.gz
cpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.tar.bz2
Add Yield() node
Diffstat (limited to 'Lib/compiler/ast.py')
-rw-r--r--Lib/compiler/ast.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py
index 4b6fd18..7f29770 100644
--- a/Lib/compiler/ast.py
+++ b/Lib/compiler/ast.py
@@ -2,6 +2,9 @@
This file is automatically generated.
"""
+# XXX performance issues:
+# 1. getChildren() could be more efficient for many cases
+
from types import TupleType, ListType
from consts import CO_VARARGS, CO_VARKEYWORDS
@@ -483,6 +486,15 @@ class Return(Node):
def __repr__(self):
return "Return(%s)" % (repr(self.value),)
+class Yield(Node):
+ nodes["yield"] = "Yield"
+ def __init__(self, value):
+ self.value = value
+ def _getChildren(self):
+ return self.value,
+ def __repr__(self):
+ return "Yield(%s)" % repr(self.value)
+
class Add(Node):
nodes["add"] = "Add"
def __init__(self, (left, right)):