Mercurial > cpython-lru_cache-weakref
changeset 2800:ab3dca97ffbe legacy-trunk
new grammar for 3rd raise arg and keyword parameters
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 07 Jul 1995 22:26:23 +0000 |
| parents | 4a998b1a331f |
| children | e911f2fb179c |
| files | Grammar/Grammar |
| diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Grammar/Grammar Wed Jul 05 23:26:15 1995 +0000 +++ b/Grammar/Grammar Fri Jul 07 22:26:23 1995 +0000 @@ -23,7 +23,7 @@ funcdef: 'def' NAME parameters ':' suite parameters: '(' [varargslist] ')' -varargslist: (fpdef ['=' test] ',')* '*' NAME | fpdef ['=' test] (',' fpdef ['=' test])* [','] +varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '*' '*' NAME] | '*' '*' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] fpdef: NAME | '(' fplist ')' fplist: fpdef (',' fpdef)* [','] @@ -39,7 +39,7 @@ break_stmt: 'break' continue_stmt: 'continue' return_stmt: 'return' [testlist] -raise_stmt: 'raise' test [',' test] +raise_stmt: 'raise' test [',' test [',' test]] import_stmt: 'import' dotted_name (',' dotted_name)* | 'from' dotted_name 'import' ('*' | NAME (',' NAME)*) dotted_name: NAME ('.' NAME)* global_stmt: 'global' NAME (',' NAME)* @@ -73,10 +73,13 @@ factor: ('+'|'-'|'~') factor | atom trailer* atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+ lambdef: 'lambda' [varargslist] ':' test -trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME +trailer: '(' [arglist] ')' | '[' subscript ']' | '.' NAME subscript: test | [test] ':' [test] exprlist: expr (',' expr)* [','] testlist: test (',' test)* [','] dictmaker: test ':' test (',' test ':' test)* [','] classdef: 'class' NAME ['(' testlist ')'] ':' suite + +arglist: argument (',' argument)* [','] +argument: [test '='] test # Really [keyword '='] test
