fixed PY-11476 No error given for mismatched accolade and squarebracket

This commit is contained in:
Ekaterina Tuzova
2013-11-25 19:39:35 +04:00
parent 10eaf8a9ac
commit 18db741b06
7 changed files with 56 additions and 2 deletions
@@ -0,0 +1,3 @@
a = {
'b': 'c',
]
@@ -0,0 +1,24 @@
PyFile:NotClosedBraceDict.py
PyAssignmentStatement
PyTargetExpression: a
PsiElement(Py:IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PyDictLiteralExpression
PsiElement(Py:LBRACE)('{')
PsiWhiteSpace('\n ')
PyKeyValueExpression
PyStringLiteralExpression: b
PsiElement(Py:SINGLE_QUOTED_STRING)(''b'')
PsiElement(Py:COLON)(':')
PsiWhiteSpace(' ')
PyStringLiteralExpression: c
PsiElement(Py:SINGLE_QUOTED_STRING)(''c'')
PsiElement(Py:COMMA)(',')
PsiErrorElement:'}' expected
<empty list>
PsiWhiteSpace('\n ')
PsiElement(Py:RBRACKET)(']')
PsiErrorElement:Statement expected, found Py:RBRACKET
<empty list>
+1
View File
@@ -0,0 +1 @@
a = {'b',]
+17
View File
@@ -0,0 +1,17 @@
PyFile:NotClosedBraceSet.py
PyAssignmentStatement
PyTargetExpression: a
PsiElement(Py:IDENTIFIER)('a')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PySetLiteralExpression
PsiElement(Py:LBRACE)('{')
PyStringLiteralExpression: b
PsiElement(Py:SINGLE_QUOTED_STRING)(''b'')
PsiElement(Py:COMMA)(',')
PsiErrorElement:'}' expected
<empty list>
PsiElement(Py:RBRACKET)(']')
PsiErrorElement:Statement expected, found Py:RBRACKET
<empty list>