From 2148f2996ae76a7773eb7d8e30c02bd036ec7b3c Mon Sep 17 00:00:00 2001 From: Bob Duff Date: Tue, 21 Jun 2022 09:50:06 -0400 Subject: [Ada] Clean up scanner This patch removes some obsolete code in the scanner and related files, and corrects some comments. Tok_Special is used only by the preprocessor, and uses only the two characters '#' and '$'. It might be simpler to have a single flag indicating we're scanning for preprocessing, instead of the Special_Characters array and the End_Of_Line_Is_Token flag, but that's for another day. gcc/ada/ * scans.ads: Fix obsolete comments about Tok_Special, and give Special_Character a predicate assuring it is one of the two characters used in preprocessing. * scng.ads: Clean up comments. * scng.adb: Clean up handling of Tok_Special. Remove comment about '@' (target_name), which doesn't seem very helpful. Set_Special_Character will now blow up if given anything other than '#' and '$', because of the predicate on Special_Character; it's not clear why it used to say "when others => null;". Remove Comment_Is_Token, which is not used. * scn.ads: Remove commented-out use clause. Remove redundant comment. * ali-util.adb: Use "is null" for do-nothing procedures. * gprep.adb (Post_Scan): Use "is null". --- gcc/ada/ali-util.adb | 63 +++++----------------------------------------------- 1 file changed, 5 insertions(+), 58 deletions(-) (limited to 'gcc/ada/ali-util.adb') diff --git a/gcc/ada/ali-util.adb b/gcc/ada/ali-util.adb index bb1fc41..6435905 100644 --- a/gcc/ada/ali-util.adb +++ b/gcc/ada/ali-util.adb @@ -42,15 +42,12 @@ package body ALI.Util is -- empty, because we don't want to report any errors when computing -- a source checksum. - procedure Post_Scan; + procedure Post_Scan is null; - procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr); - - procedure Error_Msg_S (Msg : String); - - procedure Error_Msg_SC (Msg : String); - - procedure Error_Msg_SP (Msg : String); + procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) is null; + procedure Error_Msg_S (Msg : String) is null; + procedure Error_Msg_SC (Msg : String) is null; + procedure Error_Msg_SP (Msg : String) is null; -- Instantiation of Styleg, needed to instantiate Scng @@ -85,47 +82,6 @@ package body ALI.Util is return Checksum1 = Checksum2 and then Checksum1 /= Checksum_Error; end Checksums_Match; - --------------- - -- Error_Msg -- - --------------- - - procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) is - pragma Warnings (Off, Msg); - pragma Warnings (Off, Flag_Location); - begin - null; - end Error_Msg; - - ----------------- - -- Error_Msg_S -- - ----------------- - - procedure Error_Msg_S (Msg : String) is - pragma Warnings (Off, Msg); - begin - null; - end Error_Msg_S; - - ------------------ - -- Error_Msg_SC -- - ------------------ - - procedure Error_Msg_SC (Msg : String) is - pragma Warnings (Off, Msg); - begin - null; - end Error_Msg_SC; - - ------------------ - -- Error_Msg_SP -- - ------------------ - - procedure Error_Msg_SP (Msg : String) is - pragma Warnings (Off, Msg); - begin - null; - end Error_Msg_SP; - ----------------------- -- Get_File_Checksum -- ----------------------- @@ -192,15 +148,6 @@ package body ALI.Util is Interfaces.Reset; end Initialize_ALI_Source; - --------------- - -- Post_Scan -- - --------------- - - procedure Post_Scan is - begin - null; - end Post_Scan; - ---------------------- -- Read_Withed_ALIs -- ---------------------- -- cgit v1.1