Parse and highlight the 'await' keyword (PY-16094)

This commit is contained in:
Andrey Vlasovskikh
2015-09-08 14:21:52 +03:00
parent 4439b41170
commit c855959143
11 changed files with 90 additions and 15 deletions
+5
View File
@@ -0,0 +1,5 @@
async def f(x):
await x
await = 1
+30
View File
@@ -0,0 +1,30 @@
PyFile:Await.py
PyFunction('f')
PsiElement(Py:ASYNC_KEYWORD)('async')
PsiWhiteSpace(' ')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('f')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('x')
PsiElement(Py:IDENTIFIER)('x')
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\n\n')
PyAssignmentStatement
PyTargetExpression: await
PsiElement(Py:IDENTIFIER)('await')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PyNumericLiteralExpression
PsiElement(Py:INTEGER_LITERAL)('1')