mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-31442 In recovery phase of the parser treat FSTRING_END as STATEMENT_BREAK
This token shouldn't get under PsiError node and must be propagated further up to properly terminate containing f-string.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
s = f'{ (lambda x: 'foo') }'
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
PyFile:MultilineFStringTerminatedByQuotesInsideParenthesizedExpression.py
|
||||
PyAssignmentStatement
|
||||
PyTargetExpression: s
|
||||
PsiElement(Py:IDENTIFIER)('s')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
PyStringLiteralExpression: { (lambda x:
|
||||
PyFormattedStringNode
|
||||
PsiElement(Py:FSTRING_START)('f'')
|
||||
PyFStringFragment
|
||||
PsiElement(Py:FSTRING_FRAGMENT_START)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
PyParenthesizedExpression
|
||||
PsiElement(Py:LPAR)('(')
|
||||
PyLambdaExpression
|
||||
PsiElement(Py:LAMBDA_KEYWORD)('lambda')
|
||||
PsiWhiteSpace(' ')
|
||||
PyParameterList
|
||||
PyNamedParameter('x')
|
||||
PsiElement(Py:IDENTIFIER)('x')
|
||||
PsiElement(Py:COLON)(':')
|
||||
PsiErrorElement:expression expected
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(Py:FSTRING_END)(''')
|
||||
PsiErrorElement:End of statement expected
|
||||
<empty list>
|
||||
PyExpressionStatement
|
||||
PyReferenceExpression: foo
|
||||
PsiElement(Py:IDENTIFIER)('foo')
|
||||
PsiErrorElement:End of statement expected
|
||||
<empty list>
|
||||
PyExpressionStatement
|
||||
PyStringLiteralExpression: ) }
|
||||
PsiElement(Py:SINGLE_QUOTED_STRING)('') }'')
|
||||
Reference in New Issue
Block a user