mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
improve parser recovery if keyword is used as function or class name (PY-8319)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
class from:
|
||||
pass
|
||||
@@ -0,0 +1,13 @@
|
||||
PyFile:KeywordAsClassName.py
|
||||
PyClass: null
|
||||
PsiElement(Py:CLASS_KEYWORD)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Identifier expected
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PyArgumentList
|
||||
<empty list>
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
@@ -0,0 +1,2 @@
|
||||
def from():
|
||||
pass
|
||||
@@ -0,0 +1,14 @@
|
||||
PyFile:KeywordAsFunctionName.py
|
||||
PyFunction('null')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:function name expected
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
Reference in New Issue
Block a user