StatementNode.st
changeset 4231 dd23f58513c0
parent 4227 53d14507f742
child 4315 734f7d2b6efe
child 4384 aee25576d864
child 4508 acdb6bc18328
--- a/StatementNode.st	Thu Apr 19 17:45:39 2018 +0200
+++ b/StatementNode.st	Mon Apr 23 22:17:22 2018 +0200
@@ -198,20 +198,25 @@
 allNodesDo:aBlock
     "evaluate aBlock for each node in this node and subnodes"
 
-    |s e|
+    |s|
 
     s := self.
     [s notNil] whileTrue:[
         aBlock value:s.
-"/        s ~~ self ifTrue:[
-"/            s allNodesDo:aBlock.
-"/        ].
-        e := s expression.
-        e notNil ifTrue:[e allNodesDo:aBlock].
+        s allSubNodesDo:aBlock.
         s := s nextStatement
     ].
 !
 
+allSubNodesDo:aBlock
+    "evaluate aBlock for each subnodes"
+
+    |e|
+
+    e := self expression.
+    e notNil ifTrue:[e allNodesDo:aBlock].
+!
+
 do:aBlock
     "in st/x, statements is a linked list (not an ordered collection),
      this provides some dialect compatibility (for st2js)"