PY-31442 Add a test on parsing of empty f-strings

This commit is contained in:
Mikhail Golubev
2018-10-01 12:46:43 +03:00
parent f8986ccb61
commit 3767218928
3 changed files with 44 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
s = (f'',
F"",
rf"""""",
FR'''''',
)
+35
View File
@@ -0,0 +1,35 @@
PyFile:EmptyFStrings.py
PyAssignmentStatement
PyTargetExpression: s
PsiElement(Py:IDENTIFIER)('s')
PsiWhiteSpace(' ')
PsiElement(Py:EQ)('=')
PsiWhiteSpace(' ')
PyParenthesizedExpression
PsiElement(Py:LPAR)('(')
PyTupleExpression
PyStringLiteralExpression:
PyFormattedStringNode
PsiElement(Py:FSTRING_START)('f'')
PsiElement(Py:FSTRING_END)(''')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace('\n ')
PyStringLiteralExpression:
PyFormattedStringNode
PsiElement(Py:FSTRING_START)('F"')
PsiElement(Py:FSTRING_END)('"')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace('\n ')
PyStringLiteralExpression:
PyFormattedStringNode
PsiElement(Py:FSTRING_START)('rf"""')
PsiElement(Py:FSTRING_END)('"""')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace('\n ')
PyStringLiteralExpression:
PyFormattedStringNode
PsiElement(Py:FSTRING_START)('FR'''')
PsiElement(Py:FSTRING_END)(''''')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace('\n ')
PsiElement(Py:RPAR)(')')