Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c50d11

Browse files
committed
Issue #2009: refactor varargslist and typedargslist productions to make them more friendly for third-party parsers.
1 parent cf48e44 commit 1c50d11

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Grammar/Grammar

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ decorators: decorator+
2424
decorated: decorators (classdef | funcdef)
2525
funcdef: 'def' NAME parameters ['->' test] ':' suite
2626
parameters: '(' [typedargslist] ')'
27-
typedargslist: ((tfpdef ['=' test] ',')*
28-
('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
29-
| tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
27+
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
28+
['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
29+
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
3030
tfpdef: NAME [':' test]
31-
varargslist: ((vfpdef ['=' test] ',')*
32-
('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
33-
| vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
31+
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
32+
['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
33+
| '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
3434
vfpdef: NAME
3535

3636
stmt: simple_stmt | compound_stmt

0 commit comments

Comments
 (0)