[pypy-svn] r29856 - pypy/dist/pypy/translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Sat Jul 8 18:43:06 CEST 2006


Author: antocuni
Date: Sat Jul  8 18:43:02 2006
New Revision: 29856

Modified:
   pypy/dist/pypy/translator/cli/database.py
   pypy/dist/pypy/translator/cli/gencli.py
Log:
More general way to handle constants.



Modified: pypy/dist/pypy/translator/cli/database.py
==============================================================================
--- pypy/dist/pypy/translator/cli/database.py	(original)
+++ pypy/dist/pypy/translator/cli/database.py	Sat Jul  8 18:43:02 2006
@@ -109,9 +109,8 @@
                                  runtime=True)
             ilasm.end_function()
             ilasm.end_class()
-            
-    
-    def gen_constants(self, ilasm):
+
+    def collect_constants(self):
         # traverse the forest of the constants to collect all the constants needed
         while self.pending_consts:
             pending_consts = self.pending_consts
@@ -120,7 +119,7 @@
             for const in pending_consts.itervalues():
                 const.dependencies()
 
-        # render the class holding all the constants
+    def gen_constants(self, ilasm):
         ilasm.begin_namespace(CONST_NAMESPACE)
         ilasm.begin_class(CONST_CLASS)
 

Modified: pypy/dist/pypy/translator/cli/gencli.py
==============================================================================
--- pypy/dist/pypy/translator/cli/gencli.py	(original)
+++ pypy/dist/pypy/translator/cli/gencli.py	Sat Jul  8 18:43:02 2006
@@ -60,9 +60,11 @@
         self.fix_names()
         self.gen_entrypoint()
         self.gen_pendings()
-        self.db.gen_constants(self.ilasm)
+        self.db.collect_constants()
         self.db.gen_delegate_types(self.ilasm)
         self.gen_pendings()
+        self.db.collect_constants()
+        self.db.gen_constants(self.ilasm)
         out.close()
         return self.tmpfile.strpath
 



More information about the Pypy-commit mailing list