diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-10-15 06:48:45 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-10-15 06:48:45 +0200 |
commit | 66335e7a44dc449e99706c26d51f6da11b01a7f7 (patch) | |
tree | efdeccdf216a35e9c1829e0e6202c372f755b966 /src/options.adb | |
parent | 001bdb593ff5d2413c3a3a39ee0b65fc20a27cd0 (diff) | |
download | ghdl-66335e7a44dc449e99706c26d51f6da11b01a7f7.tar.gz ghdl-66335e7a44dc449e99706c26d51f6da11b01a7f7.tar.bz2 ghdl-66335e7a44dc449e99706c26d51f6da11b01a7f7.zip |
Use Decode_Work_Option in options. Factorize code.
Diffstat (limited to 'src/options.adb')
-rw-r--r-- | src/options.adb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/options.adb b/src/options.adb index 3db68ba25..65521b411 100644 --- a/src/options.adb +++ b/src/options.adb @@ -17,7 +17,6 @@ -- 02111-1307, USA. with Simple_IO; -with Name_Table; with Errorout; use Errorout; with Libraries; with Std_Names; @@ -139,18 +138,9 @@ package body Options is elsif Opt'Length > 2 and then Opt (1 .. 2) = "-W" then return Option_Warning (Opt (3 .. Opt'Last), True); elsif Opt'Length > 7 and then Opt (1 .. 7) = "--work=" then - declare - use Name_Table; - Name : String (1 .. Opt'Last - 8 + 1); - Err : Boolean; - begin - Name := Opt (8 .. Opt'Last); - Vhdl.Scanner.Convert_Identifier (Name, Err); - if Err then - return Option_Err; - end if; - Libraries.Work_Library_Name := Get_Identifier (Name); - end; + if not Libraries.Decode_Work_Option (Opt) then + return Option_Err; + end if; elsif Opt = "-C" or else Opt = "--mb-comments" then Mb_Comment := True; elsif Opt = "--force-analysis" then |