mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed parsing decorated async functions and 'await' expressions inside them (PY-16094)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
@foo
|
||||
async def bar():
|
||||
await x
|
||||
return 0
|
||||
|
||||
|
||||
@baz(x, y)
|
||||
async def quux():
|
||||
return await x
|
||||
@@ -0,0 +1,69 @@
|
||||
PyFile:DecoratedAsyncDef.py
|
||||
PyFunction('bar')
|
||||
PyDecoratorList
|
||||
PyDecorator: @foo
|
||||
PsiElement(Py:AT)('@')
|
||||
PyReferenceExpression: foo
|
||||
PsiElement(Py:IDENTIFIER)('foo')
|
||||
PyArgumentList
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(Py:ASYNC_KEYWORD)('async')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('bar')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyExpressionStatement
|
||||
PyPrefixExpression
|
||||
PsiElement(Py:AWAIT_KEYWORD)('await')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: x
|
||||
PsiElement(Py:IDENTIFIER)('x')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyReturnStatement
|
||||
PsiElement(Py:RETURN_KEYWORD)('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PyNumericLiteralExpression
|
||||
PsiElement(Py:INTEGER_LITERAL)('0')
|
||||
PsiWhiteSpace('\n\n\n')
|
||||
PyFunction('quux')
|
||||
PyDecoratorList
|
||||
PyDecorator: @baz
|
||||
PsiElement(Py:AT)('@')
|
||||
PyReferenceExpression: baz
|
||||
PsiElement(Py:IDENTIFIER)('baz')
|
||||
PyArgumentList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PyReferenceExpression: x
|
||||
PsiElement(Py:IDENTIFIER)('x')
|
||||
PsiElement(Py:COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: y
|
||||
PsiElement(Py:IDENTIFIER)('y')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(Py:ASYNC_KEYWORD)('async')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:DEF_KEYWORD)('def')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:IDENTIFIER)('quux')
|
||||
PyParameterList
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PsiElement(Py:RPAR)(')')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiWhiteSpace('\n ')
|
||||
PyStatementList
|
||||
PyReturnStatement
|
||||
PsiElement(Py:RETURN_KEYWORD)('return')
|
||||
PsiWhiteSpace(' ')
|
||||
PyPrefixExpression
|
||||
PsiElement(Py:AWAIT_KEYWORD)('await')
|
||||
PsiWhiteSpace(' ')
|
||||
PyReferenceExpression: x
|
||||
PsiElement(Py:IDENTIFIER)('x')
|
||||
Reference in New Issue
Block a user