From 80f0ed5bb1b38a615d92bdf2b3b3dad854dd06d9 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 19 Aug 2008 19:52:46 +0000 Subject: allow keyword args to be passed in after *args #3473 --- Python/ast.c | 5 +++++ Python/graminit.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Python') diff --git a/Python/ast.c b/Python/ast.c index b6a5e0f546..8414c74480 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -1898,6 +1898,11 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func) "non-keyword arg after keyword arg"); return NULL; } + if (vararg) { + ast_error(CHILD(ch, 0), + "only named arguments may follow *expression"); + return NULL; + } e = ast_for_expr(c, CHILD(ch, 0)); if (!e) return NULL; diff --git a/Python/graminit.c b/Python/graminit.c index 14a41d1b2e..e65a992a64 100644 --- a/Python/graminit.c +++ b/Python/graminit.c @@ -1609,7 +1609,8 @@ static arc arcs_74_5[2] = { static arc arcs_74_6[1] = { {0, 6}, }; -static arc arcs_74_7[1] = { +static arc arcs_74_7[2] = { + {162, 5}, {31, 3}, }; static state states_74[8] = { @@ -1620,7 +1621,7 @@ static state states_74[8] = { {4, arcs_74_4}, {2, arcs_74_5}, {1, arcs_74_6}, - {1, arcs_74_7}, + {2, arcs_74_7}, }; static arc arcs_75_0[1] = { {28, 1}, -- cgit v1.2.1