Skip to content
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

Declaration AST placement #1602

Open
maximiliankaul opened this issue Jun 26, 2024 · 3 comments
Open

Declaration AST placement #1602

maximiliankaul opened this issue Jun 26, 2024 · 3 comments
Assignees
Labels

Comments

@maximiliankaul
Copy link
Contributor

This is just a reminder to a discussion between @oxisto and myself: 9d02f6c

@oxisto oxisto changed the title ImportDeclaration AST placement Declaration AST placement Jun 26, 2024
@oxisto
Copy link
Member

oxisto commented Jun 26, 2024

Currently, we place a declaration both on the AST property declarations directly as well as indirectly through the statements property and a DeclarationStatement. This could potentially be a bad idea, since the AST should be a tree, not a graph.

@konradweiss
Copy link
Collaborator

Yes, the ast should always be a tree. If it has more connections this can break several things, in the worst case lead to cycles in some algorithms

@oxisto
Copy link
Member

oxisto commented Sep 25, 2024

Also for this discussion: Currently we model a a: Int or a simple a (the statement, not the expression) as an assignment with no rhs. This works sort-of and the assignment expression will also add a declaration, however the question would be whether we want to directly translate this into a declaration statement / variable declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants