PY-31442 Fix detection of terminating quotes inside triple-quoted f-strings

This commit is contained in:
Mikhail Golubev
2018-10-01 12:46:47 +03:00
parent dff836aa29
commit 16dea81d1a
5 changed files with 283 additions and 255 deletions
@@ -0,0 +1,3 @@
s = f'''{
''''''
}'''
@@ -0,0 +1,20 @@
PyFile:MultilineFStringTerminatedByQuotesOfStringLiteral.py
PyAssignmentStatement
PyTargetExpression: s
PsiElement(Py:IDENTIFIER)('s')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PyStringLiteralExpression: {
}
PyFormattedStringNode
PsiElement(Py:FSTRING_START)('f'''')
PyFStringFragment
PsiElement(Py:FSTRING_FRAGMENT_START)('{')
PsiErrorElement:expression expected
PsiWhiteSpace('\n ')
PsiErrorElement:} expected
<empty list>
PsiElement(Py:FSTRING_END)(''''')
PsiElement(Py:TRIPLE_QUOTED_STRING)(''''\n}'''')