don't parse compound statements after semicolon at top level of file (PY-7660)

This commit is contained in:
Dmitry Jemerov
2012-12-13 22:03:07 +01:00
parent 2b9d27582e
commit 59d5c27308
6 changed files with 55 additions and 3 deletions
@@ -0,0 +1,2 @@
a = 0; if a:
pass
@@ -0,0 +1,28 @@
PyFile:CompoundStatementAfterSemicolon.py
PyAssignmentStatement
PyTargetExpression: a
PsiElement(Py:IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PyNumericLiteralExpression
PsiElement(Py:INTEGER_LITERAL)('0')
PsiElement(Py:SEMICOLON)(';')
PsiWhiteSpace(' ')
PsiElement(Py:IF_KEYWORD)('if')
PsiErrorElement:Statement expected, found Py:IF_KEYWORD
<empty list>
PsiWhiteSpace(' ')
PyExpressionStatement
PyReferenceExpression: a
PsiElement(Py:IDENTIFIER)('a')
PsiErrorElement:End of statement expected
<empty list>
PsiElement(Py:COLON)(':')
PsiErrorElement:Statement expected, found Py:COLON
<empty list>
PsiWhiteSpace('\n ')
PsiErrorElement:Unexpected indent
<empty list>
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')