From f6c9bc0e66602c86003f118d8d8e35693d4abcaf Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 15 Jan 2017 08:01:27 +0100 Subject: Add xref_keyword for PSL keywords that aren't reserved words. --- src/ghdldrv/ghdlprint.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/ghdldrv') diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb index d228f2d1f..53df620ae 100644 --- a/src/ghdldrv/ghdlprint.adb +++ b/src/ghdldrv/ghdlprint.adb @@ -233,22 +233,26 @@ package body Ghdlprint is Bod : Iir; Loc : Location_Type; begin - Disp_Spaces; if Flags.Flag_Xref then Loc := File_Pos_To_Location (File, Bef_Tok); Ref := Find (Loc); if Ref = Bad_Xref then + Disp_Spaces; Disp_Text; Warning_Msg_Sem (Warnid_Missing_Xref, Loc, "cannot find xref"); Missing_Xref := True; return; end if; else + Disp_Spaces; Disp_Text; return; end if; case Get_Xref_Kind (Ref) is + when Xref_Keyword => + Disp_Reserved; when Xref_Decl => + Disp_Spaces; Put (""); when Xref_Ref | Xref_End => + Disp_Spaces; Decl := Get_Xref_Node (Ref); Loc := Get_Location (Decl); if Loc /= Location_Nil then @@ -292,6 +297,7 @@ package body Ghdlprint is Disp_Text; end if; when Xref_Body => + Disp_Spaces; Put (" Put (" body "); + when Xref_Keyword => + Put (" keyword "); end case; New_Line; end; @@ -1744,6 +1752,9 @@ package body Ghdlprint is Emit_Ref (I, 'r'); when Xref_Body => Emit_Ref (I, 'b'); + when Xref_Keyword => + -- Keywords location are not written. + null; end case; end if; end loop; -- cgit v1.2.3