mirror of
https://github.com/irmen/prog8.git
synced 2025-02-16 22:30:46 +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()
|
val decls = decl.flattenStructMembers()
|
||||||
decls.add(decl)
|
decls.add(decl)
|
||||||
val result = AnonymousScope(decls, decl.position)
|
val result = AnonymousScope(decls, decl.position)
|
||||||
return listOf(IAstModification.ReplaceNode(
|
return listOf(IAstModification.ReplaceNode(decl, result, parent))
|
||||||
decl, result, parent
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return noModifications
|
return noModifications
|
||||||
|
@ -30,6 +30,7 @@ internal class VariousCleanups(val errors: IErrorReporter): AstWalker() {
|
|||||||
val idx = into.statements.indexOf(scope)
|
val idx = into.statements.indexOf(scope)
|
||||||
if(idx>=0) {
|
if(idx>=0) {
|
||||||
into.statements.addAll(idx+1, scope.statements)
|
into.statements.addAll(idx+1, scope.statements)
|
||||||
|
scope.statements.forEach { it.parent = into as Node }
|
||||||
into.statements.remove(scope)
|
into.statements.remove(scope)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
TODO
|
TODO
|
||||||
====
|
====
|
||||||
|
|
||||||
- fix crash parent node mismatch with -noopt (textelite)
|
|
||||||
|
|
||||||
- implement new 'unused' in CallGraph for more node types
|
- implement new 'unused' in CallGraph for more node types
|
||||||
|
|
||||||
- allow inlining of subroutines with params
|
- allow inlining of subroutines with params
|
||||||
|
Loading…
x
Reference in New Issue
Block a user