PY-15653 Do not consume open parenthesis after missing identifier in class and function headers

This commit is contained in:
Mikhail Golubev
2015-04-21 15:14:25 +03:00
parent c1ed100ca8
commit 6794f3299c
10 changed files with 67 additions and 5 deletions
@@ -0,0 +1,2 @@
class :
pass
@@ -0,0 +1,13 @@
PyFile:MissingClassNameAndThenColon.py
PyClass: null
PsiElement(Py:CLASS_KEYWORD)('class')
PsiErrorElement:Identifier expected
<empty list>
PsiWhiteSpace(' ')
PyArgumentList
<empty list>
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')
@@ -0,0 +1,2 @@
class ():
pass
@@ -0,0 +1,14 @@
PyFile:MissingClassNameAndThenListOfBaseClasses.py
PyClass: null
PsiElement(Py:CLASS_KEYWORD)('class')
PsiErrorElement:Identifier expected
<empty list>
PsiWhiteSpace(' ')
PyArgumentList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')
@@ -0,0 +1,2 @@
def ():
pass
@@ -0,0 +1,14 @@
PyFile:MissingFunctionNameAndThenParametersList.py
PyFunction('null')
PsiElement(Py:DEF_KEYWORD)('def')
PsiErrorElement:Identifier expected
<empty list>
PsiWhiteSpace(' ')
PyParameterList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')