[pypy-svn] r9568 - pypy/dist/pypy/translator

tismer at codespeak.net tismer at codespeak.net
Tue Mar 1 21:33:35 CET 2005


Author: tismer
Date: Tue Mar  1 21:33:34 2005
New Revision: 9568

Modified:
   pypy/dist/pypy/translator/geninterplevel.py
Log:
adjusting the classes a bit

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Tue Mar  1 21:33:34 2005
@@ -146,6 +146,9 @@
         self.latercode = u()   # list of generators generating extra lines
                                #   for later in initxxx() -- for recursive
                                #   objects
+        # this can stay empty, because we cannot have used a reserved
+        # name as a variable in the same language. But see genc.py
+        self.reserved_names = {}
         self.globaldecl = []
         self.globalobjects = []
         self.pendingfunctions = []
@@ -188,7 +191,7 @@
                     else:
                         fmt = "%s_%d"
                     # don't use zero
-                    if len(thesenames) == 0:
+                    if len(thesenames) == 0 and v.name not in self.reserved_names:
                         fmt = fmt[:-3]
                         thesenames[v.name] = ret = fmt % name
                     else:



More information about the Pypy-commit mailing list