Fix f-string boundaries and add more tests

This commit is contained in:
nfnty
2020-12-02 18:12:54 +00:00
parent e82ed75da5
commit 082a78ac7d
2 changed files with 5 additions and 2 deletions

View File

@@ -244,8 +244,11 @@ b"${test} ${test ${test}aname $$$ $test+nope"
f"{var}...{arr[123]} normal {var['{'] // 0xff} \"xzcb\" 'xzcb' {var['}'] + 1} text"
f"{expr1 if True or False else expr2} {None} wow {','.join(c.lower() for c in 'asdf')}"
f"hello {expr:.2f} yes {(lambda: 0b1)():#03x} lol {var!r}"
f'brackets: {{ 1 + 2 }} and {{{{ 3 + 4 }}}}'
f'brackets: {{{ 1 + 2 }}} and {{{{ 3 + 4 }}}}'
fr'this {that}'
f"{f'{1+1}'}"
'{{ }}'
f"{"{test}"}" # FIXME: syntax error that should not be highlighted
# Doctests.