Ver código fonte

* small fix for aktfilepos

peter 27 anos atrás
pai
commit
273fc24dbb
3 arquivos alterados com 35 adições e 22 exclusões
  1. 16 4
      compiler/scandir.inc
  2. 9 2
      compiler/scanner.pas
  3. 10 16
      compiler/verbose.pas

+ 16 - 4
compiler/scandir.inc

@@ -690,8 +690,20 @@ const
             if c=',' then
              begin
                current_scanner^.readchar;   {Remove , }
-               hs:=current_scanner^.readid; {Check for multiple switches on one line}
-               Message1(scan_d_handling_switch,'$'+hs);
+             { read next switch, support $v+,$+}
+               hs:=current_scanner^.readid;
+               if (hs='') then
+                begin
+                  if (c='$') and not(cs_tp_compatible in aktmoduleswitches) then
+                   begin
+                     current_scanner^.readchar; { skip $ }
+                     hs:=current_scanner^.readid;
+                   end;
+                  if (hs='') then
+                   Message1(scan_w_illegal_directive,'$'+c);
+                end
+               else
+                Message1(scan_d_handling_switch,'$'+hs);
              end
             else
              hs:='';
@@ -720,8 +732,8 @@ const
 
 {
   $Log$
-  Revision 1.21  1998-08-19 00:30:22  peter
-    * in_main -> in_global
+  Revision 1.22  1998-08-19 14:57:50  peter
+    * small fix for aktfilepos
 
   Revision 1.20  1998/08/18 15:11:52  peter
     * recompiles again

+ 9 - 2
compiler/scanner.pas

@@ -593,6 +593,7 @@ implementation
 {$ifdef SourceLine}
          hp  : plongint;
 {$endif SourceLine}
+         oldaktfilepos : tfileposinfo;
       begin
         if (byte(inputpointer^)=0) and
            filenotatend then
@@ -629,10 +630,13 @@ implementation
          end;
         plongint(longint(linebuf)+line_no*2)^:=lastlinepos;
 {$endif SourceLine}
-      { update for status and call the show status routine }
+      { update for status and call the show status routine,
+        but don't touch aktfilepos ! }
+        oldaktfilepos:=aktfilepos;
         gettokenpos; { update for v_status }
         inc(status.compiledlines);
         ShowStatus;
+        aktfilepos:=oldaktfilepos;
       end;
 
 
@@ -1548,7 +1552,10 @@ exit_label:
 end.
 {
   $Log$
-  Revision 1.41  1998-08-18 14:17:10  pierre
+  Revision 1.42  1998-08-19 14:57:51  peter
+    * small fix for aktfilepos
+
+  Revision 1.41  1998/08/18 14:17:10  pierre
     * bug about assigning the return value of a function to
       a procvar fixed : warning
       assigning a proc to a procvar need @ in FPC mode !!

+ 10 - 16
compiler/verbose.pas

@@ -229,7 +229,11 @@ begin
    begin
      status.currentsource:=current_module^.sourcefiles.get_file_name(aktfilepos.fileindex);
      lastmoduleidx:=current_module^.unit_index;
-     lastfileidx:=aktfilepos.fileindex;
+     { update lastfileidx only if name known PM }
+     if status.currentsource<>'' then
+       lastfileidx:=aktfilepos.fileindex
+     else
+       lastfileidx:=0;
    end;
 end;
 
@@ -327,20 +331,7 @@ begin
   Replace(s,'$VER',version_string);
   Replace(s,'$TARGET',target_string);
 { fix status }
-  status.currentline:=aktfilepos.line;
-  status.currentcolumn:=aktfilepos.column;
-  if assigned(current_module) and
-     ((current_module^.unit_index<>lastmoduleidx) or
-      (aktfilepos.fileindex<>lastfileidx)) then
-   begin
-     status.currentsource:=current_module^.sourcefiles.get_file_name(aktfilepos.fileindex);
-     lastmoduleidx:=current_module^.unit_index;
-     { update lastfileidx only if name known PM }
-     if status.currentsource<>'' then
-       lastfileidx:=aktfilepos.fileindex
-     else
-       lastfileidx:=0;
-   end;
+  UpdateStatus;
 { show comment }
   if do_comment(v,s) or dostop or (status.errorcount>=status.maxerrorcount) then
    stop;
@@ -389,7 +380,10 @@ end.
 
 {
   $Log$
-  Revision 1.16  1998-08-18 14:17:15  pierre
+  Revision 1.17  1998-08-19 14:57:52  peter
+    * small fix for aktfilepos
+
+  Revision 1.16  1998/08/18 14:17:15  pierre
     * bug about assigning the return value of a function to
       a procvar fixed : warning
       assigning a proc to a procvar need @ in FPC mode !!