-
Notifications
You must be signed in to change notification settings - Fork 289
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
Support the "ast" module #902
Comments
I'll try this if no one had been assigned 😸 |
i done by modifying some files and add
but i don't know what to next |
My proposal is write some types manually first. Summarize and find the pattern, them modify CPython grammar generator, or write the module from scratch. Just some thoughts, not verify it. |
@Daetalus so it means code generator should makes src/runtime/builtin_modules/ast.cpp?? |
Just my proposal, wait for @kmod to give some concrete suggestions |
I agree with daetalus, I don't think we should jump straight to using their generator. I think there are a couple ways we could attack this, but the one I would suggest is:
|
I think this boils down to just implementing the "_ast" module which has the actual Python types. We have a simple module (src/runtime/builtin_modules/ast.cpp) that declares the different types, but they're currently empty.
I think any individual type is pretty straightforward, but there are 90 of them. CPython auto-generates their module (Python/Python-ast.c) from their grammar file. We could try to modify their grammar generator, or modify the output, or just continue to implement the module from scratch.
The text was updated successfully, but these errors were encountered: