Skip to content

Commit

Permalink
Almost all Go test works
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Sep 24, 2023
1 parent c10d6ad commit 1b9940c
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ package de.fraunhofer.aisec.cpg.graph.declarations

import de.fraunhofer.aisec.cpg.graph.AST
import de.fraunhofer.aisec.cpg.graph.DeclarationHolder
import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.graph.StatementHolder
import de.fraunhofer.aisec.cpg.graph.edge.PropertyEdge
import de.fraunhofer.aisec.cpg.graph.edge.PropertyEdgeDelegate
import de.fraunhofer.aisec.cpg.graph.statements.Statement
import de.fraunhofer.aisec.cpg.passes.ResolutionStartHolder
import java.util.Objects
import org.neo4j.ogm.annotation.Relationship

Expand All @@ -45,7 +47,8 @@ import org.neo4j.ogm.annotation.Relationship
*
* The name property of this node need to be a FQN for property resolution.
*/
class NamespaceDeclaration : Declaration(), DeclarationHolder, StatementHolder {
class NamespaceDeclaration :
Declaration(), DeclarationHolder, StatementHolder, ResolutionStartHolder {
/**
* Edges to nested namespaces, records, functions, fields etc. contained in the current
* namespace.
Expand Down Expand Up @@ -93,4 +96,15 @@ class NamespaceDeclaration : Declaration(), DeclarationHolder, StatementHolder {

override var statements: List<Statement> by
PropertyEdgeDelegate(NamespaceDeclaration::statementEdges)

override val resolutionStartNodes: List<Node>
get() {
val list = mutableListOf<Node>()
// Add all top-level declarations
list += declarations
// Add all top-level statements
list += statements

return list
}
}

0 comments on commit 1b9940c

Please sign in to comment.