[pypy-svn] rev 1450 - pypy/trunk/src/pypy/translator

tomek at codespeak.net tomek at codespeak.net
Mon Sep 29 18:40:50 CEST 2003


Author: tomek
Date: Mon Sep 29 18:40:49 2003
New Revision: 1450

Modified:
   pypy/trunk/src/pypy/translator/genpyrex.py
Log:
small typos fixed


Modified: pypy/trunk/src/pypy/translator/genpyrex.py
==============================================================================
--- pypy/trunk/src/pypy/translator/genpyrex.py	(original)
+++ pypy/trunk/src/pypy/translator/genpyrex.py	Mon Sep 29 18:40:49 2003
@@ -2,7 +2,7 @@
 import autopath
 from pypy.tool import test
 from pypy.interpreter.baseobjspace import ObjSpace
-from pypy.translater.controlflow import *
+from pypy.translator.controlflow import *
 
 class GenPyrex:
     def __init__(self, functiongraph):
@@ -37,8 +37,10 @@
     def _str(self, obj):
         if isinstance(obj, Variable):
             return obj.pseudoname
-        else:
+        elif isinstance(obj, Constant):
             return repr(obj.value)
+        else:
+            raise ValueError("Unknow class: %s" % obj.__class__)
 
     def createCodeFromBasicBlock(self, block):
         if self.blockids.has_key(block):
@@ -56,9 +58,9 @@
             argsnames = [self._str(arg) for arg in args]
             if arity == 1 or arity == 3 or "a" <= opsymbol[0] <= "z":
                 
-                self.putline("%s = %s(%s)" % (result.pseudoname, opsymbol, ", ".join([argnames]))
+                self.putline("%s = %s(%s)" % (result.pseudoname, opsymbol, ", ".join([argnames])))
             else:
-                self.putline("%s = %s %s %s") % (result.pseudoname, argnames[0], opsymbol, argnames[1]))
+                self.putline("%s = %s %s %s" % (result.pseudoname, argnames[0], opsymbol, argnames[1]))
 
         self.dispatchBranch(block.branch)
 
@@ -73,7 +75,7 @@
         targetargs = [arg.pseudoname for arg in block.input_args]
         assert(len(sourceargs) == len(targetargs))
         if sourceargs: 
-            self.putline("%s = %s" % (", ".join(targetargs), ", ".join(sourceargs))
+            self.putline("%s = %s" % (", ".join(targetargs), ", ".join(sourceargs)))
 
         self.createCodeFromBasicBlock(block)    
 


More information about the Pypy-commit mailing list