diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-12-06 18:17:17 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-12-06 18:17:17 +0100 |
commit | 322252b8d33b2984f52021b292f1b6477a1efd71 (patch) | |
tree | d810d445eeca0e755ebb5cbafe8aaf7e571281df /src/vhdl | |
parent | a824b082fa9ed2f97aaed344f1e02aac3aca47c4 (diff) | |
download | ghdl-322252b8d33b2984f52021b292f1b6477a1efd71.tar.gz ghdl-322252b8d33b2984f52021b292f1b6477a1efd71.tar.bz2 ghdl-322252b8d33b2984f52021b292f1b6477a1efd71.zip |
parse: strenghten.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/parse.adb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index fbed818ea..ecf16218b 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -4854,7 +4854,7 @@ package body Parse is else Error_Msg_Parse ("object class keyword such as 'variable' is expected"); - Eat_Tokens_Until_Semi_Colon; + Resync_To_End_Of_Declaration; end if; when Tok_Semi_Colon => Error_Msg_Parse ("';' (semi colon) not allowed alone"); @@ -6400,11 +6400,13 @@ package body Parse is Clause := Res; loop Set_Condition (Clause, Parse_Expression); - Expect (Tok_Then, "'then' is expected here"); Then_Loc := Get_Token_Location; - - -- Eat 'then'. - Scan; + if Current_Token = Tok_Then then + -- Eat 'then'. + Scan; + else + Expect_Error (Tok_Then, "'then' is expected here"); + end if; Set_Sequential_Statement_Chain (Clause, Parse_Sequential_Statements (Res)); @@ -7081,7 +7083,18 @@ package body Parse is Set_Label (Stmt, Label); end if; end if; - Scan_Semi_Colon ("statement"); + + if Current_Token = Tok_Semi_Colon then + -- Skip ';'. + Scan; + else + Error_Missing_Semi_Colon ("statement"); + Resync_To_End_Of_Statement; + if Current_Token = Tok_Semi_Colon then + -- Skip ';'. + Scan; + end if; + end if; -- Append it to the chain. if First_Stmt = Null_Iir then |