[Python-checkins] CVS: python/dist/src/Lib/compiler ast.py,1.19.8.1,1.19.8.2 pycodegen.py,1.58.4.1,1.58.4.2 transformer.py,1.30,1.30.8.1

Jeremy Hylton jhylton@users.sourceforge.net
Fri, 21 Dec 2001 08:11:35 -0800


Update of /cvsroot/python/python/dist/src/Lib/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv12110

Modified Files:
      Tag: release22-branch
	ast.py pycodegen.py transformer.py 
Log Message:
Make the child of Expression 'node' rather than 'expr'.

Move creation of Expression() node into Transformer.eval_input().


Index: ast.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/compiler/ast.py,v
retrieving revision 1.19.8.1
retrieving revision 1.19.8.2
diff -C2 -d -r1.19.8.1 -r1.19.8.2
*** ast.py	2001/12/21 14:41:02	1.19.8.1
--- ast.py	2001/12/21 16:11:33	1.19.8.2
***************
*** 286,300 ****
      # Expression is an artifical node class to support "eval"
      nodes["expression"] = "Expression"
!     def __init__(self, expr):
!         self.expr = expr
  
      def getChildren(self):
!         return self.expr,
  
      def getChildNodes(self):
!         return self.expr,
  
      def __repr__(self):
!         return "Expression(%s)" % (repr(self.expr))
  
  class UnaryAdd(Node):
--- 286,300 ----
      # Expression is an artifical node class to support "eval"
      nodes["expression"] = "Expression"
!     def __init__(self, node):
!         self.node = node
  
      def getChildren(self):
!         return self.node,
  
      def getChildNodes(self):
!         return self.node,
  
      def __repr__(self):
!         return "Expression(%s)" % (repr(self.node))
  
  class UnaryAdd(Node):

Index: pycodegen.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v
retrieving revision 1.58.4.1
retrieving revision 1.58.4.2
diff -C2 -d -r1.58.4.1 -r1.58.4.2
*** pycodegen.py	2001/12/21 14:41:02	1.58.4.1
--- pycodegen.py	2001/12/21 16:11:33	1.58.4.2
***************
*** 357,361 ****
          self.scopes = self.parseSymbols(node)
          self.scope = self.scopes[node]
!         self.visit(node.expr)
          self.emit('RETURN_VALUE')
  
--- 357,361 ----
          self.scopes = self.parseSymbols(node)
          self.scope = self.scopes[node]
!         self.visit(node.node)
          self.emit('RETURN_VALUE')
  
***************
*** 1167,1171 ****
          self.graph = pyassem.PyFlowGraph("<expression>", tree.filename)
          self.__super_init()
!         walk(ast.Expression(tree), self)
  
      def get_module(self):
--- 1167,1171 ----
          self.graph = pyassem.PyFlowGraph("<expression>", tree.filename)
          self.__super_init()
!         walk(tree, self)
  
      def get_module(self):

Index: transformer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/compiler/transformer.py,v
retrieving revision 1.30
retrieving revision 1.30.8.1
diff -C2 -d -r1.30 -r1.30.8.1
*** transformer.py	2001/10/18 21:57:37	1.30
--- transformer.py	2001/12/21 16:11:33	1.30.8.1
***************
*** 173,177 ****
          # from the built-in function input()
          ### is this sufficient?
!         return self.com_node(nodelist[0])
  
      def funcdef(self, nodelist):
--- 173,177 ----
          # from the built-in function input()
          ### is this sufficient?
!         return Expression(self.com_node(nodelist[0]))
  
      def funcdef(self, nodelist):