-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Replace the blib2to3 tokenizer with pytokens #4536
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
@JelleZijlstra with this, the test suite is fully passing. Primer is failing (mostly just because some file in |
I don't think we currently have any tests for this, but I just linked the above two issues here because they are the same bug in the parser where |
Thanks for linking this, I'll make sure these parse identically to how CPython does it. |
Okay, primer is fixed, and all tests are green. |
Description
Replaces black's tokenizer with a from-scratch rewrite done by me. We could vendor the code into black itself, but either pinning it or keeping it as-is would be my recommendation, the tokenizer can be used by multiple tools for perfect compatibility.
Resolves #4520
Resolves #970
Resolves #3700
Tests passing so far: 381/381 (!)
What's left
ERRORTOKEN
s are not produced just yet. And there are no tests forERRORTOKEN
s. Let's add those.