-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA #70713
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
Comments
Updating Modules/parsermodule.c for every change in grammar and/or parser is a maintenance burden, listed as such at https://docs.python.org/devguide/grammar.html The attached patch lets the validation code use the auto-generated DFA structures, thus ensuring it stays up to date with the grammar. It also trims the code by over 2KLOC. |
Ping? This patch is two months old now. |
I see your message to python-dev, and apologize for taking so long to get to this. I do intend to read through your changes, and hope to be able to make time while I'm at PyCon this coming week. |
I've read through this, but haven't applied the patch & run tests (that's what buildbots are for). No objections. |
Thank you Fred for your review! I don't have commit access myself; can anybody please commit it for me? |
Are you up for trying to commit this while at the sprints, Fred? If not then assign it back to me and I can eventually commit it (busy w/ a ton of stuff so I can't promise when I will get to it). |
New changeset 4a9159ea2536 by Benjamin Peterson in branch 'default': |
The DFA is generated by other part of existing cpython code ? If it's the case looks like you did a great job. |
Thanks Xavier! Yes, this is the same DFA that's used by the main Python parser. For some reason, parsermodule didn't previously reuse it, but instead did its own thing. Any volunteers to review the other patch for Python parser, at http://bugs.python.org/issue26415 ? |
Oh btw, the comment in the beginning of Grammar/Grammar
is no longer true: after this patch went in, changing the grammar no longer requires translating the changes into Modules/parsermodule.c Can somebody please remove the obsolete comment from there? |
New changeset 3275d4b584a2 by Benjamin Peterson in branch '3.6': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: