From abfab06bb7620314f636bf5dd2854399e54062d0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 15 Mar 2017 06:17:30 +0100 Subject: Add extract_expanded_line. --- src/vhdl/errorout.adb | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index 6d1a43d06..55c367f85 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -574,34 +574,8 @@ package body Errorout is if Flag_Caret_Diagnostics and then (File /= No_Source_File_Entry and Line /= 0) then - declare - Buf : constant File_Buffer_Acc := Get_File_Source (File); - Pos : Source_Ptr; - Len : Natural; - C : Character; - begin - -- Compute line length. - Pos := Line_To_Position (File, Line); - Len := 0; - loop - C := Buf (Pos); - Pos := Pos + 1; - exit when C = ASCII.CR or C = ASCII.LF or C = ASCII.EOT; - if C = ASCII.HT then - -- Expand tab. - loop - Put (' '); - Len := Len + 1; - exit when Len mod Tab_Stop = 0; - end loop; - else - Put (C); - Len := Len + 1; - end if; - end loop; - Put_Line; - Put_Line ((1 .. Col => ' ') & '^'); - end; + Put_Line (Extract_Expanded_Line (File, Line)); + Put_Line ((1 .. Col => ' ') & '^'); end if; end Report_Msg; -- cgit v1.2.3