Issue #2009: refactor varargslist and typedargslist productions to make them more friendly for third-party parsers.
This commit is contained in:
parent
cf48e44130
commit
1c50d11708
|
@ -24,13 +24,13 @@ decorators: decorator+
|
||||||
decorated: decorators (classdef | funcdef)
|
decorated: decorators (classdef | funcdef)
|
||||||
funcdef: 'def' NAME parameters ['->' test] ':' suite
|
funcdef: 'def' NAME parameters ['->' test] ':' suite
|
||||||
parameters: '(' [typedargslist] ')'
|
parameters: '(' [typedargslist] ')'
|
||||||
typedargslist: ((tfpdef ['=' test] ',')*
|
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
|
||||||
('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
|
['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
|
||||||
| tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
|
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
|
||||||
tfpdef: NAME [':' test]
|
tfpdef: NAME [':' test]
|
||||||
varargslist: ((vfpdef ['=' test] ',')*
|
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
|
||||||
('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
|
['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
|
||||||
| vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
|
| '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
|
||||||
vfpdef: NAME
|
vfpdef: NAME
|
||||||
|
|
||||||
stmt: simple_stmt | compound_stmt
|
stmt: simple_stmt | compound_stmt
|
||||||
|
|
Loading…
Reference in New Issue