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

Jeremy Hylton jhylton@users.sourceforge.net
Fri, 17 Aug 2001 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):