trailing comma after star parameter is a syntax error (PY-4039)

This commit is contained in:
Dmitry Jemerov
2011-11-25 19:45:00 +01:00
parent d12724b499
commit 805e6b5481
4 changed files with 59 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
def some_function(*args,): # <- missing highlighting here
pass
def some_function(**kwargs,): # <- missing highlighting here
pass
+42
View File
@@ -0,0 +1,42 @@
PyFile:CommaAfterStarArg.py
PyFunction('some_function')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('some_function')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('args')
PsiElement(Py:MULT)('*')
PsiElement(Py:IDENTIFIER)('args')
PsiElement(Py:COMMA)(',')
PsiErrorElement:expression expected
<empty list>
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace(' ')
PsiComment(Py:END_OF_LINE_COMMENT)('# <- missing highlighting here')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')
PsiWhiteSpace('\n\n')
PyFunction('some_function')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('some_function')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('kwargs')
PsiElement(Py:EXP)('**')
PsiElement(Py:IDENTIFIER)('kwargs')
PsiElement(Py:COMMA)(',')
PsiErrorElement:expression expected
<empty list>
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace(' ')
PsiComment(Py:END_OF_LINE_COMMENT)('# <- missing highlighting here')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')