From 2d3b986480f5a01329cc66b2bdf50fdb94e1c1e4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 24 May 2002 15:47:06 +0000 Subject: 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. --- Python/compile.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index 03f8e3cd516..d41867f7cf8 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; -- cgit v1.2.3