summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-12-17 21:33:47 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2005-12-17 21:33:47 +0000
commitf599f424a2c8cfc490111a11203c93d23706379f (patch)
tree972d455572879ef5b9b3979d16fb4dab0f44d9b4 /Grammar
parentadb69fcdffdc50ee3e1d33b00cd874020197b445 (diff)
downloadcpython-git-f599f424a2c8cfc490111a11203c93d23706379f.tar.gz
SF patch #1355913, PEP 341 - Unification of try/except and try/finally
Modified since ast-arenas was implemented.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar3
1 files changed, 1 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index d8106e9719..0239413dae 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -67,8 +67,7 @@ compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
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]
-try_stmt: ('try' ':' suite (except_clause ':' suite)+ #diagram:break
- ['else' ':' suite] | 'try' ':' suite 'finally' ':' suite)
+try_stmt: 'try' ':' suite ((except_clause ':' suite)+ ['else' ':' suite] ['finally' ':' suite] | 'finally' ':' suite)
# NB compile.c makes sure that the default except clause is last
except_clause: 'except' [test [',' test]]
suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT