aboutsummaryrefslogtreecommitdiffstats
path: root/src/errorout.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-19 06:12:09 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-19 06:13:11 +0200
commit94912cf6e8862c9f5fe88f1e5314d4699f8e5659 (patch)
treeb92c9549d54b7489bec8ac49dd486b06d5da79eb /src/errorout.adb
parentfd91ad38193d468040fdd52d078c85a4c4201348 (diff)
downloadghdl-94912cf6e8862c9f5fe88f1e5314d4699f8e5659.tar.gz
ghdl-94912cf6e8862c9f5fe88f1e5314d4699f8e5659.tar.bz2
ghdl-94912cf6e8862c9f5fe88f1e5314d4699f8e5659.zip
errorout: handle %v for values.
Diffstat (limited to 'src/errorout.adb')
-rw-r--r--src/errorout.adb27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/errorout.adb b/src/errorout.adb
index 485f5fef3..79ed35dbf 100644
--- a/src/errorout.adb
+++ b/src/errorout.adb
@@ -134,6 +134,16 @@ package body Errorout is
return (Kind => Earg_Char, Val_Char => V);
end "+";
+ function "+" (V : Uns32) return Earg_Type is
+ begin
+ return (Kind => Earg_Uns32, Val_Uns32 => V);
+ end "+";
+
+ function "+" (V : Int32) return Earg_Type is
+ begin
+ return (Kind => Earg_Int32, Val_Int32 => V);
+ end "+";
+
function "+" (V : String8_Len_Type) return Earg_Type is
begin
return (Kind => Earg_String8, Val_Str8 => V);
@@ -357,6 +367,23 @@ package body Errorout is
end case;
Report_Handler.Message ("""");
end;
+ when 'v' =>
+ -- Numerical values
+ declare
+ Arg : Earg_Type renames Args (Argn);
+ begin
+ case Arg.Kind is
+ when Earg_Uns32 =>
+ declare
+ S : constant String :=
+ Uns32'Image (Arg.Val_Uns32);
+ begin
+ Report_Handler.Message (S (2 .. S'Last));
+ end;
+ when others =>
+ raise Internal_Error;
+ end case;
+ end;
when others =>
-- Unknown format.
raise Internal_Error;