[Python-checkins] r45286 - in python/trunk: Lib/test/test_grammar.py Python/graminit.c

thomas.wouters python-checkins at python.org
Wed Apr 12 02:07:59 CEST 2006


Author: thomas.wouters
Date: Wed Apr 12 02:07:59 2006
New Revision: 45286

Modified:
   python/trunk/Lib/test/test_grammar.py
   python/trunk/Python/graminit.c
Log:

Part two of the fix for SF bug #1466641: Regenerate graminit.c and add test
for the bogus failure.



Modified: python/trunk/Lib/test/test_grammar.py
==============================================================================
--- python/trunk/Lib/test/test_grammar.py	(original)
+++ python/trunk/Lib/test/test_grammar.py	Wed Apr 12 02:07:59 2006
@@ -815,6 +815,11 @@
 x = 5; t = True;
 verify([(i,j) for i in range(10) for j in range(5)] == list(g))
 
+# Grammar allows multiple adjacent 'if's in listcomps and genexps,
+# even though it's silly. Make sure it works (ifelse broke this.)
+verify([ x for x in range(10) if x % 2 if x % 3 ], [1, 5, 7])
+verify((x for x in range(10) if x % 2 if x % 3), [1, 5, 7])
+
 # Test ifelse expressions in various cases
 def _checkeval(msg, ret):
     "helper to check that evaluation of expressions is done correctly"

Modified: python/trunk/Python/graminit.c
==============================================================================
--- python/trunk/Python/graminit.c	(original)
+++ python/trunk/Python/graminit.c	Wed Apr 12 02:07:59 2006
@@ -1678,7 +1678,7 @@
 	{91, 1},
 };
 static arc arcs_77_1[1] = {
-	{26, 2},
+	{105, 2},
 };
 static arc arcs_77_2[2] = {
 	{162, 3},
@@ -1735,7 +1735,7 @@
 	{91, 1},
 };
 static arc arcs_80_1[1] = {
-	{26, 2},
+	{105, 2},
 };
 static arc arcs_80_2[2] = {
 	{164, 3},


More information about the Python-checkins mailing list