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
ast: improve AST node documentation #2803
Comments
On this subject, one thing that makes me struggle is that I can't find a clear way to get EditI'm looking for a way to get either |
Is it possible to add the ast_node_id to every AST node referencable via an AstNode? It can be stored in a cell similar to identifiers so we can assign them in the semantic. It will make getting the node's parent, etc easier and would eliminate the need to pass reference on enter_node and leave_node while also providing a way to access the AstNode in VisitMut, Both enter and leave events can pass the AstNodeId instead of AstNode, and we can also access the AstNode easily within our visit methods. Right now I can't see any clear way to access an AstNode from its let's say expression, statement, etc. Having AstNodeId on the struct itself would also allow us to get rid of the |
The requirement for |
While I was working with
syn
, I found the documentation on AST nodes really helpful, we should do the same.https://docs.rs/syn/latest/syn/index.html#structs
The text was updated successfully, but these errors were encountered: