Преглед на файлове

* 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 години
родител
ревизия
f34f7f10c3
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      compiler/nutils.pas

+ 4 - 2
compiler/nutils.pas

@@ -132,8 +132,9 @@ implementation
       end;
       if n.inheritsfrom(tbinarynode) then
         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).right,f,arg) or result;
         end
       else if n.inheritsfrom(tunarynode) then
         result := foreachnode(tunarynode(n).left,f,arg) or result;
@@ -172,8 +173,9 @@ implementation
         end;
         if n.inheritsfrom(tbinarynode) then
           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).right,f,arg) or result;
           end
         else if n.inheritsfrom(tunarynode) then
           result := foreachnodestatic(procmethod,tunarynode(n).left,f,arg) or result;