diff options
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/libghdl/libghdl.adb | 3 | ||||
-rw-r--r-- | src/vhdl/translate/ortho_front.adb | 12 | ||||
-rw-r--r-- | src/vhdl/vhdl-scanner.adb | 10 | ||||
-rw-r--r-- | src/vhdl/vhdl-scanner.ads | 4 |
4 files changed, 19 insertions, 10 deletions
diff --git a/src/vhdl/libghdl/libghdl.adb b/src/vhdl/libghdl/libghdl.adb index 7226e5295..b0442b9f4 100644 --- a/src/vhdl/libghdl/libghdl.adb +++ b/src/vhdl/libghdl/libghdl.adb @@ -19,6 +19,7 @@ with GNAT.OS_Lib; use GNAT.OS_Lib; with Ghdllocal; with Ghdlcomp; +with Options; use Options; with Errorout.Memory; with Files_Map.Editor; with Vhdl.Formatters; @@ -29,7 +30,7 @@ pragma Unreferenced (Vhdl.Formatters); package body Libghdl is function Set_Option (Opt : Thin_String_Ptr; Len : Natural) return Integer is begin - if Ghdllocal.Decode_Driver_Option (Opt (1 .. Len)) then + if Ghdllocal.Decode_Driver_Option (Opt (1 .. Len)) = Option_Ok then -- Ok. return 0; else diff --git a/src/vhdl/translate/ortho_front.adb b/src/vhdl/translate/ortho_front.adb index ea375b1d0..935d5c9d0 100644 --- a/src/vhdl/translate/ortho_front.adb +++ b/src/vhdl/translate/ortho_front.adb @@ -17,16 +17,17 @@ -- 02111-1307, USA. with System; with Interfaces.C_Streams; +with GNAT.OS_Lib; with Types; use Types; with Name_Table; with Hash; with Interning; -with Vhdl.Nodes; use Vhdl.Nodes; +with Flags; with Libraries; +with Vhdl.Nodes; use Vhdl.Nodes; with Vhdl.Utils; use Vhdl.Utils; with Vhdl.Std_Package; -with Flags; with Vhdl.Configuration; with Translation; with Vhdl.Sem; @@ -34,10 +35,9 @@ with Vhdl.Sem_Lib; use Vhdl.Sem_Lib; with Errorout; use Errorout; with Errorout.Console; with Vhdl.Errors; use Vhdl.Errors; -with GNAT.OS_Lib; with Bug; with Trans_Be; -with Options; +with Options; use Options; package body Ortho_Front is -- The action to be performed by the compiler. @@ -232,13 +232,13 @@ package body Ortho_Front is subtype Str_Type is String (1 .. Opt'Last - 6); begin -- The option parameter must be normalized (starts at index 1). - if Options.Parse_Option (Str_Type (Opt (7 .. Opt'Last))) then + if Parse_Option (Str_Type (Opt (7 .. Opt'Last))) = Option_Ok then return 1; else return 0; end if; end; - elsif Options.Parse_Option (Opt.all) then + elsif Options.Parse_Option (Opt.all) = Option_Ok then return 1; else return 0; diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb index 8089daf1d..2f7f37544 100644 --- a/src/vhdl/vhdl-scanner.adb +++ b/src/vhdl/vhdl-scanner.adb @@ -1451,7 +1451,7 @@ package body Vhdl.Scanner is Current_Token := Tok_Identifier; end Scan_Extended_Identifier; - procedure Convert_Identifier (Str : in out String) + procedure Convert_Identifier (Str : in out String; Err : out Boolean) is procedure Error_Bad is begin @@ -1467,6 +1467,8 @@ package body Vhdl.Scanner is subtype Id_Subtype is String (1 .. Str'Length); Id : Id_Subtype renames Str; begin + Err := True; + if Id'Length = 0 then Error_Msg_Option ("identifier required"); return; @@ -1505,6 +1507,7 @@ package body Vhdl.Scanner is end if; when Invalid => Error_Bad; + return; end case; end loop; else @@ -1515,11 +1518,13 @@ package body Vhdl.Scanner is when Upper_Case_Letter => if Vhdl_Std = Vhdl_87 and C > 'Z' then Error_8bit; + return; end if; Id (I) := To_Lower_Map (C); when Lower_Case_Letter | Digit => if Vhdl_Std = Vhdl_87 and C > 'z' then Error_8bit; + return; end if; when Special_Character => -- The current character is legal in an identifier. @@ -1541,12 +1546,15 @@ package body Vhdl.Scanner is end if; else Error_Bad; + return; end if; when others => Error_Bad; + return; end case; end loop; end if; + Err := False; end Convert_Identifier; -- Internal scanner function: return True if C must be considered as a line diff --git a/src/vhdl/vhdl-scanner.ads b/src/vhdl/vhdl-scanner.ads index f0afb1e0c..e6eedb0b8 100644 --- a/src/vhdl/vhdl-scanner.ads +++ b/src/vhdl/vhdl-scanner.ads @@ -137,9 +137,9 @@ package Vhdl.Scanner is -- Lexical checks are performed. -- This procedure is not used by Scan, but should be used for identifiers -- given in the command line. - -- Errors are directly reported through error_msg_option. + -- Errors are directly reported through error_msg_option, and ERR set. -- Also, Vhdl_Std should be set. - procedure Convert_Identifier (Str : in out String); + procedure Convert_Identifier (Str : in out String; Err : out Boolean); -- Return TRUE iff C is a whitespace. -- LRM93 13.2 Lexical elements, separators, and delimiters |