Make a proper recovery for only error statements in a suite.

This commit is contained in:
Dave Halter
2017-07-18 17:53:04 +02:00
parent 6ee986aa45
commit 790bc459ed
7 changed files with 17 additions and 13 deletions

View File

@@ -83,10 +83,7 @@ with_stmt: 'with' with_item (',' with_item)* ':' suite
with_item: test ['as' expr]
# NB compile.c makes sure that the default except clause is last
except_clause: 'except' [test ['as' NAME]]
# Edit by Francisco Souza/David Halter: The stmt is now optional. This reflects
# how Jedi allows classes and functions to be empty, which is beneficial for
# autocompletion.
suite: simple_stmt | NEWLINE INDENT stmt* DEDENT
suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
test: or_test ['if' or_test 'else' test] | lambdef
test_nocond: or_test | lambdef_nocond