-
Notifications
You must be signed in to change notification settings - Fork 237
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
Fixed the parser regression for the package names starting with the the same substrings as keywords. #619
Conversation
Unfortunately we needed to drop our dependency on pyparsing to be dependency-free. That led to someone contributing the hand-written parser, so we accepted the contribution. Had someone contributed a parser-generator solution that generating a static parser we could check into the repository, we would have accepted that, but alas that was not what was given to us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the code is failing type checks.
8a458f4
to
b8ccf76
Compare
Thanks for the fix, added it.
TBH: I know this issuel but it is not so big issue. There are pretty a lot of cyclic dependencies (I have to work around them with custom build scripts and
|
Could have been another option. Once again, the solution we were presented with was this hand-written parser.
See above. 😁 |
I guess you may want to try |
Hmm... this is a bit more broken. Names like I'll dig into the hand-written parser and spend some cycles on it to see what we might want to change about it. :) |
1c2f26a
to
3399330
Compare
Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
…ding multiple ones used as a dirty hack in order not to write `None`.
3399330
to
5061a3e
Compare
…or convenience just a string is considered a set containing one element.
Implement skipping of tokens. Whitespaces are skipped by default.
5061a3e
to
8d7f6ba
Compare
…ents: 1. with the package names starting with the the same substrings as keywords. 2. preceeded or followed by spaces. Co-Authored-By: Brett Cannon <brett@python.org>
8d7f6ba
to
df5d290
Compare
introduced in 2e5593c
Fixes: #618
Note: please never ever hand-rewrite parsers, it is very error-prone. My experience with parsers says to me that it is better to deal with them as grammars being fed to parser generators. That will notify you about conflicts and do a lot of work for you.
Shameless plug: UniGrammar is an abstraction layer for parser generators and their runtimes.