Fixed error recovery after empty blocks with no indent

This commit is contained in:
Andrey Vlasovskikh
2014-02-26 16:26:12 +04:00
parent 841e5c66d8
commit 09bd5b323a
4 changed files with 57 additions and 5 deletions
@@ -0,0 +1,6 @@
def foo(xs):
for x in xs:
def bar():
pass
@@ -0,0 +1,41 @@
PyFile:EmptyBlockInFunctionBeforeFunction.py
PyFunction('foo')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('foo')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('xs')
PsiElement(Py:IDENTIFIER)('xs')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyForStatement
PyForPart
PsiElement(Py:FOR_KEYWORD)('for')
PsiWhiteSpace(' ')
PyTargetExpression: x
PsiElement(Py:IDENTIFIER)('x')
PsiWhiteSpace(' ')
PsiElement(Py:IN_KEYWORD)('in')
PsiWhiteSpace(' ')
PyReferenceExpression: xs
PsiElement(Py:IDENTIFIER)('xs')
PsiElement(Py:COLON)(':')
PyStatementList
PsiErrorElement:Indent expected
<empty list>
PsiWhiteSpace('\n\n\n')
PyFunction('bar')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('bar')
PyParameterList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')