Browse Source

* power to ** operator fixed

pierre 25 years ago
parent
commit
71cbe13810
2 changed files with 22 additions and 5 deletions
  1. 9 1
      compiler/pmodules.pas
  2. 13 4
      compiler/symtable.pas

+ 9 - 1
compiler/pmodules.pas

@@ -638,10 +638,15 @@ unit pmodules;
         make_ref:=false;
         make_ref:=false;
         readconstdefs;
         readconstdefs;
         { if POWER is defined in the RTL then use it for starstar overloading }
         { if POWER is defined in the RTL then use it for starstar overloading }
+{$ifdef DONOTCHAINOPERATORS}
         getsym('POWER',false);
         getsym('POWER',false);
+{$endif DONOTCHAINOPERATORS}
         make_ref:=true;
         make_ref:=true;
+{$ifdef DONOTCHAINOPERATORS}
+        { Code now in chainoperators PM }
         if assigned(srsym) and (srsym^.typ=procsym) and (overloaded_operators[_STARSTAR]=nil) then
         if assigned(srsym) and (srsym^.typ=procsym) and (overloaded_operators[_STARSTAR]=nil) then
           overloaded_operators[_STARSTAR]:=pprocsym(srsym);
           overloaded_operators[_STARSTAR]:=pprocsym(srsym);
+{$endif DONOTCHAINOPERATORS}
       { Objpas unit? }
       { Objpas unit? }
         if m_objpas in aktmodeswitches then
         if m_objpas in aktmodeswitches then
          begin
          begin
@@ -1673,7 +1678,10 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.190  2000-04-26 08:54:18  pierre
+  Revision 1.191  2000-04-27 11:35:03  pierre
+   * power to ** operator fixed
+
+  Revision 1.190  2000/04/26 08:54:18  pierre
     * More changes for operator bug
     * More changes for operator bug
       Order_overloaded method removed because it conflicted with
       Order_overloaded method removed because it conflicted with
       new implementation where the defs are ordered
       new implementation where the defs are ordered

+ 13 - 4
compiler/symtable.pas

@@ -1258,6 +1258,7 @@ implementation
       begin
       begin
          storesymtablestack:=symtablestack;
          storesymtablestack:=symtablestack;
          symtablestack:=@self;
          symtablestack:=@self;
+         make_ref:=false;
          for t:=first_overloaded to last_overloaded do
          for t:=first_overloaded to last_overloaded do
            begin
            begin
               p:=nil;
               p:=nil;
@@ -1266,12 +1267,15 @@ implementation
               { each operator has a unique lowercased internal name PM }
               { each operator has a unique lowercased internal name PM }
               while assigned(symtablestack) do
               while assigned(symtablestack) do
                 begin
                 begin
-                  { search for same procsym in other units }
                   getsym(overloaded_names[t],false);
                   getsym(overloaded_names[t],false);
+                  if (t=_STARSTAR) and (srsym=nil) then
+                    begin
+                      symtablestack:=systemunit;
+                      getsym('POWER',false);
+                    end;
                   if assigned(srsym) then
                   if assigned(srsym) then
                     begin
                     begin
-                       if (srsym^.typ<>procsym) or
-                          (pprocsym(srsym)^.definition^.proctypeoption<> potype_operator) then
+                       if (srsym^.typ<>procsym) then
                          internalerror(12344321);
                          internalerror(12344321);
                        if assigned(p) then
                        if assigned(p) then
                          begin
                          begin
@@ -1298,9 +1302,11 @@ implementation
                         p^.nextprocsym:=nil;
                         p^.nextprocsym:=nil;
 {$endif CHAINPROCSYMS}
 {$endif CHAINPROCSYMS}
                     end;
                     end;
+                  { search for same procsym in other units }
                 end;
                 end;
               symtablestack:=@self;
               symtablestack:=@self;
            end;
            end;
+         make_ref:=true;
          symtablestack:=storesymtablestack;
          symtablestack:=storesymtablestack;
       end;
       end;
 {$endif DONOTCHAINOPERATORS}
 {$endif DONOTCHAINOPERATORS}
@@ -2879,7 +2885,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  2000-04-27 10:06:04  pierre
+  Revision 1.88  2000-04-27 11:35:04  pierre
+   * power to ** operator fixed
+
+  Revision 1.87  2000/04/27 10:06:04  pierre
     * fix for snapshot failue
     * fix for snapshot failue
     * order_overloaded reintrocduced and adapted to operators
     * order_overloaded reintrocduced and adapted to operators