aboutsummaryrefslogtreecommitdiffstats
path: root/src/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-11-20 20:02:41 +0100
committerTristan Gingold <tgingold@free.fr>2022-11-20 20:02:41 +0100
commitc1dc505cbe93ebaade1547b2e4180074bdf42a25 (patch)
treecf62b1a2f808169d33015da44ae669fdc40c43a2 /src/ghdldrv
parent1ea6e91b7ef11e8d7fa4679bd9cb13e91db53684 (diff)
downloadghdl-c1dc505cbe93ebaade1547b2e4180074bdf42a25.tar.gz
ghdl-c1dc505cbe93ebaade1547b2e4180074bdf42a25.tar.bz2
ghdl-c1dc505cbe93ebaade1547b2e4180074bdf42a25.zip
vhdl-prints: add an option to display comments
Diffstat (limited to 'src/ghdldrv')
-rw-r--r--src/ghdldrv/ghdlprint.adb17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb
index d3aa203f4..a95e456cd 100644
--- a/src/ghdldrv/ghdlprint.adb
+++ b/src/ghdldrv/ghdlprint.adb
@@ -1007,13 +1007,23 @@ package body Ghdlprint is
-- Command Reprint.
type Command_Reprint is new Command_Lib with record
+ -- Do a semantic analysis.
Flag_Sem : Boolean := True;
+
+ -- Reprint even in case of errors.
+ Flag_Force : Boolean := False;
+
+ -- Format the outputs, using LEVEL and REALIGN.
Flag_Format : Boolean := False;
Level : Format_Level := Format_Indent;
Flag_Realign : Boolean := False;
- Flag_Force : Boolean := False;
+
+ -- Output only lines within this range.
First_Line : Positive := 1;
Last_Line : Positive := Positive'Last;
+
+ -- Collect and display comments.
+ Flag_Comments : Boolean := True;
end record;
function Decode_Command (Cmd : Command_Reprint; Name : String)
return Boolean;
@@ -1081,6 +1091,9 @@ package body Ghdlprint is
when Constraint_Error =>
Res := Option_Err;
end;
+ elsif Option = "--comments" then
+ Cmd.Flag_Comments := True;
+ Res := Option_Ok;
else
Decode_Option (Command_Lib (Cmd), Option, Arg, Res);
end if;
@@ -1111,6 +1124,8 @@ package body Ghdlprint is
Vhdl.Canon.Canon_Flag_Specification_Lists := False;
Vhdl.Canon.Canon_Flag_Associations := False;
+ Flags.Flag_Gather_Comments := Cmd.Flag_Comments;
+
-- Parse all files.
for I in Args'Range loop
Id := Name_Table.Get_Identifier (Args (I).all);