Browse Source

* fixed current_module^.in_implementation flag

peter 27 years ago
parent
commit
e68fa48b27
1 changed files with 10 additions and 8 deletions
  1. 10 8
      compiler/pmodules.pas

+ 10 - 8
compiler/pmodules.pas

@@ -461,22 +461,15 @@ unit pmodules;
       end;
       end;
 
 
       procedure parse_implementation_uses(symt:Psymtable);
       procedure parse_implementation_uses(symt:Psymtable);
-
-      var
-         old_module_in_implementation : boolean;
       begin
       begin
          if token=_USES then
          if token=_USES then
            begin
            begin
-              old_module_in_implementation:=module_in_implementation;
-              module_in_implementation:=true;
-              current_module^.in_implementation:=true;
               symt^.symtabletype:=unitsymtable;
               symt^.symtabletype:=unitsymtable;
               loadunits;
               loadunits;
               symt^.symtabletype:=globalsymtable;
               symt^.symtabletype:=globalsymtable;
 {$ifdef DEBUG}
 {$ifdef DEBUG}
               test_symtablestack;
               test_symtablestack;
 {$endif DEBUG}
 {$endif DEBUG}
-              module_in_implementation:=old_module_in_implementation;
            end;
            end;
       end;
       end;
 
 
@@ -593,7 +586,10 @@ unit pmodules;
          constsymtable:=symtablestack;
          constsymtable:=symtablestack;
          { ... parse the declarations }
          { ... parse the declarations }
          read_interface_declarations;
          read_interface_declarations;
+
+         { Parse the implementation section }
          consume(_IMPLEMENTATION);
          consume(_IMPLEMENTATION);
+         current_module^.in_implementation:=true;
 
 
          parse_only:=false;
          parse_only:=false;
 
 
@@ -793,6 +789,9 @@ unit pmodules;
               consume(SEMICOLON);
               consume(SEMICOLON);
             end;
             end;
 
 
+         { set implementation flag }
+         current_module^.in_implementation:=true;
+
          { insert after the unit symbol tables the static symbol table }
          { insert after the unit symbol tables the static symbol table }
          { of the program                                              }
          { of the program                                              }
          st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
          st:=new(punitsymtable,init(staticsymtable,current_module^.modulename^));
@@ -897,7 +896,10 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1998-08-17 10:10:08  peter
+  Revision 1.42  1998-08-19 18:04:54  peter
+    * fixed current_module^.in_implementation flag
+
+  Revision 1.41  1998/08/17 10:10:08  peter
     - removed OLDPPU
     - removed OLDPPU
 
 
   Revision 1.40  1998/08/17 09:17:50  peter
   Revision 1.40  1998/08/17 09:17:50  peter