mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 01:29:28 +00:00
fix struct flattening parent node mismatch
This commit is contained in:
parent
b4700af2f5
commit
75d5117a2d
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user