mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tweak Python parser to handle incomplete code better (PY-4053)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
def get_key():
|
||||
if isinstance(self.instance,
|
||||
|
||||
def clean():
|
||||
pass
|
||||
@@ -0,0 +1,41 @@
|
||||
PyFile:MissingParenInCall.py
|
||||
PyFunction('get_key')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('get_key')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyIfStatement
|
||||
PyIfPartIf
|
||||
PsiElement(Py:IF_KEYWORD)('if')
|
||||
PsiWhiteSpace(' ')
|
||||
PyCallExpression: isinstance
|
||||
PyReferenceExpression: isinstance
|
||||
PsiElement(Py:IDENTIFIER)('isinstance')
|
||||
PyArgumentList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PyReferenceExpression: instance
|
||||
PyReferenceExpression: self
|
||||
PsiElement(Py:IDENTIFIER)('self')
|
||||
PsiElement(Py:DOT)('.')
|
||||
PsiElement(Py:IDENTIFIER)('instance')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n')
|
||||
PyFunction('clean')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('clean')
|
||||
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