Open maximiliankaul opened 5 months ago
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.
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
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.
This is just a reminder to a discussion between @oxisto and myself: https://github.com/Fraunhofer-AISEC/cpg/pull/1555/commits/9d02f6c76f975f39119bf8e844af4c4f5b4fa9c5