better parser error recovery for keyword as default argument value (PY-3713)

This commit is contained in:
Dmitry Jemerov
2011-06-28 21:26:20 +02:00
parent 10c5c2a792
commit eaffdced8e
5 changed files with 41 additions and 1 deletions
@@ -0,0 +1,2 @@
def select2(self, fields=from):
pass
@@ -0,0 +1,22 @@
PyFile:KeywordAsDefaultParameterValue.py
PyFunction('select2')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('select2')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('self')
PsiElement(Py:IDENTIFIER)('self')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace(' ')
PyNamedParameter('fields')
PsiElement(Py:IDENTIFIER)('fields')
PsiElement(Py:EQ)('=')
PsiErrorElement:expression expected
PsiElement(Py:FROM_KEYWORD)('from')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')