diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-12-18 06:33:09 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-12-18 07:36:25 +0100 |
commit | 07275e80da12539628be7683a5ac1fb00cd750ae (patch) | |
tree | a3922e76c53f5617c3eddb321d043ee76dbc6d61 | |
parent | d8b1335eb3be3e0e6b3fe38344cc7fa3d99a59d7 (diff) | |
download | ghdl-07275e80da12539628be7683a5ac1fb00cd750ae.tar.gz ghdl-07275e80da12539628be7683a5ac1fb00cd750ae.tar.bz2 ghdl-07275e80da12539628be7683a5ac1fb00cd750ae.zip |
parse: improve error recovery.
-rw-r--r-- | src/vhdl/parse.adb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb index 477ead805..cb53eb7ca 100644 --- a/src/vhdl/parse.adb +++ b/src/vhdl/parse.adb @@ -238,6 +238,18 @@ package body Parse is | Tok_Semi_Colon | Tok_End => exit; + when Tok_If + | Tok_For + | Tok_While + | Tok_Loop + | Tok_Wait + | Tok_Assert => + -- Sequential statement. + exit; + when Tok_Process + | Tok_Block => + -- Concurrent statement. + exit; when others => Scan; end case; @@ -8690,12 +8702,19 @@ package body Parse is when Tok_Psl_Cover => Postponed_Not_Allowed; Stmt := Parse_Psl_Cover_Statement; + when Tok_Wait + | Tok_Loop + | Tok_While => + Error_Msg_Parse + ("sequential statement only allowed in processes"); + Stmt := Parse_Sequential_Statements (Parent); + Stmt := Null_Iir; when others => -- FIXME: improve message: -- instead of 'unexpected token 'signal' in conc stmt list' -- report: 'signal declarations are not allowed in conc stmt' Unexpected ("concurrent statement list"); - Skip_Until_Semi_Colon; + Resync_To_End_Of_Statement; if Current_Token = Tok_Semi_Colon then Scan; end if; |