瀏覽代碼

* 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;