mirror of
https://github.com/davidhalter/parso.git
synced 2026-02-15 22:52:04 +08:00
Remove strange features in grammar27 that are not part of the official grammar.
This commit is contained in:
@@ -24,19 +24,12 @@ decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
|
|||||||
decorators: decorator+
|
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: '(' [varargslist] ')'
|
||||||
typedargslist: ((tfpdef ['=' test] ',')*
|
varargslist: ((fpdef ['=' test] ',')*
|
||||||
('*' [tname] (',' tname ['=' test])* [',' '**' tname] | '**' tname)
|
('*' [NAME] (',' NAME ['=' test])* [',' '**' NAME] | '**' NAME)
|
||||||
| tfpdef ['=' test] (',' tfpdef ['=' test])* [','])
|
| fpdef ['=' test] (',' fpdef ['=' test])* [','])
|
||||||
tname: NAME [':' test]
|
fpdef: NAME | '(' fplist ')'
|
||||||
tfpdef: tname | '(' tfplist ')'
|
fplist: fpdef (',' fpdef)* [',']
|
||||||
tfplist: tfpdef (',' tfpdef)* [',']
|
|
||||||
varargslist: ((vfpdef ['=' test] ',')*
|
|
||||||
('*' [vname] (',' vname ['=' test])* [',' '**' vname] | '**' vname)
|
|
||||||
| vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
|
|
||||||
vname: NAME
|
|
||||||
vfpdef: vname | '(' vfplist ')'
|
|
||||||
vfplist: vfpdef (',' vfpdef)* [',']
|
|
||||||
|
|
||||||
stmt: simple_stmt | compound_stmt
|
stmt: simple_stmt | compound_stmt
|
||||||
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
|
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
|
||||||
|
|||||||
Reference in New Issue
Block a user