Skip to content

Commit 1da31d7

Browse files
committed
Fix argumentlist parsing
1 parent 9ad6324 commit 1da31d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

parser/grammar.y

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,13 @@ dictorsetmaker: test_colon_tests optional_comma
284284

285285
classdef: CLASS NAME optional_arglist_call ':' suite
286286

287-
comma_arguments: | comma_arguments ',' argument
288-
arglist: comma_arguments argument optional_comma
289-
| comma_arguments '*' test comma_arguments
290-
| comma_arguments '*' test comma_arguments ',' STARSTAR test
291-
| comma_arguments STARSTAR test
287+
arguments: argument | arguments ',' argument
288+
optional_arguments: | arguments ','
289+
arguments2: | arguments2 ',' argument
290+
arglist: arguments optional_comma
291+
| optional_arguments '*' test arguments2
292+
| optional_arguments '*' test arguments2 ',' STARSTAR test
293+
| optional_arguments STARSTAR test
292294
// The reason that keywords are test nodes instead of NAME is that using NAME
293295
// results in an ambiguity. ast.c makes sure it's a NAME.
294296
argument: test

0 commit comments

Comments
 (0)