[pypy-svn] rev 1473 - in pypy/trunk/src/pypy: objspace/flow objspace/flow/test translator

arigo at codespeak.net arigo at codespeak.net
Tue Sep 30 17:41:50 CEST 2003


Author: arigo
Date: Tue Sep 30 17:41:49 2003
New Revision: 1473

Modified:
   pypy/trunk/src/pypy/objspace/flow/flowcontext.py
   pypy/trunk/src/pypy/objspace/flow/objspace.py
   pypy/trunk/src/pypy/objspace/flow/test/test_objspace.py
   pypy/trunk/src/pypy/objspace/flow/wrapper.py
   pypy/trunk/src/pypy/translator/controlflow.py
Log:
It really works!


Modified: pypy/trunk/src/pypy/objspace/flow/flowcontext.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/flowcontext.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/flowcontext.py	Tue Sep 30 17:41:49 2003
@@ -82,6 +82,7 @@
         
     def append(self, operation):
         assert operation == self.listtoreplay[self.index]
+        operation.result = self.listtoreplay[self.index].result
         self.index += 1
 
     def finished(self):

Modified: pypy/trunk/src/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/objspace.py	Tue Sep 30 17:41:49 2003
@@ -23,9 +23,9 @@
         # XXX Issue a delayed command to create a tuple and assign to a new W_Variable
         return W_Variable()
 
-    def getattr(self, w_obj, w_key):
-        # XXX Issue a delayed command
-        return W_Variable()
+    #def getattr(self, w_obj, w_key):
+    #    # XXX Issue a delayed command
+    #    return W_Variable()
 
     def wrap(self, obj):
         if isinstance(obj, W_Object):
@@ -127,10 +127,9 @@
             else:
                 return self.wrap(result)
 
-        w_result = W_Variable()
-        spaceop = SpaceOperation(name, args_w, w_result)
+        spaceop = SpaceOperation(name, args_w, W_Variable())
         self.executioncontext.crnt_ops.append(spaceop)
-        return w_result
+        return spaceop.result
 
     setattr(FlowObjSpace, name, generic_operator)
 

Modified: pypy/trunk/src/pypy/objspace/flow/test/test_objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/test/test_objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/test/test_objspace.py	Tue Sep 30 17:41:49 2003
@@ -27,6 +27,7 @@
                           "        return i\n"
                           "    return j\n",
                           'f')
+        import pdb; pdb.set_trace()
 
     def test_ifthenelse(self):
         x = self.codetest("def g(i):\n"

Modified: pypy/trunk/src/pypy/objspace/flow/wrapper.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/flow/wrapper.py	(original)
+++ pypy/trunk/src/pypy/objspace/flow/wrapper.py	Tue Sep 30 17:41:49 2003
@@ -52,6 +52,9 @@
         Variable.__init__(self, 'v%d' % W_Variable.counter)
         W_Variable.counter += 1
 
+    def argsrepr(self):
+        return self.pseudoname
+
 # ______________________________________________________________________
 
 class W_Constant(W_Object, Constant):

Modified: pypy/trunk/src/pypy/translator/controlflow.py
==============================================================================
--- pypy/trunk/src/pypy/translator/controlflow.py	(original)
+++ pypy/trunk/src/pypy/translator/controlflow.py	Tue Sep 30 17:41:49 2003
@@ -30,6 +30,9 @@
                 self.opname == other.opname and
                 self.args == other.args and
                 self.result == other.result)
+    def __repr__(self):
+        return '<%s = %s(%s)>' % (self.result, self.opname,
+                                  ', '.join([repr(a) for a in self.args]))
 
 class Branch:
     def __init__(self, args=None, target=None):


More information about the Pypy-commit mailing list