[pypy-svn] r23927 - in pypy/dist/pypy: interpreter/pyparser module/recparser

ale at codespeak.net ale at codespeak.net
Thu Mar 2 19:26:37 CET 2006


Author: ale
Date: Thu Mar  2 19:26:33 2006
New Revision: 23927

Modified:
   pypy/dist/pypy/interpreter/pyparser/pythonparse.py
   pypy/dist/pypy/module/recparser/pyparser.py
Log:
(arre, ale, stuart)

Some changes to make the parser/compiler translatable again.

There are more needed though.


Modified: pypy/dist/pypy/interpreter/pyparser/pythonparse.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonparse.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonparse.py	Thu Mar  2 19:26:33 2006
@@ -59,7 +59,8 @@
         goalnumber = self.symbols.sym_values[goal]
         target = self.rules[goalnumber]
         src = Source(lines, flags)
-
+        
+        result = None
         try:
             result = target.match(src, builder)
         except AlternateGrammarException: # handle from __future__ import with_statement

Modified: pypy/dist/pypy/module/recparser/pyparser.py
==============================================================================
--- pypy/dist/pypy/module/recparser/pyparser.py	(original)
+++ pypy/dist/pypy/module/recparser/pyparser.py	Thu Mar  2 19:26:33 2006
@@ -10,7 +10,7 @@
 from pypy.interpreter.pyparser.syntaxtree import TokenNode, SyntaxNode, AbstractSyntaxVisitor
 from pypy.interpreter.pyparser.pythonutil import PYTHON_PARSER
 from pypy.interpreter.pyparser.error import SyntaxError
-from pypy.interpreter.pyparser import grammar, pysymbol, pytoken
+from pypy.interpreter.pyparser import grammar, symbol, pytoken
 from pypy.interpreter.argument import Arguments
 
 
@@ -94,14 +94,14 @@
         Returns true if the root node in the syntax tree is an expr node,
         false otherwise.
         """
-        return self.node.name == pysymbol.eval_input
+        return self.node.name == symbol.eval_input
 
     def issuite(self):
         """STType.issuite()
         Returns true if the root node in the syntax tree is a suite node,
         false otherwise.
         """
-        return self.node.name == pysymbol.file_input
+        return self.node.name == symbol.file_input
 
     def descr_compile(self, w_filename = "<syntax_tree>"):
         """STType.compile()
@@ -226,8 +226,8 @@
 
 def descr_grammarelement_repr( self, space ):
     """TODO: make __repr__ RPython"""
-    import pysymbol
-    return space.wrap( self.display(0, pysymbol.sym_name) )
+    import symbol
+    return space.wrap( self.display(0, symbol.sym_name) )
 
 def descr_grammarelement_get_children( self, space ):
     return space.newlist( [ space.wrap(it) for it in self.args ] )



More information about the Pypy-commit mailing list