aboutsummaryrefslogtreecommitdiffstats
path: root/src/libraries.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-08-02 09:17:08 +0200
committerTristan Gingold <tgingold@free.fr>2016-08-02 09:17:08 +0200
commit3c83e47c98bc9e58ca2c231a5b24c3639018c9cc (patch)
treef2c0133e26ee413d3c778465c552233905a5db56 /src/libraries.adb
parentee0e651d9b3946910d513e6a670453e25e5f014d (diff)
downloadghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.tar.gz
ghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.tar.bz2
ghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.zip
Rewrite most of error and warning messages.
Diffstat (limited to 'src/libraries.adb')
-rw-r--r--src/libraries.adb29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/libraries.adb b/src/libraries.adb
index 7a24fe0c8..9e9c5093e 100644
--- a/src/libraries.adb
+++ b/src/libraries.adb
@@ -53,10 +53,15 @@ package body Libraries is
Report_Msg (Msgid_Error, Library, No_Location, Msg);
end Error_Lib_Msg;
+ procedure Error_Lib_Msg (Msg : String; Arg1 : Earg_Type) is
+ begin
+ Report_Msg (Msgid_Error, Library, No_Location, Msg, (1 => Arg1));
+ end Error_Lib_Msg;
+
-- Report a warning message.
- procedure Warning_Lib_Msg (Msg : String) is
+ procedure Warning_Lib_Msg (Msg : String; Args : Earg_Arr := No_Eargs) is
begin
- Report_Msg (Msgid_Warning, Library, No_Location, Msg);
+ Report_Msg (Msgid_Warning, Library, No_Location, Msg, Args);
end Warning_Lib_Msg;
-- Initialize pathes table.
@@ -1010,10 +1015,8 @@ package body Libraries is
"redefinition of a library unit in "
& "same design file:");
Warning_Msg_Sem
- (Warnid_Library, +Unit,
- Disp_Node (Library_Unit) & " defined at "
- & Disp_Location (Library_Unit) & " is now "
- & Disp_Node (New_Library_Unit));
+ (Warnid_Library, +Unit, "%n defined at %l is now %n",
+ (+Library_Unit, +Library_Unit, +New_Library_Unit));
end if;
else
-- Free the stub.
@@ -1030,15 +1033,12 @@ package body Libraries is
then
Warning_Lib_Msg
("changing definition of a library unit:");
- Warning_Lib_Msg (Disp_Node (Library_Unit) & " is now "
- & Disp_Node (New_Library_Unit));
+ Warning_Lib_Msg
+ ("%n is now %n", (+Library_Unit, +New_Library_Unit));
end if;
Warning_Lib_Msg
- ("library unit '"
- & Iirs_Utils.Image_Identifier (Library_Unit)
- & "' was also defined in file '"
- & Image (Get_Design_File_Filename (Design_File))
- & ''');
+ ("library unit %i was also defined in file %i",
+ (+Library_Unit, +Get_Design_File_Filename (Design_File)));
end if;
end if;
exit;
@@ -1541,8 +1541,7 @@ package body Libraries is
(Get_Design_File_Directory (Design_File),
Get_Design_File_Filename (Design_File));
if Fe = No_Source_File_Entry then
- Error_Lib_Msg
- ("cannot load " & Disp_Node (Get_Library_Unit (Design_Unit)));
+ Error_Lib_Msg ("cannot load %n", +Get_Library_Unit (Design_Unit));
raise Compilation_Error;
end if;
Set_File (Fe);