diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-03-06 20:36:46 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-03-06 20:36:46 +0100 |
commit | 7314c5d1b7cc810296223aca8db98916b45f6c15 (patch) | |
tree | 8b105031ca85ed6d0599bb09f5435a25c8448411 /src/ghdldrv | |
parent | 4ab13d5c2b7c64d84de897b67304d63b8e0c904a (diff) | |
download | ghdl-7314c5d1b7cc810296223aca8db98916b45f6c15.tar.gz ghdl-7314c5d1b7cc810296223aca8db98916b45f6c15.tar.bz2 ghdl-7314c5d1b7cc810296223aca8db98916b45f6c15.zip |
ghdlprint: add --force flag.
Diffstat (limited to 'src/ghdldrv')
-rw-r--r-- | src/ghdldrv/ghdlprint.adb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb index b02c93fdd..7a7aee408 100644 --- a/src/ghdldrv/ghdlprint.adb +++ b/src/ghdldrv/ghdlprint.adb @@ -965,6 +965,7 @@ package body Ghdlprint is Flag_Sem : Boolean := True; Flag_Format : Boolean := False; Flag_Indent : Boolean := False; + Flag_Force : Boolean := False; First_Line : Positive := 1; Last_Line : Positive := Positive'Last; end record; @@ -1011,6 +1012,9 @@ package body Ghdlprint is Cmd.Flag_Format := False; Cmd.Flag_Indent := True; Res := Option_Ok; + elsif Option = "--force" then + Cmd.Flag_Force := True; + Res := Option_Ok; elsif Option'Length > 8 and then Option (1 .. 8) = "--range=" then declare F : constant Natural := 9; @@ -1066,7 +1070,7 @@ package body Ghdlprint is Id := Name_Table.Get_Identifier (Args (I).all); Design_File := Load_File_Name (Id); if Design_File = Null_Iir - or else Errorout.Nbr_Errors > 0 + or else (Errorout.Nbr_Errors > 0 and not Cmd.Flag_Force) then raise Errorout.Compilation_Error; end if; @@ -1085,10 +1089,12 @@ package body Ghdlprint is end if; Next_Unit := Get_Chain (Unit); + if not (Cmd.Flag_Format or Cmd.Flag_Indent) + and then (Errorout.Nbr_Errors = 0 or Cmd.Flag_Force) + then + Vhdl.Prints.Disp_Vhdl (Unit); + end if; if Errorout.Nbr_Errors = 0 then - if not (Cmd.Flag_Format or Cmd.Flag_Indent) then - Vhdl.Prints.Disp_Vhdl (Unit); - end if; if Cmd.Flag_Sem then Set_Chain (Unit, Null_Iir); Libraries.Add_Design_Unit_Into_Library (Unit); |