Forráskód Böngészése

* support procvar^, with procvar returning a procvardef in tp/mac modes

git-svn-id: trunk@1477 -
peter 20 éve
szülő
commit
38993ae7e8
1 módosított fájl, 13 hozzáadás és 3 törlés
  1. 13 3
      compiler/pexpr.pas

+ 13 - 3
compiler/pexpr.pas

@@ -1707,6 +1707,18 @@ implementation
                _CARET:
                   begin
                     consume(_CARET);
+
+                    { support tp/mac procvar^ if the procvar returns a
+                      pointer type }
+                    if ((m_tp_procvar in aktmodeswitches) or
+                        (m_mac_procvar in aktmodeswitches)) and
+                       (p1.resulttype.def.deftype=procvardef) and
+                       (tprocvardef(p1.resulttype.def).rettype.def.deftype=pointerdef) then
+                      begin
+                        p1:=ccallnode.create_procvar(nil,p1);
+                        resulttypepass(p1);
+                      end;
+
                     if (p1.resulttype.def.deftype<>pointerdef) then
                       begin
                          { ^ as binary operator is a problem!!!! (FK) }
@@ -1717,9 +1729,7 @@ implementation
                          p1:=cerrornode.create;
                       end
                     else
-                      begin
-                         p1:=cderefnode.create(p1);
-                      end;
+                      p1:=cderefnode.create(p1);
                   end;
 
                _LECKKLAMMER: