Browse Source

* fixed filedef for typenodetype

peter 27 years ago
parent
commit
e659040083
1 changed files with 13 additions and 14 deletions
  1. 13 14
      compiler/pexpr.pas

+ 13 - 14
compiler/pexpr.pas

@@ -60,7 +60,7 @@ unit pexpr;
        ;
        ;
 
 
     const allow_type : boolean = true;
     const allow_type : boolean = true;
-    
+
     function parse_paras(_colon,in_prop_paras : boolean) : ptree;
     function parse_paras(_colon,in_prop_paras : boolean) : ptree;
 
 
       var
       var
@@ -630,7 +630,6 @@ unit pexpr;
       var
       var
          static_name : string;
          static_name : string;
          isclassref : boolean;
          isclassref : boolean;
-         pobj : pobjectdef;
 
 
       begin
       begin
          if sym=nil then
          if sym=nil then
@@ -662,7 +661,7 @@ unit pexpr;
                   else
                   else
                     Message(parser_e_cant_access_private_member);
                     Message(parser_e_cant_access_private_member);
                 end;
                 end;
-                
+
               { this is wrong protected should not be overwritten but
               { this is wrong protected should not be overwritten but
               can be called !! PM
               can be called !! PM
               if ((sym^.properties and sp_protected)<>0) and
               if ((sym^.properties and sp_protected)<>0) and
@@ -1419,7 +1418,7 @@ unit pexpr;
                  else
                  else
                   pd:=p1^.typenodetype;
                   pd:=p1^.typenodetype;
                  pd2:=pd;
                  pd2:=pd;
-                 
+
                  if (pd^.deftype<>pointerdef) or
                  if (pd^.deftype<>pointerdef) or
                     (ppointerdef(pd)^.definition^.deftype<>objectdef) then
                     (ppointerdef(pd)^.definition^.deftype<>objectdef) then
                   begin
                   begin
@@ -1591,25 +1590,22 @@ unit pexpr;
                  postfixoperators;
                  postfixoperators;
                end;
                end;
        _FILE : begin
        _FILE : begin
-               { FILE can be also a type cast }
                  pd:=cfiledef;
                  pd:=cfiledef;
                  consume(_FILE);
                  consume(_FILE);
+                 { FILE can be also a type cast }
                  if token=LKLAMMER then
                  if token=LKLAMMER then
                   begin
                   begin
                     consume(LKLAMMER);
                     consume(LKLAMMER);
                     p1:=comp_expr(true);
                     p1:=comp_expr(true);
                     consume(RKLAMMER);
                     consume(RKLAMMER);
                     p1:=gentypeconvnode(p1,pd);
                     p1:=gentypeconvnode(p1,pd);
+                    p1^.explizit:=true;
+                    { handle postfix operators here e.g. string(a)[10] }
+                    again:=true;
+                    postfixoperators;
                   end
                   end
                  else
                  else
-                  begin
-                    p1:=genzeronode(typen);
-                    p1^.resulttype:=pd;
-                  end;
-                 p1^.explizit:=true;
-                 { handle postfix operators here e.g. string(a)[10] }
-                 again:=true;
-                 postfixoperators;
+                  p1:=gentypenode(pd);
                end;
                end;
      CSTRING : begin
      CSTRING : begin
                  p1:=genstringconstnode(pattern);
                  p1:=genstringconstnode(pattern);
@@ -1913,7 +1909,10 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.70  1998-10-21 15:12:54  pierre
+  Revision 1.71  1998-10-22 23:57:29  peter
+    * fixed filedef for typenodetype
+
+  Revision 1.70  1998/10/21 15:12:54  pierre
     * bug fix for IOCHECK inside a procedure with iocheck modifier
     * bug fix for IOCHECK inside a procedure with iocheck modifier
     * removed the GPF for unexistant overloading
     * removed the GPF for unexistant overloading
       (firstcall was called with procedinition=nil !)
       (firstcall was called with procedinition=nil !)