From b6f8a09d6a792c6af36e86a03c18155ce9164660 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 14 Mar 2017 08:02:48 +0100 Subject: Add -ftabstop= option. Close #314 --- src/options.adb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/options.adb') 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 -- cgit v1.2.3