Inline child of an action node only is its unnamed sequence node.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 31 Jul 2015 08:22:18 +0100
changeset 509 fd22630c7e62
parent 508 c74a0dbfa161
child 510 869853decf31
Inline child of an action node only is its unnamed sequence node. Named nodes should not be inlined as they should make a method. There's little point in inlining non-sequence nodes, so don't enforce inlining on those. Some (JK :-) may prefer them non-inlined (for debugging purposes)
compiler/PPCInliningVisitor.st
--- a/compiler/PPCInliningVisitor.st	Fri Jul 31 08:16:54 2015 +0100
+++ b/compiler/PPCInliningVisitor.st	Fri Jul 31 08:22:18 2015 +0100
@@ -39,10 +39,16 @@
 !
 
 visitActionNode: node
-    node child markForInline.
+    "Only mark unnamed sequence nodes for inlining.
+     Named nodes should not be inlined as they should make a method.
+     There's little point in inlining non-sequence nodes, so don't
+     enforce inlining on those. Some (JK :-) may prefer them non-inlined
+     (for debugging purposes)"
+    (node child isSequenceNode and:[node child name isNil]) ifTrue: [ node child markForInline ].
     ^ super visitActionNode: node.
 
     "Created: / 13-05-2015 / 16:25:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-07-2015 / 08:20:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitCharSetPredicateNode: node