diff options
Diffstat (limited to 'src/vhdl/errorout.adb')
-rw-r--r-- | src/vhdl/errorout.adb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index 6b2c36e3b..6d1a43d06 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -576,19 +576,31 @@ package body Errorout is then declare Buf : constant File_Buffer_Acc := Get_File_Source (File); - Pos : constant Source_Ptr := Line_To_Position (File, Line); - Len : Source_Ptr; + Pos : Source_Ptr; + Len : Natural; C : Character; begin -- Compute line length. + Pos := Line_To_Position (File, Line); Len := 0; loop - C := Buf (Pos + Len); + C := Buf (Pos); + Pos := Pos + 1; exit when C = ASCII.CR or C = ASCII.LF or C = ASCII.EOT; - Len := Len + 1; + 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 (String (Buf (Pos .. Pos + Len - 1))); - Put_Line ((1 .. Col - 1 => ' ') & '^'); + Put_Line; + Put_Line ((1 .. Col => ' ') & '^'); end; end if; end Report_Msg; |