diff --git a/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt b/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt index 7682eb814..6ce8979dc 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt @@ -22,9 +22,7 @@ internal class AstVariousTransforms(private val program: Program) : AstWalker() val decls = decl.flattenStructMembers() decls.add(decl) val result = AnonymousScope(decls, decl.position) - return listOf(IAstModification.ReplaceNode( - decl, result, parent - )) + return listOf(IAstModification.ReplaceNode(decl, result, parent)) } return noModifications diff --git a/compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt b/compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt index ab1d66fb4..73ebca5e6 100644 --- a/compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt +++ b/compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt @@ -30,6 +30,7 @@ internal class VariousCleanups(val errors: IErrorReporter): AstWalker() { val idx = into.statements.indexOf(scope) if(idx>=0) { into.statements.addAll(idx+1, scope.statements) + scope.statements.forEach { it.parent = into as Node } into.statements.remove(scope) } } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 052adbebd..2c2b0e473 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,8 +2,6 @@ TODO ==== -- fix crash parent node mismatch with -noopt (textelite) - - implement new 'unused' in CallGraph for more node types - allow inlining of subroutines with params