ruff/crates/ruff_python_parser/src
Charlie Marsh f0d43dafcf
Ignore trailing quotes for unclosed l-brace errors (#9388)
## Summary

Given:

```python
F"{"ڤ
```

We try to locate the "unclosed left brace" error by subtracting the
quote size from the lexer offset -- so we subtract 1 from the end of the
source, which puts us in the middle of a Unicode character. I don't
think we should try to adjust the offset in this way, since there can be
content _after_ the quote. For example, with the advent of PEP 701, this
string could reasonably be fixed as:

```python
F"{"ڤ"}"
````

Closes https://github.com/astral-sh/ruff/issues/9379.
2024-01-04 05:00:55 +00:00
..
lexer Ignore trailing quotes for unclosed l-brace errors (#9388) 2024-01-04 05:00:55 +00:00
snapshots New AST nodes for f-string elements (#8835) 2023-12-07 10:28:05 -06:00
context.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
function.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
invalid.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
lexer.rs Ignore trailing quotes for unclosed l-brace errors (#9388) 2024-01-04 05:00:55 +00:00
lib.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
parser.rs Add row and column numbers to formatted parse errors (#9321) 2023-12-31 07:10:45 -05:00
python.lalrpop New AST nodes for f-string elements (#8835) 2023-12-07 10:28:05 -06:00
python.rs New AST nodes for f-string elements (#8835) 2023-12-07 10:28:05 -06:00
soft_keywords.rs Support type alias statements in simple statement positions (#8916) 2023-11-30 19:15:19 +00:00
string.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
token.rs Add support for PEP 701 (#7376) 2023-09-29 02:55:39 +00:00
typing.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00