From d512a87daf1f94892f6062f7286e3999a784931c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20FERET?= Date: Wed, 10 May 2023 13:57:15 +0200 Subject: [PATCH] #661 more error catchs --- core/grammar/kparser4.mly | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/grammar/kparser4.mly b/core/grammar/kparser4.mly index 3e777303b..3c4a6ec11 100644 --- a/core/grammar/kparser4.mly +++ b/core/grammar/kparser4.mly @@ -628,7 +628,12 @@ idin: | ID annot LAR error { raise (ExceptionDefn.Syntax_Error (add_pos 3 "Malformed intervention instruction, I was \ -expecting 'ID <- alg_expression'")) }; +expecting 'ID <- alg_expression'")) } +| ID error + { raise (ExceptionDefn.Syntax_Error + (add_pos 2 "Malformed intervention instruction, I was \ + expecting 'ID <- alg_expression'")) }; +; effect_or_idin: | effect {$1} @@ -683,7 +688,7 @@ perturbation_declaration: | perturbation_alarm DO annot effect_list perturbation_post { let (e,_,_) = $4 in let (post,_,_) = $5 in ($1,None,e,post) } - | perturbation_alarm bool_expr DO annot partial_effect_list_at_least_one_idin perturbation_post_closed + | perturbation_alarm bool_expr DO annot partial_effect_list_at_least_one_idin perturbation_post_closed { let (pre,_,_) = $2 in let (e,_,_) = $5 in let (post,_,_) = $6 in