Browse Source

* finally bug #517 solved ...

florian 26 years ago
parent
commit
8b40781b6c
4 changed files with 38 additions and 15 deletions
  1. 4 2
      compiler/README
  2. 21 9
      compiler/pexpr.pas
  3. 7 2
      compiler/ptype.pas
  4. 6 2
      compiler/symconst.pas

+ 4 - 2
compiler/README

@@ -34,7 +34,7 @@ Changes in the syntax or semantic of FPC:
   02/04/99   rtl/cfg/ directory has been removed, it's not used anymore
   02/04/99   rtl/cfg/ directory has been removed, it's not used anymore
   15/04/99   FINALIZATION is supported
   15/04/99   FINALIZATION is supported
   21/04/99   Default assembler for i386 changed to AT&T instead of direct
   21/04/99   Default assembler for i386 changed to AT&T instead of direct
-  25/04/99:  initialized vars supported in Delphi mode (only $J+ mode)
+  25/04/99   initialized vars supported in Delphi mode (only $J+ mode)
              getting the address of an untyped const is now
              getting the address of an untyped const is now
              forbidden as in BP
              forbidden as in BP
   27/04/99   New unit format PPU016, you need to recompile all older units
   27/04/99   New unit format PPU016, you need to recompile all older units
@@ -65,4 +65,6 @@ Changes in the syntax or semantic of FPC:
   08/09/99   class/object field return their offsets in the object/class. You
   08/09/99   class/object field return their offsets in the object/class. You
              must access them self with loading the object/class pointer and
              must access them self with loading the object/class pointer and
              then create a reference where you add the field
              then create a reference where you add the field
-             
+  07/11/99   Small change to property writing in PPU => all units
+             exporting classes with properties must be recompiled
+             (no new unit format, so be careful) (FK)

+ 21 - 9
compiler/pexpr.pas

@@ -631,18 +631,27 @@ unit pexpr;
 
 
       begin
       begin
          paras:=nil;
          paras:=nil;
-         { property parameters? }
-         if token=_LECKKLAMMER then
+         { property parameters? read them only if the property really }
+         { has parameters                                             }
+         if ppo_hasparameters in ppropertysym(sym)^.propoptions then
            begin
            begin
+              { property parameters?
+              if token=_LECKKLAMMER then
+                begin
+                   consume(_LECKKLAMMER);
+                   paras:=parse_paras(false,true);
+                   consume(_RECKKLAMMER);
+                end;
+              }
               consume(_LECKKLAMMER);
               consume(_LECKKLAMMER);
               paras:=parse_paras(false,true);
               paras:=parse_paras(false,true);
               consume(_RECKKLAMMER);
               consume(_RECKKLAMMER);
-           end;
-         { indexed property }
-         if (ppo_indexed in ppropertysym(sym)^.propoptions) then
-           begin
-              p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef);
-              paras:=gencallparanode(p2,paras);
+              { indexed property }
+              if (ppo_indexed in ppropertysym(sym)^.propoptions) then
+                begin
+                   p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef);
+                   paras:=gencallparanode(p2,paras);
+                end;
            end;
            end;
          { we need only a write property if a := follows }
          { we need only a write property if a := follows }
          { if not(afterassignment) and not(in_args) then }
          { if not(afterassignment) and not(in_args) then }
@@ -2109,7 +2118,10 @@ _LECKKLAMMER : begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.154  1999-11-06 14:34:21  peter
+  Revision 1.155  1999-11-07 23:16:49  florian
+    * finally bug 517 solved ...
+
+  Revision 1.154  1999/11/06 14:34:21  peter
     * truncated log to 20 revs
     * truncated log to 20 revs
 
 
   Revision 1.153  1999/11/05 00:10:30  peter
   Revision 1.153  1999/11/05 00:10:30  peter

+ 7 - 2
compiler/ptype.pas

@@ -463,6 +463,9 @@ uses
                           propertyparas^.insert(hp2);
                           propertyparas^.insert(hp2);
                           disposetree(pt);
                           disposetree(pt);
                        end;
                        end;
+                     { the parser need to know if a property has parameters }
+                     if not(propertyparas^.empty) then
+                       p^.propoptions:=p^.propoptions+[ppo_hasparameters];
                   end
                   end
                 else
                 else
                   begin
                   begin
@@ -488,7 +491,6 @@ uses
                           message(parser_e_no_property_found_to_override);
                           message(parser_e_no_property_found_to_override);
                        end;
                        end;
                   end;
                   end;
-
                 if (sp_published in current_object_option) and
                 if (sp_published in current_object_option) and
                    not(p^.proptype^.is_publishable) then
                    not(p^.proptype^.is_publishable) then
                   Message(parser_e_cant_publish_that_property);
                   Message(parser_e_cant_publish_that_property);
@@ -1598,7 +1600,10 @@ uses
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1999-10-27 16:04:06  peter
+  Revision 1.6  1999-11-07 23:16:49  florian
+    * finally bug 517 solved ...
+
+  Revision 1.5  1999/10/27 16:04:06  peter
     * fixed property reading
     * fixed property reading
 
 
   Revision 1.4  1999/10/27 14:17:08  florian
   Revision 1.4  1999/10/27 14:17:08  florian

+ 6 - 2
compiler/symconst.pas

@@ -142,7 +142,8 @@ type
   tpropertyoption=(ppo_none,
   tpropertyoption=(ppo_none,
     ppo_indexed,
     ppo_indexed,
     ppo_defaultproperty,
     ppo_defaultproperty,
-    ppo_stored
+    ppo_stored,
+    ppo_hasparameters
   );
   );
   tpropertyoptions=set of tpropertyoption;
   tpropertyoptions=set of tpropertyoption;
 
 
@@ -180,7 +181,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1999-10-26 12:30:45  peter
+  Revision 1.5  1999-11-07 23:16:49  florian
+    * finally bug 517 solved ...
+
+  Revision 1.4  1999/10/26 12:30:45  peter
     * const parameter is now checked
     * const parameter is now checked
     * better and generic check if a node can be used for assigning
     * better and generic check if a node can be used for assigning
     * export fixes
     * export fixes