[pypy-svn] r54605 - pypy/branch/gc-tweak/pypy/interpreter/pyparser

arigo at codespeak.net arigo at codespeak.net
Fri May 9 19:07:11 CEST 2008


Author: arigo
Date: Fri May  9 19:07:10 2008
New Revision: 54605

Modified:
   pypy/branch/gc-tweak/pypy/interpreter/pyparser/grammar.py
Log:
Merge r54604 from the trunk.


Modified: pypy/branch/gc-tweak/pypy/interpreter/pyparser/grammar.py
==============================================================================
--- pypy/branch/gc-tweak/pypy/interpreter/pyparser/grammar.py	(original)
+++ pypy/branch/gc-tweak/pypy/interpreter/pyparser/grammar.py	Fri May  9 19:07:10 2008
@@ -370,8 +370,13 @@
             return True        # not computed yet
         cache = cachelist[other.isKeyword]
         values = cache.get(other.codename, GrammarElement._EMPTY_VALUES_SET)
-        return (values is None or       # 'None' means 'matches anything'
-                other.value in values)  # otherwise, ok only if in the set
+        if values is None:
+            return True          # 'None' means 'matches anything'
+        elif other.value is None:
+            return False         # because tk.value != None (for all tk)
+        else:
+            return other.value in values  # otherwise, ok only if in the set
+            # XXX "None in dict" crashes after translation - needs to be fixed
 
     def reorder_rule(self):
         """Called after the computation of first set to allow rules to be



More information about the Pypy-commit mailing list