Browse Source

* change order of foreachnode(static) so the "payload" of a
statementn is processed before the next statementnodes

git-svn-id: trunk@2516 -

Jonas Maebe 19 years ago
parent
commit
f34f7f10c3
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/nutils.pas

+ 4 - 2
compiler/nutils.pas

@@ -132,8 +132,9 @@ implementation
       end;
       end;
       if n.inheritsfrom(tbinarynode) then
       if n.inheritsfrom(tbinarynode) then
         begin
         begin
-          result := foreachnode(tbinarynode(n).right,f,arg) or result;
+          { first process the "payload" of statementnodes }
           result := foreachnode(tbinarynode(n).left,f,arg) or result;
           result := foreachnode(tbinarynode(n).left,f,arg) or result;
+          result := foreachnode(tbinarynode(n).right,f,arg) or result;
         end
         end
       else if n.inheritsfrom(tunarynode) then
       else if n.inheritsfrom(tunarynode) then
         result := foreachnode(tunarynode(n).left,f,arg) or result;
         result := foreachnode(tunarynode(n).left,f,arg) or result;
@@ -172,8 +173,9 @@ implementation
         end;
         end;
         if n.inheritsfrom(tbinarynode) then
         if n.inheritsfrom(tbinarynode) then
           begin
           begin
-            result := foreachnodestatic(procmethod,tbinarynode(n).right,f,arg) or result;
+            { first process the "payload" of statementnodes }
             result := foreachnodestatic(procmethod,tbinarynode(n).left,f,arg) or result;
             result := foreachnodestatic(procmethod,tbinarynode(n).left,f,arg) or result;
+            result := foreachnodestatic(procmethod,tbinarynode(n).right,f,arg) or result;
           end
           end
         else if n.inheritsfrom(tunarynode) then
         else if n.inheritsfrom(tunarynode) then
           result := foreachnodestatic(procmethod,tunarynode(n).left,f,arg) or result;
           result := foreachnodestatic(procmethod,tunarynode(n).left,f,arg) or result;