[pypy-svn] r14204 - pypy/dist/pypy/interpreter

adim at codespeak.net adim at codespeak.net
Mon Jul 4 13:03:55 CEST 2005


Author: adim
Date: Mon Jul  4 13:03:54 2005
New Revision: 14204

Modified:
   pypy/dist/pypy/interpreter/pycompiler.py
Log:
- instantiate the transformer here rather than in pypparser because here,
  we know which compiler package should be used

- removed unused imports


Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Mon Jul  4 13:03:54 2005
@@ -173,10 +173,11 @@
 from compiler.pycodegen import ModuleCodeGenerator
 from compiler.pycodegen import InteractiveCodeGenerator
 from compiler.pycodegen import ExpressionCodeGenerator
-from pyparser.pythonparse import parse_python_source, PYTHON_PARSER
-from pyparser.tuplebuilder import TupleBuilder
+from compiler.transformer import Transformer
 from pyparser.pythonutil import ast_from_input
 import compiler
+# XXX compatibility
+# compiler = stablecompiler
 
 class PythonCompiler(CPythonCompiler):
     """Uses the stdlib's python implementation of compiler
@@ -190,7 +191,8 @@
         flags |= __future__.generators.compiler_flag   # always on (2.2 compat)
         space = self.space
         try:
-            tree = ast_from_input(source, mode)
+            transformer = Transformer()
+            tree = ast_from_input(source, mode, transformer)
             compiler.misc.set_filename(filename, tree)
             if mode == 'exec':
                 codegenerator = ModuleCodeGenerator(tree)



More information about the Pypy-commit mailing list