parse ellipsis only in the context where it can actually be used (PY-7763)

This commit is contained in:
Dmitry Jemerov
2012-12-13 22:03:08 +01:00
parent 59d5c27308
commit f51943380f
4 changed files with 61 additions and 11 deletions
@@ -0,0 +1,5 @@
def a():
... # <- highlighted as "Statement seems to have no effect"
pass
a()
@@ -0,0 +1,33 @@
PyFile:EllipsisAsStatement.py
PyFunction('a')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('a')
PyParameterList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PsiElement(Py:DOT)('.')
PsiErrorElement:Statement expected, found Py:DOT
<empty list>
PsiElement(Py:DOT)('.')
PsiErrorElement:Statement expected, found Py:DOT
<empty list>
PsiElement(Py:DOT)('.')
PsiErrorElement:Statement expected, found Py:DOT
<empty list>
PsiWhiteSpace(' ')
PsiComment(Py:END_OF_LINE_COMMENT)('# <- highlighted as "Statement seems to have no effect"')
PsiWhiteSpace('\n ')
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')
PsiWhiteSpace('\n\n')
PyExpressionStatement
PyCallExpression: a
PyReferenceExpression: a
PsiElement(Py:IDENTIFIER)('a')
PyArgumentList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')