Browse Source

* status.currentsource is now calculated in verbose (more accurated)

peter 27 years ago
parent
commit
34f5f72c53
3 changed files with 43 additions and 8 deletions
  1. 5 2
      compiler/scandir.inc
  2. 8 4
      compiler/scanner.pas
  3. 30 2
      compiler/verbose.pas

+ 5 - 2
compiler/scandir.inc

@@ -619,7 +619,7 @@ const
         current_scanner^.addfile(hp);
         if not current_scanner^.open then
          Message1(scan_f_cannot_open_includefile,hs);
-        status.currentsource:=current_scanner^.inputfile^.name^;
+{        status.currentsource:=current_scanner^.inputfile^.name^; }
         Message1(scan_u_start_include_file,current_scanner^.inputfile^.name^);
         current_scanner^.reload;
       { register for refs }
@@ -848,7 +848,10 @@ const
 
 {
   $Log$
-  Revision 1.12  1998-07-07 11:20:10  peter
+  Revision 1.13  1998-07-07 12:32:54  peter
+    * status.currentsource is now calculated in verbose (more accurated)
+
+  Revision 1.12  1998/07/07 11:20:10  peter
     + NEWINPUT for a better inputfile and scanner object
 
   Revision 1.11  1998/06/04 23:51:59  peter

+ 8 - 4
compiler/scanner.pas

@@ -402,7 +402,7 @@ implementation
       { load block }
         if not open then
          Message(scan_f_cannot_open_input);
-        status.currentsource:=inputfile^.name^;
+{        status.currentsource:=inputfile^.name^; }
         reload;
       end;
 
@@ -457,7 +457,8 @@ implementation
         filemode:=ofm;
         if ioresult<>0 then
          exit;
-      { file }  
+      { file }
+
 
         closed:=false;
         filenotatend:=true;
@@ -593,7 +594,7 @@ implementation
            nextfile;
            reopen;
          { status }
-           status.currentsource:=inputfile^.name^;
+{           status.currentsource:=inputfile^.name^; }
            Comment(V_Debug,'back in '+inputfile^.name^);
          { load some current_module fields }
            current_module^.current_index:=inputfile^.ref_index;
@@ -1803,7 +1804,10 @@ exit_label:
 end.
 {
   $Log$
-  Revision 1.29  1998-07-07 11:20:11  peter
+  Revision 1.30  1998-07-07 12:32:55  peter
+    * status.currentsource is now calculated in verbose (more accurated)
+
+  Revision 1.29  1998/07/07 11:20:11  peter
     + NEWINPUT for a better inputfile and scanner object
 
   Revision 1.28  1998/07/01 15:26:57  peter

+ 30 - 2
compiler/verbose.pas

@@ -70,7 +70,8 @@ var
   msg         : pmessage;
   UseStdErr,
   Use_Rhide   : boolean;
-
+  lastfileidx,
+  lastmoduleidx : longint;
 
 procedure LoadMsgFile(const fn:string);
 function  SetVerbosity(const s:string):boolean;
@@ -96,6 +97,10 @@ var
 
 implementation
 uses
+{$ifdef NEWINPUT}
+  files,
+{$endif}
+
   globals;
 
 procedure LoadMsgFile(const fn:string);
@@ -231,6 +236,16 @@ begin
 {$ifdef NEWINPUT}
   status.currentline:=aktfilepos.line;
   status.currentcolumn:=aktfilepos.column;
+  if assigned(current_module) and
+
+     ((current_module^.unit_index<>lastmoduleidx) or
+      (current_module^.current_index<>lastfileidx)) then
+   begin
+     status.currentsource:=current_module^.sourcefiles.get_file_name(current_module^.current_index);
+     lastmoduleidx:=current_module^.unit_index;
+     lastfileidx:=current_module^.current_index;
+   end;
+
 {$endif}
 { show comment }
   if do_comment(l,s) or dostop or (status.errorcount>=maxerrorcount) then
@@ -288,6 +303,16 @@ begin
 {$ifdef NEWINPUT}
   status.currentline:=aktfilepos.line;
   status.currentcolumn:=aktfilepos.column;
+  if assigned(current_module) and
+
+     ((current_module^.unit_index<>lastmoduleidx) or
+      (current_module^.current_index<>lastfileidx)) then
+   begin
+     status.currentsource:=current_module^.sourcefiles.get_file_name(current_module^.current_index);
+     lastmoduleidx:=current_module^.unit_index;
+     lastfileidx:=current_module^.current_index;
+   end;
+
 {$endif}
 { show comment }
   if do_comment(v,s) or dostop or (status.errorcount>=maxerrorcount) then
@@ -327,7 +352,10 @@ end.
 
 {
   $Log$
-  Revision 1.9  1998-07-07 11:20:20  peter
+  Revision 1.10  1998-07-07 12:32:56  peter
+    * status.currentsource is now calculated in verbose (more accurated)
+
+  Revision 1.9  1998/07/07 11:20:20  peter
     + NEWINPUT for a better inputfile and scanner object
 
   Revision 1.8  1998/05/23 01:21:35  peter