Quellcode durchsuchen

* support pointer constants as initialisation values for procvar typed
constants in Delphi mode on non-treetypedconstbuilder platforms
(mantis #21267)

git-svn-id: trunk@21344 -

Jonas Maebe vor 13 Jahren
Ursprung
Commit
eb7e192226
3 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/ngtcon.pas
  3. 9 0
      tests/webtbs/tw21267.pp

+ 1 - 0
.gitattributes

@@ -12574,6 +12574,7 @@ tests/webtbs/tw21151.pp svneol=native#text/plain
 tests/webtbs/tw21177.pp svneol=native#text/plain
 tests/webtbs/tw21179.pp svneol=native#text/pascal
 tests/webtbs/tw21255.pp svneol=native#text/plain
+tests/webtbs/tw21267.pp svneol=native#text/plain
 tests/webtbs/tw2128.pp svneol=native#text/plain
 tests/webtbs/tw2129.pp svneol=native#text/plain
 tests/webtbs/tw2129b.pp svneol=native#text/plain

+ 2 - 0
compiler/ngtcon.pas

@@ -1282,6 +1282,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
                 list.concat(Tai_const.Create_sym(nil));
               end
           end
+        else if n.nodetype=pointerconstn then
+          list.concat(Tai_const.Create_pint(tpointerconstnode(n).value))
         else
           Message(parser_e_illegal_expression);
         n.free;

+ 9 - 0
tests/webtbs/tw21267.pp

@@ -0,0 +1,9 @@
+{ %norun }
+
+{$mode delphi}
+
+const
+  GameObjectClass_Get_Metal_Cost : function(team : integer) : Integer = Pointer($004CDFA0);
+
+begin
+end.