Use #deepCopy instead of #copy when copying RB parse tree
...because #copy make a copy if child nodes but does not set their parents properly.
Therefore node replacing does not work because it replaces it in wrong tree (original,
not the copy).
--- a/compiler/PPCCodeGenerator.st Tue Jun 16 07:49:21 2015 +0100
+++ b/compiler/PPCCodeGenerator.st Wed Jun 17 16:49:28 2015 +0100
@@ -211,7 +211,7 @@
visitActionNode: node
| blockNode blockBody blockNodesVar blockNeedsCollection blockMatches childValueVars |
- blockNode := node block ast copy.
+ blockNode := node block ast deepCopy.
self assert: blockNode arguments size == 1.
blockNodesVar := blockNode arguments first .
blockBody := blockNode body.
@@ -304,7 +304,7 @@
compiler code: blockBody.
]
- "Modified: / 16-06-2015 / 07:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 17-06-2015 / 16:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
visitAndNode: node