Commit ecffe6f6 authored by Robert Bradshaw's avatar Robert Bradshaw

Add typed and optional arguments to the grammar.

parent bd2f4649
......@@ -26,8 +26,9 @@ funcdef: 'def' NAME parameters ':' suite
parameters: '(' [varargslist] ')'
varargslist: ((fpdef ['=' test] ',')*
('*' NAME [',' '**' NAME] | '**' NAME) |
fpdef ['=' test] (',' fpdef ['=' test])* [','])
fpdef: NAME | '(' fplist ')'
fpdef ['=' (test | '*')] (',' fpdef ['=' (test | '*')])* [',']
['.' '.' '.'])
fpdef: maybe_typed_name | '(' fplist ')'
fplist: fpdef (',' fpdef)* [',']
stmt: simple_stmt | compound_stmt | cdef_stmt | ctypedef_stmt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment