[pypy-svn] r17292 - pypy/dist/pypy/interpreter/astcompiler

adim at codespeak.net adim at codespeak.net
Tue Sep 6 16:07:19 CEST 2005


Author: adim
Date: Tue Sep  6 16:07:13 2005
New Revision: 17292

Modified:
   pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
   pypy/dist/pypy/interpreter/astcompiler/visitor.py
Log:
small changes to let the annotation go a litlle bit further in astcompiler.



Modified: pypy/dist/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/pycodegen.py	Tue Sep  6 16:07:13 2005
@@ -397,9 +397,11 @@
             for name in frees:
                 self.emitop('LOAD_CLOSURE', name)
             self.emitop_obj('LOAD_CONST', gen)
+            # self.emitop_obj('LOAD_CONST', gen.getCode())
             self.emitop_int('MAKE_CLOSURE', len(node.defaults))
         else:
             self.emitop_obj('LOAD_CONST', gen)
+            # self.emitop_obj('LOAD_CONST', gen.getCode())
             self.emitop_int('MAKE_FUNCTION', len(node.defaults))
 
         for i in range(ndecorators):
@@ -419,6 +421,7 @@
         for name in frees:
             self.emitop('LOAD_CLOSURE', name)
         self.emitop_obj('LOAD_CONST', gen)
+        # self.emitop_obj('LOAD_CONST', gen.getCode())
         if frees:
             self.emitop_int('MAKE_CLOSURE', 0)
         else:
@@ -656,9 +659,11 @@
             for name in frees:
                 self.emitop('LOAD_CLOSURE', name)
             self.emitop_obj('LOAD_CONST', gen)
+            # self.emitop_obj('LOAD_CONST', gen.getCode())            
             self.emitop_int('MAKE_CLOSURE', 0)
         else:
             self.emitop_obj('LOAD_CONST', gen)
+            # self.emitop_obj('LOAD_CONST', gen.getCode())            
             self.emitop_int('MAKE_FUNCTION', 0)
 
         # precomputation of outmost iterable
@@ -1143,7 +1148,7 @@
     # object constructors
 
     def visitEllipsis(self, node):
-        self.emitop_obj('LOAD_CONST', self.space.wrap(Ellipsis) )
+        return self.emitop_obj('LOAD_CONST', self.space.w_Ellipsis)
 
     def visitTuple(self, node):
         self.set_lineno(node)
@@ -1371,7 +1376,8 @@
 def findOp(node):
     """Find the op (DELETE, LOAD, STORE) in an AssTuple tree"""
     v = OpFinder()
-    walk(node, v, verbose=0)
+    # walk(node, v, verbose=0)
+    node.accept(v)
     return v.op
 
 class OpFinder(ast.ASTVisitor):

Modified: pypy/dist/pypy/interpreter/astcompiler/visitor.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/visitor.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/visitor.py	Tue Sep  6 16:07:13 2005
@@ -106,8 +106,8 @@
     walker.preorder(tree, visitor)
     return walker.visitor
 
-def walk(tree, visitor, verbose=None):
-    tree.accept( visitor )
+def walk(tree, visitor, verbose=-1):
+    tree.accept(visitor)
     return visitor
 
 def dumpNode(node):



More information about the Pypy-commit mailing list