summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-23 15:01:05 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-02-23 15:01:05 (GMT)
commit5224d28d38eb784f17c2fed3f48368285df6d17a (patch)
treeb258202efc39ae5239d91dcf5b1898c6ce713f16 /Grammar
parentb12f0b581a6f268d0611c87012d1273aeca220b8 (diff)
downloadcpython-5224d28d38eb784f17c2fed3f48368285df6d17a.zip
cpython-5224d28d38eb784f17c2fed3f48368285df6d17a.tar.gz
cpython-5224d28d38eb784f17c2fed3f48368285df6d17a.tar.bz2
Patch #1759: Backport of PEP 3129 class decorators
with some help from Georg
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar5
1 files changed, 3 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index cdfce69..b014c72 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -33,7 +33,8 @@ eval_input: testlist NEWLINE* ENDMARKER
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
decorators: decorator+
-funcdef: [decorators] 'def' NAME parameters ':' suite
+decorated: decorators (classdef | funcdef)
+funcdef: 'def' NAME parameters ':' suite
parameters: '(' [varargslist] ')'
varargslist: ((fpdef ['=' test] ',')*
('*' NAME [',' '**' NAME] | '**' NAME) |
@@ -73,7 +74,7 @@ global_stmt: 'global' NAME (',' NAME)*
exec_stmt: 'exec' expr ['in' test [',' test]]
assert_stmt: 'assert' test [',' test]
-compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef
+compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated
if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
while_stmt: 'while' test ':' suite ['else' ':' suite]
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]