From 8b0346d7b5ca492ac4ab8712cd3caae5c631ef30 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 9 Mar 2022 10:11:50 +0100 Subject: [PATCH] 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 --- parse.y | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/parse.y b/parse.y index f56ebbb27..539bec1b5 100644 --- a/parse.y +++ b/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; }