aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/errorout.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-28 20:14:45 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-28 20:14:45 +0100
commit5a9ece8bf4f957e4afe7a9d410c85d26bcba14d0 (patch)
tree96ced95b1864b16e5d0e01d9b77c2a3b5ad88401 /src/vhdl/errorout.adb
parent255a9db44ab998435d968ef76705fe6558704894 (diff)
downloadghdl-5a9ece8bf4f957e4afe7a9d410c85d26bcba14d0.tar.gz
ghdl-5a9ece8bf4f957e4afe7a9d410c85d26bcba14d0.tar.bz2
ghdl-5a9ece8bf4f957e4afe7a9d410c85d26bcba14d0.zip
errorout: set length of location.
Diffstat (limited to 'src/vhdl/errorout.adb')
-rw-r--r--src/vhdl/errorout.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb
index 33804e1a6..6d1b03299 100644
--- a/src/vhdl/errorout.adb
+++ b/src/vhdl/errorout.adb
@@ -217,6 +217,7 @@ package body Errorout is
Line : Natural;
New_Id : Msgid_Type;
Offset : Natural;
+ Loc_Length : Natural;
Line_Pos : Source_Ptr;
pragma Unreferenced (Line_Pos);
begin
@@ -242,6 +243,7 @@ package body Errorout is
File := No_Source_File_Entry;
Line := 0;
Offset := 0;
+ Loc_Length := 0;
case Origin is
when Option
@@ -262,10 +264,12 @@ package body Errorout is
File := Scanner.Get_Current_Source_File;
Line := Scanner.Get_Current_Line;
Offset := Scanner.Get_Current_Offset;
+ Loc_Length := 1;
when Parse =>
File := Scanner.Get_Current_Source_File;
Line := Scanner.Get_Current_Line;
Offset := Scanner.Get_Token_Offset;
+ Loc_Length := Scanner.Get_Current_Offset - Offset;
when Semantic =>
null;
end case;
@@ -273,7 +277,7 @@ package body Errorout is
end case;
Report_Handler.Error_Start
- (Err => (Origin, New_Id, Cont, File, Line, Offset));
+ (Err => (Origin, New_Id, Cont, File, Line, Offset, Loc_Length));
-- Display message.
declare
@@ -437,7 +441,7 @@ package body Errorout is
then
-- Limit reached. Emit a message.
Report_Handler.Error_Start
- (Err => (Origin, Msgid_Error, False, File, Line, Offset));
+ (Err => (Option, Msgid_Error, False, File, Line, Offset, 0));
Report_Handler.Message ("error limit reached");
Report_Handler.Message_End.all;
end if;