diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-03-14 08:02:48 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-03-14 08:02:48 +0100 |
commit | b6f8a09d6a792c6af36e86a03c18155ce9164660 (patch) | |
tree | ad833a9260ac0883eaa7397dad801e0ef199abd9 | |
parent | f6f792afaab6f8a58a06dcbfd67f0c2bcb1dbe3a (diff) | |
download | ghdl-b6f8a09d6a792c6af36e86a03c18155ce9164660.tar.gz ghdl-b6f8a09d6a792c6af36e86a03c18155ce9164660.tar.bz2 ghdl-b6f8a09d6a792c6af36e86a03c18155ce9164660.zip |
Add -ftabstop= option.
Close #314
-rw-r--r-- | src/options.adb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/options.adb b/src/options.adb index e36e8bedd..03e1810b7 100644 --- a/src/options.adb +++ b/src/options.adb @@ -26,6 +26,7 @@ with Disp_Tree; with Scanner; with Back_End; use Back_End; with Flags; use Flags; +with Files_Map; package body Options is procedure Initialize is @@ -138,6 +139,22 @@ package body Options is Flag_Diagnostics_Show_Option := True; elsif Opt = "-fno-diagnostics-show-option" then Flag_Diagnostics_Show_Option := False; + elsif Opt'Length > 10 and then Opt (1 .. 10) = "-ftabstop=" then + declare + use Files_Map; + V : Natural; + begin + V := Natural'Value (Opt (11 .. Opt'Last)); + if V not in Tab_Stop_Range then + Error_Msg_Option ("incorrect value for -ftabstop"); + return True; + end if; + Tab_Stop := V; + exception + when Constraint_Error => + Error_Msg_Option ("numeric value expected after -ftabstop="); + return True; + end; elsif Opt = "--bootstrap" then Bootstrap := True; elsif Opt = "-fexplicit" then |