[pypy-svn] r44446 - in pypy/dist/pypy/rlib/parsing: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Jun 22 22:46:17 CEST 2007


Author: cfbolz
Date: Fri Jun 22 22:46:16 2007
New Revision: 44446

Modified:
   pypy/dist/pypy/rlib/parsing/deterministic.py
   pypy/dist/pypy/rlib/parsing/ebnfparse.py
   pypy/dist/pypy/rlib/parsing/parsing.py
   pypy/dist/pypy/rlib/parsing/regex.py
   pypy/dist/pypy/rlib/parsing/regexparse.py
   pypy/dist/pypy/rlib/parsing/test/test_deterministic.py
   pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py
Log:
more 2.3 compat


Modified: pypy/dist/pypy/rlib/parsing/deterministic.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/deterministic.py	(original)
+++ pypy/dist/pypy/rlib/parsing/deterministic.py	Fri Jun 22 22:46:16 2007
@@ -3,7 +3,7 @@
 try:
     set
 except NameError:
-    from sets import Set as set, FrozenSet as frozenset
+    from sets import Set as set, ImmutableSet as frozenset
 
 def compress_char_set(chars):
     chars = list(chars)

Modified: pypy/dist/pypy/rlib/parsing/ebnfparse.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/ebnfparse.py	(original)
+++ pypy/dist/pypy/rlib/parsing/ebnfparse.py	Fri Jun 22 22:46:16 2007
@@ -8,6 +8,8 @@
 from pypy.rlib.parsing.lexer import Lexer, DummyLexer
 from pypy.rlib.objectmodel import we_are_translated
 
+set = py.builtin.set
+
 def make_ebnf_parser():
     NONTERMINALNAME = parse_regex("([a-z]|_)[a-z0-9_]*")
     SYMBOLNAME = parse_regex("_*[A-Z]([A-Z]|_)*")

Modified: pypy/dist/pypy/rlib/parsing/parsing.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/parsing.py	(original)
+++ pypy/dist/pypy/rlib/parsing/parsing.py	Fri Jun 22 22:46:16 2007
@@ -187,7 +187,7 @@
         """NOT_RPYTHON"""
         follows = {}
         for rule in self.rules:
-            follow = set()
+            follow = py.builtin.set()
             follows[rule.nonterminal] = follow
             for expansion in rule.expansions:
                 if expansion and self.is_nonterminal(expansion[0]):

Modified: pypy/dist/pypy/rlib/parsing/regex.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/regex.py	(original)
+++ pypy/dist/pypy/rlib/parsing/regex.py	Fri Jun 22 22:46:16 2007
@@ -1,6 +1,9 @@
+import py
 import string
 from pypy.rlib.parsing.deterministic import NFA
 
+set = py.builtin.set
+
 class RegularExpression(object):
     def __init__(self):
         raise NotImplementedError("abstract base class")

Modified: pypy/dist/pypy/rlib/parsing/regexparse.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/regexparse.py	(original)
+++ pypy/dist/pypy/rlib/parsing/regexparse.py	Fri Jun 22 22:46:16 2007
@@ -1,7 +1,3 @@
-
-
-
-
 import py
 from pypy.rlib.parsing.parsing import PackratParser, Rule
 from pypy.rlib.parsing.tree import Nonterminal
@@ -10,6 +6,8 @@
 from pypy.rlib.parsing.deterministic import compress_char_set, DFA
 import string
 
+set = py.builtin.set
+
 ESCAPES = {
     "\\a": "\a",
     "\\b": "\b",

Modified: pypy/dist/pypy/rlib/parsing/test/test_deterministic.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/test/test_deterministic.py	(original)
+++ pypy/dist/pypy/rlib/parsing/test/test_deterministic.py	Fri Jun 22 22:46:16 2007
@@ -1,5 +1,7 @@
 from pypy.rlib.parsing.deterministic import *
 
+from sets import Set
+
 def test_DFA_simple():
     a = DFA()
     s0 = a.add_state("start")

Modified: pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py	(original)
+++ pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py	Fri Jun 22 22:46:16 2007
@@ -4,6 +4,7 @@
 from pypy.rlib.parsing.ebnfparse import parse_ebnf, make_parse_function
 from pypy.rlib.parsing.test.test_parse import EvaluateVisitor
 
+from sets import Set
 
 def test_simple():
     regexs, rules, transformer = parse_ebnf("""



More information about the Pypy-commit mailing list