From 9772d64360bc0f24785655a7d28e600efc8a5eea Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 12 Jul 2017 09:09:01 +0200 Subject: [PATCH] Remove strange features in grammar27 that are not part of the official grammar. --- parso/python/grammar27.txt | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/parso/python/grammar27.txt b/parso/python/grammar27.txt index 515dea6..8101078 100644 --- a/parso/python/grammar27.txt +++ b/parso/python/grammar27.txt @@ -24,19 +24,12 @@ decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE decorators: decorator+ decorated: decorators (classdef | funcdef) funcdef: 'def' NAME parameters ['->' test] ':' suite -parameters: '(' [typedargslist] ')' -typedargslist: ((tfpdef ['=' test] ',')* - ('*' [tname] (',' tname ['=' test])* [',' '**' tname] | '**' tname) - | tfpdef ['=' test] (',' tfpdef ['=' test])* [',']) -tname: NAME [':' test] -tfpdef: tname | '(' tfplist ')' -tfplist: tfpdef (',' tfpdef)* [','] -varargslist: ((vfpdef ['=' test] ',')* - ('*' [vname] (',' vname ['=' test])* [',' '**' vname] | '**' vname) - | vfpdef ['=' test] (',' vfpdef ['=' test])* [',']) -vname: NAME -vfpdef: vname | '(' vfplist ')' -vfplist: vfpdef (',' vfpdef)* [','] +parameters: '(' [varargslist] ')' +varargslist: ((fpdef ['=' test] ',')* + ('*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME) + | fpdef ['=' test] (',' fpdef ['=' test])* [',']) +fpdef: NAME | '(' fplist ')' +fplist: fpdef (',' fpdef)* [','] stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE