ParserSyntaxError for "unmatched ']'" faults wrong location
Open
enhancement
parsing
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
I suspect this is an upstream issue, but documenting the repro so we can know if it gets fixed:
```
"""docstring"""
import a
import b
def foo(data: str) -> tuple[str, ...], frozenset[str]]:
pass
```
(note too many close brackets at the end of the def line)
```
libcst._exceptions.ParserSyntaxError: Syntax Error @ 1:1.
tokenizer error: unmatched ']'
"""docstring"""
^
```
faults the first line of the file, when there is clearly one specific byte that can be faulted -- the extra close bracket.
Contributor guide
Assessment
This issue has not been assessed yet.