diff options
author | Jonsba <jonasb@tranquille.ch> | 2016-07-28 08:04:14 +0200 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2016-07-28 08:04:14 +0200 |
commit | d0d04ba9b19e0f4a0db16c70db1b3452e16d6923 (patch) | |
tree | 3bd8274073368ed39ba54eaaa92e0c0dbb0f8588 /src/grt/grt-wave_opt_file-tree_reading.adb | |
parent | cc352d278fcce918d374406ff64c27cde0a59402 (diff) | |
download | ghdl-d0d04ba9b19e0f4a0db16c70db1b3452e16d6923.tar.gz ghdl-d0d04ba9b19e0f4a0db16c70db1b3452e16d6923.tar.bz2 ghdl-d0d04ba9b19e0f4a0db16c70db1b3452e16d6923.zip |
Changes in warning/error messages formatting in the Wave_Opt_File pac… (#124)
Changes in warning/error messages formatting in the Wave_Opt_File packages to match better the way ghdl print warning/error messages. A little code cleanup.
Diffstat (limited to 'src/grt/grt-wave_opt_file-tree_reading.adb')
-rw-r--r-- | src/grt/grt-wave_opt_file-tree_reading.adb | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/grt/grt-wave_opt_file-tree_reading.adb b/src/grt/grt-wave_opt_file-tree_reading.adb index f2343be7a..ba3834e50 100644 --- a/src/grt/grt-wave_opt_file-tree_reading.adb +++ b/src/grt/grt-wave_opt_file-tree_reading.adb @@ -25,7 +25,6 @@ -- Description: See package specifications -with Grt.Strings; use Grt.Strings; with Grt.Errors; use Grt.Errors; package body Grt.Wave_Opt_File.Tree_Reading is @@ -67,12 +66,12 @@ package body Grt.Wave_Opt_File.Tree_Reading is -- Read the whole sub tree given and check if every element was found in -- design. Called by Check_If_All_Found procedure Check_Sub_Tree_If_All_Found - (Previous_Cursor : Elem_Acc; Sep : Character; Level : Positive); + (Previous_Cursor : Elem_Acc; Sep : Character); procedure Check_If_All_Found is begin for Index in Tree_Index_Type'Range loop - Check_Sub_Tree_If_All_Found (Trees (Index), Seps (Index), 1); + Check_Sub_Tree_If_All_Found (Trees (Index), Seps (Index)); end loop; end Check_If_All_Found; @@ -103,34 +102,24 @@ package body Grt.Wave_Opt_File.Tree_Reading is end Find_Cursor; procedure Check_Sub_Tree_If_All_Found - (Previous_Cursor : Elem_Acc; Sep : Character; Level : Positive) + (Previous_Cursor : Elem_Acc; Sep : Character) is Cursor : Elem_Acc; - Index : Positive; begin Cursor := Previous_Cursor; while Cursor /= null loop if Cursor.Kind = Not_Found then - Print_Context (Cursor.Line_Context, Warning); + Print_Context (Cursor, Warning); Report_C ("no VHDL object in design matches "); - -- Display the path of the first unfound vhdl object in signal path - if Level > 1 then - Index := Cursor.Line_Context.Str'First; - for I in 2 .. Level loop - Index := Find (Cursor.Line_Context.Str.all, Sep, Index + 1); - end loop; - Report_C (Cursor.Line_Context.Str (Cursor.Line_Context.Str'First - .. Index)); - elsif Sep = '/' then - Report_C ("/"); - end if; Report_E (Cursor.Name.all); - elsif Level = Cursor.Line_Context.Max_Level + elsif Cursor.Level = Cursor.Path_Context.Max_Level and then Cursor.Kind = Pkg_Entity then - Error_Context ("not a signal", Cursor.Line_Context, Warning); + Print_Context (Cursor, Warning); + Report_C (Cursor.Name.all); + Report_E (" is not a signal"); else - Check_Sub_Tree_If_All_Found (Cursor.Next_Child, Sep, Level + 1); + Check_Sub_Tree_If_All_Found (Cursor.Next_Child, Sep); end if; Cursor := Cursor.Next_Sibling; end loop; |