mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
only allow single expression after 'in'; tweak error recovery when waiting for colon (PY-9561)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
if "string" in "string", "string2":
|
||||
pass
|
||||
@@ -0,0 +1,22 @@
|
||||
PyFile:IfInList.py
|
||||
PyIfStatement
|
||||
PyIfPartIf
|
||||
PsiElement(Py:IF_KEYWORD)('if')
|
||||
PsiWhiteSpace(' ')
|
||||
PyBinaryExpression
|
||||
PyStringLiteralExpression: string
|
||||
PsiElement(Py:SINGLE_QUOTED_STRING)('"string"')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IN_KEYWORD)('in')
|
||||
PsiWhiteSpace(' ')
|
||||
PyStringLiteralExpression: string
|
||||
PsiElement(Py:SINGLE_QUOTED_STRING)('"string"')
|
||||
PsiErrorElement:Colon expected
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:SINGLE_QUOTED_STRING)('"string2"')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
@@ -73,13 +73,8 @@ PyFile:WithStatement2.py
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PsiErrorElement:Colon expected
|
||||
<empty list>
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:INTEGER_LITERAL)('1')
|
||||
PyStatementList
|
||||
<empty list>
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiErrorElement:Statement expected, found Py:EQ
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PyExpressionStatement
|
||||
PyNumericLiteralExpression
|
||||
PsiElement(Py:INTEGER_LITERAL)('1')
|
||||
<empty list>
|
||||
Reference in New Issue
Block a user