Recover from parser errors in all variable declarations

Currently the parser can recover from `integer` or `time` variable
declarations, but not for variables of other types. Refector the parser
rules so that it can recover for all variable types as well as events.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-03-09 10:11:50 +01:00
parent 246a0d3ce8
commit 8b0346d7b5
1 changed files with 4 additions and 5 deletions

View File

@ -2628,13 +2628,12 @@ block_item_decl
/* Recover from errors that happen within variable lists. Use the
trailing semi-colon to resync the parser. */
| K_integer error ';'
{ yyerror(@1, "error: syntax error in integer variable list.");
| data_type error ';'
{ yyerror(@1, "error: syntax error in variable list.");
yyerrok;
}
| K_time error ';'
{ yyerror(@1, "error: syntax error in time variable list.");
| K_event error ';'
{ yyerror(@1, "error: syntax error in event variable list.");
yyerrok;
}