-
Notifications
You must be signed in to change notification settings - Fork 0
Expose a C API for pegen #11
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
Conversation
Check the TODO items!
* Use @trailer for the generated C API functions * Use EXTENSION_SUFFIX for the generated Python-level module * Expose four C API functions that return either a mod_ty or a PyCodeObject * * Expose two Python-level functions that return an AST object
* Extension modules does not get generated anymore
* Complete rewrite of run_parser* functions
* Use trailer meta for only one function that calls the start_rule
|
I'll have a look at the code soon. Right now I notice that (on my Mac) |
I'm on it. EDIT: Fixed in |
…erate the code object in run_parser
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.
This is great progress. But I think we need some refactoring. (Some you may be able to put off to another PR.)
Also, I'm sorry that there's so much duplicate code between here and Tools/peg_generator -- hopefully this is temporary!
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.
This PR is getting so large, maybe finish these nits, land, and start another iteration with the API inmprovements?
|
Should we merge this now? Note that pegen tests pass and all the other will fail one way or the other. |
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.
Yes, let's land this one!
Expose pegen as a C API and as a Python-leve module:
This is getting bigger and bigger, so I'm opening this WIP PR, so that it becomes a bit easier to follow what's going on.
Feedback is needed once more.
Closes #6.