diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-03-15 06:17:30 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-03-15 06:17:30 +0100 |
commit | abfab06bb7620314f636bf5dd2854399e54062d0 (patch) | |
tree | ba826224f2d527539fa0705e7858816770060df7 /src/vhdl | |
parent | 173ec2e3096a6f7f5c9274d567c42511cf908386 (diff) | |
download | ghdl-abfab06bb7620314f636bf5dd2854399e54062d0.tar.gz ghdl-abfab06bb7620314f636bf5dd2854399e54062d0.tar.bz2 ghdl-abfab06bb7620314f636bf5dd2854399e54062d0.zip |
Add extract_expanded_line.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/errorout.adb | 30 |
1 files changed, 2 insertions, 28 deletions
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; |