Files
openide/python/testData/psi/PatternMatchingRecoveryNoPatternAfterCaseInIntermediateCaseClause.txt
Mikhail Golubev 20097f7a69 PY-49785 Properly recover from "case" keyword in the middle of a match statement
Not stopping at a statement break token and continuing recovery until a colon,
we considered the subsequent well-formed case clause to be a part of an error
message about a missing pattern, thus, moving the caret to its colon.

GitOrigin-RevId: f4ee0e12876960e989de3dee89925b65e3cf2339
2021-07-19 16:29:15 +00:00

41 lines
1.3 KiB
Plaintext

PyFile:PatternMatchingRecoveryNoPatternAfterCaseInIntermediateCaseClause.py
PyMatchStatement
PsiElement(Py:MATCH_KEYWORD)('match')
PsiWhiteSpace(' ')
PyReferenceExpression: x
PsiElement(Py:IDENTIFIER)('x')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyCaseClause
PsiElement(Py:CASE_KEYWORD)('case')
PsiWhiteSpace(' ')
PyLiteralPattern
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')
PsiWhiteSpace('\n ')
PyCaseClause
PsiElement(Py:CASE_KEYWORD)('case')
PsiErrorElement:Pattern expected
<empty list>
PsiErrorElement:':' expected
<empty list>
PsiWhiteSpace('\n ')
PyStatementList
PsiErrorElement:Indent expected
<empty list>
PyCaseClause
PsiElement(Py:CASE_KEYWORD)('case')
PsiWhiteSpace(' ')
PyLiteralPattern
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList
PyPassStatement
PsiElement(Py:PASS_KEYWORD)('pass')