diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-05-12 08:29:54 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-05-12 10:25:10 +0200 |
commit | 17eb0242dac5e119ec8f31a700c82aeff01b9869 (patch) | |
tree | 44c12e33284bf2d4c181083e5535e9d310c916bc /src/errorout-console.adb | |
parent | 649375789f8c5867028a882ef9ef67d1ed7975e4 (diff) | |
download | ghdl-17eb0242dac5e119ec8f31a700c82aeff01b9869.tar.gz ghdl-17eb0242dac5e119ec8f31a700c82aeff01b9869.tar.bz2 ghdl-17eb0242dac5e119ec8f31a700c82aeff01b9869.zip |
errorout: add messages group instead of continuation.
Diffstat (limited to 'src/errorout-console.adb')
-rw-r--r-- | src/errorout-console.adb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/errorout-console.adb b/src/errorout-console.adb index 0e9694811..632a7386e 100644 --- a/src/errorout-console.adb +++ b/src/errorout-console.adb @@ -96,6 +96,8 @@ package body Errorout.Console is Msg_Len : Natural; Current_Error : Error_Record; + Current_Line : Natural; + In_Group : Boolean := False; procedure Put (Str : String) is @@ -155,6 +157,13 @@ package body Errorout.Console is begin Current_Error := E; + if In_Group then + Current_Line := Current_Line + 1; + else + pragma Assert (Current_Line <= 1); + Current_Line := 1; + end if; + Detect_Terminal; -- And no program name. @@ -228,7 +237,8 @@ package body Errorout.Console is procedure Console_Message_End is begin - if Flag_Diagnostics_Show_Option + if Current_Line = 1 + and then Flag_Diagnostics_Show_Option and then Current_Error.Id in Msgid_Warnings then Put (" [-W"); @@ -242,7 +252,8 @@ package body Errorout.Console is Put_Line; - if Flag_Caret_Diagnostics + if Current_Line = 1 + and then Flag_Caret_Diagnostics and then (Current_Error.File /= No_Source_File_Entry and Current_Error.Line /= 0) then @@ -252,10 +263,18 @@ package body Errorout.Console is end if; end Console_Message_End; + procedure Console_Message_Group (Start : Boolean) is + begin + Current_Line := 0; + pragma Assert (In_Group /= Start); + In_Group := Start; + end Console_Message_Group; + procedure Install_Handler is begin Set_Report_Handler ((Console_Error_Start'Access, Console_Message'Access, - Console_Message_End'Access)); + Console_Message_End'Access, + Console_Message_Group'Access)); end Install_Handler; end Errorout.Console; |