Prechádzať zdrojové kódy

compiler:
- allow turning some messages off by default by prefixing verbosity type with '-' sign (in error.msg)
- interpret -vm- as a switch which changes message verbosity to *on* by default
* appropriate error.msg file changes will come later

git-svn-id: trunk@19570 -

paul 13 rokov pred
rodič
commit
aba10cd184
2 zmenil súbory, kde vykonal 9 pridanie a 9 odobranie
  1. 6 0
      compiler/cmsgs.pas
  2. 3 9
      compiler/verbose.pas

+ 6 - 0
compiler/cmsgs.pas

@@ -361,6 +361,12 @@ begin
       begin
       begin
         { skip _ }
         { skip _ }
         inc(hp1);
         inc(hp1);
+        { set default verbosity to off is '-' is found just after the '_' }
+        if hp1^='-' then
+         begin
+           msgstates[numpart]^[numidx]:=ms_off_global;
+           inc(hp1);
+         end;
         { put the address in the idx, the numbers are already checked }
         { put the address in the idx, the numbers are already checked }
         msgidx[numpart]^[numidx]:=hp1;
         msgidx[numpart]^[numidx]:=hp1;
       end;
       end;

+ 3 - 9
compiler/verbose.pas

@@ -227,13 +227,6 @@ implementation
         result:=true;
         result:=true;
       end;
       end;
 
 
-    { This function is only used for command line argument -vmXXX }
-    { thus the message needs to be cleared globally }
-    function ClearMessageVerbosity(s: string; var i: integer): boolean;
-      begin
-        ClearMessageVerbosity:=ChangeMessageVerbosity(s,i,ms_off_global);
-      end;
-
     function SetMessageVerbosity(v:longint;state:tmsgstate):boolean;
     function SetMessageVerbosity(v:longint;state:tmsgstate):boolean;
       begin
       begin
         result:=msg^.setverbosity(v,state);
         result:=msg^.setverbosity(v,state);
@@ -246,6 +239,8 @@ implementation
 
 
 
 
     function SetVerbosity(const s:string):boolean;
     function SetVerbosity(const s:string):boolean;
+      const
+        message_verbosity:array[boolean] of tmsgstate=(ms_off_global,ms_on_global);
       var
       var
         m : Longint;
         m : Longint;
         i : Integer;
         i : Integer;
@@ -283,8 +278,7 @@ implementation
                           else
                           else
                             status.print_source_path:=true;
                             status.print_source_path:=true;
                        end;
                        end;
-                 'M' : if inverse or
-                         not ClearMessageVerbosity(s, i) then
+                 'M' : if not ChangeMessageVerbosity(s,i,message_verbosity[inverse]) then
                          begin
                          begin
                            result:=false;
                            result:=false;
                            exit
                            exit