[pypy-svn] r13192 - pypy/branch/pycompiler/module/recparser

adim at codespeak.net adim at codespeak.net
Wed Jun 8 18:50:19 CEST 2005


Author: adim
Date: Wed Jun  8 18:50:18 2005
New Revision: 13192

Modified:
   pypy/branch/pycompiler/module/recparser/pythonparse.py
   pypy/branch/pycompiler/module/recparser/syntaxtree.py
Log:
- cosemtic changes in syntaxtree
- import Source rather than PythonSource in pythonparse



Modified: pypy/branch/pycompiler/module/recparser/pythonparse.py
==============================================================================
--- pypy/branch/pycompiler/module/recparser/pythonparse.py	(original)
+++ pypy/branch/pycompiler/module/recparser/pythonparse.py	Wed Jun  8 18:50:18 2005
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-from pythonlexer import PythonSource
+from pythonlexer import Source
 from ebnfparse import parse_grammar
 import sys
 import os
@@ -26,7 +26,7 @@
 def parse_python_source( textsrc, gram, goal, builder=None ):
     """Parse a python source according to goal"""
     target = gram.rules[goal]
-    src = PythonSource(textsrc)
+    src = Source(textsrc)
     if builder is None:
         builder = grammar.BaseGrammarBuilder(debug=False, rules=gram.rules)
     result = target.match(src, builder)

Modified: pypy/branch/pycompiler/module/recparser/syntaxtree.py
==============================================================================
--- pypy/branch/pycompiler/module/recparser/syntaxtree.py	(original)
+++ pypy/branch/pycompiler/module/recparser/syntaxtree.py	Wed Jun  8 18:50:18 2005
@@ -102,6 +102,7 @@
         return "(%s)"  % self.name
 
     def visit(self, visitor):
+        """NOT RPYTHON, used only at bootstrap time anyway"""
         visit_meth = getattr(visitor, "visit_%s" % self.name, None)
         if visit_meth:
             return visit_meth(self)
@@ -114,7 +115,7 @@
         return [ self ]
 
     def totuple(self, lineno=False ):
-        symvalue = SYMBOLS.get( self.name, (0,self.name) )
+        symvalue = SYMBOLS.get( self.name, (0, self.name) )
         l = [ symvalue ]
         l += [node.totuple(lineno) for node in self.nodes]
         return tuple(l)



More information about the Pypy-commit mailing list