Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParserSyntaxError for "unmatched ']'" faults wrong location #1112

Open
thatch opened this issue Feb 27, 2024 · 1 comment
Open

ParserSyntaxError for "unmatched ']'" faults wrong location #1112

thatch opened this issue Feb 27, 2024 · 1 comment
Labels
enhancement New feature or request parsing Converting source code into CST nodes

Comments

@thatch
Copy link
Contributor

thatch commented Feb 27, 2024

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.

@zsol zsol added enhancement New feature or request parsing Converting source code into CST nodes labels May 15, 2024
@thatch
Copy link
Contributor Author

thatch commented Nov 8, 2024

Hit this again today via ufmt, forgot I filed this one before :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parsing Converting source code into CST nodes
Projects
None yet
Development

No branches or pull requests

2 participants