From 0e66e143fdb6b019d2cc8334cf7c5fb4a1f042ea Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Thu, 29 Dec 2022 02:16:44 +0800 Subject: [PATCH] added check: named arguments must follow bare star --- compiler/parser/python.lalrpop | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/parser/python.lalrpop b/compiler/parser/python.lalrpop index 70ad18f7b..7683b606c 100644 --- a/compiler/parser/python.lalrpop +++ b/compiler/parser/python.lalrpop @@ -667,7 +667,7 @@ TypedParameter: ast::Arg = { // TODO: figure out another grammar that makes this inline no longer required. #[inline] ParameterListStarArgs: (Option>, Vec, Vec, Option>) = { - "*" )*> )?> => { + "*" )*> )?> =>? { // Extract keyword arguments: let mut kwonlyargs = Vec::new(); let mut kw_defaults = Vec::new(); @@ -685,7 +685,14 @@ ParameterListStarArgs: (Option>, Vec, Vec