diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-11-16 20:21:21 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-11-16 20:21:21 +0100 |
commit | f05a43bbce85d50b25ab9eba2a15e1fec640133e (patch) | |
tree | 88c40b490957d8a458ad4a8591cfd34a261ba8fc /src/vhdl/errorout.adb | |
parent | 304e2e2fb74eeb52d8de896fb2742a464e5b2272 (diff) | |
download | ghdl-f05a43bbce85d50b25ab9eba2a15e1fec640133e.tar.gz ghdl-f05a43bbce85d50b25ab9eba2a15e1fec640133e.tar.bz2 ghdl-f05a43bbce85d50b25ab9eba2a15e1fec640133e.zip |
errorout: add %s to display strings.
Diffstat (limited to 'src/vhdl/errorout.adb')
-rw-r--r-- | src/vhdl/errorout.adb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index e068e113c..a86eb890b 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -26,6 +26,7 @@ with Ada.Strings.Unbounded; with Std_Names; with Flags; use Flags; with PSL.Nodes; +with Str_Table; package body Errorout is -- Name of the program, used to report error message. @@ -183,6 +184,11 @@ package body Errorout is return (Kind => Earg_Char, Val_Char => V); end "+"; + function "+" (V : String8_Len_Type) return Earg_Type is + begin + return (Kind => Earg_String8, Val_Str8 => V); + end "+"; + function Get_Location_Safe (N : Iir) return Location_Type is begin if N = Null_Iir then @@ -543,6 +549,22 @@ package body Errorout is raise Internal_Error; end case; end; + when 's' => + -- String + declare + Arg : Earg_Type renames Args (Argn); + begin + Put ('"'); + case Arg.Kind is + when Earg_String8 => + Put (Str_Table.String_String8 + (Arg.Val_Str8.Str, Arg.Val_Str8.Len)); + when others => + -- Invalid conversion to character. + raise Internal_Error; + end case; + Put ('"'); + end; when others => -- Unknown format. raise Internal_Error; @@ -680,9 +702,10 @@ package body Errorout is Report_Msg (Msgid_Error, Parse, No_Location, Msg); end Error_Msg_Parse_1; - procedure Error_Msg_Parse (Loc : Location_Type; Msg: String) is + procedure Error_Msg_Parse + (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs) is begin - Report_Msg (Msgid_Error, Parse, Loc, Msg); + Report_Msg (Msgid_Error, Parse, Loc, Msg, Args); end Error_Msg_Parse; -- Disp a message during semantic analysis. |