py/lexer: Fix parsing of f'{{'.

Prior to this fix, f'{{' would raise a SyntaxError.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2026-03-04 22:43:23 +11:00
parent b343a3697c
commit 58436b2882
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,8 @@ print(f"a{ {0,1,2}}")
# PEP-0498 specifies that handling of double braces '{{' or '}}' should
# behave like str.format.
print(f'{{')
print(f'}}')
print(f'{{}}')
print(f'{{{4*10}}}', '{40}')