diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-18 00:07:14 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-08-18 00:07:14 (GMT) |
commit | 8548f9b1831b995e8b499015ffae87920dd8b8ae (patch) | |
tree | 92280939195bf8a2dc620257c96f44888320ce8c /Tools | |
parent | 4fd9e2fc134a8a95fa9ef29e39572f82f3b5240e (diff) | |
download | cpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.zip cpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.tar.gz cpython-8548f9b1831b995e8b499015ffae87920dd8b8ae.tar.bz2 |
Add Yield() node
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/compiler/compiler/ast.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Tools/compiler/compiler/ast.py b/Tools/compiler/compiler/ast.py index 4b6fd18..7f29770 100644 --- a/Tools/compiler/compiler/ast.py +++ b/Tools/compiler/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)): |