Support 'yield from' syntax (PY-6702)

This commit is contained in:
Andrey Vlasovskikh
2012-06-05 15:41:35 +04:00
parent 56a0c67e4a
commit b9939f1601
9 changed files with 67 additions and 3 deletions
+2
View File
@@ -0,0 +1,2 @@
def f(g):
yield from g()
+25
View File
@@ -0,0 +1,25 @@
PyFile:YieldFrom.py
PyFunction('f')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('f')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('g')
PsiElement(Py:IDENTIFIER)('g')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyExpressionStatement
PyYieldExpression
PsiElement(Py:YIELD_KEYWORD)('yield')
PsiWhiteSpace(' ')
PsiElement(Py:FROM_KEYWORD)('from')
PsiWhiteSpace(' ')
PyCallExpression: g
PyReferenceExpression: g
PsiElement(Py:IDENTIFIER)('g')
PyArgumentList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')