[pypy-svn] r13476 - pypy/branch/pycompiler/module/recparser
adim at codespeak.net
adim at codespeak.net
Thu Jun 16 14:10:50 CEST 2005
Author: adim
Date: Thu Jun 16 14:10:49 2005
New Revision: 13476
Modified:
pypy/branch/pycompiler/module/recparser/automata.py
Log:
We don't need DEFAULTClass. Using None for DEFAULT is sufficient, and
simplifies the annotator work.
Modified: pypy/branch/pycompiler/module/recparser/automata.py
==============================================================================
--- pypy/branch/pycompiler/module/recparser/automata.py (original)
+++ pypy/branch/pycompiler/module/recparser/automata.py Thu Jun 16 14:10:49 2005
@@ -14,21 +14,11 @@
# PYPY Modification: removed the EMPTY class as it's not needed here
-# PYPY Modification: Make the DEFAULTClasse inherit from str
-# to make the state dict homogeneous
-class DEFAULTClass(str):
- def __repr__ (self):
- return 'automata.DEFAULT'
-
- def __eq__(self, other):
- return False # Never equals other strings
-
- def __ne__(self, other):
- return True # Always different from other strings
-
-
-DEFAULT = DEFAULTClass()
-
+# PYPY Modification: we don't need a particuliar DEFAULT class here
+# a simple None works fine.
+# (Having a DefaultClass inheriting from str makes
+# the annotator crash)
+DEFAULT = None
# PYPY Modification : removed all automata functions (any, maybe,
# newArcPair, etc.)
@@ -69,6 +59,7 @@
return i - 1
else:
return -1
+
# ______________________________________________________________________
class NonGreedyDFA (DFA):
More information about the Pypy-commit
mailing list