[Python-checkins] r82837 - python/branches/py3k/Grammar/Grammar
mark.dickinson
python-checkins at python.org
Mon Jul 12 16:14:18 CEST 2010
Author: mark.dickinson
Date: Mon Jul 12 16:14:18 2010
New Revision: 82837
Log:
Issue #2009: refactor varargslist and typedargslist productions to make them more friendly for third-party parsers.
Modified:
python/branches/py3k/Grammar/Grammar
Modified: python/branches/py3k/Grammar/Grammar
==============================================================================
--- python/branches/py3k/Grammar/Grammar (original)
+++ python/branches/py3k/Grammar/Grammar Mon Jul 12 16:14:18 2010
@@ -24,13 +24,13 @@
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
More information about the Python-checkins
mailing list