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 named parameter (PY-8318)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
def f(from=1, another_one=2):
|
||||
pass
|
||||
@@ -0,0 +1,24 @@
|
||||
PyFile:KeywordAsNamedParameter.py
|
||||
PyFunction('f')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('f')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiErrorElement:formal parameter name expected
|
||||
PsiElement(Py:FROM_KEYWORD)('from')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiElement(Py:INTEGER_LITERAL)('1')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyNamedParameter('another_one')
|
||||
PsiElement(Py:IDENTIFIER)('another_one')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PyNumericLiteralExpression
|
||||
PsiElement(Py:INTEGER_LITERAL)('2')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyPassStatement
|
||||
PsiElement(Py:PASS_KEYWORD)('pass')
|
||||
Reference in New Issue
Block a user