mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:28 +00:00
![]() ## Summary This PR updates the parser definition to use the precise location when reporting an invalid f-string conversion flag error. Taking the following example code: ```python f"{foo!x}" ``` On earlier version, ``` Error: f-string: invalid conversion character at byte offset 6 ``` Now, ``` Error: f-string: invalid conversion character at byte offset 7 ``` This becomes more useful when there's whitespace between `!` and the flag value although that is not valid but we can't detect that now. ## Test Plan As mentioned above. |
||
---|---|---|
.. | ||
lexer | ||
snapshots | ||
context.rs | ||
function.rs | ||
lexer.rs | ||
lib.rs | ||
parser.rs | ||
python.lalrpop | ||
python.rs | ||
soft_keywords.rs | ||
string.rs | ||
token.rs | ||
typing.rs |