This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/snippets/python/test_raw_fstring.txt
Matthäus G. Chajdas 147b22face Improve whitespace handling in Python.
This triggers a new case in the HtmlFormatter, which emits an empty span
at the end of the line for a new line, as those are removed by the
split-by-parts code. This requires separate post-processing.

Doesn't fix all whitespace issues with Python either, but we're done to
360 failing examples with that, from previously >400.
2022-12-11 12:52:23 +01:00

46 lines
1.2 KiB
Text

# Tests that the lexer can parse raw f-strings
---input---
rf"m_\nu = x"
f"m_\nu = {x}"
rf"m_{{\nu}} = {x}"
---tokens---
'rf' Literal.String.Affix
'"' Literal.String.Double
'm_' Literal.String.Double
'\\' Literal.String.Double
'nu = x' Literal.String.Double
'"' Literal.String.Double
'\n' Text.Whitespace
'\n' Text.Whitespace
'f' Literal.String.Affix
'"' Literal.String.Double
'm_' Literal.String.Double
'\\n' Literal.String.Escape
'u = ' Literal.String.Double
'{' Literal.String.Interpol
'x' Name
'}' Literal.String.Interpol
'"' Literal.String.Double
'\n' Text.Whitespace
'\n' Text.Whitespace
'rf' Literal.String.Affix
'"' Literal.String.Double
'm_' Literal.String.Double
'{{' Literal.String.Escape
'\\' Literal.String.Double
'nu' Literal.String.Double
'}}' Literal.String.Escape
' = ' Literal.String.Double
'{' Literal.String.Interpol
'x' Name
'}' Literal.String.Interpol
'"' Literal.String.Double
'\n' Text.Whitespace