mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
tweak parsing of incomplete statements (PY-3792)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
def foo():
|
||||
for item in ba
|
||||
|
||||
def bar():
|
||||
pass
|
||||
@@ -0,0 +1,37 @@
|
||||
PyFile:IncompleteFor.py
|
||||
PyFunction('foo')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('foo')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyForStatement
|
||||
PyForPart
|
||||
PsiElement(Py:FOR_KEYWORD)('for')
|
||||
PsiWhiteSpace(' ')
|
||||
PyTargetExpression: item
|
||||
PsiElement(Py:IDENTIFIER)('item')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IN_KEYWORD)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: ba
|
||||
PsiElement(Py:IDENTIFIER)('ba')
|
||||
PsiErrorElement:colon expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n')
|
||||
PyFunction('bar')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('bar')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
@@ -0,0 +1,5 @@
|
||||
def foo():
|
||||
if ba
|
||||
|
||||
def bar():
|
||||
pass
|
||||
@@ -0,0 +1,32 @@
|
||||
PyFile:IncompleteStatementList.py
|
||||
PyFunction('foo')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('foo')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyIfStatement
|
||||
PyIfPartIf
|
||||
PsiElement(Py:IF_KEYWORD)('if')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: ba
|
||||
PsiElement(Py:IDENTIFIER)('ba')
|
||||
PsiErrorElement:colon expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n')
|
||||
PyFunction('bar')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('bar')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
@@ -26,6 +26,8 @@ PyFile:MissingParenInCall.py
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PsiErrorElement:colon expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n\n')
|
||||
PyFunction('clean')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
|
||||
@@ -72,10 +72,11 @@ PyFile:WithStatement2.py
|
||||
PyWithItem
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PyStatementList
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiErrorElement:statement expected, found Py:EQ
|
||||
<empty list>
|
||||
PsiErrorElement:colon expected
|
||||
<empty list>
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiErrorElement:statement expected, found Py:EQ
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PyExpressionStatement
|
||||
PyNumericLiteralExpression
|
||||
|
||||
Reference in New Issue
Block a user