-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add Ast
as top level enum
#58
Conversation
cc @MichaReiser |
Thanks for working on this and sorry for my late reply. I've been busy with other work and haven't had time to think more about the problem. I still think that I would favor the flat structure over the nested one because:
Would you mind if I change the enum to a flat structure? I will also introduce a |
impl<R> Node for Ast<R> { | ||
const NAME: &'static str = "AST"; | ||
const FIELD_NAMES: &'static [&'static str] = &[]; | ||
} |
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.
What's the reason that the enums implement the Node
trait. They aren't really nodes and have no fields.
Because current |
I wish conversion between Ast and other types like Stmt and Expr doesn't require much cost. If we can achieve it with flat structure, that's also fine. |
I'll add it on the Ruff side if you want to keep using the |
Yes, that will be a good option. |
One of the possible solution of #48