summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-05-24 15:47:06 (GMT)
committerGuido van Rossum <guido@python.org>2002-05-24 15:47:06 (GMT)
commit2d3b986480f5a01329cc66b2bdf50fdb94e1c1e4 (patch)
treedf063351c064542b1694701577ad4e14dd5e00a5 /Python/compile.c
parenta0a6c5a042818461fa199c8a3daefb7fd00ffe1b (diff)
downloadcpython-2d3b986480f5a01329cc66b2bdf50fdb94e1c1e4.zip
cpython-2d3b986480f5a01329cc66b2bdf50fdb94e1c1e4.tar.gz
cpython-2d3b986480f5a01329cc66b2bdf50fdb94e1c1e4.tar.bz2
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 03f8e3c..d41867f 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2474,6 +2474,7 @@ com_assign(struct compiling *c, node *n, int assigning, node *augn)
case exprlist:
case testlist:
+ case testlist1:
if (NCH(n) > 1) {
if (assigning > OP_APPLY) {
com_error(c, PyExc_SyntaxError,
@@ -2955,6 +2956,7 @@ is_constant_false(struct compiling *c, node *n)
case expr_stmt:
case testlist:
+ case testlist1:
case test:
case and_test:
case not_test:
@@ -3356,6 +3358,7 @@ get_rawdocstring(node *n)
case expr_stmt:
case testlist:
+ case testlist1:
case test:
case and_test:
case not_test:
@@ -3704,6 +3707,7 @@ com_node(struct compiling *c, node *n)
/* Expression nodes */
case testlist:
+ case testlist1:
case testlist_safe:
com_list(c, n, 0);
break;
@@ -5447,6 +5451,7 @@ symtable_assign(struct symtable *st, node *n, int def_flag)
return;
case exprlist:
case testlist:
+ case testlist1:
if (NCH(n) == 1) {
n = CHILD(n, 0);
goto loop;