f-strings: expressions in curly braces

Create issue
Issue #1524 new
Udi Oron created an issue

f-strings highlighting does not currently display expressions in curly braces correctly:

s1 = "{1} {1+1} {a} {a*b}"
s2 = f"{1} {1+1} {a} {a*b}"

See: http://pygments.org/demo/6837038/

For s1 (regular string literal) {1} and {a} should be in a different color.

For s2 all four curly bracket expressions should be colored.

This is somewhat tricky, as the following expressions are allowed:

f"{'}' * 10}"

However, if the expression inside the curly brackets can be completely syntax highlighted as well, as any python expression, this will be amazing!

Comments (0)

  1. Log in to comment