mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py/lexer: Support concatenation of adjacent f-strings.
This is quite a simple and small change to support concatenation of adjacent f-strings, and improve compatibility with CPython. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -65,3 +65,13 @@ print(f"{a!s:8s}")
|
||||
# Still allow ! in expressions.
|
||||
print(f"{'1' if a != '456' else '0'!r:8s}")
|
||||
print(f"{'1' if a != '456' else '0'!s:8s}")
|
||||
|
||||
# Concatenation of adjacent f-strings.
|
||||
print(f"" f"")
|
||||
print(f"a" f"b")
|
||||
print(f"{x}" f"{y}")
|
||||
print(
|
||||
f"a{x}b---------------------------------"
|
||||
f"cd---------------------------------"
|
||||
f"e{y}f---------------------------------"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user