better recovery for syntax errors in parameter list (PY-3635); fix old bug with tuple parameters parsing

This commit is contained in:
Dmitry Jemerov
2011-05-24 17:13:23 +04:00
parent 79c0c49857
commit 8a97673aeb
5 changed files with 53 additions and 6 deletions
@@ -0,0 +1,2 @@
def select2 (self,filds=None, from=''):
print (sql)
@@ -0,0 +1,34 @@
PyFile:ErrorInParameterList.py
PyFunction('select2')
PsiElement(Py:DEF_KEYWORD)('def')
PsiWhiteSpace(' ')
PsiElement(Py:IDENTIFIER)('select2')
PsiWhiteSpace(' ')
PyParameterList
PsiElement(Py:LPAR)('(')
PyNamedParameter('self')
PsiElement(Py:IDENTIFIER)('self')
PsiElement(Py:COMMA)(',')
PyNamedParameter('filds')
PsiElement(Py:IDENTIFIER)('filds')
PsiElement(Py:EQ)('=')
PyReferenceExpression: None
PsiElement(Py:IDENTIFIER)('None')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace(' ')
PsiErrorElement:formal parameter name expected
PsiElement(Py:FROM_KEYWORD)('from')
PsiElement(Py:EQ)('=')
PsiElement(Py:STRING_LITERAL)('''')
PsiElement(Py:RPAR)(')')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPrintStatement
PsiElement(Py:PRINT_KEYWORD)('print')
PsiWhiteSpace(' ')
PyParenthesizedExpression
PsiElement(Py:LPAR)('(')
PyReferenceExpression: sql
PsiElement(Py:IDENTIFIER)('sql')
PsiElement(Py:RPAR)(')')