summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-12 14:14:18 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-12 14:14:18 (GMT)
commit1c50d117084feff310a901763c112d6d9e2df2bd (patch)
treeb1f6d3b66f7a56506dc66233a0bc6fc02e690dfb /Grammar
parentcf48e4413030b1e22562216687d7800aba098e09 (diff)
downloadcpython-1c50d117084feff310a901763c112d6d9e2df2bd.zip
cpython-1c50d117084feff310a901763c112d6d9e2df2bd.tar.gz
cpython-1c50d117084feff310a901763c112d6d9e2df2bd.tar.bz2
Issue #2009: refactor varargslist and typedargslist productions to make them more friendly for third-party parsers.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar12
1 files changed, 6 insertions, 6 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 7d63e23..89f4c36 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -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