tweak decorator parsing so that following line comment is outside the text range of PyDecorator (PY-5912)

This commit is contained in:
Dmitry Jemerov
2013-11-05 19:37:47 +01:00
parent a61112a8e8
commit f52709b867
6 changed files with 76 additions and 5 deletions
@@ -0,0 +1,3 @@
@uncallable_deco # some comment
def f():
pass
@@ -0,0 +1,23 @@
PyFile:CommentAfterDecorator.py
PyFunction('f')
PyDecoratorList
PyDecorator: @uncallable_deco
PsiElement(Py:AT)('@')
PyReferenceExpression: uncallable_deco
PsiElement(Py:IDENTIFIER)('uncallable_deco')
PyArgumentList
<empty list>
PsiWhiteSpace(' ')
PsiComment(Py:END_OF_LINE_COMMENT)('# some comment')
PsiWhiteSpace('\n')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('f')
PyParameterList
PsiElement(Py:LPAR)('(')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')