diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-12-13 13:35:27 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-12-13 13:35:27 +0100 |
commit | 6b0e4e8d1e42ac329e12fafa3758f3ccd106b436 (patch) | |
tree | 9f4cfe08199349f1e7af54580e2c92c3e737bb79 /src/vhdl/scanner.adb | |
parent | e3f6f212fe25e2fdb757d6bbf27fd51d0c296e8d (diff) | |
download | ghdl-6b0e4e8d1e42ac329e12fafa3758f3ccd106b436.tar.gz ghdl-6b0e4e8d1e42ac329e12fafa3758f3ccd106b436.tar.bz2 ghdl-6b0e4e8d1e42ac329e12fafa3758f3ccd106b436.zip |
PSL: allow labels on psl directives (fix ticket26).
Diffstat (limited to 'src/vhdl/scanner.adb')
-rw-r--r-- | src/vhdl/scanner.adb | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/src/vhdl/scanner.adb b/src/vhdl/scanner.adb index 260bd7c8f..7f68b3238 100644 --- a/src/vhdl/scanner.adb +++ b/src/vhdl/scanner.adb @@ -702,6 +702,10 @@ package body Scanner is Current_Token := Tok_Psl_Sequence; when Std_Names.Name_Property => Current_Token := Tok_Psl_Property; + when Std_Names.Name_Cover => + Current_Token := Tok_Psl_Cover; + when Std_Names.Name_Default => + Current_Token := Tok_Psl_Default; when Std_Names.Name_Inf => Current_Token := Tok_Inf; when Std_Names.Name_Within => @@ -968,32 +972,16 @@ package body Scanner is case Id is when Name_Psl => - -- Scan first identifier after '-- psl'. - if not Scan_Comment_Identifier then - return False; + -- Accept tokens after '-- psl'. + if Flag_Psl_Comment then + Flag_Psl := True; + Flag_Scan_In_Comment := True; + return True; end if; - Id := Name_Table.Get_Identifier; - case Id is - when Name_Property => - Current_Token := Tok_Psl_Property; - when Name_Sequence => - Current_Token := Tok_Psl_Sequence; - when Name_Endpoint => - Current_Token := Tok_Psl_Endpoint; - when Name_Assert => - Current_Token := Tok_Psl_Assert; - when Name_Cover => - Current_Token := Tok_Psl_Cover; - when Name_Default => - Current_Token := Tok_Psl_Default; - when others => - return False; - end case; - Flag_Scan_In_Comment := True; - return True; when others => - return False; + null; end case; + return False; end Scan_Comment; function Scan_Exclam_Mark return Boolean is @@ -1118,10 +1106,8 @@ package body Scanner is end if; -- Handle keywords in comment (PSL). - if Flag_Comment_Keyword - and then Scan_Comment - then - return; + if Flag_Comment_Keyword and then Scan_Comment then + goto Again; end if; -- LRM93 13.2 |