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:
parent
246a0d3ce8
commit
8b0346d7b5
9
parse.y
9
parse.y
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue