]> granicus.if.org Git - python/commitdiff
Issue #2009: refactor varargslist and typedargslist productions to make them more...
authorMark Dickinson <dickinsm@gmail.com>
Mon, 12 Jul 2010 14:14:18 +0000 (14:14 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Mon, 12 Jul 2010 14:14:18 +0000 (14:14 +0000)
Grammar/Grammar

index 7d63e23135d601a713ba0486bcc87aceb67c743b..89f4c3614ed8d7d9d810a4682f0060c970462a81 100644 (file)
@@ -24,13 +24,13 @@ decorators: decorator+
 decorated: decorators (classdef | funcdef)
 funcdef: 'def' NAME parameters ['->' test] ':' suite
 parameters: '(' [typedargslist] ')'
-typedargslist: ((tfpdef ['=' test] ',')*
-                ('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
-                | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
+typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
+       ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
+     |  '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
 tfpdef: NAME [':' test]
-varargslist: ((vfpdef ['=' test] ',')*
-              ('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
-              | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
+varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
+       ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
+     |  '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
 vfpdef: NAME
 
 stmt: simple_stmt | compound_stmt