diff --git a/cpg-language-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/StatementHandler.kt b/cpg-language-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/StatementHandler.kt index e0dbda9bc05..b871376e905 100644 --- a/cpg-language-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/StatementHandler.kt +++ b/cpg-language-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/StatementHandler.kt @@ -385,12 +385,8 @@ class StatementHandler(frontend: PythonLanguageFrontend) : return annotations } - private fun makeBlock( - stmts: List, - code: String? = null, - rawNode: Python.AST? = null - ): Block { - val result = newBlock(code, rawNode) + private fun makeBlock(stmts: List, rawNode: Python.AST? = null): Block { + val result = newBlock(rawNode = rawNode) for (stmt in stmts) { result.addStatement(handle(stmt)) } @@ -411,7 +407,7 @@ class StatementHandler(frontend: PythonLanguageFrontend) : * @return The wrapped [decl] */ private fun wrapDeclarationToStatement(decl: Declaration): DeclarationStatement { - val declStmt = newDeclarationStatement(code = decl.code, rawNode = null) // TODO: rawNode + val declStmt = newDeclarationStatement().codeAndLocationFrom(decl) declStmt.addDeclaration(decl) return declStmt }