diff Python/compile.c @ 23538:9e67a0d5705f legacy-trunk

Disambiguate the grammar for backtick. The old syntax suggested that a trailing comma was OK inside backticks, but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar to avoid the ambiguity. Fred: you may want to update the refman.
author Guido van Rossum <guido@python.org>
date Fri, 24 May 2002 15:47:06 +0000
parents 9e22a8702de2
children c4fa37f89783
line wrap: on
line diff
--- a/Python/compile.c	Fri May 24 15:24:38 2002 +0000
+++ b/Python/compile.c	Fri May 24 15:47:06 2002 +0000
@@ -2474,6 +2474,7 @@
 		
 		case exprlist:
 		case testlist:
+		case testlist1:
 			if (NCH(n) > 1) {
 				if (assigning > OP_APPLY) {
 					com_error(c, PyExc_SyntaxError,
@@ -2955,6 +2956,7 @@
 
 	case expr_stmt:
 	case testlist:
+	case testlist1:
 	case test:
 	case and_test:
 	case not_test:
@@ -3356,6 +3358,7 @@
 
 	case expr_stmt:
 	case testlist:
+	case testlist1:
 	case test:
 	case and_test:
 	case not_test:
@@ -3704,6 +3707,7 @@
 	/* Expression nodes */
 	
 	case testlist:
+	case testlist1:
 	case testlist_safe:
 		com_list(c, n, 0);
 		break;
@@ -5447,6 +5451,7 @@
 		return;
 	case exprlist:
 	case testlist:
+	case testlist1:
 		if (NCH(n) == 1) {
 			n = CHILD(n, 0);
 			goto loop;