parsing and PSI for Python 2.5 'with' keyword

This commit is contained in:
Dmitry Jemerov
2008-02-03 20:03:59 +03:00
parent 942eff8eb0
commit d2b1054283
2 changed files with 31 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
from __future__ import with_statement
with x as y:
pass
+28
View File
@@ -0,0 +1,28 @@
PyFile:WithStatement.py
PyFromImportStatement
PsiElement(Py:FROM_KEYWORD)('from')
PsiWhiteSpace(' ')
PyReferenceExpression: __future__
PsiElement(Py:IDENTIFIER)('__future__')
PsiWhiteSpace(' ')
PsiElement(Py:IMPORT_KEYWORD)('import')
PsiWhiteSpace(' ')
PyImportElement
PyReferenceExpression: with_statement
PsiElement(Py:IDENTIFIER)('with_statement')
PsiWhiteSpace('\n')
PyWithStatement
PsiElement(Py:WITH_KEYWORD)('with')
PsiWhiteSpace(' ')
PyReferenceExpression: x
PsiElement(Py:IDENTIFIER)('x')
PsiWhiteSpace(' ')
PsiElement(Py:AS_KEYWORD)('as')
PsiWhiteSpace(' ')
PyReferenceExpression: y
PsiElement(Py:IDENTIFIER)('y')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')