[Python-checkins] CVS: python/dist/src/Tools/compiler/compiler ast.py,1.13,1.14

Jeremy Hylton jhylton@users.sourceforge.net
2001年8月17日 17:07:17 -0700


Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv3924
Modified Files:
	ast.py 
Log Message:
Add Yield() node
Index: ast.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/ast.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ast.py	2001年08月14日 21:18:30	1.13
--- ast.py	2001年08月18日 00:07:14	1.14
***************
*** 3,6 ****
--- 3,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,486 ****
--- 486,498 ----
 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):

AltStyle によって変換されたページ (->オリジナル) /