mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-13 09:12:10 +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.
|
||
|---|---|---|
| .. | ||
| src | ||
| build.rs | ||
| Cargo.toml | ||