mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 09:12:22 +07:00
All the corresponding PSI elements now have empty interfaces. The API will be "beefed up" as we start adding actual processing of them in the code insight (e.g. for the upcoming CFG and inspections). The trickiest part of the parsing was the recovery. Patterns allow only a limited subset of expression syntax, but I tried to sensibly consume and report everything else (not building PSI for it). So that if user starts typing more general expressions in the midst of a pattern, we still give meaningful error messages. It seems a likely cause of errors when the feature first rolls out in Python 3.10. GitOrigin-RevId: fae40034964e4a25d91dab06a43d3fc07225d9c7
72 lines
2.4 KiB
Plaintext
72 lines
2.4 KiB
Plaintext
PyFile:PatternMatchingRecoveryIllegalExpressionInSequencePatternItem.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(' ')
|
|
PySequencePattern
|
|
PsiElement(Py:LPAR)('(')
|
|
PyLiteralPattern
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('1')
|
|
PsiElement(Py:COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PyLiteralPattern
|
|
PyBinaryExpression
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('2')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:PLUS)('+')
|
|
PsiErrorElement:Number expected
|
|
<empty list>
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Unexpected tokens
|
|
PsiElement(Py:LPAR)('(')
|
|
PsiElement(Py:INTEGER_LITERAL)('3')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:DIV)('/')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:INTEGER_LITERAL)('4')
|
|
PsiElement(Py:RPAR)(')')
|
|
PsiElement(Py:RPAR)(')')
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace('\n ')
|
|
PyStatementList
|
|
PyPassStatement
|
|
PsiElement(Py:PASS_KEYWORD)('pass')
|
|
PsiWhiteSpace('\n ')
|
|
PyCaseClause
|
|
PsiElement(Py:CASE_KEYWORD)('case')
|
|
PsiWhiteSpace(' ')
|
|
PySequencePattern
|
|
PsiElement(Py:LPAR)('(')
|
|
PyLiteralPattern
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('1')
|
|
PsiWhiteSpace(' ')
|
|
PsiErrorElement:Unexpected tokens
|
|
PsiElement(Py:LTLT)('<<')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:LPAR)('(')
|
|
PsiElement(Py:INTEGER_LITERAL)('2')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:DIV)('/')
|
|
PsiWhiteSpace(' ')
|
|
PsiElement(Py:INTEGER_LITERAL)('3')
|
|
PsiElement(Py:RPAR)(')')
|
|
PsiElement(Py:COMMA)(',')
|
|
PsiWhiteSpace(' ')
|
|
PyLiteralPattern
|
|
PyNumericLiteralExpression
|
|
PsiElement(Py:INTEGER_LITERAL)('4')
|
|
PsiElement(Py:RPAR)(')')
|
|
PsiElement(Py:COLON)(':')
|
|
PsiWhiteSpace('\n ')
|
|
PyStatementList
|
|
PyPassStatement
|
|
PsiElement(Py:PASS_KEYWORD)('pass') |