diff options
| author | Tristan Gingold <tgingold@free.fr> | 2018-12-05 18:41:21 +0100 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2018-12-05 18:41:21 +0100 | 
| commit | 402f082e491d47addb070956f93f78ba6d737acc (patch) | |
| tree | e84b545bdcdac7ac62a4fc46bfcd4b7c67de8811 | |
| parent | dbd6431ddbcf8c7c1b882aaf0315860353421a49 (diff) | |
| download | ghdl-402f082e491d47addb070956f93f78ba6d737acc.tar.gz ghdl-402f082e491d47addb070956f93f78ba6d737acc.tar.bz2 ghdl-402f082e491d47addb070956f93f78ba6d737acc.zip  | |
Move Error_Msg_Parse from errorout to parse.
| -rw-r--r-- | src/ghdldrv/ghdlprint.adb | 3 | ||||
| -rw-r--r-- | src/vhdl/errorout.adb | 22 | ||||
| -rw-r--r-- | src/vhdl/errorout.ads | 10 | ||||
| -rw-r--r-- | src/vhdl/parse.adb | 28 | ||||
| -rw-r--r-- | src/vhdl/parse_psl.adb | 12 | ||||
| -rw-r--r-- | src/vhdl/psl-errors.ads | 11 | 
6 files changed, 35 insertions, 51 deletions
diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb index ce0433204..8470b6ea3 100644 --- a/src/ghdldrv/ghdlprint.adb +++ b/src/ghdldrv/ghdlprint.adb @@ -1091,7 +1091,8 @@ package body Ghdlprint is              loop                 Scan;                 if Ref_Tokens.Table (Tok_Idx) /= Current_Token then -                  Error_Msg_Parse ("token mismatch"); +                  Report_Msg (Msgid_Error, Errorout.Parse, No_Location, +                              "token mismatch");                    exit;                 end if;                 case Current_Token is diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index daf5a9af7..4d38fc9d9 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -532,28 +532,6 @@ package body Errorout is        Report_Msg (Id, Scan, No_Location, Msg, (1 => Arg1), Cont);     end Warning_Msg_Scan; -   procedure Error_Msg_Parse (Msg: String; Arg1 : Earg_Type) is -   begin -      Report_Msg (Msgid_Error, Parse, No_Location, Msg, (1 => Arg1)); -   end Error_Msg_Parse; - -   procedure Error_Msg_Parse -     (Msg: String; Args : Earg_Arr := No_Eargs; Cont : Boolean := False) is -   begin -      Report_Msg (Msgid_Error, Parse, No_Location, Msg, Args, Cont); -   end Error_Msg_Parse; - -   procedure Error_Msg_Parse_1 (Msg: String) is -   begin -      Report_Msg (Msgid_Error, Parse, No_Location, Msg); -   end Error_Msg_Parse_1; - -   procedure Error_Msg_Parse -     (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs) is -   begin -      Report_Msg (Msgid_Error, Parse, Loc, Msg, Args); -   end Error_Msg_Parse; -     -- Disp a message during semantic analysis.     -- LOC is used for location and current token.     procedure Error_Msg_Sem (Msg: String; Loc: in Iir) is diff --git a/src/vhdl/errorout.ads b/src/vhdl/errorout.ads index 85ff86dc4..863c7b198 100644 --- a/src/vhdl/errorout.ads +++ b/src/vhdl/errorout.ads @@ -239,16 +239,6 @@ package Errorout is                                 Arg1 : Earg_Type;                                 Cont : Boolean := False); -   -- Disp a message during parse -   -- The location of the current token is automatically displayed before -   -- the message. -   procedure Error_Msg_Parse_1 (Msg: String); -   procedure Error_Msg_Parse (Msg: String; Arg1 : Earg_Type); -   procedure Error_Msg_Parse -     (Msg: String; Args : Earg_Arr := No_Eargs; Cont : Boolean := False); -   procedure Error_Msg_Parse -     (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs); -     -- Disp a message during semantic analysis.     procedure Warning_Msg_Sem (Id : Msgid_Warnings;                                Loc : Location_Type; diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 9c2d99793..ea3181b83 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -83,17 +83,31 @@ package body Parse is        Set_Location (Node, Get_Token_Location);     end Set_Location; +   -- Disp a message during parse +   -- The location of the current token is automatically displayed before +   -- the message. +   procedure Error_Msg_Parse (Msg: String; Arg1 : Earg_Type) is +   begin +      Report_Msg (Msgid_Error, Errorout.Parse, No_Location, Msg, (1 => Arg1)); +   end Error_Msg_Parse; + +   procedure Error_Msg_Parse +     (Msg: String; Args : Earg_Arr := No_Eargs; Cont : Boolean := False) is +   begin +      Report_Msg (Msgid_Error, Errorout.Parse, No_Location, Msg, Args, Cont); +   end Error_Msg_Parse; + +   procedure Error_Msg_Parse +     (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs) is +   begin +      Report_Msg (Msgid_Error, Errorout.Parse, Loc, Msg, Args); +   end Error_Msg_Parse; +     procedure Unexpected (Where: String) is     begin -      Error_Msg_Parse -        ("unexpected token %t in a " & Where, +Current_Token); +      Error_Msg_Parse ("unexpected token %t in a " & Where, +Current_Token);     end Unexpected; ---   procedure Unexpected_Eof is ---   begin ---      Error_Msg_Parse ("unexpected end of file"); ---   end Unexpected_Eof; -     procedure Expect_Error (Token: Token_Type; Msg: String) is     begin        if Msg'Length > 0 then diff --git a/src/vhdl/parse_psl.adb b/src/vhdl/parse_psl.adb index 4a7a7bc34..9566f2735 100644 --- a/src/vhdl/parse_psl.adb +++ b/src/vhdl/parse_psl.adb @@ -16,6 +16,7 @@  --  Software Foundation, 59 Temple Place - Suite 330, Boston, MA  --  02111-1307, USA. +with Errorout; use Errorout;  with PSL.Nodes; use PSL.Nodes;  with Iirs;  with Scanner; use Scanner; @@ -24,6 +25,17 @@ with PSL.Priorities; use PSL.Priorities;  with Parse;  package body Parse_Psl is +   procedure Error_Msg_Parse (Msg: String) is +   begin +      Report_Msg (Msgid_Error, Errorout.Parse, No_Location, Msg); +   end Error_Msg_Parse; + +   procedure Error_Msg_Parse +     (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs) is +   begin +      Report_Msg (Msgid_Error, Errorout.Parse, Loc, Msg, Args); +   end Error_Msg_Parse; +     function Create_Node_Loc (K : Nkind) return Node is        Res : Node;     begin diff --git a/src/vhdl/psl-errors.ads b/src/vhdl/psl-errors.ads index 16aae7772..c65443aee 100644 --- a/src/vhdl/psl-errors.ads +++ b/src/vhdl/psl-errors.ads @@ -1,4 +1,3 @@ -with PSL.Nodes;  with Types; use Types;  with Errorout; use Errorout;  with Files_Map; @@ -10,16 +9,6 @@ package PSL.Errors is     procedure Error_Kind (Msg : String; N : PSL_Node) renames       Errorout.Error_Kind; -   procedure Error_Msg_Parse (Msg: String) -     renames Errorout.Error_Msg_Parse_1; - -   procedure Error_Msg_Parse -     (Loc : Location_Type; Msg: String; Args : Earg_Arr := No_Eargs) -     renames Errorout.Error_Msg_Parse; -     procedure Error_Msg_Sem (Msg: String; Loc: PSL_Node)       renames Errorout.Error_Msg_Sem_1; - -   function "+" (N : PSL_Node) return Location_Type -     renames PSL.Nodes.Get_Location;  end PSL.Errors;  | 
